Skip to content

Add UI for adding a comment to a series #1338

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

Closed
php-coder opened this issue Apr 15, 2020 · 1 comment
Closed

Add UI for adding a comment to a series #1338

php-coder opened this issue Apr 15, 2020 · 1 comment
Assignees
Labels
area/frontend estimation/1h Estimated time: 60 minutes kind/task Task that is part of some feature
Milestone

Comments

@php-coder
Copy link
Owner

php-coder commented Apr 15, 2020

On the src/main/webapp/WEB-INF/views/series/info.html page we should add another form to add a comment. It should have a single textarea and a submit button. Here is an example that can be helpful:

<div class="form-group js-comment collapse in" th:classappend="|${#fields.hasErrors('comment') ? 'has-error' : ''} ${addSeriesForm.comment != null ? 'js-has-data' : ''}|" sec:authorize="hasAuthority('ADD_COMMENTS_TO_SERIES')">
<label for="comment" class="control-label col-sm-3" th:text="#{t_comment}">
Comment
</label>
<div class="col-sm-5">
<textarea id="comment" class="form-control" cols="22" rows="3" th:field="*{comment}"></textarea>
<!--/*/
<span id="comment.errors" class="help-block" th:if="${#fields.hasErrors('comment')}" th:each="error : ${#fields.errors('comment')}" th:text="${error}"></span>
/*/-->
</div>
</div>

When we submit a form, it should send a PATCH request to API /series/{id} with

[
  { "op": "add", "path": "/comment", "value": "<user data>" }
]

and reload a page on success. It should show an error when server returns an error. Note that there can be 2 type of errors -- general (for a whole form) and validation error (for a particular field).

Part of #785

@php-coder php-coder added kind/task Task that is part of some feature area/frontend estimation/30m Estimated time: 30 minutes labels Apr 15, 2020
@php-coder php-coder added this to the 0.4.4 milestone Apr 15, 2020
@php-coder php-coder added estimation/45m Estimated time: 45 minutes and removed estimation/30m Estimated time: 30 minutes labels Apr 15, 2020
@php-coder php-coder added estimation/1h Estimated time: 60 minutes and removed estimation/45m Estimated time: 45 minutes labels May 6, 2020
@php-coder
Copy link
Owner Author

Note that there can be 2 type of errors -- general (for a whole form) and validation error (for a particular field).

The error handling should be the same as in SeriesSaleImportForm and SimilarSeriesForm

php-coder added a commit that referenced this issue May 6, 2020
php-coder added a commit that referenced this issue Jun 13, 2020
Also fix the elements with duplicated ids.

Corrections to the following commits:
- 487ef61 (#1341, #1339)
- 86959e0 (#1342, #1340)
- 660e616 (#1338, #785)
- fb1df42 (#1344, #1343)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend estimation/1h Estimated time: 60 minutes kind/task Task that is part of some feature
Projects
None yet
Development

No branches or pull requests

2 participants