Skip to content

Commit 71f8ce6

Browse files
committed
fix exercise numbering
1 parent 85361d1 commit 71f8ce6

File tree

5 files changed

+48
-156
lines changed

5 files changed

+48
-156
lines changed

src/content/7/en/part7a.md

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -13,60 +13,6 @@ In addition to the exercises in this and the next chapter, there are a series of
1313

1414
### React Router
1515

16-
This section has been moved to the [part 5](/en/part5/react_router_ui_frameworks). You still may do the below exercises.
17-
18-
</div>
19-
20-
<div class="tasks">
21-
22-
### Exercises 7.1.-7.3.
23-
24-
Let's return to working with anecdotes. Use the redux-free anecdote app found in the repository <https://github.com/fullstack-hy2020/routed-anecdotes> as the starting point for the exercises.
25-
26-
If you clone the project into an existing git repository, remember to <i>delete the git configuration of the cloned application:</i>
27-
28-
```bash
29-
cd routed-anecdotes // go first to directory of the cloned repository
30-
rm -rf .git
31-
```
32-
33-
The application starts the usual way, but first, you need to install its dependencies:
34-
35-
```bash
36-
npm install
37-
npm run dev
38-
```
39-
40-
#### 7.1: Routed Anecdotes, step 1
41-
42-
Add React Router to the application so that by clicking links in the <i>Menu</i> component the view can be changed.
43-
44-
At the root of the application, meaning the path _/_, show the list of anecdotes:
45-
46-
![browser at baseURL showing anecdotes and footer](../../assets/teht/40.png)
47-
48-
The <i>Footer</i> component should always be visible at the bottom.
49-
50-
The creation of a new anecdote should happen e.g. in the path <i>create</i>:
51-
52-
![browser anecdotes /create shows create form](../../assets/teht/41.png)
53-
54-
#### 7.2: Routed Anecdotes, step 2
55-
56-
Implement a view for showing a single anecdote:
57-
58-
![browser /anecdotes/number showing single anecdote](../../assets/teht/42.png)
59-
60-
Navigating to the page showing the single anecdote is done by clicking the name of that anecdote:
61-
62-
![browser showing previous link that was clicked](../../assets/teht/43.png)
63-
64-
#### 7.3: Routed Anecdotes, step3
65-
66-
The default functionality of the creation form is quite confusing because nothing seems to be happening after creating a new anecdote using the form.
67-
68-
Improve the functionality such that after creating a new anecdote the application transitions automatically to showing the view for all anecdotes <i>and</i> the user is shown a notification informing them of this successful creation for the next five seconds:
69-
70-
![browser anecdotes showing success message for adding anecdote](../../assets/teht/44.png)
16+
This section has been moved to the [part 5](/en/part5/react_router_ui_frameworks).
7117

7218
</div>

src/content/7/en/part7b.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,11 @@ The internet is starting to fill up with more and more helpful material related
290290

291291
<div class="tasks">
292292

293-
### Exercises 7.4.-7.8.
293+
### Exercises 7.1.-7.5.
294294

295295
We'll continue with the app from the [exercises](/en/part7/react_router#exercises-7-1-7-3) of the [react router](/en/part7/react_router) chapter.
296296

297-
#### 7.4: Anecdotes and Hooks step 1
297+
#### 7.1: Anecdotes and Hooks step 1
298298

299299
Simplify the anecdote creation form of your application with the _useField_ custom hook we defined earlier.
300300

