Skip to content

Add UI for adding catalog numbers to a series #1341

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 · 2 comments · Fixed by #1392
Closed

Add UI for adding catalog numbers to a series #1341

php-coder opened this issue Apr 15, 2020 · 2 comments · Fixed by #1392
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 catalog numbers. It should have inputs for numbers (just a text input) and a catalog name. Also there should be a submit button. Here are examples that can be helpful:

  • List of catalogs:

    <div class="form-group">
    <label for="catalogName" th:text="|#{t_catalog}:|">Catalog:</label>
    <select id="catalogName" name="catalogName" class="form-control">
    <option value="michel" th:text="#{t_michel}">Michel</option>
    <option value="scott" th:text="#{t_scott}">Scott</option>
    <option value="yvert" th:text="#{t_yvert}">Yvert</option>
    <option value="gibbons" th:text="#{t_sg}">Gibbons</option>
    <option value="solovyov" th:text="#{t_solovyov}">Solovyov</option>
    <option value="zagorski" th:text="#{t_zagorski}">Zagorski</option>
    </select>
    </div>

  • Catalog numbers:

    <div class="form-group form-group-sm js-catalogs-info collapse in" th:classappend="|${michelHasErrors ? 'has-error' : ''} ${showCatalogsInfo ? 'js-has-data' : ''}|">
    <label for="michelNumbers" class="control-label col-sm-3" th:text="#{t_michel}">
    Michel
    </label>
    <div class="col-sm-7">
    <div class="row">
    <div class="col-xs-6">
    <input type="text" id="michelNumbers" class="form-control js-catalog-numbers" th:field="*{michelNumbers}" />
    </div>
    <div class="col-xs-3 no-padding">
    <div class="input-group">
    <span class="input-group-addon">&euro;</span>
    <input type="text" class="form-control js-with-tooltip" size="5" title="EUR" th:field="*{michelPrice}" />
    </div>
    </div>
    </div>
    <!--/*/
    <span id="michelNumbers.errors" class="help-block" th:if="${#fields.hasErrors('michelNumbers')}" th:each="error : ${#fields.errors('michelNumbers')}" th:text="${error}"></span>
    <span id="michelPrice.errors" class="help-block" th:if="${#fields.hasErrors('michelPrice')}" th:each="error : ${#fields.errors('michelPrice')}" 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": "/michel_numbers", "value": [ "1", "2", "3"] }
]

and reload a page on success. The value of path depends on a value of catalog name -- for Michel catalog, we use "/michel_numbers" but for Scott it should be "/scott_numbers" and so on.

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 #1339

@php-coder php-coder added kind/task Task that is part of some feature 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 area/frontend estimation/1h Estimated time: 60 minutes and removed estimation/30m Estimated time: 30 minutes labels Apr 15, 2020
@php-coder
Copy link
Owner Author

@ArtemFedorchuk Hi, please, let me know if you need help or if you aren't going to work on this issue. Thanks!

@php-coder
Copy link
Owner Author

We can copy&paste code from #1342

bahoss added a commit to bahoss/mystamps that referenced this issue May 13, 2020
bahoss added a commit to bahoss/mystamps that referenced this issue May 14, 2020
bahoss added a commit to bahoss/mystamps that referenced this issue May 19, 2020
bahoss added a commit to bahoss/mystamps that referenced this issue May 20, 2020
bahoss added a commit to bahoss/mystamps that referenced this issue May 20, 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

Successfully merging a pull request may close this issue.

3 participants