Skip to content

Commit 087fc82

Browse files
committed
frontend update to 24.04.000.086
1 parent f58fded commit 087fc82

Some content is hidden

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

41 files changed

+314
-1369
lines changed

frontend/build/templates/web-basic.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,6 @@
247247
<url-pattern>/sc</url-pattern>
248248
</servlet-mapping>
249249

250-
<servlet>
251-
<servlet-name>ShowImageServlet</servlet-name>
252-
<servlet-class>com.agnitas.web.ShowImageServlet</servlet-class>
253-
</servlet>
254250
<servlet-mapping>
255251
<servlet-name>ShowImageServlet</servlet-name>
256252
<url-pattern>/image</url-pattern>

frontend/build/templates/web-openemm.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@
1616
/WEB-INF/applicationContext*.xml
1717
</param-value>
1818
</context-param>
19+
20+
<servlet>
21+
<servlet-name>ShowImageServlet</servlet-name>
22+
<servlet-class>com.agnitas.web.ShowImageServlet</servlet-class>
23+
</servlet>
1924
</web-app>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
3+
Copyright (C) 2022 AGNITAS AG (https://www.agnitas.org)
4+
5+
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
7+
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
8+
9+
*/
10+
11+
DROP PROCEDURE IF EXISTS TEMP_PROCEDURE;
12+
13+
DELIMITER ;;
14+
CREATE PROCEDURE TEMP_PROCEDURE()
15+
BEGIN
16+
DECLARE isMariaDB INTEGER;
17+
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
18+
ALTER TABLE birtreport_parameter_tbl DROP COLUMN change_date;
19+
ALTER TABLE push_retry_tbl CHANGE status state INT(1) DEFAULT NULL;
20+
ALTER TABLE undo_mailing_tbl MODIFY undo_id INT(11) NOT NULL AUTO_INCREMENT COMMENT 'unique ID';
21+
22+
SELECT LOWER(VERSION()) LIKE '%maria%' INTO isMariaDB FROM DUAL;
23+
24+
IF isMariaDB > 0 THEN
25+
-- Use sql in string to hide it from MySQL
26+
SET @ddl1 = CONCAT('ALTER TABLE company_tbl DROP CONSTRAINT comp$status$fk');
27+
PREPARE stmt1 FROM @ddl1;
28+
EXECUTE stmt1;
29+
DEALLOCATE PREPARE stmt1;
30+
31+
SET @ddl2 = CONCAT('ALTER TABLE company_tbl ADD CONSTRAINT comp$status$fk FOREIGN KEY (status) REFERENCES company_status_desc_tbl (status)');
32+
PREPARE stmt2 FROM @ddl2;
33+
EXECUTE stmt2;
34+
DEALLOCATE PREPARE stmt2;
35+
ELSE
36+
ALTER TABLE company_tbl DROP FOREIGN KEY comp$status$fk;
37+
ALTER TABLE company_tbl DROP KEY comp$status$fk;
38+
ALTER TABLE company_tbl ADD CONSTRAINT comp$status$fk FOREIGN KEY (status) REFERENCES company_status_desc_tbl (status);
39+
END IF;
40+
END;;
41+
DELIMITER ;
42+
43+
CALL TEMP_PROCEDURE;
44+
DROP PROCEDURE TEMP_PROCEDURE;
45+
46+
INSERT INTO agn_dbversioninfo_tbl (version_number, updating_user, update_timestamp)
47+
VALUES ('22.10.181', CURRENT_USER, CURRENT_TIMESTAMP);

frontend/src/java/com/agnitas/dao/impl/ComMailingComponentDaoImpl.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -472,12 +472,15 @@ public boolean deleteImages(int companyId, int mailingId, Set<Integer> bulkIds)
472472
return update(logger, sqlDeleteImages, companyId, mailingId, MailingComponentType.HostedImage.getCode(), MailingComponentType.Image.getCode()) > 0;
473473
}
474474

