Skip to content

Commit 5c314a4

Browse files
committed
refactor(AccountUrl): extract exposeUrlsToView() method.
Addressed to #927 No functional changes.
1 parent 755d564 commit 5c314a4

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/main/java/ru/mystamps/web/Url.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,15 @@ public static Map<String, String> asMap(boolean production) {
117117
boolean serveContentFromSingleHost = !production;
118118

119119
// Not all URLs are listed here but only those that are being used on views
120-
// Constants sorted in an ascending order.
121120
Map<String, String> map = new HashMap<>();
122-
map.put("ACTIVATE_ACCOUNT_PAGE", AccountUrl.ACTIVATE_ACCOUNT_PAGE);
121+
AccountUrl.exposeUrlsToView(map);
122+
123123
map.put("ADD_CATEGORY_PAGE", CategoryUrl.ADD_CATEGORY_PAGE);
124124
map.put("ADD_COUNTRY_PAGE", CountryUrl.ADD_COUNTRY_PAGE);
125125
map.put("ADD_IMAGE_SERIES_PAGE", ADD_IMAGE_SERIES_PAGE);
126126
map.put("ADD_PARTICIPANT_PAGE", ParticipantUrl.ADD_PARTICIPANT_PAGE);
127127
map.put("ADD_SERIES_ASK_PAGE", ADD_SERIES_ASK_PAGE);
128128
map.put("ADD_SERIES_PAGE", ADD_SERIES_PAGE);
129-
map.put("AUTHENTICATION_PAGE", AccountUrl.AUTHENTICATION_PAGE);
130129
map.put("BOOTSTRAP_LANGUAGE", BOOTSTRAP_LANGUAGE);
131130
map.put("DAILY_STATISTICS", DAILY_STATISTICS);
132131
map.put("ESTIMATION_COLLECTION_PAGE", CollectionUrl.ESTIMATION_COLLECTION_PAGE);
@@ -138,10 +137,7 @@ public static Map<String, String> asMap(boolean production) {
138137
map.put("INFO_SERIES_PAGE", INFO_SERIES_PAGE);
139138
map.put("LIST_IMPORT_REQUESTS_PAGE", LIST_IMPORT_REQUESTS_PAGE);
140139
map.put("IMPORT_SERIES_SALES", IMPORT_SERIES_SALES);
141-
map.put("LOGIN_PAGE", AccountUrl.LOGIN_PAGE);
142-
map.put("LOGOUT_PAGE", AccountUrl.LOGOUT_PAGE);
143140
map.put("PUBLIC_URL", production ? PUBLIC_URL : SITE);
144-
map.put("REGISTRATION_PAGE", AccountUrl.REGISTRATION_PAGE);
145141
map.put("REQUEST_IMPORT_PAGE", REQUEST_IMPORT_PAGE);
146142
map.put("REQUEST_IMPORT_SERIES_PAGE", REQUEST_IMPORT_SERIES_PAGE);
147143
map.put("SEARCH_SERIES_BY_CATALOG", SEARCH_SERIES_BY_CATALOG);

src/main/java/ru/mystamps/web/feature/account/AccountUrl.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
*/
1818
package ru.mystamps.web.feature.account;
1919

20+
import java.util.Map;
21+
2022
/**
2123
* Account-related URLs.
2224
*
@@ -39,4 +41,12 @@ public final class AccountUrl {
3941
private AccountUrl() {
4042
}
4143

44+
public static void exposeUrlsToView(Map<String, String> urls) {
45+
urls.put("ACTIVATE_ACCOUNT_PAGE", ACTIVATE_ACCOUNT_PAGE);
46+
urls.put("AUTHENTICATION_PAGE", AUTHENTICATION_PAGE);
47+
urls.put("LOGIN_PAGE", LOGIN_PAGE);
48+
urls.put("LOGOUT_PAGE", LOGOUT_PAGE);
49+
urls.put("REGISTRATION_PAGE", REGISTRATION_PAGE);
50+
}
51+
4252
}

0 commit comments

Comments
 (0)