Skip to content

Commit c298c1c

Browse files
committed
frontend update to 24.04.000.102
1 parent 6e6124a commit c298c1c

File tree

62 files changed

+242
-316
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+242
-316
lines changed

frontend/build/templates/web-basic.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@
354354
</init-param>
355355
<init-param>
356356
<param-name>destinationUrl</param-name>
357-
<param-value>/logonRedesigned.action</param-value>
357+
<param-value>/logon.action</param-value>
358358
</init-param>
359359
</servlet>
360360
<servlet-mapping>

frontend/src/java/com/agnitas/emm/core/Permission.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ public class Permission {
144144
public static final Permission RECIPIENT_SHOW = new Permission("recipient.show", true, PermissionType.Standard);
145145
public static final Permission RECIPIENT_HISTORY_MAILING_DELIVERY = new Permission("recipient.history.mailing.delivery", false, PermissionType.Premium);
146146

147-
public static final Permission REPORT_BIRT_DELETE = new Permission("report.birt.delete", false, PermissionType.Standard);
148-
public static final Permission REPORT_BIRT_CHANGE = new Permission("report.birt.change", false, PermissionType.Standard);
149-
public static final Permission REPORT_BIRT_SHOW = new Permission("report.birt.show", false, PermissionType.Standard);
147+
public static final Permission REPORT_BIRT_DELETE = new Permission("report.birt.delete", true, PermissionType.Standard);
148+
public static final Permission REPORT_BIRT_CHANGE = new Permission("report.birt.change", true, PermissionType.Standard);
149+
public static final Permission REPORT_BIRT_SHOW = new Permission("report.birt.show", true, PermissionType.Standard);
150150

151151
public static final Permission ROLE_CHANGE = new Permission("role.change", true, PermissionType.Standard);
152152
public static final Permission ROLE_DELETE = new Permission("role.delete", true, PermissionType.Standard);

frontend/src/java/com/agnitas/emm/core/admin/web/AdminController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ public String delete(Admin admin, AdminForm form, Popups popups,
451451
if (admin.getAdminID() == deletedAdmin.getAdminID()) {
452452
session.invalidate();
453453
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
454-
return "redirect:/logon.action";
454+
return "redirect:/logonOld.action";
455455
}
456456

457457
popups.success(SELECTION_DELETED_MSG);
@@ -494,7 +494,7 @@ public String deleteRedesigned(@RequestParam(required = false) Set<Integer> bulk
494494
if (deletedAdmins.stream().anyMatch(a -> a.getAdminID() == admin.getAdminID())) {
495495
session.invalidate();
496496
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
497-
return "redirect:/logonRedesigned.action";
497+
return "redirect:/logon.action";
498498
}
499499

500500
popups.success(SELECTION_DELETED_MSG);

frontend/src/java/com/agnitas/emm/core/admin/web/RestfulUserController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ public String delete(final Admin admin, final AdminForm form, final Popups popup
397397
if (admin.getAdminID() == deletedAdmin.getAdminID()) {
398398
session.invalidate();
399399
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
400-
return "redirect:/logon.action";
400+
return "redirect:/logonOld.action";
401401
}
402402

403403
popups.success("default.selection.deleted");

frontend/src/java/com/agnitas/emm/core/logon/web/LogonController.java

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,10 @@
7676
import jakarta.servlet.http.HttpSession;
7777

7878
public class LogonController implements XssCheckAware {
79-
/** The logger. */
79+
8080
private static final Logger logger = LogManager.getLogger(LogonController.class);
8181

8282
protected static final String PASSWORD_CHANGED_KEY = "com.agnitas.emm.core.logon.web.PASSWORD_CHANGED";
83-
// TODO: EMMGUI-714: replace with redesigned page
8483
public static final String PASSWORD_RESET_LINK_PATTERN = "/logon/reset-password.action?username={username}&token={token}";
8584

8685
protected final ComLogonService logonService;
@@ -110,26 +109,26 @@ public LogonController(ComLogonService logonService, LoginTrackService loginTrac
110109
public String onUnexpectedLogonStateException(UnexpectedLogonStateException e) {
111110
logger.debug("Unexpected logon state", e);
112111

113-
return "redirect:/logonRedesigned.action";
112+
return "redirect:/logon.action";
114113
}
115114

116115
@ExceptionHandler(HostAuthenticationServiceException.class)
117116
public String onHostAuthenticationServiceException(HostAuthenticationServiceException e, Popups popups) {
118117
logger.error("Host authentication exception", e);
119118
popups.alert("Error");
120119

121-
return "redirect:/logonRedesigned.action";
120+
return "redirect:/logon.action";
122121
}
123122

124123
@Anonymous
125-
@GetMapping("/logon.action")
124+
@GetMapping("/logonOld.action")
126125
// TODO: EMMGUI-714: remove when old design will be removed
127126
public String logonView(final LogonStateBundle logonStateBundle, @ModelAttribute("form") LogonForm form, Model model, HttpServletRequest request, Popups popups, final HttpSession session) {
128127
return viewLogon(logonStateBundle, model, request, popups, session, false);
129128
}
130129

131130
@Anonymous
132-
@GetMapping("/logonRedesigned.action")
131+
@GetMapping("/logon.action")
133132
public String logonViewRedesigned(LogonStateBundle logonStateBundle, @ModelAttribute("form") LogonForm form,
134133
@RequestParam(value = "afterLogout", required = false) boolean isAfterLogout, Model model,
135134
HttpServletRequest request, Popups popups, HttpSession session) {
@@ -157,14 +156,14 @@ private String viewLogon(LogonStateBundle logonStateBundle, Model model, HttpSer
157156
}
158157

159158
@Anonymous
160-
@PostMapping("/logon.action")
159+
@PostMapping("/logonOld.action")
161160
// TODO: EMMGUI-714: remove when old design will be removed
162161
public String logon(final LogonStateBundle logonStateBundle, @ModelAttribute("form") LogonForm form, Model model, HttpServletRequest request, Popups popups) {
163162
return doLogon(logonStateBundle, form, model, request, popups, false);
164163
}
165164

166165
@Anonymous
167-
@PostMapping("/logonRedesigned.action")
166+
@PostMapping("/logon.action")
168167
public String logonRedesigend(final LogonStateBundle logonStateBundle, @ModelAttribute("form") LogonForm form, Model model, HttpServletRequest request, Popups popups) {
169168
return doLogon(logonStateBundle, form, model, request, popups, true);
170169
}
@@ -332,7 +331,7 @@ private String authenticateHostView(LogonStateBundle logonStateBundle, Model mod
332331
// Admin/supervisor must have an e-mail address where a security code is going to be sent.
333332
if (StringUtils.isBlank(email)) {
334333
popups.alert("logon.error.hostauth.no_address");
335-
return redesigned ? "redirect:/logonRedesigned.action" : "redirect:/logon.action";
334+
return redesigned ? "redirect:/logon.action" : "redirect:/logonOld.action";
336335
}
337336

338337
if (hostId == null) {
@@ -345,11 +344,11 @@ private String authenticateHostView(LogonStateBundle logonStateBundle, Model mod
345344
} catch (CannotSendSecurityCodeException e) {
346345
logger.error("Cannot send security code to {}", e.getReceiver());
347346
popups.alert("logon.error.hostauth.send_failed", email);
348-
return redesigned ? "redirect:/logonRedesigned.action" : "redirect:/logon.action";
347+
return redesigned ? "redirect:/logon.action" : "redirect:/logonOld.action";
349348
} catch (Exception e) {
350349
logger.error("Error generating or sending security code", e);
351350
popups.alert("logon.error.hostauth.send_failed", email);
352-
return redesigned ? "redirect:/logonRedesigned.action" : "redirect:/logon.action";
351+
return redesigned ? "redirect:/logon.action" : "redirect:/logonOld.action";
353352
}
354353

355354
model.addAttribute("adminMailAddress", getEmailForHostAuthentication(logonStateBundle.getAdmin()));
@@ -450,7 +449,7 @@ private String viewChangePassword(LogonStateBundle logonStateBundle, Model model
450449
if (model.containsAttribute(PASSWORD_CHANGED_KEY)) {
451450
logonStateBundle.requireLogonState(LogonState.COMPLETE);
452451
if (redesigned) {
453-
popups.success("password.changed.proceed", request.getContextPath() + "/logonRedesigned.action");
452+
popups.success("password.changed.proceed", request.getContextPath() + "/logon.action");
454453
}
455454
return redesigned ? "login_password_changed" : "logon_password_changed";
456455
} else {
@@ -588,7 +587,7 @@ private String doResetPassword(LogonStateBundle logonStateBundle, LogonResetPass
588587
writeUserActivityLog(admin, "change password", admin.getUsername() + " (" + admin.getAdminID() + ")");
589588
writeUserActivityLog(admin, UserActivityLogActions.LOGIN_LOGOUT.getLocalValue(), "logged in after password reset via " + admin.getEmail() + " from " + AgnUtils.getIpAddressForStorage(request));
590589

591-
return redesigned ? "forward:/logonRedesigned.action" : "forward:/logon.action";
590+
return redesigned ? "forward:/logon.action" : "forward:/logonOld.action";
592591
}
593592

594593
popups.addPopups(result);
@@ -660,7 +659,7 @@ public String logout(Admin admin, HttpSession session) {
660659
writeUserActivityLog(admin, new UserAction(UserActivityLogActions.LOGIN_LOGOUT.getLocalValue(), "log out"));
661660

662661
if (admin.isRedesignedUiUsed()) {
663-
return "redirect:/logonRedesigned.action?afterLogout=true";
662+
return "redirect:/logon.action?afterLogout=true";
664663
}
665664
}
666665

frontend/src/java/com/agnitas/emm/core/mailing/service/impl/MailingParameterLogServiceImpl.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,37 +86,36 @@ public List<String> getParameterChanges(ComMailingParameter oldParameter, ComMai
8686
String nameOld = StringUtils.defaultIfEmpty(oldParameter.getName(), PLACEHOLDER_EMPTY);
8787
String nameNew = StringUtils.defaultIfEmpty(newParameter.getName(), PLACEHOLDER_EMPTY);
8888
if (!StringUtils.equals(nameOld, nameNew)) {
89-
changes.add(String.format("Changed name from '%s' to '%s'.",
90-
nameOld, nameNew));
89+
changes.add(String.format("Changed name from '%s' to '%s'.", nameOld, nameNew));
9190
}
9291

9392
String valueOld = StringUtils.defaultIfEmpty(oldParameter.getValue(), PLACEHOLDER_EMPTY);
9493
String valueNew = StringUtils.defaultIfEmpty(newParameter.getValue(), PLACEHOLDER_EMPTY);
9594
if (!StringUtils.equals(valueOld, valueNew)) {
96-
changes.add(String.format("Changed value from '%s' to '%s'.",
97-
valueOld, valueNew));
95+
changes.add(String.format("Changed value from '%s' to '%s'.", valueOld, valueNew));
9896
}
9997

10098
String descriptionOld = StringUtils.defaultIfEmpty(oldParameter.getDescription(), PLACEHOLDER_EMPTY);
10199
String descriptionNew = StringUtils.defaultIfEmpty(newParameter.getDescription(), PLACEHOLDER_EMPTY);
102100
if (!StringUtils.equals(descriptionOld, descriptionNew)) {
103-
changes.add(String.format("Changed description from '%s' to '%s'.",
104-
descriptionOld, descriptionNew));
101+
changes.add(String.format("Changed description from '%s' to '%s'.", descriptionOld, descriptionNew));
102+
}
103+
int oldMailingId = oldParameter.getMailingID();
104+
int newMailingId = newParameter.getMailingID();
105+
if (oldMailingId != newMailingId) {
106+
changes.add(String.format("Changed mailing from id = '%d' to id = '%d'.", oldMailingId, newMailingId));
105107
}
106108
} else if (oldParameter != null) {
107109
String nameOld = StringUtils.defaultIfEmpty(oldParameter.getName(), PLACEHOLDER_EMPTY);
108110
String valueOld = StringUtils.defaultIfEmpty(oldParameter.getValue(), PLACEHOLDER_EMPTY);
109111

110-
changes.add(String.format("Deleted parameter '%s' = '%s'.",
111-
nameOld, valueOld));
112+
changes.add(String.format("Deleted parameter '%s' = '%s'.", nameOld, valueOld));
112113
} else if (newParameter != null) {
113114
String nameNew = StringUtils.defaultIfEmpty(newParameter.getName(), PLACEHOLDER_EMPTY);
114115
String valueNew = StringUtils.defaultIfEmpty(newParameter.getValue(), PLACEHOLDER_EMPTY);
115116

116-
changes.add(String.format("Added parameter '%s' = '%s'.",
117-
nameNew, valueNew));
117+
changes.add(String.format("Added parameter '%s' = '%s'.", nameNew, valueNew));
118118
}
119-
120119
return changes;
121120
}
122121
}

frontend/src/java/com/agnitas/emm/core/mailing/web/MailingController.java

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ public Object list(MailingOverviewForm form, Model model, Admin admin, HttpServl
294294
};
295295
return new Pollable<>(
296296
Pollable.uid(req.getSession().getId(), MAILING_OVERVIEW_KEY, form.toArray()),
297-
Pollable.SHORT_TIMEOUT,
297+
Pollable.LONG_TIMEOUT,
298298
new ModelAndView(REDIRECT_TO_LIST, form.toMap()),
299299
listWorker);
300300
}
@@ -2086,18 +2086,22 @@ public String actions(@PathVariable int mailingId, Admin admin, Model model) {
20862086
@GetMapping("/create.action")
20872087
public String create(Admin admin, HttpServletRequest req, Model model) {
20882088
updateForwardParameters(req, true);
2089-
List<MailingCreationOption> allowedOptions = Arrays.stream(MailingCreationOption.values())
2090-
.filter(option -> admin.permissionAllowed(option.getRequiredPermission()))
2091-
.collect(Collectors.toList());
2092-
if (allowedOptions.size() == 1) {
2093-
return autoSelectOptionNew(allowedOptions.get(0), req);
2089+
if (!admin.isRedesignedUiUsed()) {
2090+
List<MailingCreationOption> allowedOptions = Arrays.stream(MailingCreationOption.values())
2091+
.filter(option -> admin.permissionAllowed(option.getRequiredPermission()))
2092+
.collect(Collectors.toList());
2093+
if (allowedOptions.size() == 1) {
2094+
return autoSelectOptionNew(allowedOptions.get(0), req);
2095+
}
20942096
}
2095-
addAttrsForCreationPage(model, admin);
2097+
addAttrsForCreationPage(req, admin, model);
20962098
return "mailing_create_start";
20972099
}
20982100

2099-
protected void addAttrsForCreationPage(Model model, Admin admin) {
2100-
// empty for OpenEMM
2101+
protected void addAttrsForCreationPage(HttpServletRequest req, Admin admin, Model model) {
2102+
if (admin.isRedesignedUiUsed()) {
2103+
model.addAttribute("workflowId", WorkflowParametersHelper.getWorkflowIdFromSession(req.getSession()));
2104+
}
21012105
}
21022106

21032107
private String autoSelectOptionNew(MailingCreationOption optionToSelect, HttpServletRequest req) {

frontend/src/java/com/agnitas/emm/core/recipient/web/RecipientController.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ public String view(Admin admin, @PathVariable int id, @ModelAttribute("form") Re
477477
if (admin.isRedesignedUiUsed()) {
478478
model.addAttribute("dataSource", findDataSource(recipient.getIntValue("datasource_id")));
479479
model.addAttribute("latestDataSource", findDataSource(recipient.getIntValue("latest_datasource_id")));
480+
model.addAttribute("showProfileFieldsHint", !configService.getBooleanValue(ConfigValue.WriteCustomerOpenOrClickField, companyId));
480481
}
481482
loadViewData(admin, model);
482483

frontend/src/java/com/agnitas/emm/core/salutation/web/SalutationController.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,11 @@ private boolean isAllowedToChange(Title title, int companyId, Popups popups) {
216216
}
217217

218218
@RequestMapping(value = {"/create.action", "/0/view.action"})
219-
public String create(@ModelAttribute("form") SalutationForm form, Admin admin) {
219+
public String create(@ModelAttribute("form") SalutationForm form, Admin admin, Model model) {
220220
form.setDescription(I18nString.getLocaleString("default.salutation.shortname", admin.getLocale()));
221+
if (admin.isRedesignedUiUsed()) {
222+
model.addAttribute("recipients", recipentService.getAdminAndTestRecipientsSalutation(admin));
223+
}
221224
return "salutation_view";
222225
}
223226

frontend/src/java/com/agnitas/emm/core/workflow/beans/impl/WorkflowMailingImpl.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import com.agnitas.emm.core.workflow.beans.WorkflowMailing;
1717

1818
public class WorkflowMailingImpl extends WorkflowMailingAwareImpl implements WorkflowMailing {
19+
1920
private int autoReport;
2021
private boolean skipEmptyBlocks = false;
2122
private boolean doubleCheck = true;
@@ -79,9 +80,11 @@ public void setBlocksize(int blocksize) {
7980

8081
@Override
8182
public boolean equalsIgnoreI18n(Object o) {
83+
if (!super.equalsIgnoreI18n(o)) {
84+
return false;
85+
}
8286
WorkflowMailingImpl that = (WorkflowMailingImpl) o;
83-
return super.equalsIgnoreI18n(o)
84-
&& autoReport == that.autoReport
87+
return autoReport == that.autoReport
8588
&& skipEmptyBlocks == that.skipEmptyBlocks
8689
&& doubleCheck == that.doubleCheck
8790
&& maxRecipients == that.maxRecipients

frontend/src/java/com/agnitas/emm/core/wysiwyg/web/WysiwygController.java

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import com.agnitas.web.mvc.XssCheckAware;
1818
import com.agnitas.web.perm.annotations.PermissionMapping;
1919
import net.sf.json.JSONObject;
20-
import org.springframework.ui.Model;
2120
import org.springframework.web.bind.annotation.RequestMapping;
2221
import org.springframework.web.bind.annotation.RequestParam;
2322
import org.springframework.web.bind.annotation.ResponseBody;
@@ -27,7 +26,7 @@ public class WysiwygController implements XssCheckAware {
2726

2827
private final AgnTagService agnTagService;
2928
private final WysiwygService wysiwygService;
30-
private final ComMailingComponentsService mailingComponentsService;
29+
protected final ComMailingComponentsService mailingComponentsService;
3130

3231
public WysiwygController(AgnTagService agnTagService, WysiwygService wysiwygService, ComMailingComponentsService mailingComponentsService) {
3332
this.agnTagService = agnTagService;
@@ -52,32 +51,4 @@ public ModelAndView showAgnTagsRedesigned(Admin admin) {
5251
@RequestParam(name = "mi", required = false) final int mailingId) {
5352
return wysiwygService.getImagesLinksWithDescriptionJson(admin, mailingId);
5453
}
55-
56-
@RequestMapping("/image-browser.action")
57-
// TODO: EMMGUI-714: remove when old design will be removed
58-
public String imageBrowser(@RequestParam int mailingID, Admin admin, Model model) {
59-
int companyID = admin.getCompanyID();
60-
61-
model.addAttribute("rdirDomain", admin.getCompany().getRdirDomain());
62-
model.addAttribute("companyId", companyID);
63-
model.addAttribute("mailingImages", mailingComponentsService.getImagesNames(mailingID, companyID));
64-
addExtendedAttrsForImgBrowser(companyID, model);
65-
return "wysiwyg_agn_tags_window";
66-
}
67-
68-
// TODO: EMMGUI-714: remove when old design will be removed
69-
protected void addExtendedAttrsForImgBrowser(int companyId, Model model) {}
70-
71-
@RequestMapping("/image-browserRedesigned.action")
72-
@PermissionMapping("imageBrowser")
73-
public String imageBrowserRedesigned(@RequestParam int mailingID, Admin admin, Model model) {
74-
addAttributesForImageBrowser(mailingID, admin, model);
75-
return "wysiwyg_image_browser_window";
76-
}
77-
78-
protected void addAttributesForImageBrowser(int mailingId, Admin admin, Model model) {
79-
model.addAttribute("rdirDomain", admin.getCompany().getRdirDomain());
80-
model.addAttribute("companyId", admin.getCompanyID());
81-
model.addAttribute("mailingImages", mailingComponentsService.getImagesNames(mailingId, admin.getCompanyID()));
82-
}
8354
}

frontend/src/java/com/agnitas/spring/web/view/AgnUrlBasedViewResolver.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public class AgnUrlBasedViewResolver extends UrlBasedViewResolver {
4141
customRedesignedViewMappings.put("settings_admin_rights", "user_permissions");
4242
customRedesignedViewMappings.put("settings_restfuluser_permissions", "user_permissions");
4343
customRedesignedViewMappings.put("export_result", "evaluation_finished");
44+
customRedesignedViewMappings.put("mailing_create_start", "mailing_creation_modal");
4445
}
4546

4647
@Override

frontend/src/java/com/agnitas/web/ComAjaxServletBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ protected final boolean checkAuthenticated(HttpServletRequest request, HttpServl
7878
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
7979

8080
try {
81-
request.getRequestDispatcher("/logonRedesigned.action?method=init")
81+
request.getRequestDispatcher("/logon.action?method=init")
8282
.forward(request, response);
8383
} catch (ServletException | IOException e) {
8484
logger.error("Error occurred: " + e.getMessage(), e);

frontend/src/java/com/agnitas/web/ComManualServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public void service(HttpServletRequest request, HttpServletResponse response) th
6969
if (requestUri.contains(MANUAL_CONTEXT)) {
7070
response.sendRedirect(requestUri.substring(0, requestUri.indexOf(MANUAL_CONTEXT)) + "logon.action");
7171
} else {
72-
response.sendRedirect("/logonRedesigned.action");
72+
response.sendRedirect("/logon.action");
7373
}
7474
} else {
7575
String manualRequestUriPart = StringUtils.strip(requestUri.substring(requestUri.indexOf(MANUAL_CONTEXT) + MANUAL_CONTEXT.length()), "/");

frontend/src/java/com/agnitas/web/perm/exceptions/AuthorizationExceptionHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class AuthorizationExceptionHandler {
2929
@ResponseStatus(HttpStatus.UNAUTHORIZED)
3030
public String onAuthorizationException(AuthorizationException e) {
3131
logger.error("User authorization required");
32-
return "forward:/logonRedesigned.action";
32+
return "forward:/logon.action";
3333
}
3434

3535
@ExceptionHandler(NotAllowedActionException.class)

0 commit comments

Comments
 (0)