@@ -337,7 +337,7 @@ const App = () => {
337337
}
338338
```
339339

340-
#### 7.5: Anecdotes and Hooks step 2
340+
#### 7.2: Anecdotes and Hooks step 2
341341

342342
Add a button to the form that you can use to clear all the input fields:
343343

@@ -351,7 +351,7 @@ Depending on your solution, you may see the following warning in your console:
351351

352352
We will return to this warning in the next exercise.
353353

354-
#### 7.6: Anecdotes and Hooks step 3
354+
#### 7.3: Anecdotes and Hooks step 3
355355

356356
If your solution did not cause a warning to appear in the console, you have already finished this exercise.
357357

@@ -388,7 +388,7 @@ One simple fix would be to not use the spread syntax and write all of the forms
388388

389389
If we were to do this, we would lose much of the benefit provided by the <i>useField</i> hook. Instead, come up with a solution that fixes the issue, but is still easy to use with the spread syntax.
390390

391-
#### 7.7: Country hook
391+
#### 7.4: Country hook
392392

393393
Let's return to exercises [2.18-2.20](/en/part2/adding_styles_to_react_app#exercises-2-18-2-20).
394394

@@ -408,7 +408,7 @@ Use the API endpoint [name](https://studies.cs.helsinki.fi/restcountries/) to fe
408408

409409
Note that in this exercise it is essential to use useEffect's [second parameter](https://react.dev/reference/react/useEffect#parameters) array to control when the effect function is executed. See the course [part 2](/en/part2/adding_styles_to_react_app#couple-of-important-remarks) for more info how the second parameter could be used.
410410

411-
#### 7.8: Ultimate Hooks
411+
#### 7.5: Ultimate Hooks
412412

413413
The code of the application responsible for communicating with the backend of the note application of the previous parts looks like this:
414414

src/content/7/en/part7f.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ One good piece of advice for both refactoring and writing new code is to take <i
1919

2020
<div class="tasks">
2121

22-
### Exercises 7.9.-7.21.
22+
### Exercises 7.6.-7.18.
2323

24-
#### 7.9: Automatic Code Formatting
24+
#### 7.6: Automatic Code Formatting
2525

2626
In the previous parts, we used ESLint to ensure that the code follows the defined conventions. [Prettier](https://prettier.io/) is yet another approach for the same. According to the documentation, Prettier is <i>an opinionated code formatter</i>, that is, Prettier not only controls the code style but also formats the code according to the definition.
2727

@@ -31,63 +31,63 @@ Take Prettier to use in your app and configure it to work with your editor.
3131

3232
### State Management: Zustand
3333

34-
<i>There are two alternative versions to choose for exercises 7.10-7.13: you can do the state management of the application either using Zustand or React Query and Context</i>. If you want to maximize your learning, you should do both versions!
34+
<i>There are two alternative versions to choose for exercises 7.7-7.10: you can do the state management of the application either using Zustand or React Query and Context</i>. If you want to maximize your learning, you should do both versions!
3535

3636
Note: if you completed part 6 using Redux, you can of course use Redux instead of Zustand in this exercise series!
3737

38-
#### 7.10: Zustand, Step 1
38+
#### 7.7: Zustand, Step 1
3939

4040
Refactor the application to use Zustand to manage the notification data.
4141

42-
#### 7.11: Zustand, Step 2
42+
#### 7.8: Zustand, Step 2
4343

4444
<i>Note</i> that this and the next two exercises are quite laborious but incredibly educational.
4545

4646
Store the information about blog posts in the Zustand store. In this exercise, it is enough that you can see the blogs in the backend and create a new blog.
4747

4848
You are free to manage the state for logging in and creating new blog posts by using the internal state of React components.
4949

50-
#### 7.12: Zustand, Step 3
50+
#### 7.9: Zustand, Step 3
5151

5252
Expand your solution so that it is again possible to like and delete a blog.
5353

54-
#### 7.13: Zustand, Step 4
54+
#### 7.10: Zustand, Step 4
5555

5656
Store the information about the signed-in user in the Zustand store.
5757

5858
### State Management: React Query and Context
5959

60-
<i>There are two alternative versions to choose for exercises 7.10-7.13: you can do the state management of the application either using Zustand or React Query and Context</i>. If you want to maximize your learning, you should do both versions!
60+
<i>There are two alternative versions to choose for exercises 7.7-7.10: you can do the state management of the application either using Zustand or React Query and Context</i>. If you want to maximize your learning, you should do both versions!
6161

62-
#### 7.10: React Query and Context step 1
62+
#### 7.7: React Query and Context step 1
6363

6464
Refactor the app to use the useReducer-hook and context to manage the notification data.
6565

66-
#### 7.11: React Query and Context step 2
66+
#### 7.8: React Query and Context step 2
6767

6868
Use React Query to manage the state for blog posts. For this exercise, it is sufficient that the application displays existing blogs and that the creation of a new blog is successful.
6969

7070
You are free to manage the state for logging in and creating new blog posts by using the internal state of React components.
7171

72-
#### 7.12: React Query and Context step 3
72+
#### 7.9: React Query and Context step 3
7373

7474
Expand your solution so that it is again possible to like and delete a blog.
7575

76-
#### 7.13: React Query and Context step 4
76+
#### 7.10: React Query and Context step 4
7777

7878
Use the useReducer-hook and context to manage the data for the logged in user.
7979

8080
### Views
8181

8282
The rest of the tasks are common to both the Zustand and React Query versions.
8383

84-
#### 7.14: Users view
84+
#### 7.11: Users view
8585

8686
Implement a view to the application that displays all of the basic information related to users:
8787

8888
![browser blogs with users table showing blogs created](../../images/7/41.png)
8989

90-
#### 7.15: Individual User View
90+
#### 7.12: Individual User View
9191

9292
Implement a view for individual users that displays all of the blog posts added by that user:
9393

@@ -122,7 +122,7 @@ const User = () => {
122122
}
123123
```
124124

125-
#### 7.16: Blog View
125+
#### 7.13: Blog View
126126

