Skip to content

Commit 9892a3a

Browse files
committed
task: add an empty AddCatalogPriceForm..
Address to #1342 Part of #1340
1 parent 9fb0d33 commit 9892a3a

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// IMPORTANT:
3+
// You must update ResourceUrl.RESOURCES_VERSION each time whenever you're modified this file!
4+
//
5+
6+
class AddCatalogPriceForm extends React.Component {
7+
8+
render() {
9+
return (
10+
<div>TODO: add price form</div>
11+
)
12+
}
13+
}

Diff for: src/main/java/ru/mystamps/web/feature/site/ResourceUrl.java

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public final class ResourceUrl {
4646
private static final String SALE_IMPORT_FORM_JS = "/public/js/" + RESOURCES_VERSION + "/components/SeriesSaleImportForm.js";
4747
private static final String SIMILAR_SERIES_FORM_JS = "/public/js/" + RESOURCES_VERSION + "/components/SimilarSeriesForm.js";
4848
private static final String ADD_COMMENT_FORM_JS = "/public/js/" + RESOURCES_VERSION + "/components/AddCommentForm.js";
49+
private static final String CATALOG_PRICE_FORM_JS = "/public/js/" + RESOURCES_VERSION + "/components/AddCatalogPriceForm.js";
4950
private static final String BOOTSTRAP_LANGUAGE = "https://cdn.jsdelivr.net/gh/usrz/bootstrap-languages@3ac2a3d2b27ac43a471cd99e79d378a03b2c6b5f/languages.min.css";
5051
private static final String FAVICON_ICO = "/favicon.ico";
5152

@@ -82,6 +83,7 @@ public static void exposeResourcesToView(Map<String, String> resources, String h
8283
put(resources, host, "SALE_IMPORT_FORM_JS", SALE_IMPORT_FORM_JS);
8384
put(resources, host, "SIMILAR_SERIES_FORM_JS", SIMILAR_SERIES_FORM_JS);
8485
put(resources, host, "ADD_COMMENT_FORM_JS", ADD_COMMENT_FORM_JS);
86+
put(resources, host, "CATALOG_PRICE_FORM_JS", CATALOG_PRICE_FORM_JS);
8587
}
8688

8789
// see also MvcConfig.addResourceHandlers()

Diff for: src/main/webapp/WEB-INF/views/series/info.html

+30-1
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,8 @@ <h5 th:text="#{t_hidden_images}">Hidden images</h5>
392392
</div>
393393
</div>
394394

395+
<div id="add-catalog-price" sec:authorize="hasAuthority('CREATE_SERIES')"></div>
396+
395397
<div id="add-comment" sec:authorize="hasAuthority('ADD_COMMENTS_TO_SERIES')"></div>
396398

397399
<div id="similar-series" class="row" th:if="${not #lists.isEmpty(similarSeries)}">
@@ -838,7 +840,7 @@ <h5 th:text="#{t_add_info_who_selling_series}">Add info about selling/buying thi
838840
th:src="${SERIES_INFO_JS}"></script>
839841

840842
<!--/*/
841-
<th:block sec:authorize="hasAnyAuthority('IMPORT_SERIES_SALES', 'MARK_SIMILAR_SERIES', 'ADD_COMMENTS_TO_SERIES')">
843+
<th:block sec:authorize="hasAnyAuthority('IMPORT_SERIES_SALES', 'MARK_SIMILAR_SERIES', 'CREATE_SERIES', 'ADD_COMMENTS_TO_SERIES')">
842844
/*/-->
843845
<script src="https://unpkg.com/[email protected]/umd/react.development.js" th:src="${REACT_JS}"></script>
844846
<script src="https://unpkg.com/[email protected]/umd/react-dom.development.js" th:src="${REACT_DOM_JS}"></script>
@@ -923,6 +925,33 @@ <h5 th:text="#{t_add_info_who_selling_series}">Add info about selling/buying thi
923925
</th:block>
924926
/*/-->
925927

928+
<!--/*/
929+
<th:block sec:authorize="hasAuthority('CREATE_SERIES')">
930+
/*/-->
931+
<script src="../../../../../../target/classes/js/components/AddCatalogPriceForm.js" th:src="${CATALOG_PRICE_FORM_JS}"></script>
932+
<script th:inline="javascript">
933+
/*[+
934+
var addCatalogPriceProps = {
935+
'csrfHeaderName': [[ ${_csrf.headerName} ]],
936+
'csrfTokenValue': [[ ${_csrf.token} ]],
937+
'l10n': {
938+
}
939+
};
940+
+]*/
941+
942+
/*[- */
943+
var addCatalogPriceProps = {
944+
'url': '/series/100',
945+
'l10n': {}
946+
};
947+
/* -]*/
948+
949+
renderComponent(AddCatalogPriceForm, addCatalogPriceProps, 'add-catalog-price');
950+
</script>
951+
<!--/*/
952+
</th:block>
953+
/*/-->
954+
926955
<!--/*/
927956
<th:block sec:authorize="hasAuthority('ADD_COMMENTS_TO_SERIES')">
928957
/*/-->

0 commit comments

Comments
 (0)