@genesislcap/pbc-notify-ui 14.487.0 → 14.488.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.
Files changed (28) hide show
  1. package/dist/custom-elements.json +2957 -2063
  2. package/dist/dts/components/foundation-inbox/inbox-base/inbox-base.d.ts +16 -0
  3. package/dist/dts/components/foundation-inbox/inbox-base/inbox-base.d.ts.map +1 -1
  4. package/dist/dts/components/foundation-inbox/inbox.styles.d.ts.map +1 -1
  5. package/dist/dts/components/foundation-inbox/inbox.template.d.ts.map +1 -1
  6. package/dist/dts/components/foundation-inbox/inbox.utils.d.ts +1 -0
  7. package/dist/dts/components/foundation-inbox/inbox.utils.d.ts.map +1 -1
  8. package/dist/dts/components/foundation-notification-dashboard/notification-dashboard.utils.d.ts.map +1 -1
  9. package/dist/dts/react.d.ts +38 -38
  10. package/dist/dts/services/notify-route.service.d.ts +27 -0
  11. package/dist/dts/services/notify-route.service.d.ts.map +1 -0
  12. package/dist/esm/components/foundation-inbox/inbox-base/inbox-base.js +183 -0
  13. package/dist/esm/components/foundation-inbox/inbox.styles.js +27 -0
  14. package/dist/esm/components/foundation-inbox/inbox.template.js +35 -3
  15. package/dist/esm/components/foundation-inbox/inbox.utils.js +7 -0
  16. package/dist/esm/components/foundation-notification-dashboard/notification-dashboard.utils.js +3 -1
  17. package/dist/esm/services/notify-route.service.js +107 -0
  18. package/dist/pbc-notify-ui.d.ts +45 -0
  19. package/dist/react.cjs +44 -44
  20. package/dist/react.mjs +39 -39
  21. package/dist/tsconfig.tsbuildinfo +1 -1
  22. package/package.json +23 -23
  23. package/src/components/foundation-inbox/inbox-base/inbox-base.ts +206 -0
  24. package/src/components/foundation-inbox/inbox.styles.ts +27 -0
  25. package/src/components/foundation-inbox/inbox.template.ts +48 -3
  26. package/src/components/foundation-inbox/inbox.utils.ts +8 -0
  27. package/src/components/foundation-notification-dashboard/notification-dashboard.utils.ts +7 -1
  28. package/src/services/notify-route.service.ts +164 -0
@@ -4,6 +4,7 @@ import type { Tabs } from '@genesislcap/foundation-ui';
4
4
  import { GenesisElement } from '@genesislcap/web-core';
5
5
  import { AlertService } from '../../../services/alert.service';
6
6
  import { FoundationInboxService } from '../../../services/inbox.service';
7
+ import { NotifyChannel, NotifyRoute, NotifyRouteService } from '../../../services/notify-route.service';
7
8
  import { RuleService } from '../../../services/rule.service';
8
9
  import { TemplateService } from '../../../services/template.service';
9
10
  import { Alert, InboxTab, NotificationRuleTemplateReply, Rule, RuleTemplate } from '../inbox.types';
