Skip to content

/series/{id}: rewrite series sales block to React #1329

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 · Fixed by #1439
Closed

/series/{id}: rewrite series sales block to React #1329

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

Comments

@php-coder
Copy link
Owner

php-coder commented Apr 15, 2020

The following block should be converted to React component:

<div class="row" th:if="${not #lists.isEmpty(purchasesAndSales)}" sec:authorize="hasAuthority('VIEW_SERIES_SALES')">
<div class="col-sm-12">
<h5 th:text="#{t_who_selling_series}">Who was selling/buying this series</h5>
<ul th:remove="all-but-first">
<li id="series-sale-1-info"
th:id="|series-sale-${iter.count}-info|"
th:each="transaction,iter : ${purchasesAndSales}"
th:with="firstPrice=${#numbers.formatDecimal(transaction.firstPrice, 0, 'DEFAULT', 2, 'DEFAULT') + '&nbsp;' + transaction.firstCurrency},
optionalSecondPrice=${transaction.secondPrice != null ? ('&nbsp;' + '(' + #numbers.formatDecimal(transaction.secondPrice, 0, 'DEFAULT', 2, 'DEFAULT') + '&nbsp;' + transaction.secondCurrency + ')') : ''}">
<!--/*/
<span th:if="${transaction.date != null}" th:remove="tag" th:text="${#dates.format(transaction.date, 'dd.MM.yyyy')}"></span>
/*/-->
<a href="http://example.com/james-alan-hetfield"
id="series-sale-1-seller"
rel="nofollow"
th:id="|series-sale-${iter.count}-seller|"
th:remove="${transaction.sellerUrl == null} ? tag"
th:href="${transaction.sellerUrl}"
th:text="${transaction.sellerName}">James Alan Hetfield</a>
<span th:if="${transaction.buyerName == null}" th:remove="tag" th:text="#{t_was_selling_for}">was selling for</span>
<!--/*/
<th:block th:if="${transaction.buyerName != null}">
<span th:text="#{t_sold_to}" th:remove="tag">sold to</span>
<a href="http://example.com/eicca-toppinen" rel="nofollow" th:remove="${transaction.buyerUrl == null} ? tag" th:href="${transaction.buyerUrl}" th:text="${transaction.buyerName}">Eicca Toppinen</a>
<span th:text="#{t_sold_for}" th:remove="tag">for</span>
</th:block>
/*/-->
<a href="http://example.com/james-alan-hetfield/selling-stamps"
id="series-sale-1-transaction"
rel="nofollow"
th:id="|series-sale-${iter.count}-transaction|"
th:remove="${transaction.transactionUrl == null} ? tag"
th:href="${transaction.transactionUrl}"
th:text="${firstPrice + optionalSecondPrice}">100 USD</a>
</li>
<li id="series-sale-2-info">
<a href="http://example.com/james-alan-hetfield" id="series-sale-2-seller" rel="nofollow">James Alan Hetfield</a> was selling for <a href="http://example.com/james-alan-hetfield/selling-stamps" id="series-sale-2-transaction" rel="nofollow">100 USD (650 RUB)</a>
</li>
<li id="series-sale-3-info">
02.02.2002 <a href="http://example.com/tommy-lee-jones" id="series-sale-3-seller" rel="nofollow">Tommy Lee Jones</a> was selling for <a href="http://example.com/tommy-lee-jones/selling-stamps" id="series-sale-3-transaction" rel="nofollow">200 USD</a>
</li>
<li id="series-sale-4-info">
02.02.2002 <a href="http://example.com/tommy-lee-jones" id="series-sale-4-seller" rel="nofollow">Tommy Lee Jones</a> was selling for <a href="http://example.com/tommy-lee-jones/selling-stamps" id="series-sale-4-transaction" rel="nofollow">200 USD (1300 RUB)</a>
</li>
<li id="series-sale-5-info">
03.03.2003 <a href="http://example.com/eicca-toppinen" id="series-sale-5-seller" rel="nofollow">Eicca Toppinen</a> sold to <a href="http://example.com/kurt-cobain" rel="nofollow">Kurt Cobain</a> for <a href="http://example.com/eicca-toppinen/selling-stamps" id="series-sale-5-transaction" rel="nofollow">300 USD</a>
</li>
<li id="series-sale-6-info">
03.03.2003 <a href="http://example.com/eicca-toppinen" id="series-sale-6-seller" rel="nofollow">Eicca Toppinen</a> sold to Michael Jackson for <a href="http://example.com/eicca-toppinen/selling-stamps" id="series-sale-6-transaction" rel="nofollow">300 USD (1560 RUB)</a>
</li>
</ul>
</div>
</div>

Part of #1328

Definition of done:

  • when I open series/info.html page in a browser, I should see exactly the same block as now but rendered with React
  • backend call will be implemented in Implement API for fetching all sales of a series #1330 based on a mock data from this task
  • tests are out-of-scope
  • we should show an error when we can't load data
@php-coder php-coder added kind/task Task that is part of some feature area/frontend estimation/1h Estimated time: 60 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 the estimation/30m Estimated time: 30 minutes label Jun 4, 2020
bahoss added a commit to bahoss/mystamps that referenced this issue Jun 11, 2020
bahoss added a commit to bahoss/mystamps that referenced this issue Jun 14, 2020
bahoss added a commit to bahoss/mystamps that referenced this issue Jun 14, 2020
bahoss added a commit to bahoss/mystamps that referenced this issue Jun 16, 2020
bahoss added a commit to bahoss/mystamps that referenced this issue Jun 16, 2020
bahoss added a commit to bahoss/mystamps that referenced this issue Jun 16, 2020
@php-coder php-coder added estimation/2h Estimated time: 120 minutes and removed estimation/1h Estimated time: 60 minutes estimation/30m Estimated time: 30 minutes labels Jun 16, 2020
@php-coder
Copy link
Owner Author

Changed estimated time to 2 hours.

@php-coder php-coder modified the milestones: 0.4.4, 0.4.5 Jun 20, 2020
bahoss added a commit to bahoss/mystamps that referenced this issue Jun 21, 2020
bahoss added a commit to bahoss/mystamps that referenced this issue Jun 22, 2020
bahoss added a commit to bahoss/mystamps that referenced this issue Jun 28, 2020
bahoss added a commit to bahoss/mystamps that referenced this issue Jun 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend estimation/2h Estimated time: 120 minutes kind/task Task that is part of some feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants