@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,143 @@
|
|
|
1
|
+
// #region Enums
|
|
2
|
+
export enum LogicalOperator {
|
|
3
|
+
EQUALS = 'EQUALS',
|
|
4
|
+
NOT_EQUALS = 'NOT_EQUALS',
|
|
5
|
+
GREATER_THAN = 'GREATER_THAN',
|
|
6
|
+
LESS_THAN = 'LESS_THAN',
|
|
7
|
+
NULL = 'NULL',
|
|
8
|
+
NOT_NULL = 'NOT_NULL',
|
|
9
|
+
BLANK = 'BLANK',
|
|
10
|
+
NOT_BLANK = 'NOT_BLANK',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const LogicalOperators = [
|
|
14
|
+
{
|
|
15
|
+
label: 'Equals',
|
|
16
|
+
operator: 'EQUALS',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: 'Not Equals',
|
|
20
|
+
operator: 'NOT_EQUALS',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: 'Greater Than',
|
|
24
|
+
operator: 'GREATER_THAN',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: 'Less Than',
|
|
28
|
+
operator: 'LESS_THAN',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: 'Null',
|
|
32
|
+
operator: 'NULL',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: 'Not Null',
|
|
36
|
+
operator: 'NOT_NULL',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: 'Blank',
|
|
40
|
+
operator: 'BLANK',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: 'Not Blank',
|
|
44
|
+
operator: 'NOT_BLANK',
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
export const DateLogicalOperators = [
|
|
49
|
+
{
|
|
50
|
+
label: 'Equals',
|
|
51
|
+
operator: 'EQUALS',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
label: 'Not Equals',
|
|
55
|
+
operator: 'NOT_EQUALS',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: 'After',
|
|
59
|
+
operator: 'GREATER_THAN',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
label: 'On or After',
|
|
63
|
+
operator: 'GREATER_THAN_OR_EQUAL',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
label: 'Before',
|
|
67
|
+
operator: 'LESS_THAN',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
label: 'On or Before',
|
|
71
|
+
operator: 'LESS_THAN_OR_EQUAL',
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
|
|
75
|
+
export const nullAndBlankLogicalOperatorValues = [
|
|
76
|
+
LogicalOperator.NULL,
|
|
77
|
+
LogicalOperator.NOT_NULL,
|
|
78
|
+
LogicalOperator.BLANK,
|
|
79
|
+
LogicalOperator.NOT_BLANK,
|
|
80
|
+
];
|
|
81
|
+
|
|
82
|
+
export enum RightCriteria {
|
|
83
|
+
VALUE = 'VALUE',
|
|
84
|
+
USER_ENTRY = 'USER_ENTRY',
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export enum ParamType {
|
|
88
|
+
// FIELD = 'FIELD',
|
|
89
|
+
STRING = 'STRING',
|
|
90
|
+
// BOOLEAN = 'BOOLEAN',
|
|
91
|
+
NUMBER = 'NUMBER',
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export enum ParamSourceType {
|
|
95
|
+
USER_TEXT = 'USER_TEXT',
|
|
96
|
+
DEFINED_GROUP = 'DEFINED_GROUP',
|
|
97
|
+
REQ_REP = 'REQ_REP',
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export enum Severity {
|
|
101
|
+
INFORMATION = 'INFORMATION',
|
|
102
|
+
CRITICAL = 'CRITICAL',
|
|
103
|
+
SERIOUS = 'SERIOUS',
|
|
104
|
+
WARNING = 'WARNING',
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export enum ExpressionType {
|
|
108
|
+
FIELD = 'FIELD',
|
|
109
|
+
NUMBER = 'NUMBER',
|
|
110
|
+
STRING = 'STRING',
|
|
111
|
+
PLACEHOLDER = 'PLACEHOLDER',
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export enum Assignment {
|
|
115
|
+
HEADER = 'HEADER',
|
|
116
|
+
BODY = 'BODY',
|
|
117
|
+
NOTIFY_SEVERITY = 'NOTIFY_SEVERITY',
|
|
118
|
+
TOPIC = 'TOPIC',
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export enum UpdateType {
|
|
122
|
+
INSERT = 'INSERT',
|
|
123
|
+
MODIFY = 'MODIFY',
|
|
124
|
+
DELETE = 'DELETE',
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export const defaultUpdateType = [UpdateType.INSERT];
|
|
128
|
+
|
|
129
|
+
export enum EmptyValue {
|
|
130
|
+
BLANK = '',
|
|
131
|
+
NULL = 'NULL',
|
|
132
|
+
}
|
|
133
|
+
// #endregion
|
|
134
|
+
|
|
135
|
+
// #region Types
|
|
136
|
+
export type ConditionBuilderEntity = {
|
|
137
|
+
ID: string;
|
|
138
|
+
LEFT_VALUE: any;
|
|
139
|
+
LOGICAL_OPERATOR: string;
|
|
140
|
+
RIGHT_CRITERIA: string;
|
|
141
|
+
RIGHT_VALUE: string;
|
|
142
|
+
};
|
|
143
|
+
// #endregion
|
package/src/sandbox.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Auth, AuthType, Connect } from '@genesislcap/foundation-comms';
|
|
2
|
+
import { css, customElement, GenesisElement, html, observable, when } from '@genesislcap/web-core';
|
|
3
|
+
|
|
4
|
+
@customElement({
|
|
5
|
+
name: 'notify-sandbox',
|
|
6
|
+
template: html`
|
|
7
|
+
${when(
|
|
8
|
+
(x) => x.ready,
|
|
9
|
+
html`
|
|
10
|
+
<rapid-design-system-provider>
|
|
11
|
+
<div
|
|
12
|
+
style="width:100%; display:flex; justify-content:flex-end; margin-top:10px; margin-bottom:10px;"
|
|
13
|
+
>
|
|
14
|
+
<rapid-button @click=${(x) => x.openFlyout()}>
|
|
15
|
+
Open right positioned flyout
|
|
16
|
+
</rapid-button>
|
|
17
|
+
<rapid-flyout
|
|
18
|
+
:closed="${(x) => !x.rightFlyoutActive}"
|
|
19
|
+
@closed=${(x) => (x.rightFlyoutActive = false)}
|
|
20
|
+
>
|
|
21
|
+
<div slot="title">Alerts Center</div>
|
|
22
|
+
<foundation-inbox></foundation-inbox>
|
|
23
|
+
</rapid-flyout>
|
|
24
|
+
</div>
|
|
25
|
+
<rapid-tabs>
|
|
26
|
+
<rapid-tab slot="dashboard">Dashboard</rapid-tab>
|
|
27
|
+
<rapid-tab slot="inbox">Inbox</rapid-tab>
|
|
28
|
+
<rapid-tab slot="counter">Counter</rapid-tab>
|
|
29
|
+
<rapid-tab-panel>
|
|
30
|
+
<foundation-notification-dashboard></foundation-notification-dashboard>
|
|
31
|
+
</rapid-tab-panel>
|
|
32
|
+
<rapid-tab-panel>
|
|
33
|
+
<foundation-inbox></foundation-inbox>
|
|
34
|
+
</rapid-tab-panel>
|
|
35
|
+
<rapid-tab-panel>
|
|
36
|
+
<foundation-inbox-counter></foundation-inbox-counter>
|
|
37
|
+
</rapid-tab-panel>
|
|
38
|
+
</rapid-tabs>
|
|
39
|
+
</rapid-design-system-provider>
|
|
40
|
+
`,
|
|
41
|
+
)}
|
|
42
|
+
`,
|
|
43
|
+
styles: css`
|
|
44
|
+
rapid-flyout > foundation-inbox {
|
|
45
|
+
height: 100vh;
|
|
46
|
+
}
|
|
47
|
+
rapid-flyout::part(flyout) {
|
|
48
|
+
min-width: 800px;
|
|
49
|
+
}
|
|
50
|
+
`,
|
|
51
|
+
})
|
|
52
|
+
export class ReconciliationSandbox extends GenesisElement {
|
|
53
|
+
@Connect connect!: Connect;
|
|
54
|
+
@Auth auth!: Auth;
|
|
55
|
+
@observable ready = false;
|
|
56
|
+
@observable rightFlyoutActive = false;
|
|
57
|
+
|
|
58
|
+
async connectedCallback() {
|
|
59
|
+
super.connectedCallback();
|
|
60
|
+
|
|
61
|
+
console.log('.env:', {
|
|
62
|
+
GENX_SANDBOX_DEFAULT_USER,
|
|
63
|
+
GENX_SANDBOX_DEFAULT_PASSWORD,
|
|
64
|
+
GENX_SANDBOX_API_HOST,
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
await this.connect.connect(GENX_SANDBOX_API_HOST);
|
|
68
|
+
|
|
69
|
+
await this.auth.login({
|
|
70
|
+
username: GENX_SANDBOX_DEFAULT_USER,
|
|
71
|
+
password: GENX_SANDBOX_DEFAULT_PASSWORD,
|
|
72
|
+
type: AuthType.BASIC,
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
this.auth.isLoggedIn$.subscribe((isLoggedIn) => {
|
|
76
|
+
this.ready = isLoggedIn;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
openFlyout() {
|
|
81
|
+
this.rightFlyoutActive = true;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Connect, Message, SocketObservable } from '@genesislcap/foundation-comms';
|
|
2
|
+
import { DI } from '@genesislcap/web-core';
|
|
3
|
+
|
|
4
|
+
export interface AlertService {
|
|
5
|
+
getAlerts(): SocketObservable<Message<any>>;
|
|
6
|
+
dismissNotifyAlert(alertId: string);
|
|
7
|
+
dismissAllNotifyAlerts();
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
class AlertServiceImpl implements AlertService {
|
|
11
|
+
@Connect private connect: Connect;
|
|
12
|
+
|
|
13
|
+
public getAlerts(): SocketObservable<Message<any>> {
|
|
14
|
+
return this.connect.stream(
|
|
15
|
+
'ALL_NOTIFY_ALERT_RECORDS',
|
|
16
|
+
(streamMessage: Message) => {
|
|
17
|
+
() => {};
|
|
18
|
+
},
|
|
19
|
+
(x) => {},
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public async dismissNotifyAlert(alertId: string) {
|
|
24
|
+
return this.connect.commitEvent('EVENT_DISMISS_NOTIFY_ALERT', {
|
|
25
|
+
DETAILS: {
|
|
26
|
+
ALERT_ID: alertId,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public async dismissAllNotifyAlerts() {
|
|
32
|
+
return this.connect.commitEvent('EVENT_DISMISS_ALL_NOTIFY_ALERT', { DETAILS: {} });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const AlertService = DI.createInterface<AlertService>((x) => x.singleton(AlertServiceImpl));
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Auth, Connect, SocketObservable, SocketSubscription } from '@genesislcap/foundation-comms';
|
|
2
|
+
import { DI } from '@genesislcap/web-core';
|
|
3
|
+
import { logger, updateArray } from '../utils';
|
|
4
|
+
|
|
5
|
+
export interface FoundationInboxServiceStore {
|
|
6
|
+
items: Array<any>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export type SubscribeCallback = ({ store }: { store: FoundationInboxServiceStore }) => any;
|
|
10
|
+
|
|
11
|
+
export type Subscription = {
|
|
12
|
+
callback: SubscribeCallback;
|
|
13
|
+
socketSubscription: SocketSubscription;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export interface FoundationInboxService {
|
|
17
|
+
subscribe(callback: SubscribeCallback, reverse: boolean, criteriaMatch: string): void;
|
|
18
|
+
unsubscribe(callback: SubscribeCallback): void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
class FoundationInboxServiceImpl implements FoundationInboxService {
|
|
22
|
+
@Connect private connect: Connect;
|
|
23
|
+
@Auth private auth: Auth;
|
|
24
|
+
private stream: SocketObservable<any> | null;
|
|
25
|
+
private subscriptions: Subscription[] = [];
|
|
26
|
+
public store: FoundationInboxServiceStore = {
|
|
27
|
+
items: [],
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
private getStream(reverse: boolean, criteriaMatch: string): SocketObservable<any> {
|
|
31
|
+
return this.connect.stream(
|
|
32
|
+
'ALL_NOTIFY_ALERT_RECORDS',
|
|
33
|
+
(result) => {
|
|
34
|
+
if (result.ERROR) {
|
|
35
|
+
logger.error(result.ERROR);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
this.store.items = updateArray(result?.ROW, this.store.items);
|
|
40
|
+
|
|
41
|
+
this.subscriptions.forEach((subscription) => {
|
|
42
|
+
subscription.callback({ store: this.store });
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
(response) => logger.error(response),
|
|
46
|
+
{
|
|
47
|
+
REVERSE: reverse,
|
|
48
|
+
...(criteriaMatch != '' && { CRITERIA_MATCH: criteriaMatch }),
|
|
49
|
+
},
|
|
50
|
+
) as SocketObservable<any>;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public subscribe(callback: SubscribeCallback, reverse: boolean, criteriaMatch: string): void {
|
|
54
|
+
if (this.stream) {
|
|
55
|
+
callback({ store: this.store });
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
this.stream = this.getStream(reverse, criteriaMatch);
|
|
60
|
+
const socketSubscription = this.stream.subscribe();
|
|
61
|
+
|
|
62
|
+
this.subscriptions.push({ callback, socketSubscription });
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public unsubscribe(callback: SubscribeCallback): void {
|
|
66
|
+
const index = this.subscriptions.findIndex(
|
|
67
|
+
(subscription) => subscription.callback === callback,
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
if (index >= 0) {
|
|
71
|
+
const found = this.subscriptions.splice(index, 1);
|
|
72
|
+
found.forEach((subscription) => {
|
|
73
|
+
subscription.socketSubscription.unsubscribe();
|
|
74
|
+
subscription.callback({ store: { items: [] } });
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
this.stream = undefined;
|
|
79
|
+
this.store = { items: [] };
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export const FoundationInboxService = DI.createInterface<FoundationInboxService>((x) =>
|
|
84
|
+
x.transient(FoundationInboxServiceImpl),
|
|
85
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Connect } from '@genesislcap/foundation-comms';
|
|
2
|
+
import { DI } from '@genesislcap/web-core';
|
|
3
|
+
|
|
4
|
+
export interface NotifyService {
|
|
5
|
+
getNotifyRouteTopics();
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
class NotifyServiceImpl implements NotifyService {
|
|
9
|
+
@Connect private connect: Connect;
|
|
10
|
+
|
|
11
|
+
public async getNotifyRouteTopics() {
|
|
12
|
+
const data = await this.connect.request('REQ_NOTIFY_ROUTE_TOPICS', {
|
|
13
|
+
REQUEST: { NOTIFY_ROUTE_ID: '' },
|
|
14
|
+
});
|
|
15
|
+
return data.REPLY ? data.REPLY[0].TOPICS : [];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const NotifyService = DI.createInterface<NotifyService>((x) =>
|
|
20
|
+
x.singleton(NotifyServiceImpl),
|
|
21
|
+
);
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { Connect, Message } from '@genesislcap/foundation-comms';
|
|
2
|
+
import { DI } from '@genesislcap/web-core';
|
|
3
|
+
import type { Rule } from '../components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.types';
|
|
4
|
+
|
|
5
|
+
export interface RuleService {
|
|
6
|
+
subscribeRule(dynamicRuleId: string, parameterDetails: any);
|
|
7
|
+
unsubscribeRule(dynamicRuleId: string);
|
|
8
|
+
enableRule(dynamicRuleId: string);
|
|
9
|
+
disableRule(dynamicRuleId: string);
|
|
10
|
+
getRules(): Promise<any>;
|
|
11
|
+
getRuleDetails(ruleId: string): Promise<Rule>;
|
|
12
|
+
createRule(rule: Rule): Promise<Message>;
|
|
13
|
+
updateRule(rule: Rule): Promise<Message>;
|
|
14
|
+
deleteRule(ruleId: string): void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
class RuleServiceImpl implements RuleService {
|
|
18
|
+
@Connect private connect: Connect;
|
|
19
|
+
|
|
20
|
+
public async getRules() {
|
|
21
|
+
const response = await this.connect.request('REQ_NOTIFICATION_RULE', { REQUEST: true });
|
|
22
|
+
return response.REPLY;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public async getRuleDetails(ruleId: string): Promise<Rule> {
|
|
26
|
+
const response = await this.connect.request('REQ_NOTIFICATION_RULE_DETAILS', {
|
|
27
|
+
REQUEST: {
|
|
28
|
+
ID: ruleId,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
if (!response.REPLY) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return response.REPLY[0];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async createRule(rule: Rule): Promise<Message> {
|
|
40
|
+
return this.connect.commitEvent('EVENT_NOTIFICATION_RULE_CREATE', {
|
|
41
|
+
DETAILS: rule,
|
|
42
|
+
IGNORE_WARNINGS: true,
|
|
43
|
+
VALIDATE: false,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async updateRule(rule: Rule): Promise<Message> {
|
|
48
|
+
return this.connect.commitEvent('EVENT_NOTIFICATION_RULE_UPDATE', {
|
|
49
|
+
DETAILS: rule,
|
|
50
|
+
IGNORE_WARNINGS: true,
|
|
51
|
+
VALIDATE: false,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
deleteRule(ruleId: string) {
|
|
56
|
+
this.connect.commitEvent('EVENT_NOTIFICATION_RULE_DELETE', {
|
|
57
|
+
DETAILS: {
|
|
58
|
+
ID: ruleId,
|
|
59
|
+
},
|
|
60
|
+
IGNORE_WARNINGS: true,
|
|
61
|
+
VALIDATE: false,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public async subscribeRule(dynamicRuleId: string, parameterDetails: unknown) {
|
|
66
|
+
if (!dynamicRuleId) {
|
|
67
|
+
console.error('Invalid dynamicRuleId');
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return this.connect.commitEvent('EVENT_NOTIFICATION_RULE_SUBSCRIBE', {
|
|
72
|
+
DETAILS: {
|
|
73
|
+
DYNAMIC_RULE_ID: dynamicRuleId,
|
|
74
|
+
PARAMETER_DETAILS: parameterDetails,
|
|
75
|
+
},
|
|
76
|
+
IGNORE_WARNINGS: true,
|
|
77
|
+
VALIDATE: false,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
public async unsubscribeRule(dynamicRuleId: string) {
|
|
82
|
+
if (!dynamicRuleId) {
|
|
83
|
+
console.error('Invalid dynamicRuleId');
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return this.connect.commitEvent(
|
|
88
|
+
'EVENT_NOTIFICATION_RULE_UNSUBSCRIBE',
|
|
89
|
+
this.createDynamicRuleIDParams(dynamicRuleId),
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
public async enableRule(dynamicRuleId: string) {
|
|
94
|
+
if (!dynamicRuleId) {
|
|
95
|
+
console.error('Invalid dynamicRuleId');
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return this.connect.commitEvent(
|
|
100
|
+
'EVENT_NOTIFICATION_RULE_ENABLE',
|
|
101
|
+
this.createDynamicRuleIDParams(dynamicRuleId),
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
public async disableRule(dynamicRuleId: string) {
|
|
106
|
+
if (!dynamicRuleId) {
|
|
107
|
+
console.error('Invalid dynamicRuleId');
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return this.connect
|
|
112
|
+
.commitEvent('EVENT_NOTIFICATION_RULE_DISABLE', this.createDynamicRuleIDParams(dynamicRuleId))
|
|
113
|
+
.then((data) => {
|
|
114
|
+
console.log(data);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
private createDynamicRuleIDParams(dynamicRuleId: string) {
|
|
119
|
+
return {
|
|
120
|
+
DETAILS: {
|
|
121
|
+
ID: dynamicRuleId,
|
|
122
|
+
},
|
|
123
|
+
IGNORE_WARNINGS: true,
|
|
124
|
+
VALIDATE: false,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export const RuleService = DI.createInterface<RuleService>((x) => x.singleton(RuleServiceImpl));
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Connect } from '@genesislcap/foundation-comms';
|
|
2
|
+
import { DI } from '@genesislcap/web-core';
|
|
3
|
+
|
|
4
|
+
export type Field = {
|
|
5
|
+
FIELD_NAME: string;
|
|
6
|
+
FIELD_TYPE: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export interface SystemService {
|
|
10
|
+
getResources(): Promise<string[]>;
|
|
11
|
+
getFields(resource: string): Promise<Field[]>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
class SystemServiceImpl implements SystemService {
|
|
15
|
+
@Connect private connect: Connect;
|
|
16
|
+
|
|
17
|
+
public async getResources(): Promise<string[]> {
|
|
18
|
+
const response = await this.connect.request('NOTIFY_SYSTEM_ENTITY', {
|
|
19
|
+
REQUEST: { ENTITY_NAME: '*' },
|
|
20
|
+
});
|
|
21
|
+
return response.REPLY.map((table) => table.ENTITY_NAME).sort();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async getFields(resource: string): Promise<Field[]> {
|
|
25
|
+
if (!resource) {
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const response = await this.connect.request('SYSTEM_ENTITY_FIELDS', {
|
|
30
|
+
REQUEST: {
|
|
31
|
+
ENTITY_NAME: resource,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
return response.REPLY.sort((a, b) => a.NAME.localeCompare(b.NAME)).map((entity) => ({
|
|
35
|
+
FIELD_NAME: entity.NAME,
|
|
36
|
+
FIELD_TYPE: entity.TYPE,
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const SystemService = DI.createInterface<SystemService>((x) =>
|
|
42
|
+
x.singleton(SystemServiceImpl),
|
|
43
|
+
);
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Connect } from '@genesislcap/foundation-comms';
|
|
2
|
+
import { DI } from '@genesislcap/web-core';
|
|
3
|
+
import type { Template } from '../components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.types';
|
|
4
|
+
|
|
5
|
+
export interface TemplateService {
|
|
6
|
+
createRuleTemplate(ruleTemplate: Template): Promise<any>;
|
|
7
|
+
editRuleTemplate(ruleTemplate: Template): Promise<any>;
|
|
8
|
+
getRuleTemplates();
|
|
9
|
+
getRuleTemplateDetails(dynamicRuleId: string);
|
|
10
|
+
deleteRuleTemplate(dynamicRuleId: string);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
class TemplateServiceImpl implements TemplateService {
|
|
14
|
+
@Connect private connect: Connect;
|
|
15
|
+
|
|
16
|
+
async createRuleTemplate(ruleTemplate: Template): Promise<any> {
|
|
17
|
+
return this.connect.commitEvent('EVENT_NOTIFICATION_RULE_TEMPLATE_CREATE', {
|
|
18
|
+
DETAILS: ruleTemplate,
|
|
19
|
+
IGNORE_WARNINGS: true,
|
|
20
|
+
VALIDATE: false,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async editRuleTemplate(ruleTemplate: Template): Promise<any> {
|
|
25
|
+
return this.connect.commitEvent('EVENT_NOTIFICATION_RULE_TEMPLATE_UPDATE', {
|
|
26
|
+
DETAILS: ruleTemplate,
|
|
27
|
+
IGNORE_WARNINGS: true,
|
|
28
|
+
VALIDATE: false,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public async getRuleTemplates() {
|
|
33
|
+
let ruleTemplates = [];
|
|
34
|
+
await this.connect.request('REQ_NOTIFICATION_RULE_TEMPLATE', { REQUEST: true }).then((data) => {
|
|
35
|
+
ruleTemplates = data.REPLY;
|
|
36
|
+
});
|
|
37
|
+
return ruleTemplates;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public async getRuleTemplateDetails(dynamicRuleId: string) {
|
|
41
|
+
let ruleTemplateDetails = {};
|
|
42
|
+
await this.connect
|
|
43
|
+
.request('REQ_NOTIFICATION_RULE_TEMPLATE_DETAILS', {
|
|
44
|
+
REQUEST: {
|
|
45
|
+
ID: dynamicRuleId,
|
|
46
|
+
},
|
|
47
|
+
})
|
|
48
|
+
.then((data) => {
|
|
49
|
+
if (!data.REPLY) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
ruleTemplateDetails = data.REPLY[0];
|
|
54
|
+
});
|
|
55
|
+
return ruleTemplateDetails;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
deleteRuleTemplate(dynamicRuleId: string) {
|
|
59
|
+
return this.connect.commitEvent('EVENT_NOTIFICATION_RULE_TEMPLATE_DELETE', {
|
|
60
|
+
DETAILS: {
|
|
61
|
+
ID: dynamicRuleId,
|
|
62
|
+
},
|
|
63
|
+
IGNORE_WARNINGS: true,
|
|
64
|
+
VALIDATE: false,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export const TemplateService = DI.createInterface<TemplateService>((x) =>
|
|
70
|
+
x.singleton(TemplateServiceImpl),
|
|
71
|
+
);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { css } from '@genesislcap/web-core';
|
|
2
|
+
|
|
3
|
+
export const scrollbarStyles = css`
|
|
4
|
+
::-webkit-scrollbar {
|
|
5
|
+
width: calc((var(--base-height-multiplier) + var(--design-unit)) * 1px);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
::-webkit-scrollbar-track {
|
|
9
|
+
background: var(--neutral-layer-1);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
::-webkit-scrollbar-thumb {
|
|
13
|
+
background: var(--neutral-fill-rest);
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const hideColumn = {
|
|
2
|
+
hide: true,
|
|
3
|
+
};
|
|
4
|
+
|
|
5
|
+
export const suppressColumn = {
|
|
6
|
+
...hideColumn,
|
|
7
|
+
suppressColumnsToolPanel: true,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const hideColumns = (fieldsToSuppress: any) =>
|
|
11
|
+
fieldsToSuppress.map((columnName) => ({
|
|
12
|
+
field: columnName,
|
|
13
|
+
...suppressColumn,
|
|
14
|
+
}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const humanize = (s: string) => {
|
|
2
|
+
if (!s) {
|
|
3
|
+
return '';
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
let i;
|
|
7
|
+
const frags = s.split('_');
|
|
8
|
+
|
|
9
|
+
for (i = 0; i < frags.length; i += 1) {
|
|
10
|
+
frags[i] = frags[i].charAt(0).toUpperCase() + frags[i].slice(1).toLowerCase();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return frags.join(' ');
|
|
14
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { html } from '@genesislcap/web-core';
|
|
2
|
+
|
|
3
|
+
export const editIcon = html`
|
|
4
|
+
<rapid-icon
|
|
5
|
+
style="pointer-events: none; opacity: 0.5"
|
|
6
|
+
class="icon-button"
|
|
7
|
+
variant="solid"
|
|
8
|
+
name="pen"
|
|
9
|
+
size="lg"
|
|
10
|
+
></rapid-icon>
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
export const deleteIcon = html`
|
|
14
|
+
<rapid-icon style="opacity: 0.5" variant="regular" name="trash-alt" size="lg"></rapid-icon>
|
|
15
|
+
`;
|