@@ -21,6 +22,11 @@ export declare class FoundationInboxBase extends GenesisElement {
21
22
  templateService: TemplateService;
22
23
  templates: RuleTemplate[];
23
24
  templatesFilter: RuleTemplate[];
25
+ routeService: NotifyRouteService;
26
+ channelAvailability: Record<string, Record<NotifyChannel, boolean>>;
27
+ userChannelRoutes: Record<string, Record<NotifyChannel, NotifyRoute | null>>;
28
+ channelTogglePending: Record<string, Partial<Record<NotifyChannel, boolean>>>;
29
+ private channelRoutesQueryId;
24
30
  searchAlertLog: string;
25
31
  titleSearchValue: string;
26
32
  bodySearchValue: string;
@@ -56,10 +62,20 @@ export declare class FoundationInboxBase extends GenesisElement {
56
62
  validateResponse(response: any): void;
57
63
  dismissAllAlerts(): void;
58
64
  refreshSubscribeData(): Promise<void>;
65
+ private refreshChannelRoutes;
66
+ private isOwnRoute;
59
67
  findSubscribedRule(template: RuleTemplate): Rule | undefined;
60
68
  isTemplateSubscribed(template: RuleTemplate): boolean;
69
+ isChannelAvailable(template: RuleTemplate, channel: NotifyChannel): boolean;
70
+ isChannelEnabled(template: RuleTemplate, channel: NotifyChannel): boolean;
71
+ private isLastEnabledChannel;
72
+ isChannelTogglePending(template: RuleTemplate, channel: NotifyChannel): boolean;
73
+ private setChannelRoute;
74
+ private setChannelTogglePending;
75
+ toggleChannel(template: RuleTemplate, channel: NotifyChannel): Promise<void>;
61
76
  handleTemplateToggle(template: RuleTemplate, event: Event): Promise<void>;
62
77
  onTemplateSubscribed(templateId?: string): Promise<void>;
78
+ private ensureDefaultChannel;
63
79
  cancelPendingSubscribe(): void;
64
80
  formatDateStrForMatchCriteria(date?: string): string;
65
81
  }
@@ -1 +1 @@
1
- {"version":3,"file":"inbox-base.d.ts","sourceRoot":"","sources":["../../../../../src/components/foundation-inbox/inbox-base/inbox-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAEL,UAAU,EAKX,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAc,MAAM,uBAAuB,CAAC;AAKnE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAmB,MAAM,iCAAiC,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAGrE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,6BAA6B,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAgBpG,qBAAa,mBAAoB,SAAQ,cAAc;IAC/C,IAAI,EAAE,IAAI,CAAC;IACR,OAAO,EAAE,OAAO,CAAC;IAEZ,YAAY,EAAE,YAAY,CAAC;IACjB,YAAY,EAAE,sBAAsB,CAAC;IAC7D,OAAO,CAAC,aAAa,CAAe;IACxB,OAAO,CAAC,MAAM,CAAe;IAC7B,YAAY,EAAE,KAAK,EAAE,CAAM;IAC3B,UAAU,EAAE,OAAO,CAAS;IAE3B,WAAW,EAAE,WAAW,CAAC;IAC1B,KAAK,EAAE,IAAI,EAAE,CAAM;IAEd,eAAe,EAAE,eAAe,CAAC;IACtC,SAAS,EAAE,YAAY,EAAE,CAAM;IAC/B,eAAe,EAAE,YAAY,EAAE,CAAM;IAErC,cAAc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;IAIlB,kBAAkB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS;IAI5D,oBAAoB,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO;IAIrD,kBAAkB,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO;IAI3E,gBAAgB,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO;IAIzE,OAAO,CAAC,oBAAoB;IAQ5B,sBAAsB,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO;IAI/E,OAAO,CAAC,eAAe;IAcvB,OAAO,CAAC,uBAAuB;IAOzB,aAAa,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa;IA+C5D,oBAAoB,CAAC,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK;IA2CzD,oBAAoB,CAAC,UAAU,CAAC,EAAE,MAAM;YAmBhC,oBAAoB;IAkClC,sBAAsB;IAMtB,6BAA6B,CAAC,IAAI,CAAC,EAAE,MAAM;CAG5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"inbox.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/foundation-inbox/inbox.styles.ts"],"names":[],"mappings":"AA4JA,eAAO,MAAM,WAAW,iDA+BvB,CAAC;AAEF,eAAO,MAAM,yBAAyB,iDA8ErC,CAAC;AAEF,eAAO,MAAM,aAAa,iDAYzB,CAAC;AAEF,eAAO,MAAM,SAAS,iDAYrB,CAAC;AAEF,eAAO,MAAM,eAAe,iDAwG3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,iDAyBjC,CAAC"}
1
+ {"version":3,"file":"inbox.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/foundation-inbox/inbox.styles.ts"],"names":[],"mappings":"AA4JA,eAAO,MAAM,WAAW,iDA+BvB,CAAC;AAEF,eAAO,MAAM,yBAAyB,iDA8ErC,CAAC;AAEF,eAAO,MAAM,aAAa,iDAYzB,CAAC;AAEF,eAAO,MAAM,SAAS,iDAYrB,CAAC;AAEF,eAAO,MAAM,eAAe,iDAmI3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,iDAyBjC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"inbox.template.d.ts","sourceRoot":"","sources":["../../../../src/components/foundation-inbox/inbox.template.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAmM/C;;GAEG;AACH,eAAO,MAAM,uBAAuB,sEAoGnC,CAAC"}
1
+ {"version":3,"file":"inbox.template.d.ts","sourceRoot":"","sources":["../../../../src/components/foundation-inbox/inbox.template.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAmM/C;;GAEG;AACH,eAAO,MAAM,uBAAuB,sEAiJnC,CAAC"}
@@ -1,3 +1,4 @@
1
+ export declare function extractTopic(resultExpression: string): string | null;
1
2
  export declare const getFormattedDate: (dateTimeInMills: any) => string;
2
3
  export declare function getSeverityColor(severity: string): "var(--info-color, #11C9FC)" | "var(--error-color)" | "var(--serious-notify-color, #F9644D)" | "var(--warning-color)" | "var(--neutral-foreground-rest)";
3
4
  //# sourceMappingURL=inbox.utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"inbox.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/foundation-inbox/inbox.utils.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,gBAAgB,GAAI,oBAAe,WAG/C,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,4JAgBhD"}
1
+ {"version":3,"file":"inbox.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/foundation-inbox/inbox.utils.ts"],"names":[],"mappings":"AAWA,wBAAgB,YAAY,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEpE;AAED,eAAO,MAAM,gBAAgB,GAAI,oBAAe,WAG/C,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,4JAgBhD"}
@@ -1 +1 @@
1
- {"version":3,"file":"notification-dashboard.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/foundation-notification-dashboard/notification-dashboard.utils.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,aAAa,EASd,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAC;AAEtG,qBAAa,aAAa;IAClB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAO;IAChC,MAAM,CAAC,UAAU,QAAO,MAAM,CAAyB;CACxD;AAED,eAAO,MAAM,OAAO,GAAI,UAAK,YAC8C,CAAC;AAkH5E,qBAAa,gBAAgB;IAC3B,MAAM,CAAC,oBAAoB,QAAO,sBAAsB,CAOrD;IAEH,MAAM,CAAC,gBAAgB,GAAI,OAAO,MAAM,EAAE,OAAO,MAAM;;;;;;;;;MASpD;IAQH,MAAM,CAAC,oBAAoB,GACzB,OAAO,MAAM,EACb,MAAM,MAAM,EACZ,SAAQ;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,EAAO;;;;;;MAOpC;IAEH,MAAM,CAAC,kBAAkB,GAAI,aAAa,GAAG,EAAE,EAAE,OAAO,MAAM,KAAG,MAAM,CACS;IAIhF,MAAM,CAAC,iBAAiB,GAAI,aAAa,GAAG,EAAE,EAAE,OAAO,MAAM,KAAG,MAAM,CAGpE;IAKF,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,aAAa,EAAE,EAAE,UAAU,CAAC,KAAA,GAAG,GAAG;IAkBtE,MAAM,CAAC,sBAAsB,CAAC,UAAU,EAAE,aAAa,EAAE,GAAG,OAAO;IAUnE,MAAM,CAAC,SAAS,CAAC,UAAU,EAAE,aAAa,EAAE,GAAG,OAAO;IAWtD,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,aAAa,EAAE,GAAG,OAAO;IAUrD,MAAM,CAAC,sBAAsB,CAAC,UAAU,EAAE,aAAa,EAAE,GAAG,OAAO;IAYnE,MAAM,CAAC,iBAAiB,CAAC,UAAU,EAAE,aAAa,EAAE,GAAG,sBAAsB,EAAE;IAa/E,MAAM,CAAC,iBAAiB,CAAC,UAAU,EAAE,aAAa,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,aAAa,EAAE;IAcrF,MAAM,CAAC,gBAAgB,QAAO,oBAAoB,CAI/C;IAWH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,aAAa,EAAE,GAAG,MAAM;IAiB9D,MAAM,CAAC,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,EAAE,GAAG,IAAI;CAazE;AAqUD,qBAAa,aAAa;IACxB,MAAM,CAAC,oBAAoB,QAAO,sBAAsB,CAOrD;IAEH,MAAM,CAAC,aAAa,CAAC,UAAU,KAAA;;;;;;;;IAe/B,OAAO,CAAC,MAAM,CAAC,eAAe;IAe9B,MAAM,CAAC,aAAa,CAAC,UAAU,KAAA,EAAE,UAAU,CAAC,KAAA;IAgB5C,MAAM,CAAC,sBAAsB,CAAC,UAAU,KAAA;CAmBzC;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAC,eAAe;IAe9B,MAAM,CAAC,aAAa,CAAC,UAAU,KAAA;CAYhC;AAID,wBAAgB,qBAAqB,CAAC,KAAK,KAAA,QAa1C"}
1
+ {"version":3,"file":"notification-dashboard.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/foundation-notification-dashboard/notification-dashboard.utils.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,aAAa,EASd,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAC;AAEtG,qBAAa,aAAa;IAClB,OAAO,CAAC,MAAM,CAAC,IAAI,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AiB9D,MAAM,CAAC,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,EAAE,GAAG,IAAI;CAazE;AAqUD,qBAAa,aAAa;IACxB,MAAM,CAAC,oBAAoB,QAAO,sBAAsB,CAOrD;IAEH,MAAM,CAAC,aAAa,CAAC,UAAU,KAAA;;;;;;;;IAe/B,OAAO,CAAC,MAAM,CAAC,eAAe;IAe9B,MAAM,CAAC,aAAa,CAAC,UAAU,KAAA,EAAE,UAAU,CAAC,KAAA;IAgB5C,MAAM,CAAC,sBAAsB,CAAC,UAAU,KAAA;CAmBzC;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAC,eAAe;IAe9B,MAAM,CAAC,aAAa,CAAC,UAAU,KAAA;CAYhC;AAID,wBAAgB,qBAAqB,CAAC,KAAK,KAAA,QAe1C"}
@@ -67,15 +67,6 @@ export declare const ReconciliationSandbox: React.ForwardRefExoticComponent<
67
67
  >;
68
68
  export type ReconciliationSandboxRef = ReconciliationSandboxWC;
69
69
 
70
- export declare const FoundationInbox: React.ForwardRefExoticComponent<
71
- React.PropsWithChildren<
72
- Omit<PublicOf<FoundationInboxWC>, 'children' | 'style'> &
73
- HTMLWCProps & {
74
- }
75
- > & React.RefAttributes<FoundationInboxWC>
76
- >;
77
- export type FoundationInboxRef = FoundationInboxWC;
78
-
79
70
  export declare const FoundationNotificationDashboard: React.ForwardRefExoticComponent<
80
71
  React.PropsWithChildren<
81
72
  Omit<PublicOf<FoundationNotificationDashboardWC>, 'children' | 'style'> &
@@ -85,34 +76,14 @@ export declare const FoundationNotificationDashboard: React.ForwardRefExoticComp
85
76
  >;
86
77
  export type FoundationNotificationDashboardRef = FoundationNotificationDashboardWC;
87
78
 
88
- export declare const FoundationInboxCounter: React.ForwardRefExoticComponent<
89
- React.PropsWithChildren<
90
- Omit<PublicOf<FoundationInboxCounterWC>, 'children' | 'style'> &
91
- HTMLWCProps & {
92
- }
93
- > & React.RefAttributes<FoundationInboxCounterWC>
94
- >;
95
- export type FoundationInboxCounterRef = FoundationInboxCounterWC;
96
-
97
- export declare const FoundationInboxFlyout: React.ForwardRefExoticComponent<
98
- React.PropsWithChildren<
99
- Omit<PublicOf<FoundationInboxFlyoutWC>, 'children' | 'style'> &
100
- HTMLWCProps & {
101
- }
102
- > & React.RefAttributes<FoundationInboxFlyoutWC>
103
- >;
104
- export type FoundationInboxFlyoutRef = FoundationInboxFlyoutWC;
105
-
106
- export declare const InboxSubscription: React.ForwardRefExoticComponent<
79
+ export declare const FoundationInbox: React.ForwardRefExoticComponent<
107
80
  React.PropsWithChildren<
108
- Omit<PublicOf<InboxSubscriptionWC>, 'children' | 'style'> &
81
+ Omit<PublicOf<FoundationInboxWC>, 'children' | 'style'> &
109
82
  HTMLWCProps & {
110
- onTemplateSubscribed?: (event: CustomEvent<unknown>) => void;
111
- onSubscribeCancelled?: (event: CustomEvent<unknown>) => void;
112
83
  }
113
- > & React.RefAttributes<InboxSubscriptionWC>
84
+ > & React.RefAttributes<FoundationInboxWC>
114
85
  >;
115
- export type InboxSubscriptionRef = InboxSubscriptionWC;
86
+ export type FoundationInboxRef = FoundationInboxWC;
116
87
 
117
88
  export declare const NotifyAuditManagement: React.ForwardRefExoticComponent<
118
89
  React.PropsWithChildren<
@@ -150,15 +121,34 @@ export declare const TemplateManagement: React.ForwardRefExoticComponent<
150
121
  >;
151
122
  export type TemplateManagementRef = TemplateManagementWC;
152
123
 
153
- export declare const RuleParameter: React.ForwardRefExoticComponent<
124
+ export declare const FoundationInboxCounter: React.ForwardRefExoticComponent<
154
125
  React.PropsWithChildren<
155
- Omit<PublicOf<RuleParameterWC>, 'children' | 'style'> &
126
+ Omit<PublicOf<FoundationInboxCounterWC>, 'children' | 'style'> &
156
127
  HTMLWCProps & {
157
- onParameterEdited?: (event: CustomEvent<ParameterEditedEventDetail>) => void;
158
128
  }
159
- > & React.RefAttributes<RuleParameterWC>
129
+ > & React.RefAttributes<FoundationInboxCounterWC>
160
130
  >;
161
- export type RuleParameterRef = RuleParameterWC;
131
+ export type FoundationInboxCounterRef = FoundationInboxCounterWC;
132
+
133
+ export declare const FoundationInboxFlyout: React.ForwardRefExoticComponent<
134
+ React.PropsWithChildren<
135
+ Omit<PublicOf<FoundationInboxFlyoutWC>, 'children' | 'style'> &
136
+ HTMLWCProps & {
137
+ }
138
+ > & React.RefAttributes<FoundationInboxFlyoutWC>
139
+ >;
140
+ export type FoundationInboxFlyoutRef = FoundationInboxFlyoutWC;
141
+
142
+ export declare const InboxSubscription: React.ForwardRefExoticComponent<
143
+ React.PropsWithChildren<
144
+ Omit<PublicOf<InboxSubscriptionWC>, 'children' | 'style'> &
145
+ HTMLWCProps & {
146
+ onTemplateSubscribed?: (event: CustomEvent<unknown>) => void;
147
+ onSubscribeCancelled?: (event: CustomEvent<unknown>) => void;
148
+ }
149
+ > & React.RefAttributes<InboxSubscriptionWC>
150
+ >;
151
+ export type InboxSubscriptionRef = InboxSubscriptionWC;
162
152
 
163
153
  export declare const EmailDistributionRouteManagement: React.ForwardRefExoticComponent<
164
154
  React.PropsWithChildren<
@@ -225,6 +215,16 @@ export declare const TemplateDialog: React.ForwardRefExoticComponent<
225
215
  >;
226
216
  export type TemplateDialogRef = TemplateDialogWC;
227
217
 
218
+ export declare const RuleParameter: React.ForwardRefExoticComponent<
219
+ React.PropsWithChildren<
220
+ Omit<PublicOf<RuleParameterWC>, 'children' | 'style'> &
221
+ HTMLWCProps & {
222
+ onParameterEdited?: (event: CustomEvent<ParameterEditedEventDetail>) => void;
223
+ }
224
+ > & React.RefAttributes<RuleParameterWC>
225
+ >;
226
+ export type RuleParameterRef = RuleParameterWC;
227
+
228
228
  export declare const RuleConditionBuilder: React.ForwardRefExoticComponent<
229
229
  React.PropsWithChildren<
230
230
  Omit<PublicOf<RuleConditionBuilderWC>, 'children' | 'style'> &
@@ -0,0 +1,27 @@
1
+ export type NotifyChannel = 'popup' | 'email';
2
+ export interface NotifyRoute {
3
+ NOTIFY_ROUTE_ID: string;
4
+ TOPIC_MATCH: string;
5
+ GATEWAY_ID: string;
6
+ ROUTE_ENABLED: boolean;
7
+ ENTITY_ID: string;
8
+ ENTITY_ID_TYPE: string;
9
+ }
10
+ /**
11
+ * Per-user notification channel routing, backed by the platform's own
12
+ * NOTIFY_ROUTE / SCREEN_NOTIFY_ROUTE_EXT / EMAIL_USER_NOTIFY_ROUTE_EXT
13
+ * tables — the same CRUD events the admin Route Management screens use.
14
+ *
15
+ * A topic "supports" a channel when any route exists for that
16
+ * TOPIC_MATCH + GATEWAY_ID (admin-configured marker rows, entity-blank).
17
+ * A specific user has that channel enabled when a route additionally
18
+ * exists scoped to ENTITY_ID_TYPE=USER_NAME, ENTITY_ID=<username>.
19
+ */
20
+ export interface NotifyRouteService {
21
+ getAllRoutes(channel: NotifyChannel): Promise<NotifyRoute[]>;
22
+ findUserRoute(channel: NotifyChannel, topic: string, username: string): Promise<NotifyRoute | null>;
23
+ createUserRoute(channel: NotifyChannel, topic: string, username: string): Promise<NotifyRoute>;
24
+ deleteRoute(channel: NotifyChannel, notifyRouteId: string): Promise<void>;
25
+ }
26
+ export declare const NotifyRouteService: import("@microsoft/fast-foundation").InterfaceSymbol<NotifyRouteService>;
27
+ //# sourceMappingURL=notify-route.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notify-route.service.d.ts","sourceRoot":"","sources":["../../../src/services/notify-route.service.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,OAAO,CAAC;AAO9C,MAAM,WAAW,WAAW;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;CACxB;AAsBD;;;;;;;;;GASG;AACH,MAAM,WAAW,kBAAkB;IACjC,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAC7D,aAAa,CACX,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC/B,eAAe,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAC/F,WAAW,CAAC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3E;AAuGD,eAAO,MAAM,kBAAkB,0EAE9B,CAAC"}
@@ -8,11 +8,14 @@ import utc from 'dayjs/plugin/utc';
8
8
  import debounce from 'lodash.debounce';
9
9
  import { AlertService } from '../../../services/alert.service';
10
10
  import { FoundationInboxService, INBOX_PAGE_SIZE } from '../../../services/inbox.service';
11
+ import { NotifyRouteService, } from '../../../services/notify-route.service';
11
12
  import { RuleService } from '../../../services/rule.service';
12
13
  import { TemplateService } from '../../../services/template.service';
13
14
  import { logger } from '../../../utils';
15
+ import { NotifyPermission } from '../../../utils/notifyPermissions';
14
16
  import { showNotificationError } from '../../foundation-notification-dashboard/notification-dashboard.utils';
15
17
  import { InboxTab } from '../inbox.types';
18
+ import { extractTopic } from '../inbox.utils';
16
19
  dayjs.extend(utc);
17
20
  const criteriaBuilder = () => new CriteriaBuilder();
18
21
  const expressionBuilder = (field, value, serialiser) => {
@@ -32,6 +35,12 @@ export class FoundationInboxBase extends GenesisElement {
32
35
  this.rules = [];
33
36
  this.templates = [];
34
37
  this.templatesFilter = [];
38
+ this.channelAvailability = {};
39
+ this.userChannelRoutes = {};
40
+ this.channelTogglePending = {};
41
+ // Bumped on each refreshChannelRoutes call so a slower earlier run can detect it
42
+ // has been superseded and skip writing stale results.
43
+ this.channelRoutesQueryId = 0;
35
44
  this.searchAlertLog = null;
36
45
  this.titleSearchValue = null;
37
46
  this.bodySearchValue = null;
@@ -204,15 +213,135 @@ export class FoundationInboxBase extends GenesisElement {
204
213
  }
205
214
  });
206
215
  this.subscribedTemplateIds = subscribed;
216
+ yield this.refreshChannelRoutes();
207
217
  this.templatesChanged();
208
218
  });
209
219
  }
