Skip to content

Commit f31cb9c

Browse files
committed
exercise naming
1 parent e1d0add commit f31cb9c

File tree

8 files changed

+44
-44
lines changed

8 files changed

+44
-44
lines changed

src/content/4/fr/part4d.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ Dans les exercices suivants, les bases de la gestion des utilisateurs seront imp
359359

360360
**Encore un avertissement:** Si vous remarquez que vous mélangez les appels async/await et _then_, il est à 99 % certain que vous faites quelque chose de mal. Utilisez l'un ou l'autre, mais jamais les deux.
361361

362-
#### 4.15 : expansion de bloglist, étape3
362+
#### 4.15 : expansion de Blog List étape3
363363

364364
Mettez en oeuvre un moyen de créer de nouveaux utilisateurs en effectuant une requête HTTP POST à l'adresse <i>api/users</i>. Les utilisateurs ont un <i>nom d'utilisateur, un mot de passe et un nom</i>.
365365

@@ -379,7 +379,7 @@ La liste des utilisateurs peut, par exemple, ressembler à ceci:
379379

380380
![api/users du navigateur affiche les données JSON de deux utilisateurs](../../images/4/22.png)
381381

382-
#### 4.16* : expansion de bloglist, étape4
382+
#### 4.16* : expansion de Blog List étape4
383383

384384
Ajoutez une fonctionnalité qui impose les restrictions suivantes pour la création de nouveaux utilisateurs : Le nom d'utilisateur et le mot de passe doivent être fournis. Le nom d'utilisateur et le mot de passe doivent avoir au moins 3 caractères de long. Le nom d'utilisateur doit être unique.
385385

@@ -389,7 +389,7 @@ L'opération doit répondre avec un code de statut approprié et une sorte de me
389389

390390
Mettez également en oeuvre des tests qui garantissent que les utilisateurs invalides ne sont pas créés et qu'une opération d'ajout d'utilisateur invalide retourne un code de statut et un message d'erreur appropriés.
391391

392-
#### 4.17 : expansion de bloglist, étape5
392+
#### 4.17 : expansion de Blog List étape5
393393

394394
Étendez les blogs pour que chaque blog contienne des informations sur le créateur du blog.
395395

@@ -404,15 +404,15 @@ et que la liste de tous les utilisateurs affiche également les blogs créés pa
404404

405405
![api/users intègre les blogs dans les données JSON](../../images/4/24e.png)
406406

407-
#### 4.18 : expansion de bloglist, étape6
407+
#### 4.18 : expansion de Blog List étape6
408408

409409
Mettez en oeuvre l'authentification basée sur les jetons selon le chapitre [Authentification par jeton](/en/part4/token_authentication) de la partie 4.
410410

411-
#### 4.19 : expansion de bloglist, étape7
411+
#### 4.19 : expansion de Blog List étape7
412412

413413
Modifiez l'ajout de nouveaux blogs pour qu'il ne soit possible que si un jeton valide est envoyé avec la requête HTTP POST. L'utilisateur identifié par le jeton est désigné comme le créateur du blog.
414414

415-
#### 4.20* : expansion de bloglist, étape8
415+
#### 4.20* : expansion de Blog List étape8
416416

417417
[Cet exemple](/en/part4/token_authentication) de la partie 4 montre comment extraire le jeton de l'en-tête avec la fonction d'aide _getTokenFrom_ dans <i>controllers/blogs.js</i>.
418418

@@ -444,7 +444,7 @@ const tokenExtractor = (request, response, next) => {
444444
}
445445
```
446446

447-
#### 4.21* : expansion de bloglist, étape9
447+
#### 4.21* : expansion de Blog List étape9
448448

449449
Modifiez l'opération de suppression de blog de manière à ce qu'un blog puisse être supprimé uniquement par l'utilisateur qui l'a ajouté. Par conséquent, la suppression d'un blog n'est possible que si le jeton envoyé avec la requête est le même que celui du créateur du blog.
450450

@@ -462,7 +462,7 @@ le champ <i>blog.user</i> ne contient pas une chaîne de caractères, mais un ob
462462
if ( blog.user.toString() === userid.toString() ) ...
463463
```
464464

465-
#### 4.22* : expansion de bloglist, étape10
465+
#### 4.22* : expansion de Blog List étape10
466466

467467
Les opérations de création d'un nouveau blog et de suppression d'un blog doivent toutes deux déterminer l'identité de l'utilisateur qui effectue l'opération. Le middleware _tokenExtractor_ que nous avons réalisé dans l'exercice 4.20 aide, mais les gestionnaires des opérations <i>post</i> et <i>delete</i> doivent toujours déterminer qui est l'utilisateur associé à un jeton spécifique.
468468

