Skip to content

Add React component for country creation #1345

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

Open
php-coder opened this issue Apr 16, 2020 · 0 comments
Open

Add React component for country creation #1345

php-coder opened this issue Apr 16, 2020 · 0 comments
Labels
area/frontend estimation/45m Estimated time: 45 minutes kind/task Task that is part of some feature
Milestone

Comments

@php-coder
Copy link
Owner

php-coder commented Apr 16, 2020

We need to port existing form for country creation to React. Here is the current code:

<form id="add-country-form" method="post" class="form-horizontal" action="info.html"
th:action="@{${ADD_COUNTRY_PAGE}}" th:object="${addCountryForm}">
<div class="form-group" th:classappend="${#fields.hasErrors('name') ? 'has-error' : ''}">
<label for="name" class="control-label col-sm-4">
<span th:remove="tag" th:text="#{t_name_in_english}">
Name (in English)
</span>
<span class="required_field">*</span>
</label>
<div class="col-sm-5">
<input id="name" type="text" class="form-control" required="required" th:field="*{name}" />
<!--/*/
<span id="name.errors" class="help-block" th:if="${#fields.hasErrors('name')}" th:each="error : ${#fields.errors('name')}" th:text="${error}"></span>
/*/-->
</div>
</div>
<div class="form-group" th:classappend="${#fields.hasErrors('nameRu') ? 'has-error' : ''}">
<label for="nameRu" class="control-label col-sm-4" th:text="#{t_name_in_russian}">
Name (in Russian)
</label>
<div class="col-sm-5">
<input id="nameRu" type="text" class="form-control" th:field="*{nameRu}" />
<!--/*/
<span id="nameRu.errors" class="help-block" th:if="${#fields.hasErrors('nameRu')}" th:each="error : ${#fields.errors('nameRu')}" th:text="${error}"></span>
/*/-->
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-5">
<input type="submit" class="btn btn-primary" value="Add" th:value="#{t_add}" />
</div>
</div>
</form>

When a user submits data, we should POST it to /categories Also, we should handle&show related errors from a server.

As part of this task we should only create a React component. API call will be implemented in #1347 Unit and integration tests, will be added later.

Part of #1328

@php-coder php-coder added kind/task Task that is part of some feature area/frontend estimation/45m Estimated time: 45 minutes labels Apr 16, 2020
@php-coder php-coder added this to the 0.4.4 milestone Apr 16, 2020
@splin-shady splin-shady self-assigned this Apr 18, 2020
@php-coder php-coder modified the milestones: 0.4.4, next May 23, 2020
@php-coder php-coder modified the milestones: next, 0.4.5 Jun 21, 2020
@php-coder php-coder modified the milestones: 0.4.5, 0.4.6 Aug 15, 2020
@php-coder php-coder modified the milestones: 0.4.6, next Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend estimation/45m Estimated time: 45 minutes kind/task Task that is part of some feature
Projects
None yet
Development

No branches or pull requests

2 participants