220
+ refreshChannelRoutes() {
221
+ return __awaiter(this, void 0, void 0, function* () {
222
+ var _a, _b;
223
+ if (!((_a = this.auth.currentUser) === null || _a === void 0 ? void 0 : _a.hasPermission(NotifyPermission.NotificationRouteView))) {
224
+ this.channelAvailability = {};
225
+ this.userChannelRoutes = {};
226
+ return;
227
+ }
228
+ const username = (_b = this.auth.currentUser) === null || _b === void 0 ? void 0 : _b.username;
229
+ this.channelRoutesQueryId += 1;
230
+ const queryId = this.channelRoutesQueryId;
231
+ // Two snapshots total (one per channel) instead of two per template: fetch every
232
+ // route once and match it to templates by TOPIC_MATCH in memory below.
233
+ const [popupRoutes, emailRoutes] = yield Promise.all([
234
+ this.routeService.getAllRoutes('popup'),
235
+ this.routeService.getAllRoutes('email'),
236
+ ]);
237
+ // A newer refresh started while this one was in flight; its data is fresher, so
238
+ // drop ours rather than clobber it with a now-stale snapshot.
239
+ if (queryId !== this.channelRoutesQueryId) {
240
+ return;
241
+ }
242
+ const availability = {};
243
+ const userRoutes = {};
244
+ this.templates.forEach((template) => {
245
+ var _a, _b;
246
+ const topic = extractTopic(template.RESULT_EXPRESSION);
247
+ if (!topic) {
248
+ availability[template.ID] = { popup: false, email: false };
249
+ userRoutes[template.ID] = { popup: null, email: null };
250
+ return;
251
+ }
252
+ const popupForTopic = popupRoutes.filter((route) => route.TOPIC_MATCH === topic);
253
+ const emailForTopic = emailRoutes.filter((route) => route.TOPIC_MATCH === topic);
254
+ availability[template.ID] = {
255
+ popup: popupForTopic.length > 0,
256
+ email: emailForTopic.length > 0,
257
+ };
258
+ userRoutes[template.ID] = {
259
+ popup: (_a = popupForTopic.find((route) => this.isOwnRoute(route, username))) !== null && _a !== void 0 ? _a : null,
260
+ email: (_b = emailForTopic.find((route) => this.isOwnRoute(route, username))) !== null && _b !== void 0 ? _b : null,
261
+ };
262
+ });
263
+ this.channelAvailability = availability;
264
+ this.userChannelRoutes = userRoutes;
265
+ });
266
+ }
267
+ isOwnRoute(route, username) {
268
+ return !!username && route.ENTITY_ID_TYPE === 'USER_NAME' && route.ENTITY_ID === username;
269
+ }
210
270
  findSubscribedRule(template) {
211
271
  return this.rules.find((rule) => rule.NAME === template.NAME);
212
272
  }
