Skip to content

Commit 40d39f6

Browse files
authored
Merge pull request #1432 from utmstack/backlog/office-365-cloud-environment-configuration-field
feat(o365-plugin): add Office 365 cloud environment configuration opt…
2 parents 9f85c83 + c33cd57 commit 40d39f6

File tree

5 files changed

+89
-60
lines changed

5 files changed

+89
-60
lines changed

backend/src/main/java/com/park/utmstack/domain/application_modules/UtmModuleGroupConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ public UtmModuleGroupConfiguration(ModuleConfigurationKey key) {
7171
this.confDataType = key.getConfDataType();
7272
this.confRequired = key.getConfRequired();
7373
this.confOptions = key.getConfOptions();
74-
this.confVisibility = key.getConfOptions();
74+
this.confValue = key.getConfValue();
75+
this.confVisibility = key.getConfVisibility();
7576
}
7677

7778
}

backend/src/main/java/com/park/utmstack/domain/application_modules/factory/impl/ModuleO365.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,22 @@ public List<ModuleConfigurationKey> getConfigurationKeys(Long groupId) throws Ex
7272
.withConfDataType("text")
7373
.withConfRequired(true)
7474
.build());
75+
76+
keys.add(ModuleConfigurationKey.builder()
77+
.withGroupId(groupId)
78+
.withConfKey("office365_cloud_environment")
79+
.withConfName("Cloud Environment")
80+
.withConfDescription("Select the Microsoft cloud environment for Office 365 integration.")
81+
.withConfDataType("select")
82+
.withConfRequired(false)
83+
.withConfValue("Commercial")
84+
.withConfOptions("[" +
85+
"{ \"value\": \"Commercial\", \"label\": \"Commercial - Azure commercial global (Default)\" }," +
86+
"{ \"value\": \"GCC\", \"label\": \"GCC - US Government Community Cloud\" }," +
87+
"{ \"value\": \"GCCHigh\", \"label\": \"GCC High - US Government Community Cloud High (DoD IL4)\" }," +
88+
"{ \"value\": \"DoD\", \"label\": \"DoD - US Department of Defense (DoD IL5)\" }" +
89+
"]")
90+
.build());
7591
return keys;
7692
}
7793

backend/src/main/java/com/park/utmstack/domain/application_modules/types/ModuleConfigurationKey.java

Lines changed: 21 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,24 @@
11
package com.park.utmstack.domain.application_modules.types;
22

3+
import lombok.Getter;
4+
import lombok.Setter;
5+
6+
@Getter
7+
@Setter
38
public class ModuleConfigurationKey {
49
private Long groupId;
510
private String confKey;
611
private String confName;
12+
private String confValue;
713
private String confDescription;
814
private String confDataType;
915
private String confOptions;
10-
16+
private String confVisibility;
1117
private Boolean confRequired;
1218

1319
private ModuleConfigurationKey() {
1420
}
1521

16-
public Long getGroupId() {
17-
return groupId;
18-
}
19-
20-
public void setGroupId(Long groupId) {
21-
this.groupId = groupId;
22-
}
23-
24-
public String getConfKey() {
25-
return confKey;
26-
}
27-
28-
public void setConfKey(String confKey) {
29-
this.confKey = confKey;
30-
}
31-
32-
public String getConfName() {
33-
return confName;
34-
}
35-
36-
public void setConfName(String confName) {
37-
this.confName = confName;
38-
}
39-
40-
public String getConfDescription() {
41-
return confDescription;
42-
}
43-
44-
public void setConfDescription(String confDescription) {
45-
this.confDescription = confDescription;
46-
}
47-
48-
public String getConfDataType() {
49-
return confDataType;
50-
}
51-
52-
public void setConfDataType(String confDataType) {
53-
this.confDataType = confDataType;
54-
}
55-
56-
public Boolean getConfRequired() {
57-
return confRequired;
58-
}
59-
60-
public void setConfRequired(Boolean confRequired) {
61-
this.confRequired = confRequired;
62-
}
63-
64-
public String getConfOptions() {
65-
return confOptions;
66-
}
67-
68-
public void setConfOptions(String confOptions) {
69-
this.confOptions = confOptions;
70-
}
71-
7222
public static Builder builder() {
7323
return new Builder();
7424
}
@@ -77,11 +27,11 @@ public static class Builder {
7727
private Long groupId;
7828
private String confKey;
7929
private String confName;
30+
private String confValue;
8031
private String confDescription;
8132
private String confDataType;
8233
private Boolean confRequired;
83-
private Boolean confVisible = true;
84-
34+
private String confVisibility;
8535
private String confOptions;
8636

8737
public Builder withGroupId(Long groupId) {
@@ -119,6 +69,16 @@ public Builder withConfOptions(String confOptions) {
11969
return this;
12070
}
12171

72+
public Builder withConfValue(String confValue) {
73+
this.confValue = confValue;
74+
return this;
75+
}
76+
77+
public Builder withConfVisibility(String confVisibility) {
78+
this.confVisibility = confVisibility;
79+
return this;
80+
}
81+
12282
public ModuleConfigurationKey build() {
12383
ModuleConfigurationKey key = new ModuleConfigurationKey();
12484
key.setGroupId(groupId);
@@ -128,6 +88,8 @@ public ModuleConfigurationKey build() {
12888
key.setConfDataType(confDataType);
12989
key.setConfRequired(confRequired);
13090
key.setConfOptions(confOptions);
91+
key.setConfValue(confValue);
92+
key.setConfVisibility(confVisibility);
13193
return key;
13294
}
13395
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<databaseChangeLog
3+
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
6+
7+
<changeSet id="20251125001" author="Manuel">
8+
<preConditions onFail="MARK_RAN">
9+
<sqlCheck expectedResult="1">
10+
SELECT CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END AS result
11+
FROM public.utm_module_group
12+
WHERE module_id = 34
13+
</sqlCheck>
14+
</preConditions>
15+
16+
<sql dbms="postgresql" splitStatements="true" stripComments="true">
17+
INSERT INTO public.utm_module_group_configuration (
18+
group_id,
19+
conf_key,
20+
conf_value,
21+
conf_name,
22+
conf_description,
23+
conf_data_type,
24+
conf_required,
25+
conf_options,
26+
conf_visibility
27+
)
28+
SELECT
29+
g.id,
30+
'office365_cloud_environment',
31+
'Commercial',
32+
'Cloud Environment',
33+
'Select the Microsoft cloud environment for Office 365 integration.',
34+
'select',
35+
false,
36+
'[
37+
{ "value": "Commercial", "label": "Commercial - Azure commercial global (Default)" },
38+
{ "value": "GCC", "label": "GCC - US Government Community Cloud" },
39+
{ "value": "GCCHigh", "label": "GCC High - US Government Community Cloud High (DoD IL4)" },
40+
{ "value": "DoD", "label": "DoD - US Department of Defense (DoD IL5)" }
41+
]',
42+
null
43+
FROM public.utm_module_group g
44+
WHERE g.module_id = 34;
45+
</sql>
46+
</changeSet>
47+
48+
</databaseChangeLog>

backend/src/main/resources/config/liquibase/master.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,5 +269,7 @@
269269

270270
<include file="/config/liquibase/changelog/20251111001_set_alert-response_rule_seq.xml" relativeToChangelogFile="false"/>
271271

272+
<include file="/config/liquibase/changelog/20251125001_add_environment_o365_integration.xml" relativeToChangelogFile="false"/>
273+
272274

273275
</databaseChangeLog>

0 commit comments

Comments
 (0)