Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #41

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
78 changes: 29 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,29 @@
# Vue Dynamic List of Posts

Implement the App with ability to show posts of a current logged-in user.
The user should be able to create a new post with their userId. Each post can
be opened in the sidebar with its comments, can be edited and deleted. There should delete a comment and a
form to add new comments.

> Here is [the working version](https://mate-academy.github.io/vue_dynamic-list-of-posts/#/)

1. Learn the `.html` files to get all needed layouts;
- Bulma is required to have all styles
1. Initially the `App` shows the `Posts table` and `Create new post` button

- show the `<Loader>` while waiting for the API response;
- show an error notification if `posts` loading fails;
- if the user has no posts show the `No posts yet` notification.

1. Add the `Sidebar--open` class to the sidebar when user click on `Create new post`;

- the form for new post should be appear there immediately;
- add validation to the fields;
- when user click on `Create` component with post details and comments should be appear there immediately ;

1. In the `Post preview` user should see `edit` and `delete` buttons;

- When user click on `Delete`, post should be deleted and sidebar close;
- When user click on `Edit` show edit post form;
- When user click on `Save` in edit mode - show post preview in the sidebar;

1. Add the `Sidebar--open` class to the sidebar when a post is selected;
- the post details should appear there immediately;
- the post commnets should be loaded from the API;
- the `Loader` is shown before comments are loaded;
- `CommentsError` notification is show on loading error;
- `NoComments` message is shown if the post does not have comments yet;
1. Show the `Write a comment` button below the comments
- after click hide the button and show the form to add new comment;
- the form stays visible until the other post is opened;
- the form should be implemented as a separate component;
1. The form requires an author's name and email and a comment text.
- show errors only after the form is submitted;
- remove an error on the field change;
- keep the `name` and `email` after the successful submit but clear a comment text;
- The `Clear` button should also clear all errors;
- Add the `is-loading` class to the submit button while waiting for a response;
- Add the new comment received as a response from the `API` to the end of the list;
1. Implement comment deletion
- Delete the commnet immediately not waiting for the server response to improve the UX.
1. (\*) Handle `Add` and `Delete` errors so the user can retry
# vue_dynamic-list-of-posts

This template should help get you started developing with Vue 3 in Vite.

## Recommended IDE Setup

[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).

## Customize configuration

See [Vite Configuration Reference](https://vitejs.dev/config/).

## Project Setup

```sh
npm install
```

### Compile and Hot-Reload for Development

```sh
npm run dev
```

### Compile and Minify for Production

```sh
npm run build
```
16 changes: 0 additions & 16 deletions addPost.html

This file was deleted.

9 changes: 0 additions & 9 deletions comment.html

This file was deleted.

16 changes: 0 additions & 16 deletions header.html

This file was deleted.

13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vue Post List</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
26 changes: 0 additions & 26 deletions inputField.html

This file was deleted.

8 changes: 8 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
},
"exclude": ["node_modules", "dist"]
}
6 changes: 0 additions & 6 deletions loader/index.html

This file was deleted.

30 changes: 0 additions & 30 deletions login.html

This file was deleted.

21 changes: 0 additions & 21 deletions needToRegister.html

This file was deleted.

3 changes: 0 additions & 3 deletions noCommentsYet.html

This file was deleted.

Loading