127127
Implement a separate view for blog posts. You can model the layout of your view after the following example:
128128

@@ -134,13 +134,13 @@ Users should be able to access this view by clicking the name of the blog post i
134134

135135
After you're done with this exercise, the functionality that was implemented in exercise 5.7 is no longer necessary. Clicking a blog post no longer needs to expand the item in the list and display the details of the blog post.
136136

137-
#### 7.17: Navigation
137+
#### 7.14: Navigation
138138

139139
Implement a navigation menu for the application:
140140

141141
![browser blogs navigation navigation menu](../../images/7/47.png)
142142

143-
#### 7.18: Comments, step 1
143+
#### 7.15: Comments, step 1
144144

145145
Implement the functionality for commenting the blog posts:
146146

@@ -152,17 +152,17 @@ In this exercise, it is enough for the frontend to only display the comments tha
152152

153153
An appropriate mechanism for adding comments to a blog post would be an HTTP POST request to the <i>api/blogs/:id/comments</i> endpoint.
154154

155-
#### 7.19: Comments, step 2
155+
#### 7.16: Comments, step 2
156156

157157
Extend your application so that users can add comments to blog posts from the frontend:
158158

159159
![browser showing comments added via frontend](../../images/7/49.png)
160160

161-
#### 7.20: Styles, step 1
161+
#### 7.17: Styles, step 1
162162

163163
Improve the appearance of your application by applying one of the methods shown in the course material.
164164

165-
#### 7.21: Styles, step 2
165+
#### 7.18: Styles, step 2
166166

167167
You can mark this exercise as finished if you use an hour or more for styling your application.
168168

src/content/7/fi/osa7a.md

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -13,60 +13,6 @@ Tämän ja seuraavan luvun tehtävien lisäksi seitsemäs osa sisältää kertaa
1313

1414
### React Router
1515

16-
Tämän luvun materiaali siirtynyt [osaan 5](/osa5/react_router_tyylikirjastot). Voit kuitenkin edelleen tehdä aiheeseen liittyvät tehtävät.
17-
18-
</div>
19-
20-
<div class="tasks">
21-
22-
### Tehtävät 7.1.-7.3.
23-
24-
Jatketaan anekdoottien parissa. Ota seuraaviin tehtäviin pohjaksi repositoriossa <https://github.com/fullstack-hy2020/routed-anecdotes> oleva Reduxiton anekdoottisovellus.
25-
26-
Jos kloonaat projektin olemassaolevan Git-repositorion sisälle, <i>poista kloonatun sovelluksen Git-konfiguraatio</i>:
27-
28-
```bash
29-
cd routed-anecdotes // eli mene ensin kloonatun repositorion hakemistoon
30-
rm -rf .git
31-
```
32-
33-
Sovellus käynnistyy normaaliin tapaan, mutta joudut ensin asentamaan sovelluksen riippuvuudet:
34-
35-
```bash
36-
npm install
37-
npm run dev
38-
```
39-
40-
#### 7.1: routed anecdotes, step1
41-
42-
Lisää sovellukseen React Router siten, että <i>Menu</i>-komponentissa olevia linkkejä klikkailemalla saadaan säädeltyä näytettävää näkymää.
43-
44-
Sovelluksen juuressa eli polulla _/_ näytetään anekdoottien lista:
45-
46-
![](../../assets/teht/40.png)
47-
48-
Pohjalla oleva <i>Footer</i>-komponentti tulee näyttää aina.
49-
50-
Uuden anekdootin luominen tapahtuu esim. polulla <i>create</i>:
51-
52-
![](../../assets/teht/41.png)
53-
54-
#### 7.2: routed anecdotes, step2
55-
56-
Toteuta sovellukseen yksittäisen anekdootin tiedot näyttävä näkymä:
57-
58-
![](../../assets/teht/42.png)
59-
60-
Yksittäisen anekdootin sivulle navigoidaan klikkaamalla anekdootin nimeä:
61-
62-
![](../../assets/teht/43.png)
63-
64-
#### 7.3: routed anecdotes, step3
65-
66-
Luomislomakkeen oletusarvoinen toiminnallisuus on melko hämmentävä, sillä kun lomakkeen avulla luodaan uusi muistiinpano, mitään ei näytä tapahtuvan.
67-
68-
Paranna toiminnallisuutta siten, että luomisen jälkeen siirrytään automaattisesti kaikkien anekdoottien näkymään <i>ja</i> käyttäjälle näytetään viiden sekunnin ajan onnistuneesta lisäyksestä kertova notifikaatio:
69-
70-
![](../../assets/teht/44.png)
16+
Tämän luvun materiaali siirtynyt [osaan 5](/osa5/react_router_tyylikirjastot).
7117

7218
</div>

0 commit comments

Comments
 (0)