Skip to content

Commit 041744c

Browse files
committed
fix(series import): don't show a field with alternative price when it's empty.
Fix #1279
1 parent 8d2dbd0 commit 041744c

File tree

5 files changed

+43
-1
lines changed

5 files changed

+43
-1
lines changed

src/main/resources/liquibase/test-data/series_import_parsed_data.xml

+10
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,14 @@
3434

3535
</changeSet>
3636

37+
<changeSet id="add-series-parsed-data-for-gh1279" author="php-coder" context="test-data">
38+
39+
<insert tableName="series_import_parsed_data">
40+
<column name="request_id" valueComputed="(SELECT id FROM series_import_requests WHERE url = 'http://example.com/issue/1279')" />
41+
<column name="created_at" valueComputed="${NOW}" />
42+
<column name="updated_at" valueComputed="${NOW}" />
43+
</insert>
44+
45+
</changeSet>
46+
3747
</databaseChangeLog>

src/main/resources/liquibase/test-data/series_import_requests.xml

+12
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,16 @@
4949

5050
</changeSet>
5151

52+
<changeSet id="add-import-request-for-gh1279" author="php-coder" context="test-data">
53+
54+
<insert tableName="series_import_requests">
55+
<column name="url" value="http://example.com/issue/1279" />
56+
<column name="status_id" valueComputed="(SELECT id FROM series_import_request_statuses WHERE name = 'ParsingSucceeded')" />
57+
<column name="requested_at" valueComputed="${NOW}" />
58+
<column name="requested_by" valueComputed="(SELECT id FROM users WHERE role = 'ADMIN' ORDER by id LIMIT 1)" />
59+
<column name="updated_at" valueComputed="${NOW}" />
60+
</insert>
61+
62+
</changeSet>
63+
5264
</databaseChangeLog>

src/main/resources/liquibase/test-data/series_sales_import_parsed_data.xml

+12
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,16 @@
3838

3939
</changeSet>
4040

41+
<changeSet id="add-series-sale-with-price-and-currency-only" author="php-coder" context="test-data">
42+
43+
<insert tableName="series_sales_import_parsed_data">
44+
<column name="request_id" valueComputed="(SELECT id FROM series_import_requests WHERE url = 'http://example.com/issue/1279')" />
45+
<column name="price" valueNumeric="100" />
46+
<column name="currency" value="RUB" />
47+
<column name="created_at" valueComputed="${NOW}" />
48+
<column name="updated_at" valueComputed="${NOW}" />
49+
</insert>
50+
51+
</changeSet>
52+
4153
</databaseChangeLog>

src/main/webapp/WEB-INF/views/series/import/info.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ <h3 th:text="#{t_gathered_data}">
495495
</td>
496496
</tr>
497497

498-
<tr th:if="${hasSalesInfo and (importSeriesForm.seriesSale.altPrice != null or !disabled)}"
498+
<tr th:if="${hasSalesInfo and importSeriesForm.seriesSale.altPrice != null}"
499499
th:classappend="${#fields.hasErrors('seriesSale.altPrice') or #fields.hasErrors('seriesSale.altCurrency') ? 'has-error' : ''}">
500500
<th>
501501
<label for="alt-price" class="control-label" th:text="#{t_alternative_price}">

src/test/robotframework/series/import/import-misc.robot

+8
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ Seller info should be invisible where seller id has been extracted
2121
Element Should Not Be Visible id:seller-name
2222
Element Should Not Be Visible id:seller-url
2323

24+
Alternative price and currency should be invisible when they are empty
25+
Go To ${SITE_URL}/series/import/request/5
26+
Element Text Should Be id:request-url http://example.com/issue/1279
27+
Textfield Value Should Be id:price 100
28+
List Selection Should Be id:currency RUB
29+
Element Should Not Be Visible id:alt-price
30+
Element Should Not Be Visible id:alt-currency
31+
2432
*** Keywords ***
2533
Before Test Suite
2634
Open Browser ${SITE_URL}/account/auth ${BROWSER}

0 commit comments

Comments
 (0)