@@ -525,7 +525,7 @@ router.post('/', middleware.userExtractor, async (request, response) => {
525525
}
526526
```
527527
528-
#### 4.23* : expansion de bloglist, étape11
528+
#### 4.23* : expansion de Blog List étape11
529529
530530
Après l'ajout de l'authentification basée sur les jetons, les tests pour l'ajout d'un nouveau blog ont échoué. Corrigez les tests. Écrivez également un nouveau test pour vous assurer que l'ajout d'un blog échoue avec le code de statut approprié <i>401 Non autorisé</i> si un jeton n'est pas fourni.
531531

src/content/4/zh/part4d.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ const errorHandler = (error, request, response, next) => {
428428
<!-- **One more warning:** If you notice you are mixing async/await and _then_ calls, it is 99% certain you are doing something wrong. Use either or, never both.-->
429429
**还有一个警告:**如果你注意到你在混合使用async/await和_then_调用,那么99%肯定是你做错了什么。使用其中之一,而不是同时使用。
430430

431-
#### 4.15: bloglist expansion, step3
431+
#### 4.15: Blog List Expansion, step3
432432

433433
<!-- Implement a way to create new users by doing a HTTP POST-request to address <i>api/users</i>. Users have <i>username, password and name</i>.-->
434434
实现一种创建新用户的方法,通过HTTP POST-request来解决<i>api/users</i>。用户有<i>用户名、密码和姓名</i>。
@@ -454,7 +454,7 @@ npm uninstall bcrypt
454454

455455
![](../../images/4/22.png)
456456

457-
#### 4.16*: bloglist expansion, step4
457+
#### 4.16*: Blog List Expansion, step4
458458

459459
<!-- Add a feature which adds the following restrictions to creating new users: Both username and password must be given. Both username and password must be at least 3 characters long. The username must be unique.-->
460460
添加一个功能,在创建新用户时增加以下限制。必须给出用户名和密码。用户名和密码都必须至少有3个字符长。用户名必须是唯一的。
@@ -468,7 +468,7 @@ npm uninstall bcrypt
468468
<!-- Also, implement tests which check that invalid users are not created and invalid add user operation returns a suitable status code and error message.-->
469469
同时,实施测试,检查无效的用户是否被创建,无效的添加用户操作是否返回合适的状态代码和错误信息。
470470

471-
#### 4.17: bloglist expansion, step5
471+
#### 4.17: Blog List Expansion, step5
472472

473473
<!-- Expand blogs so that each blog contains information on the creator of the blog.-->
474474
扩展博客,使每个博客包含博客创建者的信息。
@@ -488,17 +488,17 @@ npm uninstall bcrypt
488488

489489
![](../../images/4/24e.png)
490490

491-
#### 4.18: bloglist expansion, step6
491+
#### 4.18: Blog List Expansion, step6
492492

493493
<!-- Implement token-based authentication according to part 4 chapter [Token authentication](/en/part4/token_authentication).-->
494494
根据第四章节[令牌认证](/en/part4/token_authentication)实施基于令牌的认证。
495495

496-
#### 4.19: bloglist expansion, step7
496+
#### 4.19: Blog List Expansion, step7
497497

498498
<!-- Modify adding new blogs so that it is only possible if a valid token is sent with the HTTP POST request. The user identified by the token is designated as the creator of the blog.-->
499499
修改添加新的博客,以便只有在HTTP POST请求中发送了有效的令牌才有可能。由令牌识别的用户被指定为博客的创建者。
500500

501-
#### 4.20*: bloglist expansion, step8
501+
#### 4.20*: Blog List Expansion, step8
502502

503503
<!-- [This example](/en/part4/token_authentication) from part 4 shows taking the token from the header with the _getTokenFrom_ helper function.-->
504504
[这个例子](/en/part4/token_authentication)来自第四章节,显示了用_getTokenFrom_辅助函数从头文件中获取令牌。
@@ -534,7 +534,7 @@ const tokenExtractor = (request, response, next) => {
534534
}
535535
```
536536

537-
#### 4.21*: bloglist expansion, step9
537+
#### 4.21*: Blog List Expansion, step9
538538

539539
<!-- Change the delete blog operation so that a blog can be deleted only by the user who added the blog. Therefore, deleting a blog is possible only if the token sent with the request is the same as that of the blog's creator.-->
540540
改变删除博客的操作,使一个博客只能由添加该博客的用户删除。因此,只有当与请求一起发送的令牌与博客创建者的令牌相同时,删除博客才有可能。
@@ -556,7 +556,7 @@ const blog = await Blog.findById(...)
556556
if ( blog.user.toString() === userid.toString() ) ...
557557
```
558558

559-
#### 4.22*: bloglist expansion, step10
559+
#### 4.22*: Blog List Expansion, step10
560560

561561
<!-- Both the new blog creation and blog deletion need to find out the identity of the user who is doing the operation. The middleware _tokenExtractor_ that we did in exercise 4.20 helps but still both the handlers of <i>post</i> and <i>delete</i> operations need to find out who is the user holding a specific token.-->
562562
新博客的创建和博客的删除都需要找出进行操作的用户的身份。我们在练习4.20中所做的中间件_tokenExtractor_有帮助,但<i>post</i>和<i>delete</i>操作的处理程序仍然需要找出谁是持有特定令牌的用户。
@@ -616,7 +616,7 @@ router.post('/', userExtractor, async (request, response) => {
616616
}
617617
```
618618
619-
#### 4.23*: bloglist expansion, step11
619+
#### 4.23*: Blog List Expansion, step11
620620
621621
<!-- After adding token based authentication the tests for adding a new blog broke down. Fix the tests. Also write a new test to ensure adding a blog fails with the proper status code <i>401 Unauthorized</i> if a token is not provided.-->
622622
在添加了基于令牌的认证后,添加一个新博客的测试出现了问题。修复测试。同时写一个新的测试,以确保在没有提供令牌的情况下,添加一个博客会以适当的状态代码<i>401 Unauthorized</i>失败。

src/content/5/fr/part5a.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ Pendant que vous faites les exercices, rappelez-vous toutes les méthodes de dé
534534

535535
**Attention:** Si vous remarquez que vous mélangez les fonctions _async/await_ et les commandes _then_, il est à 99,9 % certain que vous faites quelque chose de mal. Utilisez l'un ou l'autre, jamais les deux.
536536

537-
#### 5.1 : bloglist frontend, étape 1
537+
#### 5.1 : Blog List Frontend, étape 1
538538

539539
Clonez l'application depuis [GitHub](https://github.com/fullstack-hy2020/bloglist-frontend) avec la commande:
540540

@@ -593,21 +593,21 @@ Les détails de l'utilisateur connecté n'ont pas encore à être sauvegardés d
593593
}
594594
```
595595

596-
#### 5.2 : bloglist frontend, étape 2
596+
#### 5.2 : Blog List Frontend, étape 2
597597

598598
Rendez la connexion 'permanente' en utilisant le stockage local. Implémentez également un moyen de se déconnecter.
599599

600600
![navigateur montrant le bouton de déconnexion après la connexion](../../images/5/6e.png)
601601

602602
Assurez-vous que le navigateur ne se souvient pas des détails de l'utilisateur après la déconnexion.
603603

604-
#### 5.3 : bloglist frontend, étape 3
604+
#### 5.3 : Blog List Frontend, étape 3
605605

606606
Étendez votre application pour permettre à un utilisateur connecté d'ajouter de nouveaux blogs :
607607

608608
![navigateur montrant le formulaire de nouveau blog](../../images/5/7e.png)
609609

610-
#### 5.4 : bloglist frontend, étape 4
610+
#### 5.4 : Blog List Frontend, étape 4
611611

612612
Implémentez des notifications qui informent l'utilisateur des opérations réussies et échouées en haut de la page. Par exemple, lorsqu'un nouveau blog est ajouté, la notification suivante peut être affichée:
613613

src/content/5/ptbr/part5a.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ Enquanto faz os exercícios, lembre-se de todos os métodos de depuração que d
559559

560560
**Aviso:** Se você perceber que está misturando os comandos das funções _async/await_ e _then_, é 99,9% certo que está fazendo algo errado. Use apenas um ou outro, nunca os dois.
561561

562-
#### 5.1: frontend do bloglist, passo 1
562+
#### 5.1: frontend do Blog List Passo 1
563563

564564
Clone a aplicação do [GitHub](https://github.com/fullstack-hy2020/bloglist-frontend) com o comando:
565565

@@ -618,7 +618,7 @@ Detalhes do usuário logado não precisam ser salvos no local storage ainda.
618618
}
619619
```
620620