475-
@Override
476-
public List<String> getImagesNames(int mailingId, Set<Integer> bulkIds, int companyID) {
477-
String query = "SELECT compname FROM component_tbl WHERE company_id = ? AND mailing_id = ? AND comptype in (?, ?) AND "
478-
+ makeBulkInClauseForInteger("component_id", bulkIds);
479-
return select(logger, query, StringRowMapper.INSTANCE, companyID, mailingId, MailingComponentType.HostedImage.getCode(), MailingComponentType.Image.getCode());
480-
}
475+
@Override
476+
public List<String> getImagesNames(int mailingId, Set<Integer> ids, int companyID) {
477+
String query = "SELECT compname FROM component_tbl WHERE company_id = ? AND mailing_id = ? AND comptype in (?, ?)";
478+
if (CollectionUtils.isNotEmpty(ids)) {
479+
query += " AND " + makeBulkInClauseForInteger("component_id", ids);
480+
}
481+
482+
return select(logger, query, StringRowMapper.INSTANCE, companyID, mailingId, MailingComponentType.HostedImage.getCode(), MailingComponentType.Image.getCode());
483+
}
481484

482485
@Override
483486
public List<MailingComponent> getImagesOverview(int companyID, int mailingID, MailingImagesOverviewFilter filter) {

frontend/src/java/com/agnitas/emm/core/components/service/ComMailingComponentsService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,7 @@ interface ImportStatistics {
110110
void updateMailingMediapoolImagesReferences(int mailingId, int companyId, Set<String> mediapoolImagesNames);
111111

112112
List<String> getImagesNames(int mailingId, Set<Integer> bulkIds, Admin admin);
113+
List<String> getImagesNames(int mailingId, int companyId);
114+
113115

114116
}

frontend/src/java/com/agnitas/emm/core/components/service/impl/ComMailingComponentsServiceImpl.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,4 +689,9 @@ public void updateMailingMediapoolImagesReferences(int mailingId, int companyId,
689689
public List<String> getImagesNames(int mailingId, Set<Integer> bulkIds, Admin admin) {
690690
return mailingComponentDao.getImagesNames(mailingId, bulkIds, admin.getCompanyID());
691691
}
692+
693+
@Override
694+
public List<String> getImagesNames(int mailingId, int companyId) {
695+
return mailingComponentDao.getImagesNames(mailingId, Collections.emptySet(), companyId);
696+
}
692697
}

frontend/src/java/com/agnitas/emm/core/workflow/beans/WorkflowIcon.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,14 @@ public interface WorkflowIcon {
9797
default List<WorkflowDependency> getDependencies() {
9898
return new ArrayList<>();
9999
}
100+
101+
/**
102+
* The original method includes properties that can vary depending on the user's locale.
103+
* This method compares icons for cases where such properties can be ignored.
104+
*
105+
* @param o the object to compare
106+
* @return {@code true} if the objects are equal, {@code false} otherwise
107+
*/
108+
@JsonIgnore
109+
boolean equalsIgnoreI18n(Object o);
100110
}

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

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,20 +119,26 @@ public List<WorkflowConnection> getConnections() {
119119

120120
@Override
121121
public boolean equals(Object o) {
122+
BaseWorkflowIcon that = (BaseWorkflowIcon) o;
123+
return equalsIgnoreI18n(o)
124+
// i18n properties:
125+
&& Objects.equals(iconTitle, that.iconTitle)
126+
&& Objects.equals(iconComment, that.iconComment);
127+
}
128+
129+
@Override
130+
public boolean equalsIgnoreI18n(Object o) {
122131
if (this == o) return true;
123132
if (o == null || getClass() != o.getClass()) return false;
124133
BaseWorkflowIcon that = (BaseWorkflowIcon) o;
125-
return id == that.id &&
126-
x == that.x &&
127-
y == that.y &&
128-
type == that.type &&
129-
filled == that.filled &&
130-
editable == that.editable &&
131-
Objects.equals(iconTitle, that.iconTitle) &&
132-
Objects.equals(iconComment, that.iconComment);
134+
return id == that.id
135+
&& x == that.x
136+
&& y == that.y
137+
&& type == that.type
138+
&& filled == that.filled
139+
&& editable == that.editable;
133140
}
134141

135-
136142
@Override
137143
public int hashCode() {
138144
return Objects.hash(id, x, y, type, filled, iconTitle, editable, iconComment);

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

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,11 @@ public List<WorkflowDependency> getDependencies() {
5959
}
6060

6161
@Override
62-
public boolean equals(Object o) {
63-
if (this == o) {
64-
return true;
65-
}
66-
if (o == null || getClass() != o.getClass()) {
67-
return false;
68-
}
69-
if (!super.equals(o)) {
70-
return false;
71-
}
62+
public boolean equalsIgnoreI18n(Object o) {
7263
WorkflowArchiveImpl that = (WorkflowArchiveImpl) o;
73-
return campaignId == that.campaignId &&
74-
archived == that.archived;
64+
return super.equalsIgnoreI18n(o)
65+
&& campaignId == that.campaignId
66+
&& archived == that.archived;
7567
}
7668

7769
@Override

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

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -105,24 +105,16 @@ public void setUseTime(boolean useTime) {
105105
}
106106

107107
@Override
108-
public boolean equals(Object o) {
109-
if (this == o) {
110-
return true;
111-
}
112-
if (o == null || getClass() != o.getClass()) {
113-
return false;
114-
}
115-
if (!super.equals(o)) {
116-
return false;
117-
}
108+
public boolean equalsIgnoreI18n(Object o) {
118109
WorkflowDeadlineImpl that = (WorkflowDeadlineImpl) o;
119-
return delayValue == that.delayValue &&
120-
hour == that.hour &&
121-
minute == that.minute &&
122-
useTime == that.useTime &&
123-
deadlineType == that.deadlineType &&
124-
Objects.equals(date, that.date) &&
125-
timeUnit == that.timeUnit;
110+
return super.equalsIgnoreI18n(o)
111+
&& delayValue == that.delayValue
112+
&& hour == that.hour
113+
&& minute == that.minute
114+
&& useTime == that.useTime
115+
&& deadlineType == that.deadlineType
116+
&& Objects.equals(date, that.date)
117+
&& timeUnit == that.timeUnit;
126118
}
127119

128120
@Override

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

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -218,29 +218,21 @@ public List<WorkflowDependency> getDependencies() {
218218
}
219219

220220
@Override
221-
public boolean equals(Object o) {
222-
if (this == o) {
223-
return true;
224-
}
225-
if (o == null || getClass() != o.getClass()) {
226-
return false;
227-
}
228-
if (!super.equals(o)) {
229-
return false;
230-
}
221+
public boolean equalsIgnoreI18n(Object o) {
231222
WorkflowDecisionImpl that = (WorkflowDecisionImpl) o;
232-
return mailingId == that.mailingId &&
233-
linkId == that.linkId &&
234-
includeVetoed == that.includeVetoed &&
235-
decisionType == that.decisionType &&
236-
decisionCriteria == that.decisionCriteria &&
237-
reaction == that.reaction &&
238-
Objects.equals(profileField, that.profileField) &&
239-
Objects.equals(dateFormat, that.dateFormat) &&
240-
aoDecisionCriteria == that.aoDecisionCriteria &&
241-
Objects.equals(threshold, that.threshold) &&
242-
Objects.equals(decisionDate, that.decisionDate) &&
243-
Objects.equals(rules, that.rules);
223+
return super.equalsIgnoreI18n(o)
224+
&& mailingId == that.mailingId
225+
&& linkId == that.linkId
226+
&& includeVetoed == that.includeVetoed
227+
&& decisionType == that.decisionType
228+
&& decisionCriteria == that.decisionCriteria
229+
&& reaction == that.reaction
230+
&& Objects.equals(profileField, that.profileField)
231+
&& Objects.equals(dateFormat, that.dateFormat)
232+
&& aoDecisionCriteria == that.aoDecisionCriteria
233+
&& Objects.equals(threshold, that.threshold)
234+
&& Objects.equals(decisionDate, that.decisionDate)
235+
&& Objects.equals(rules, that.rules);
244236
}
245237

246238
@Override

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

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,10 @@ public List<WorkflowDependency> getDependencies() {
4848
}
4949

5050
@Override
51-
public boolean equals(Object o) {
52-
if (this == o) {
53-
return true;
54-
}
55-
if (o == null || getClass() != o.getClass()) {
56-
return false;
57-
}
58-
if (!super.equals(o)) {
59-
return false;
60-
}
51+
public boolean equalsIgnoreI18n(Object o) {
6152
WorkflowExportImpl that = (WorkflowExportImpl) o;
62-
return autoExportId == that.autoExportId;
53+
return super.equalsIgnoreI18n(o)
54+
&& autoExportId == that.autoExportId;
6355
}
6456

6557
@Override

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

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,11 @@ public List<WorkflowDependency> getDependencies() {
6060
}
6161

6262
@Override
63-
public boolean equals(Object o) {
64-
if (this == o) {
65-
return true;
66-
}
67-
if (o == null || getClass() != o.getClass()) {
68-
return false;
69-
}
70-
if (!super.equals(o)) {
71-
return false;
72-
}
63+
public boolean equalsIgnoreI18n(Object o) {
7364
WorkflowFollowupMailingImpl that = (WorkflowFollowupMailingImpl) o;
74-
return baseMailingId == that.baseMailingId &&
75-
decisionCriterion == that.decisionCriterion;
65+
return super.equalsIgnoreI18n(o)
66+
&& baseMailingId == that.baseMailingId
67+
&& decisionCriterion == that.decisionCriterion;
7668
}
7769

7870
@Override

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

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,11 @@ public List<WorkflowDependency> getDependencies() {
5959
}
6060

6161
@Override
62-
public boolean equals(Object o) {
63-
if (this == o) {
64-
return true;
65-
}
66-
if (o == null || getClass() != o.getClass()) {
67-
return false;
68-
}
69-
if (!super.equals(o)) {
70-
return false;
71-
}
62+
public boolean equalsIgnoreI18n(Object o) {
7263
WorkflowFormImpl that = (WorkflowFormImpl) o;
73-
return userFormId == that.userFormId &&
74-
Objects.equals(formType, that.formType);
64+
return super.equalsIgnoreI18n(o)
65+
&& userFormId == that.userFormId
66+
&& Objects.equals(formType, that.formType);
7567
}
7668

7769
@Override

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

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,11 @@ public List<WorkflowDependency> getDependencies() {
5959
}
6060

6161
@Override
62-
public boolean equals(Object o) {
63-
if (this == o) {
64-
return true;
65-
}
66-
if (o == null || getClass() != o.getClass()) {
67-
return false;
68-
}
69-
if (!super.equals(o)) {
70-
return false;
71-
}
62+
public boolean equalsIgnoreI18n(Object o) {
7263
WorkflowImportImpl that = (WorkflowImportImpl) o;
73-
return autoImportId == that.autoImportId &&
74-
isErrorTolerant == that.isErrorTolerant;
64+
return super.equalsIgnoreI18n(o)
65+
&& autoImportId == that.autoImportId
66+
&& isErrorTolerant == that.isErrorTolerant;
7567
}
7668

7769
@Override

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

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,10 @@ public List<WorkflowDependency> getDependencies() {
4242
}
4343

4444
@Override
45-
public boolean equals(Object o) {
46-
if (this == o) {
47-
return true;
48-
}
49-
if (o == null || getClass() != o.getClass()) {
50-
return false;
51-
}
52-
if (!super.equals(o)) {
53-
return false;
54-
}
45+
public boolean equalsIgnoreI18n(Object o) {
5546
WorkflowMailingAwareImpl that = (WorkflowMailingAwareImpl) o;
56-
return mailingId == that.mailingId;
47+
return super.equalsIgnoreI18n(o)
48+
&& mailingId == that.mailingId;
5749
}
5850

5951
@Override

0 commit comments

Comments
 (0)