@genesislcap/pbc-notify-ui 1.0.64 → 14.308.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-extractor.json +4 -0
- package/dist/dts/components/foundation-inbox/components/inbox-subscription/inbox-subscription.d.ts.map +1 -1
- package/dist/dts/components/foundation-inbox/inbox.utils.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/rules/columns.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/columns.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/notification-dashboard.utils.d.ts.map +1 -1
- package/dist/dts/tsdoc-metadata.json +11 -0
- package/dist/dts/utils/gridConfig.d.ts.map +1 -1
- package/dist/dts/utils/humanize.d.ts.map +1 -1
- package/dist/dts/utils/toBoolean.d.ts.map +1 -1
- package/dist/dts/utils/updateArray.d.ts.map +1 -1
- package/dist/esm/index.federated.js +0 -1
- package/dist/pbc-notify-ui.api.json +889 -0
- package/dist/pbc-notify-ui.d.ts +252 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/docs/api/index.md +30 -0
- package/docs/api/pbc-notify-ui.foundationinbox.connectedcallback.md +18 -0
- package/docs/api/pbc-notify-ui.foundationinbox.disconnectedcallback.md +18 -0
- package/docs/api/pbc-notify-ui.foundationinbox.md +66 -0
- package/docs/api/pbc-notify-ui.foundationinboxcounter.connectedcallback.md +15 -0
- package/docs/api/pbc-notify-ui.foundationinboxcounter.disconnectedcallback.md +15 -0
- package/docs/api/pbc-notify-ui.foundationinboxcounter.inboxservice.md +11 -0
- package/docs/api/pbc-notify-ui.foundationinboxcounter.md +116 -0
- package/docs/api/pbc-notify-ui.foundationinboxcounter.value.md +11 -0
- package/docs/api/pbc-notify-ui.foundationinboxflyout.close.md +15 -0
- package/docs/api/pbc-notify-ui.foundationinboxflyout.connectedcallback.md +15 -0
- package/docs/api/pbc-notify-ui.foundationinboxflyout.disconnectedcallback.md +15 -0
- package/docs/api/pbc-notify-ui.foundationinboxflyout.flyout.md +11 -0
- package/docs/api/pbc-notify-ui.foundationinboxflyout.flyoutclosed.md +11 -0
- package/docs/api/pbc-notify-ui.foundationinboxflyout.loadremotes.md +15 -0
- package/docs/api/pbc-notify-ui.foundationinboxflyout.md +169 -0
- package/docs/api/pbc-notify-ui.foundationinboxflyout.open.md +15 -0
- package/docs/api/pbc-notify-ui.foundationinboxflyout.ready.md +11 -0
- package/docs/api/pbc-notify-ui.foundationnotificationdashboard.auth.md +11 -0
- package/docs/api/pbc-notify-ui.foundationnotificationdashboard.connectedcallback.md +15 -0
- package/docs/api/pbc-notify-ui.foundationnotificationdashboard.haspermissions.md +11 -0
- package/docs/api/pbc-notify-ui.foundationnotificationdashboard.md +122 -0
- package/docs/api/pbc-notify-ui.foundationnotificationdashboard.ready.md +11 -0
- package/docs/api/pbc-notify-ui.md +60 -0
- package/docs/api-report.md.api.md +76 -0
- package/license.txt +46 -0
- package/package.json +26 -39
- package/src/components/components.ts +54 -0
- package/src/components/foundation-inbox/components/foundation-inbox-counter/foundation-inbox-counter.styles.ts +30 -0
- package/src/components/foundation-inbox/components/foundation-inbox-counter/foundation-inbox-counter.template.ts +16 -0
- package/src/components/foundation-inbox/components/foundation-inbox-counter/foundation-inbox-counter.ts +33 -0
- package/src/components/foundation-inbox/components/foundation-inbox-flyout/foundation-inbox-flyout.styles.ts +18 -0
- package/src/components/foundation-inbox/components/foundation-inbox-flyout/foundation-inbox-flyout.template.ts +22 -0
- package/src/components/foundation-inbox/components/foundation-inbox-flyout/foundation-inbox-flyout.ts +43 -0
- package/src/components/foundation-inbox/components/inbox-subscription/inbox-subscription.styles.ts +37 -0
- package/src/components/foundation-inbox/components/inbox-subscription/inbox-subscription.template.ts +50 -0
- package/src/components/foundation-inbox/components/inbox-subscription/inbox-subscription.ts +81 -0
- package/src/components/foundation-inbox/components/inbox-subscription/rule-parameter/rule-parameter.styles.ts +25 -0
- package/src/components/foundation-inbox/components/inbox-subscription/rule-parameter/rule-parameter.template.ts +96 -0
- package/src/components/foundation-inbox/components/inbox-subscription/rule-parameter/rule-parameter.ts +55 -0
- package/src/components/foundation-inbox/inbox-base/inbox-base.ts +320 -0
- package/src/components/foundation-inbox/inbox.styles.ts +309 -0
- package/src/components/foundation-inbox/inbox.template.ts +317 -0
- package/src/components/foundation-inbox/inbox.ts +26 -0
- package/src/components/foundation-inbox/inbox.types.ts +84 -0
- package/src/components/foundation-inbox/inbox.utils.ts +33 -0
- package/src/components/foundation-notification-dashboard/components/notify-audit/notify-audit-management.ts +96 -0
- package/src/components/foundation-notification-dashboard/components/routes/route-management.ts +56 -0
- package/src/components/foundation-notification-dashboard/components/routes/tabs/email-distribution-route-management.ts +58 -0
- package/src/components/foundation-notification-dashboard/components/routes/tabs/email-user-route-management.ts +68 -0
- package/src/components/foundation-notification-dashboard/components/routes/tabs/log-route-management.ts +43 -0
- package/src/components/foundation-notification-dashboard/components/routes/tabs/ms-teams-route-management.ts +48 -0
- package/src/components/foundation-notification-dashboard/components/routes/tabs/screen-route-management.ts +73 -0
- package/src/components/foundation-notification-dashboard/components/rules/columns.ts +48 -0
- package/src/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.template.ts +139 -0
- package/src/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.ts +255 -0
- package/src/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.types.ts +4 -0
- package/src/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.template.ts +159 -0
- package/src/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.ts +202 -0
- package/src/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.types.ts +28 -0
- package/src/components/foundation-notification-dashboard/components/rules/rule-management.ts +72 -0
- package/src/components/foundation-notification-dashboard/components/templates/columns.ts +48 -0
- package/src/components/foundation-notification-dashboard/components/templates/template-dialog/parameter-builder/parameter-builder.styles.ts +59 -0
- package/src/components/foundation-notification-dashboard/components/templates/template-dialog/parameter-builder/parameter-builder.template.ts +95 -0
- package/src/components/foundation-notification-dashboard/components/templates/template-dialog/parameter-builder/parameter-builder.ts +124 -0
- package/src/components/foundation-notification-dashboard/components/templates/template-dialog/template-condition-builder/template-condition-builder.template.ts +107 -0
- package/src/components/foundation-notification-dashboard/components/templates/template-dialog/template-condition-builder/template-condition-builder.ts +185 -0
- package/src/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.template.ts +139 -0
- package/src/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.ts +246 -0
- package/src/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.types.ts +38 -0
- package/src/components/foundation-notification-dashboard/components/templates/template-management.ts +72 -0
- package/src/components/foundation-notification-dashboard/index.ts +1 -0
- package/src/components/foundation-notification-dashboard/notification-dashboard.styles.ts +21 -0
- package/src/components/foundation-notification-dashboard/notification-dashboard.tabs.ts +35 -0
- package/src/components/foundation-notification-dashboard/notification-dashboard.template.ts +58 -0
- package/src/components/foundation-notification-dashboard/notification-dashboard.ts +40 -0
- package/src/components/foundation-notification-dashboard/notification-dashboard.utils.ts +295 -0
- package/src/components/foundation-notification-dashboard/styles/condition-builder.styles.ts +66 -0
- package/src/components/foundation-notification-dashboard/styles/dynamic-rule.styles.ts +159 -0
- package/src/components/foundation-notification-dashboard/styles/management.styles.ts +21 -0
- package/src/components/foundation-notification-dashboard/types/expression-type.ts +13 -0
- package/src/components/foundation-notification-dashboard/types/logical-operator.ts +18 -0
- package/src/components/foundation-notification-dashboard/types/param-source-type.ts +11 -0
- package/src/components/foundation-notification-dashboard/types/param-type.ts +13 -0
- package/src/components/foundation-notification-dashboard/types/right-criteria.ts +6 -0
- package/src/components/foundation-notification-dashboard/types/rule-execution-strategy.ts +6 -0
- package/src/components/foundation-notification-dashboard/types/severity.ts +13 -0
- package/src/globals.d.ts +7 -0
- package/src/index.federated.ts +1 -0
- package/src/index.ts +4 -0
- package/src/notify.types.ts +143 -0
- package/src/sandbox.ts +83 -0
- package/src/services/alert.service.ts +36 -0
- package/src/services/inbox.service.ts +85 -0
- package/src/services/notify.service.ts +21 -0
- package/src/services/rule.service.ts +129 -0
- package/src/services/system.service.ts +43 -0
- package/src/services/template.service.ts +71 -0
- package/src/styles/scrollbar.styles.ts +15 -0
- package/src/utils/eventDetail.ts +5 -0
- package/src/utils/gridConfig.ts +14 -0
- package/src/utils/humanize.ts +14 -0
- package/src/utils/icons.ts +15 -0
- package/src/utils/index.ts +6 -0
- package/src/utils/logger.ts +3 -0
- package/src/utils/notifyPermissions.ts +6 -0
- package/src/utils/toBoolean.ts +7 -0
- package/src/utils/updateArray.ts +33 -0
- package/temp/api-report.md.api.md +76 -0
- package/tsconfig.json +11 -0
- package/.husky/commit-msg +0 -3
- package/.husky/pre-commit +0 -4
- package/README.md +0 -31
- package/commitlint.config.js +0 -25
- package/index.html +0 -28
- package/scripts/commitlint.js +0 -24
- package/sonar-project.properties +0 -5
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { showNotification } from '@genesislcap/foundation-notifications';
|
|
2
|
+
import { UUID } from '@genesislcap/foundation-utils';
|
|
3
|
+
import {
|
|
4
|
+
ConditionBuilderEntity,
|
|
5
|
+
EmptyValue,
|
|
6
|
+
ExpressionType,
|
|
7
|
+
ParamSourceType,
|
|
8
|
+
ParamType,
|
|
9
|
+
RightCriteria,
|
|
10
|
+
nullAndBlankLogicalOperatorValues,
|
|
11
|
+
LogicalOperator,
|
|
12
|
+
} from '../../notify.types';
|
|
13
|
+
import { logger } from '../../utils';
|
|
14
|
+
import { toBoolean } from '../../utils/toBoolean';
|
|
15
|
+
import { ParameterBuilderEntity } from './components/templates/template-dialog/template-dialog.types';
|
|
16
|
+
|
|
17
|
+
export class UUIDGenerator {
|
|
18
|
+
@UUID private static uuid: UUID;
|
|
19
|
+
static createUUID = (): string => this.uuid.createId();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const isEmpty = (value) =>
|
|
23
|
+
value == null || (typeof value === 'string' && value.trim().length === 0);
|
|
24
|
+
|
|
25
|
+
// #region Rules and Templates
|
|
26
|
+
class ConditionUtils {
|
|
27
|
+
static transformLogicalOperator(logicalOperator) {
|
|
28
|
+
switch (logicalOperator) {
|
|
29
|
+
case LogicalOperator.NULL:
|
|
30
|
+
case LogicalOperator.BLANK:
|
|
31
|
+
return LogicalOperator.EQUALS;
|
|
32
|
+
case LogicalOperator.NOT_NULL:
|
|
33
|
+
case LogicalOperator.NOT_BLANK:
|
|
34
|
+
return LogicalOperator.NOT_EQUALS;
|
|
35
|
+
default:
|
|
36
|
+
return logicalOperator;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static buildLogicalOperator(condition) {
|
|
41
|
+
if (condition.RIGHT.TYPE === EmptyValue.NULL) {
|
|
42
|
+
return condition.OPERATION === LogicalOperator.EQUALS
|
|
43
|
+
? LogicalOperator.NULL
|
|
44
|
+
: LogicalOperator.NOT_NULL;
|
|
45
|
+
} else if (condition.RIGHT.VALUE === EmptyValue.BLANK) {
|
|
46
|
+
return condition.OPERATION === LogicalOperator.EQUALS
|
|
47
|
+
? LogicalOperator.BLANK
|
|
48
|
+
: LogicalOperator.NOT_BLANK;
|
|
49
|
+
} else {
|
|
50
|
+
return condition.OPERATION;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static getRightExpression(condition: ConditionBuilderEntity, parameters?) {
|
|
55
|
+
// 1. Check LOGICAL_OPERATOR for null values
|
|
56
|
+
if (
|
|
57
|
+
condition.LOGICAL_OPERATOR === LogicalOperator.NULL ||
|
|
58
|
+
condition.LOGICAL_OPERATOR === LogicalOperator.NOT_NULL
|
|
59
|
+
) {
|
|
60
|
+
return {
|
|
61
|
+
TYPE: EmptyValue.NULL,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// 2. Check LOGICAL_OPERATOR for blank values
|
|
66
|
+
if (
|
|
67
|
+
condition.LOGICAL_OPERATOR === LogicalOperator.BLANK ||
|
|
68
|
+
condition.LOGICAL_OPERATOR === LogicalOperator.NOT_BLANK
|
|
69
|
+
) {
|
|
70
|
+
return {
|
|
71
|
+
TYPE: 'STRING',
|
|
72
|
+
VALUE: ConditionUtils.handleNullOrBlankLogicalOperator(condition.LOGICAL_OPERATOR),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// 3. Handle by RIGHT_CRITERIA
|
|
77
|
+
switch (condition.RIGHT_CRITERIA) {
|
|
78
|
+
case 'USER_ENTRY':
|
|
79
|
+
return {
|
|
80
|
+
TYPE: 'PLACEHOLDER',
|
|
81
|
+
KEY: parameters.find((parameter) => parameter.UUID === condition.RIGHT_VALUE).PARAM_NAME,
|
|
82
|
+
};
|
|
83
|
+
case 'FIELD': // Only for Rules
|
|
84
|
+
return {
|
|
85
|
+
TYPE: 'FIELD',
|
|
86
|
+
NAME: condition.RIGHT_VALUE,
|
|
87
|
+
};
|
|
88
|
+
case 'VALUE':
|
|
89
|
+
switch (condition.LEFT_VALUE.FIELD_TYPE) {
|
|
90
|
+
case 'BOOLEAN':
|
|
91
|
+
return {
|
|
92
|
+
TYPE: 'BOOLEAN',
|
|
93
|
+
VALUE: toBoolean(condition.RIGHT_VALUE),
|
|
94
|
+
};
|
|
95
|
+
case 'STRING':
|
|
96
|
+
case 'ENUM':
|
|
97
|
+
return {
|
|
98
|
+
TYPE: 'STRING',
|
|
99
|
+
VALUE: condition.RIGHT_VALUE,
|
|
100
|
+
};
|
|
101
|
+
case 'INT':
|
|
102
|
+
case 'SHORT':
|
|
103
|
+
case 'DOUBLE':
|
|
104
|
+
case 'LONG':
|
|
105
|
+
case 'BIGDECIMAL':
|
|
106
|
+
return {
|
|
107
|
+
TYPE: 'NUMBER',
|
|
108
|
+
VALUE: condition.RIGHT_VALUE,
|
|
109
|
+
};
|
|
110
|
+
default:
|
|
111
|
+
return {
|
|
112
|
+
TYPE: 'FIELD',
|
|
113
|
+
NAME: condition.RIGHT_VALUE,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
default:
|
|
117
|
+
logger.error(`Unexpected RIGHT_CRITERIA: ${condition.RIGHT_CRITERIA}`);
|
|
118
|
+
return {};
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
static handleNullOrBlankLogicalOperator(logicalOperator) {
|
|
123
|
+
switch (logicalOperator) {
|
|
124
|
+
case LogicalOperator.NULL:
|
|
125
|
+
case LogicalOperator.NOT_NULL:
|
|
126
|
+
return EmptyValue.NULL;
|
|
127
|
+
case LogicalOperator.BLANK:
|
|
128
|
+
case LogicalOperator.NOT_BLANK:
|
|
129
|
+
return EmptyValue.BLANK;
|
|
130
|
+
default:
|
|
131
|
+
logger.error(`Unexpected LogicalOperator: ${logicalOperator}`);
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export class DynamicRuleUtils {
|
|
138
|
+
static createEmptyCondition = (): ConditionBuilderEntity => ({
|
|
139
|
+
ID: null,
|
|
140
|
+
LEFT_VALUE: null,
|
|
141
|
+
LOGICAL_OPERATOR: LogicalOperator.EQUALS,
|
|
142
|
+
RIGHT_CRITERIA: RightCriteria.VALUE,
|
|
143
|
+
RIGHT_VALUE: null,
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
static createAssignment = (field: string, value: string) => ({
|
|
147
|
+
FIELD: {
|
|
148
|
+
TYPE: 'FIELD',
|
|
149
|
+
NAME: field,
|
|
150
|
+
},
|
|
151
|
+
VALUE: {
|
|
152
|
+
TYPE: 'STRING',
|
|
153
|
+
VALUE: value,
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
static getAssignmentValue = (assignments: any[], field: string): string =>
|
|
158
|
+
assignments.find((assignment) => assignment.FIELD.NAME === field).VALUE.VALUE;
|
|
159
|
+
|
|
160
|
+
static createConditions(conditions: ConditionBuilderEntity[], parameters?): any {
|
|
161
|
+
return conditions.map((condition) => ({
|
|
162
|
+
LEFT: {
|
|
163
|
+
TYPE: 'FIELD', // TODO: Use ParamType
|
|
164
|
+
NAME: condition.LEFT_VALUE.FIELD_NAME,
|
|
165
|
+
},
|
|
166
|
+
OPERATION: ConditionUtils.transformLogicalOperator(condition.LOGICAL_OPERATOR),
|
|
167
|
+
RIGHT: ConditionUtils.getRightExpression(condition, parameters),
|
|
168
|
+
}));
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export class TemplateUtils {
|
|
173
|
+
static createEmptyParameter = (): ParameterBuilderEntity => ({
|
|
174
|
+
UUID: UUIDGenerator.createUUID(),
|
|
175
|
+
PARAM_NAME: null,
|
|
176
|
+
PARAM_LABEL: null,
|
|
177
|
+
PARAM_TYPE: ParamType.STRING,
|
|
178
|
+
PARAM_SOURCE_TYPE: ParamSourceType.USER_TEXT,
|
|
179
|
+
PARAM_SOURCE: null,
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
static getParameters(parameters) {
|
|
183
|
+
if (!parameters) {
|
|
184
|
+
return [];
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return Object.keys(parameters).map((key) => ({
|
|
188
|
+
UUID: UUIDGenerator.createUUID(),
|
|
189
|
+
PARAM_NAME: parameters[key].PARAM_NAME,
|
|
190
|
+
PARAM_LABEL: parameters[key].PARAM_LABEL,
|
|
191
|
+
PARAM_TYPE: parameters[key].PARAM_TYPE,
|
|
192
|
+
PARAM_SOURCE_TYPE: parameters[key].PARAM_SOURCE_TYPE,
|
|
193
|
+
PARAM_SOURCE: parameters[key].PARAM_SOURCE,
|
|
194
|
+
}));
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
private static buildRightValue(logicalOperator: LogicalOperator, condition, parameters?) {
|
|
198
|
+
// Is Null or Blank
|
|
199
|
+
if (nullAndBlankLogicalOperatorValues.includes(logicalOperator)) {
|
|
200
|
+
return EmptyValue.BLANK;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Find parameter name by key
|
|
204
|
+
if (condition.RIGHT.TYPE === ExpressionType.PLACEHOLDER) {
|
|
205
|
+
return parameters.find((parameter) => parameter.PARAM_NAME === condition.RIGHT.KEY).UUID;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// If value is null, then NAME is filled
|
|
209
|
+
return String(condition.RIGHT.VALUE ?? condition.RIGHT.NAME);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
static getConditions(conditions, parameters?) {
|
|
213
|
+
return conditions.map((condition) => {
|
|
214
|
+
const logicalOperator = ConditionUtils.buildLogicalOperator(condition);
|
|
215
|
+
return {
|
|
216
|
+
ID: UUIDGenerator.createUUID(),
|
|
217
|
+
LEFT_VALUE: condition.LEFT.VALUE ?? condition.LEFT.NAME,
|
|
218
|
+
LOGICAL_OPERATOR: logicalOperator,
|
|
219
|
+
RIGHT_CRITERIA:
|
|
220
|
+
condition.RIGHT.TYPE === ExpressionType.PLACEHOLDER
|
|
221
|
+
? RightCriteria.USER_ENTRY
|
|
222
|
+
: RightCriteria.VALUE,
|
|
223
|
+
RIGHT_VALUE: this.buildRightValue(logicalOperator, condition, parameters),
|
|
224
|
+
};
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
static createParameterDetails(parameters) {
|
|
229
|
+
if (!parameters || parameters.length === 0) {
|
|
230
|
+
return {};
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
const map = {};
|
|
234
|
+
|
|
235
|
+
parameters.forEach((parameter) => {
|
|
236
|
+
map[parameter.PARAM_NAME] = {
|
|
237
|
+
PARAM_LABEL: parameter.PARAM_LABEL,
|
|
238
|
+
PARAM_TYPE: parameter.PARAM_TYPE,
|
|
239
|
+
PARAM_SOURCE_TYPE: parameter.PARAM_SOURCE_TYPE,
|
|
240
|
+
PARAM_SOURCE: parameter.PARAM_SOURCE ?? '',
|
|
241
|
+
PARAM_OPERATOR: 'EQUALS', // TODO: Remove
|
|
242
|
+
};
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
return map;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export class RuleUtils {
|
|
250
|
+
private static buildRightValue(logicalOperator: LogicalOperator, condition) {
|
|
251
|
+
// Is Null or Blank
|
|
252
|
+
if (nullAndBlankLogicalOperatorValues.includes(logicalOperator)) {
|
|
253
|
+
return EmptyValue.BLANK;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// Get KEY
|
|
257
|
+
if (condition.RIGHT.TYPE === ExpressionType.PLACEHOLDER) {
|
|
258
|
+
return condition.RIGHT.KEY;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// If value is null, then NAME is filled
|
|
262
|
+
return String(condition.RIGHT.VALUE ?? condition.RIGHT.NAME);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
static getConditions(conditions) {
|
|
266
|
+
return conditions.map((condition) => {
|
|
267
|
+
const logicalOperator = ConditionUtils.buildLogicalOperator(condition);
|
|
268
|
+
return {
|
|
269
|
+
ID: UUIDGenerator.createUUID(),
|
|
270
|
+
LEFT_VALUE: condition.LEFT.VALUE ?? condition.LEFT.NAME,
|
|
271
|
+
LOGICAL_OPERATOR: logicalOperator,
|
|
272
|
+
RIGHT_CRITERIA: condition.RIGHT.TYPE === 'FIELD' ? 'FIELD' : 'VALUE',
|
|
273
|
+
RIGHT_VALUE: this.buildRightValue(logicalOperator, condition),
|
|
274
|
+
};
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
// #endregion
|
|
279
|
+
|
|
280
|
+
// #region Screen
|
|
281
|
+
export function showNotificationError(error) {
|
|
282
|
+
showNotification(
|
|
283
|
+
{
|
|
284
|
+
title: error[0]?.CODE,
|
|
285
|
+
body: error[0]?.TEXT,
|
|
286
|
+
config: {
|
|
287
|
+
snackbar: {
|
|
288
|
+
type: 'error',
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
'rapid',
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
// #endregion
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { css } from '@genesislcap/web-core';
|
|
2
|
+
|
|
3
|
+
export const ConditionBuilderStyles = css`
|
|
4
|
+
.condition-builder {
|
|
5
|
+
display: flex;
|
|
6
|
+
gap: calc(var(--design-unit) * 2px);
|
|
7
|
+
margin-bottom: calc(var(--design-unit) * 2px);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
rapid-button {
|
|
11
|
+
margin: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.delete {
|
|
15
|
+
margin: 0;
|
|
16
|
+
display: flex;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
height: calc(var(--design-unit) * 9px);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.delete:hover {
|
|
22
|
+
background-color: color-mix(in srgb, var(--neutral-foreground-rest), transparent 89%);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
rapid-text-field {
|
|
26
|
+
width: 100%;
|
|
27
|
+
margin-bottom: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
rapid-text-field::part(root) {
|
|
31
|
+
height: calc(var(--design-unit) * 9px);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
rapid-select {
|
|
35
|
+
min-width: auto;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
rapid-select.left-value::part(control) {
|
|
39
|
+
width: 250px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
rapid-select.logical-operator::part(control) {
|
|
43
|
+
width: 160px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.logical-operator-null-and-blank {
|
|
47
|
+
width: 100%;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
rapid-select.right-criteria::part(control) {
|
|
51
|
+
width: 135px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
rapid-select.right-criteria-user-entry {
|
|
55
|
+
width: 100%;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
rapid-select.right-criteria-select {
|
|
59
|
+
width: 100%;
|
|
60
|
+
min-width: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
rapid-select::part(listbox) {
|
|
64
|
+
max-height: 160px;
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { css } from '@genesislcap/web-core';
|
|
2
|
+
import { scrollbarStyles } from '../../../styles/scrollbar.styles';
|
|
3
|
+
|
|
4
|
+
export const DynamicRuleManagementStyles = css`
|
|
5
|
+
.container {
|
|
6
|
+
display: flex;
|
|
7
|
+
height: 100%;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.header {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: row-reverse;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.grid {
|
|
17
|
+
height: 100%;
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
// #region Dialog
|
|
22
|
+
const modalWidthPx = 940;
|
|
23
|
+
|
|
24
|
+
const top = css`
|
|
25
|
+
rapid-modal::part(top) {
|
|
26
|
+
padding: calc(var(--design-unit) * 4px);
|
|
27
|
+
border-bottom: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
|
|
28
|
+
margin: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.dialog-top {
|
|
32
|
+
font-weight: bold;
|
|
33
|
+
align-self: center;
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
const bottom = css`
|
|
38
|
+
rapid-modal::part(bottom) {
|
|
39
|
+
padding: calc(var(--design-unit) * 4px);
|
|
40
|
+
border-top: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
|
|
41
|
+
margin: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.dialog-bottom {
|
|
45
|
+
display: flex;
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
const textField = css`
|
|
50
|
+
rapid-text-field {
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
gap: calc(var(--design-unit) * 2px);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
rapid-text-field::part(label) {
|
|
57
|
+
margin: 0;
|
|
58
|
+
color: var(--neutral-foreground-rest);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
rapid-text-field::part(label)::after {
|
|
62
|
+
content: '*';
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
|
|
66
|
+
const select = css`
|
|
67
|
+
rapid-select,
|
|
68
|
+
rapid-multiselect::part(root) {
|
|
69
|
+
min-width: 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
rapid-select::part(listbox) {
|
|
73
|
+
max-height: 160px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
rapid-multiselect {
|
|
77
|
+
max-height: 40px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
rapid-multiselect::part(filter-search) {
|
|
81
|
+
height: calc((var(--design-unit) * 9px) - 2px);
|
|
82
|
+
}
|
|
83
|
+
`;
|
|
84
|
+
|
|
85
|
+
export const DynamicRuleDialogStyles = css`
|
|
86
|
+
${scrollbarStyles}
|
|
87
|
+
${top}
|
|
88
|
+
${bottom}
|
|
89
|
+
|
|
90
|
+
rapid-modal::part(dialog) {
|
|
91
|
+
padding: 0;
|
|
92
|
+
background: var(--neutral-layer-4);
|
|
93
|
+
border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.dialog-content {
|
|
97
|
+
display: flex;
|
|
98
|
+
flex-direction: column;
|
|
99
|
+
width: ${String(modalWidthPx)}px;
|
|
100
|
+
max-height: 500px;
|
|
101
|
+
overflow-y: scroll;
|
|
102
|
+
gap: calc(var(--design-unit) * 3px);
|
|
103
|
+
padding: calc(var(--design-unit) * 4px);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.content-row {
|
|
107
|
+
display: flex;
|
|
108
|
+
gap: calc(var(--design-unit) * 3px);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.control {
|
|
112
|
+
display: flex;
|
|
113
|
+
flex-direction: column;
|
|
114
|
+
width: 100%;
|
|
115
|
+
gap: calc(var(--design-unit) * 2px);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.items {
|
|
119
|
+
border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
|
|
120
|
+
border-radius: calc(var(--control-corner-radius) * 1px);
|
|
121
|
+
display: flex;
|
|
122
|
+
padding: calc(var(--design-unit) * 2px);
|
|
123
|
+
flex-direction: column;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.item {
|
|
127
|
+
gap: 0;
|
|
128
|
+
flex-direction: column;
|
|
129
|
+
margin-bottom: 0;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
${textField}
|
|
133
|
+
${select}
|
|
134
|
+
|
|
135
|
+
rapid-button {
|
|
136
|
+
margin: 0;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
rapid-select {
|
|
140
|
+
min-width: 0;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
rapid-select::part(listbox) {
|
|
144
|
+
max-height: 160px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.horizontal {
|
|
148
|
+
flex-direction: row;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.destination {
|
|
152
|
+
align-self: center;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.topic {
|
|
156
|
+
min-width: revert-layer;
|
|
157
|
+
}
|
|
158
|
+
`;
|
|
159
|
+
// #endregion
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { css } from '@genesislcap/web-core';
|
|
2
|
+
|
|
3
|
+
export const managementGridStyles = css`
|
|
4
|
+
:host {
|
|
5
|
+
height: 100%;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.container {
|
|
9
|
+
display: flex;
|
|
10
|
+
height: 100%;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.header {
|
|
15
|
+
display: flex;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.grid {
|
|
19
|
+
height: 100%;
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const EXPRESSION_TYPE_FIELD = 'FIELD';
|
|
2
|
+
export const EXPRESSION_TYPE_NUMBER = 'NUMBER';
|
|
3
|
+
export const EXPRESSION_TYPE_STRING = 'STRING';
|
|
4
|
+
export const EXPRESSION_TYPE_PLACEHOLDER = 'PLACEHOLDER';
|
|
5
|
+
|
|
6
|
+
export const ALL_EXPRESSION_TYPES = [
|
|
7
|
+
EXPRESSION_TYPE_FIELD,
|
|
8
|
+
EXPRESSION_TYPE_NUMBER,
|
|
9
|
+
EXPRESSION_TYPE_STRING,
|
|
10
|
+
EXPRESSION_TYPE_PLACEHOLDER,
|
|
11
|
+
] as const;
|
|
12
|
+
|
|
13
|
+
export type ExpressionType = (typeof ALL_EXPRESSION_TYPES)[number];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const LOGICAL_OPERATOR_EQUALS = 'EQUALS';
|
|
2
|
+
export const LOGICAL_OPERATOR_NOT_EQUALS = 'NOT_EQUALS';
|
|
3
|
+
export const LOGICAL_OPERATOR_GREATER_THAN = 'GREATER_THAN';
|
|
4
|
+
export const LOGICAL_OPERATOR_LESS_THAN = 'LESS_THAN';
|
|
5
|
+
|
|
6
|
+
export const LOGICAL_OPERATOR_NULL = 'NULL';
|
|
7
|
+
export const LOGICAL_OPERATOR_NOT_NULL = 'NOT_NULL';
|
|
8
|
+
export const LOGICAL_OPERATOR_BLANK = 'BLANK_NULL';
|
|
9
|
+
export const LOGICAL_OPERATOR_NOT_BLANK = 'NOT_BLANK';
|
|
10
|
+
|
|
11
|
+
export const ALL_LOGICAL_OPERATORS = [
|
|
12
|
+
LOGICAL_OPERATOR_EQUALS,
|
|
13
|
+
LOGICAL_OPERATOR_NOT_EQUALS,
|
|
14
|
+
LOGICAL_OPERATOR_GREATER_THAN,
|
|
15
|
+
LOGICAL_OPERATOR_LESS_THAN,
|
|
16
|
+
] as const;
|
|
17
|
+
|
|
18
|
+
export type LogicalOperator = (typeof ALL_LOGICAL_OPERATORS)[number];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const PARAM_SOURCE_TYPE_USER_TEXT = 'USER_TEXT';
|
|
2
|
+
export const PARAM_SOURCE_TYPE_DEFINED_GROUP = 'DEFINED_GROUP';
|
|
3
|
+
export const PARAM_SOURCE_TYPE_REQ_REP = 'REQ_REP';
|
|
4
|
+
|
|
5
|
+
export const ALL_PARAM_SOURCE_TYPES = [
|
|
6
|
+
PARAM_SOURCE_TYPE_USER_TEXT,
|
|
7
|
+
PARAM_SOURCE_TYPE_DEFINED_GROUP,
|
|
8
|
+
// PARAM_SOURCE_TYPE_REQ_REP,
|
|
9
|
+
] as const;
|
|
10
|
+
|
|
11
|
+
export type ParamSourceType = (typeof ALL_PARAM_SOURCE_TYPES)[number];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const PARAM_TYPE_FIELD = 'FIELD';
|
|
2
|
+
export const PARAM_TYPE_STRING = 'STRING';
|
|
3
|
+
export const PARAM_TYPE_BOOLEAN = 'BOOLEAN';
|
|
4
|
+
export const PARAM_TYPE_NUMBER = 'NUMBER';
|
|
5
|
+
|
|
6
|
+
export const ALL_PARAM_TYPES = [
|
|
7
|
+
// PARAM_TYPE_FIELD,
|
|
8
|
+
PARAM_TYPE_STRING,
|
|
9
|
+
// PARAM_TYPE_BOOLEAN,
|
|
10
|
+
PARAM_TYPE_NUMBER,
|
|
11
|
+
] as const;
|
|
12
|
+
|
|
13
|
+
export type ParamType = (typeof ALL_PARAM_TYPES)[number];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const RIGHT_CRITERIA_VALUE = 'VALUE';
|
|
2
|
+
export const RIGHT_CRITERIA_USER_ENTRY = 'USER_ENTRY';
|
|
3
|
+
|
|
4
|
+
export const ALL_RIGHT_CRITERIAS = [RIGHT_CRITERIA_VALUE, RIGHT_CRITERIA_USER_ENTRY] as const;
|
|
5
|
+
|
|
6
|
+
export type RightCriteria = (typeof ALL_RIGHT_CRITERIAS)[number];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const RULE_EXECUTION_UNLIMITED = 'UNLIMITED';
|
|
2
|
+
export const RULE_EXECUTION = 'ONCE_ONLY';
|
|
3
|
+
|
|
4
|
+
export const ALL_RULE_EXECUTION_STRATEGIES = [RULE_EXECUTION_UNLIMITED, RULE_EXECUTION] as const;
|
|
5
|
+
|
|
6
|
+
export type RuleExecutionStrategy = (typeof ALL_RULE_EXECUTION_STRATEGIES)[number];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const SEVERITY_INFORMATION = 'INFORMATION';
|
|
2
|
+
export const SEVERITY_CRITICAL = 'CRITICAL';
|
|
3
|
+
export const SEVERITY_SERIOUS = 'SERIOUS';
|
|
4
|
+
export const SEVERITY_WARNING = 'WARNING';
|
|
5
|
+
|
|
6
|
+
export const ALL_SEVERITIES = [
|
|
7
|
+
{ type: SEVERITY_INFORMATION, text: 'Information' },
|
|
8
|
+
{ type: SEVERITY_WARNING, text: 'Warning' },
|
|
9
|
+
{ type: SEVERITY_SERIOUS, text: 'Serious' },
|
|
10
|
+
{ type: SEVERITY_CRITICAL, text: 'Critical' },
|
|
11
|
+
] as const;
|
|
12
|
+
|
|
13
|
+
export type Severity = (typeof ALL_SEVERITIES)[number];
|
package/src/globals.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import('./index');
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export * from './components/foundation-inbox/inbox';
|
|
2
|
+
export * from './components/foundation-inbox/components/foundation-inbox-flyout/foundation-inbox-flyout';
|
|
3
|
+
export * from './components/foundation-inbox/components/foundation-inbox-counter/foundation-inbox-counter';
|
|
4
|
+
export * from './components/foundation-notification-dashboard';
|