621-
### 5.2: frontend do bloglist, passo 2
621+
### 5.2: frontend do Blog List Passo 2
622622

623623

624624
Torne o login 'permanente' usando o local storage. Além disso, implemente uma maneira de deslogar.
@@ -627,13 +627,13 @@ Torne o login 'permanente' usando o local storage. Além disso, implemente uma m
627627

628628
Assegure-se de que o navegador não lembre os detalhes do usuário após o logout.
629629

630-
#### 5.3: frontend do bloglist, passo 3
630+
#### 5.3: frontend do Blog List Passo 3
631631

632632
Expanda sua aplicação para permitir que um usuário logado adicione novos blogs:
633633

634634
![navegador mostrando o formulário do novo blog](../../images/5/7e.png)
635635

636-
#### 5.4: frontend do bloglist, passo 4
636+
#### 5.4: frontend do Blog List Passo 4
637637

638638
Implemente notificações que informem o usuário sobre operações bem-sucedidas e mal-sucedidas no topo da página. Por exemplo, quando um novo blog é adicionado, a seguinte notificação pode ser exibida:
639639

src/content/5/ptbr/part5d.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ Recomendo especialmente a leitura de [Introdução ao Cypress](https://docs.cypr
11001100
11011101
> <i>Este é o guia mais importante para entender como testar com o Cypress. Leia. Entenda.</i>
11021102
1103-
#### 5.17: testes end-to-end do bloglist, etapa 1
1103+
#### 5.17: testes end-to-end do Blog List etapa 1
11041104
11051105
Configure o Cypress para o seu projeto. Crie um teste para verificar se a aplicação exibe o formulário de login por padrão.
11061106
@@ -1121,7 +1121,7 @@ describe('Blog app', function() {
11211121
11221122
O bloco <i>beforeEach</i> deve esvaziar o banco de dados usando, por exemplo, o método que usamos no [material](/ptbr/part5/testes_end_to_end#controlando-o-estado-do-banco-de-dados).
11231123
1124-
#### 5.18: testes end-to-end do bloglist, etapa 2
1124+
#### 5.18: testes end-to-end do Blog List etapa 2
11251125
11261126
Faça testes para fazer login. Teste tentativas de login bem-sucedidas e malsucedidas.
11271127
Crie um novo usuário no bloco <i>beforeEach</i> para os testes.
@@ -1154,7 +1154,7 @@ describe('Aplicativo Blog', function() {
11541154
11551155
Exercício bônus opcional: Verifique se a notificação exibida após uma tentativa de login malsucedida é exibida em vermelho.
11561156
1157-
#### 5.19: testes end-to-end do bloglist, etapa 3
1157+
#### 5.19: testes end-to-end do Blog List etapa 3
11581158
11591159
Crie um teste que verifique se um usuário logado pode criar um novo blog.
11601160
A estrutura do teste pode ser a seguinte:
@@ -1178,19 +1178,19 @@ describe('Blog app', function() {
11781178
11791179
"O teste deve garantir que um novo blog seja adicionado à lista de todos os blogs.
11801180
1181-
#### 5.20: Testes end-to-end do bloglist, passo 4
1181+
#### 5.20: Testes end-to-end do Blog List Passo 4
11821182
11831183
Crie um teste que confirme que os usuários podem curtir um blog.
11841184
1185-
#### 5.21: Testes end-to-end do bloglist, passo 5
1185+
#### 5.21: Testes end-to-end do Blog List Passo 5
11861186
11871187
Crie um teste para garantir que o usuário que criou um blog possa excluí-lo.
11881188
1189-
#### 5.22: Testes end-to-end do bloglist, passo 6
1189+
#### 5.22: Testes end-to-end do Blog List Passo 6
11901190
11911191
Crie um teste para garantir que outros usuários, exceto o criador, não vejam o botão de exclusão.
11921192
1193-
#### 5.23: Testes end-to-end do bloglist, passo 7
1193+
#### 5.23: Testes end-to-end do Blog List Passo 7
11941194
11951195
Crie um teste que verifique se os blogs estão ordenados de acordo com as curtidas, sendo o blog com mais curtidas o primeiro.
11961196

src/content/5/zh/part5a.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ window.localStorage.clear()
595595
<!-- **Warning:** If you notice you are mixing in same function async/await and _then_ commands, it's 99.9% certain you are doing something wrong. Use either or, never both.-->
596596
**警告:**如果你注意到你在同一函数中混入了async/await和_then_命令,那么99.9%的人肯定是做错了。请使用其中之一,不要同时使用。
597597

598-
#### 5.1: bloglist frontend, step1
598+
#### 5.1: Blog List Frontend, step1
599599

600600
<!-- Clone the application from [Github](https://github.com/fullstack-hy2020/bloglist-frontend) with the command:-->
601601
用命令从[Github](https://github.com/fullstack-hy2020/bloglist-frontend)克隆应用。
@@ -661,7 +661,7 @@ npm start
661661
}
662662
```
663663

664-
#### 5.2: bloglist frontend, step2
664+
#### 5.2: Blog List Frontend, step2
665665

666666
<!-- Make the login 'permanent' by using the local storage. Also implement a way to log out.-->
667667
通过使用本地存储使登录成为"永久"。同时实现一个注销的方法。
@@ -671,14 +671,14 @@ npm start
671671
<!-- Ensure the browser does not remember the details of the user after logging out.-->
672672
确保浏览器在注销后不会记住用户的详细信息。
673673

674-
#### 5.3: bloglist frontend, step3
674+
#### 5.3: Blog List Frontend, step3
675675

676676
<!-- Expand your application to allow a logged-in user to add new blogs:-->
677677
扩展你的应用,允许登录的用户添加新的博客。
678678

679679
![](../../images/5/7e.png)
680680

681-
#### 5.4: bloglist frontend, step4
681+
#### 5.4: Blog List Frontend, step4
682682

683683
<!-- Implement notifications which inform the user about successful and unsuccessful operations at the top of the page. For example, when a new blog is added, the following notification can be shown:-->
684684
实施通知,在页面顶部告知用户成功和不成功的操作。例如,当一个新博客被添加时,可以显示以下通知。

src/content/5/zh/part5d.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,7 @@ it('then example', function() {
12151215
<!-- > <i>This is the single most important guide for understanding how to test with Cypress. Read it. Understand it.</i>-->
12161216
> <i>这是了解如何使用Cypress进行测试的唯一最重要的指南。阅读它。理解它。</i>
12171217
1218-
#### 5.17: bloglist end to end testing, step1
1218+
#### 5.17: Blog List End to end testing, step1
12191219
12201220
<!-- Configure Cypress to your project. Make a test for checking that the application displays the login form by default.-->
12211221
为你的项目配置Cypress。做一个测试,检查应用是否默认显示登录表单。
@@ -1239,7 +1239,7 @@ describe('Blog app', function() {
12391239
<!-- The <i>beforeEach</i> formatting blog must empty the database using for example the method we used in the [material](/en/part5/end_to_end_testing#controlling-the-state-of-the-database).-->
12401240
<i>beforeEach</i> 格式化的博客必须清空数据库,例如使用我们在[材料](/en/part5/end_to_end_testing#controlling-the-state-of-the-database)中使用的方法。
12411241
1242-
#### 5.18: bloglist end to end testing, step2
1242+
#### 5.18: Blog List End to end testing, step2
12431243
12441244
<!-- Make tests for logging in. Test both successful and unsuccessful login attempts.-->
12451245
进行登录测试。测试成功和不成功的登录尝试。
@@ -1275,7 +1275,7 @@ describe('Blog app', function() {
12751275
12761276
<i>Optional bonus exercise</i>: Check that the notification shown with unsuccessful login is displayed red.
12771277
1278-
#### 5.19: bloglist end to end testing, step3
1278+
#### 5.19: Blog List End to end testing, step3
12791279
12801280
<!-- Make a test which checks that a logged-in user can create a new blog.-->
12811281
做一个测试,检查一个登录的用户是否可以创建一个新的博客。
@@ -1302,19 +1302,19 @@ describe('Blog app', function() {
13021302
<!-- The test has to ensure that a new blog is added to the list of all blogs.-->
13031303
该测试必须确保一个新的博客被添加到所有博客的列表中。
13041304
1305-
#### 5.20: bloglist end to end testing, step4
1305+
#### 5.20: Blog List End to end testing, step4
13061306
13071307
<!-- Make a test which checks that users can like a blog.-->
13081308
做一个测试,检查用户是否可以喜欢一个博客。
13091309
1310-
#### 5.21: bloglist end to end testing, step5
1310+
#### 5.21: Blog List End to end testing, step5
13111311
13121312
<!-- Make a test for ensuring that the user who created a blog can delete it.-->
13131313
做一个测试,确保创建博客的用户可以删除它。
13141314
13151315
<i>Optional bonus exercise:</i> also check that other users cannot delete the blog.
13161316
1317-
#### 5.22: bloglist end to end testing, step6
1317+
#### 5.22: Blog List End to end testing, step6
13181318
13191319
<!-- Make a test which checks that the blogs are ordered according to likes with the blog with the most likes being first.-->
13201320
做一个测试,检查博客是否按照喜欢程度排序,喜欢最多的博客排在前面。

0 commit comments

Comments
 (0)