213
273
  isTemplateSubscribed(template) {
214
274
  return !!this.subscribedTemplateIds[template.ID];
215
275
  }
276
+ isChannelAvailable(template, channel) {
277
+ var _a;
278
+ return !!((_a = this.channelAvailability[template.ID]) === null || _a === void 0 ? void 0 : _a[channel]);
279
+ }
280
+ isChannelEnabled(template, channel) {
281
+ var _a;
282
+ return !!((_a = this.userChannelRoutes[template.ID]) === null || _a === void 0 ? void 0 : _a[channel]);
283
+ }
284
+ isLastEnabledChannel(template, channel) {
285
+ const otherChannel = channel === 'popup' ? 'email' : 'popup';
286
+ return !(this.isChannelAvailable(template, otherChannel) &&
287
+ this.isChannelEnabled(template, otherChannel));
288
+ }
289
+ isChannelTogglePending(template, channel) {
290
+ var _a;
291
+ return !!((_a = this.channelTogglePending[template.ID]) === null || _a === void 0 ? void 0 : _a[channel]);
292
+ }
293
+ setChannelRoute(templateId, channel, route) {
294
+ var _a;
295
+ this.userChannelRoutes = Object.assign(Object.assign({}, this.userChannelRoutes), { [templateId]: Object.assign(Object.assign({}, this.userChannelRoutes[templateId]), { [channel]: route }) });
296
+ this.channelAvailability = Object.assign(Object.assign({}, this.channelAvailability), { [templateId]: Object.assign(Object.assign({}, this.channelAvailability[templateId]), { [channel]: ((_a = this.channelAvailability[templateId]) === null || _a === void 0 ? void 0 : _a[channel]) || !!route }) });
297
+ }
298
+ setChannelTogglePending(templateId, channel, pending) {
299
+ this.channelTogglePending = Object.assign(Object.assign({}, this.channelTogglePending), { [templateId]: Object.assign(Object.assign({}, this.channelTogglePending[templateId]), { [channel]: pending }) });
300
+ }
301
+ toggleChannel(template, channel) {
302
+ return __awaiter(this, void 0, void 0, function* () {
303
+ var _a, _b;
304
+ if (!this.isTemplateSubscribed(template) || this.isChannelTogglePending(template, channel)) {
305
+ return;
306
+ }
307
+ const topic = extractTopic(template.RESULT_EXPRESSION);
308
+ if (!topic) {
309
+ return;
310
+ }
311
+ const existingRoute = (_a = this.userChannelRoutes[template.ID]) === null || _a === void 0 ? void 0 : _a[channel];
312
+ if (existingRoute && this.isLastEnabledChannel(template, channel)) {
313
+ showNotificationError([
314
+ {
315
+ CODE: 'VALIDATION_ERROR',
316
+ TEXT: 'At least one channel (Pop-up or Email) must stay enabled.',
317
+ },
318
+ ]);
319
+ return;
320
+ }
321
+ // Flip the chip instantly and let the network call catch up in the background —
322
+ // waiting on the round trip before updating the UI reads as an unresponsive click.
323
+ const optimisticRoute = existingRoute ? null : { NOTIFY_ROUTE_ID: 'pending' };
324
+ this.setChannelRoute(template.ID, channel, optimisticRoute);
325
+ this.setChannelTogglePending(template.ID, channel, true);
326
+ const username = (_b = this.auth.currentUser) === null || _b === void 0 ? void 0 : _b.username;
327
+ let updatedRoute;
328
+ try {
329
+ updatedRoute = existingRoute
330
+ ? yield this.routeService
331
+ .deleteRoute(channel, existingRoute.NOTIFY_ROUTE_ID)
332
+ .then(() => null)
333
+ : yield this.routeService.createUserRoute(channel, topic, username);
334
+ }
335
+ catch (error) {
336
+ this.setChannelRoute(template.ID, channel, existingRoute !== null && existingRoute !== void 0 ? existingRoute : null);
337
+ this.setChannelTogglePending(template.ID, channel, false);
338
+ showNotificationError([{ CODE: 'ROUTE_ERROR', TEXT: error.message }]);
339
+ return;
340
+ }
341
+ this.setChannelRoute(template.ID, channel, updatedRoute);
342
+ this.setChannelTogglePending(template.ID, channel, false);
343
+ });
344
+ }
216
345
  handleTemplateToggle(template, event) {
217
346
  return __awaiter(this, void 0, void 0, function* () {
218
347
  var _a;
@@ -232,6 +361,7 @@ export class FoundationInboxBase extends GenesisElement {
232
361
  if (parameters.length === 0) {
233
362
  yield this.ruleService.subscribeRule(template.ID, {});
234
363
  yield this.refreshSubscribeData();
364
+ yield this.ensureDefaultChannel(template);
235
365
  return;
236
366
  }
237
367
  target.checked = false;
@@ -261,6 +391,47 @@ export class FoundationInboxBase extends GenesisElement {
261
391
  this.pendingSubscribeTemplateId = null;
262
392
  this.ruleTemplateDetails = null;
263
393
  yield this.refreshSubscribeData();
394
+ const template = id && this.templates.find((t) => t.ID === id);
395
+ if (template) {
396
+ yield this.ensureDefaultChannel(template);
397
+ }
398
+ });
399
+ }
400
+ // First-time subscribers start with no channel routes at all, which means no
401
+ // delivery until they notice and pick one themselves — default the first available
402
+ // channel (Pop-up preferred, else Email) on so a fresh subscription is never
403
+ // silently inert.
404
+ ensureDefaultChannel(template) {
405
+ return __awaiter(this, void 0, void 0, function* () {
406
+ var _a, _b;
407
+ if (!((_a = this.auth.currentUser) === null || _a === void 0 ? void 0 : _a.hasPermission(NotifyPermission.NotificationRouteView))) {
408
+ return;
409
+ }
410
+ if (this.isChannelEnabled(template, 'popup') || this.isChannelEnabled(template, 'email')) {
411
+ return;
412
+ }
413
+ let defaultChannel = null;
414
+ if (this.isChannelAvailable(template, 'popup')) {
415
+ defaultChannel = 'popup';
416
+ }
417
+ else if (this.isChannelAvailable(template, 'email')) {
418
+ defaultChannel = 'email';
419
+ }
420
+ if (!defaultChannel) {
421
+ return;
422
+ }
423
+ const topic = extractTopic(template.RESULT_EXPRESSION);
424
+ const username = (_b = this.auth.currentUser) === null || _b === void 0 ? void 0 : _b.username;
425
+ if (!topic || !username) {
426
+ return;
427
+ }
428
+ try {
429
+ const route = yield this.routeService.createUserRoute(defaultChannel, topic, username);
430
+ this.setChannelRoute(template.ID, defaultChannel, route);
431
+ }
432
+ catch (error) {
433
+ logger.error(`Failed to enable default ${defaultChannel} channel:`, error);
434
+ }
264
435
  });
265
436
  }
266
437
  cancelPendingSubscribe() {
@@ -308,6 +479,18 @@ __decorate([
308
479
  __decorate([
309
480
  observable
310
481
  ], FoundationInboxBase.prototype, "templatesFilter", void 0);
482
+ __decorate([
483
+ NotifyRouteService
484
+ ], FoundationInboxBase.prototype, "routeService", void 0);
485
+ __decorate([
486
+ observable
487
+ ], FoundationInboxBase.prototype, "channelAvailability", void 0);
488
+ __decorate([
489
+ observable
490
+ ], FoundationInboxBase.prototype, "userChannelRoutes", void 0);
491
+ __decorate([
492
+ observable
493
+ ], FoundationInboxBase.prototype, "channelTogglePending", void 0);
311
494
  __decorate([
312
495
  observable
313
496
  ], FoundationInboxBase.prototype, "searchAlertLog", void 0);
@@ -319,6 +319,33 @@ export const ruleAndTemplate = css `
319
319
  font-size: var(--type-ramp-minus-1-font-size);
320
320
  color: var(--neutral-foreground-hint);
321
321
  }
322
+
323
+ .channel-chip-row {
324
+ display: flex;
325
+ align-items: center;
326
+ gap: calc(var(--design-unit) * 1px);
327
+ margin-top: calc(var(--design-unit) * 1px);
328
+ justify-content: flex-end;
329
+ }
330
+
331
+ .channel-chip {
332
+ border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest);
333
+ border-radius: calc(var(--control-corner-radius) * 999px);
334
+ font-size: var(--type-ramp-minus-2-font-size);
335
+
336
+ &[appearance='selected'] {
337
+ background-color: color-mix(in srgb, #7acc79, transparent 20%);
338
+ color: #fff;
339
+ border-color: transparent;
340
+ }
341
+
342
+ &[disabled] {
343
+ opacity: 50%;
344
+ background-color: var(--neutral-layer-3);
345
+ color: var(--neutral-foreground-hint);
346
+ cursor: not-allowed;
347
+ }
348
+ }
322
349
  }
323
350
 
324
351
  .rule {
@@ -238,9 +238,6 @@ export const FoundationInboxTemplate = html `
238
238
  <div class="template-details">
239
239
  <div class="template-name">${(x) => x.NAME}</div>
240
240
  <div class="template-description">${(x) => x.DESCRIPTION}</div>
241
- <div class="template-datetime">
242
- ${(x, c) => getFormattedDate(x.DATETIME)}
243
- </div>
244
241
  </div>
245
242
  <rapid-switch
246
243
  class="template-subscribe-toggle"
@@ -249,6 +246,41 @@ export const FoundationInboxTemplate = html `
249
246
  @click=${(_, c) => c.event.stopPropagation()}
250
247
  ></rapid-switch>
251
248
  </div>
249
+ ${when((x, c) => {
250
+ var _a;
251
+ return (_a = c.parent.auth.currentUser) === null || _a === void 0 ? void 0 : _a.hasPermission(NotifyPermission.NotificationRouteView);
252
+ }, html `
253
+ <div class="channel-chip-row">
254
+ ${when((x, c) => c.parent.isChannelAvailable(x, 'popup'), html `
255
+ <rapid-button
256
+ class="channel-chip"
257
+ appearance=${(x, c) => c.parent.isChannelEnabled(x, 'popup') ? 'selected' : ''}
258
+ ?disabled=${(x, c) => !c.parent.isTemplateSubscribed(x) ||
259
+ c.parent.isChannelTogglePending(x, 'popup')}
260
+ @click=${(x, c) => {
261
+ c.event.stopPropagation();
262
+ c.parent.toggleChannel(x, 'popup');
263
+ }}
264
+ >
265
+ Pop-up
266
+ </rapid-button>
267
+ `)}
268
+ ${when((x, c) => c.parent.isChannelAvailable(x, 'email'), html `
269
+ <rapid-button
270
+ class="channel-chip"
271
+ appearance=${(x, c) => c.parent.isChannelEnabled(x, 'email') ? 'selected' : ''}
272
+ ?disabled=${(x, c) => !c.parent.isTemplateSubscribed(x) ||
273
+ c.parent.isChannelTogglePending(x, 'email')}
274
+ @click=${(x, c) => {
275
+ c.event.stopPropagation();
276
+ c.parent.toggleChannel(x, 'email');
277
+ }}
278
+ >
279
+ Email
280
+ </rapid-button>
281
+ `)}
282
+ </div>
283
+ `)}
252
284
  ${when((x, c) => c.parent.pendingSubscribeTemplateId === x.ID, html `
253
285
  <inbox-subscription
254
286
  inline
@@ -1,4 +1,11 @@
1
1
  import { SEVERITY_CRITICAL, SEVERITY_INFORMATION, SEVERITY_SERIOUS, SEVERITY_WARNING, } from '../foundation-notification-dashboard/types/severity';
2
+ // Matches TOPIC = "VALUE" or TOPIC = 'VALUE'; the backreference keeps the
3
+ // opening and closing quote the same so mismatched quotes don't match.
4
+ const TOPIC_ASSIGNMENT = /TOPIC\s*=\s*(['"])([^'"]+)\1/;
5
+ export function extractTopic(resultExpression) {
6
+ var _a, _b;
7
+ return (_b = (_a = resultExpression === null || resultExpression === void 0 ? void 0 : resultExpression.match(TOPIC_ASSIGNMENT)) === null || _a === void 0 ? void 0 : _a[2]) !== null && _b !== void 0 ? _b : null;
8
+ }
2
9
  export const getFormattedDate = (dateTimeInMills) => {
3
10
  const dateTime = new Date(dateTimeInMills);
4
11
  return `${dateTime.toLocaleDateString()} ${dateTime.toLocaleTimeString()}`;
@@ -1,6 +1,6 @@
1
1
  var _a;
2
2
  import { __decorate } from "tslib";
3
- import { showNotification } from '@genesislcap/foundation-notifications';
3
+ import { showNotification, ToastVerticalEdge, ToastHorizontalEdge, } from '@genesislcap/foundation-notifications';
4
4
  import { UUID } from '@genesislcap/foundation-utils';
5
5
  import { EmptyValue, ExpressionType, JoinOperator, ParamSourceType, ParamType, RightCriteria, nullAndBlankLogicalOperatorValues, LogicalOperator, } from '../../notify.types';
6
6
  import { logger } from '../../utils';
@@ -671,6 +671,8 @@ export function showNotificationError(error) {
671
671
  config: {
672
672
  snackbar: {
673
673
  type: 'error',
674
+ verticalEdge: ToastVerticalEdge.Top,
675
+ horizontalEdge: ToastHorizontalEdge.Right,
674
676
  },
675
677
  },
676
678
  }, 'rapid');