@genesislcap/pbc-notify-ui 1.0.49 → 1.0.50
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/dist/dts/components/foundation-inbox/components/foundation-inbox-counter/foundation-inbox-counter.d.ts.map +1 -1
- package/dist/dts/utils/updateArray.d.ts.map +1 -1
- package/dist/esm/components/foundation-inbox/components/foundation-inbox-counter/foundation-inbox-counter.js +4 -2
- package/dist/esm/utils/updateArray.js +3 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foundation-inbox-counter.d.ts","sourceRoot":"","sources":["../../../../../../src/components/foundation-inbox/components/foundation-inbox-counter/foundation-inbox-counter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,cAAc,EAAc,MAAM,uBAAuB,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"foundation-inbox-counter.d.ts","sourceRoot":"","sources":["../../../../../../src/components/foundation-inbox/components/foundation-inbox-counter/foundation-inbox-counter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,cAAc,EAAc,MAAM,uBAAuB,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAK5E,qBAKa,sBAAuB,SAAQ,cAAc;IAC5C,KAAK,EAAE,MAAM,CAAK;IACN,YAAY,EAAE,sBAAsB,CAAC;IAC7D,OAAO,CAAC,mBAAmB,CAAgB;IAErC,iBAAiB;IASvB,oBAAoB;CAIrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateArray.d.ts","sourceRoot":"","sources":["../../../src/utils/updateArray.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,YAAa,KAAK,CAAC,GAAG,CAAC,WAAW,KAAK,CAAC,GAAG,CAAC,KAAG,KAAK,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"updateArray.d.ts","sourceRoot":"","sources":["../../../src/utils/updateArray.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,YAAa,KAAK,CAAC,GAAG,CAAC,WAAW,KAAK,CAAC,GAAG,CAAC,KAAG,KAAK,CAAC,GAAG,CAgC/E,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { customElement, GenesisElement, observable } from '@genesislcap/web-core
|
|
|
3
3
|
import { FoundationInboxService } from '../../../../services/inbox.service';
|
|
4
4
|
import { FoundationInboxCounterStyles } from './foundation-inbox-counter.styles';
|
|
5
5
|
import { FoundationInboxCounterTemplate } from './foundation-inbox-counter.template';
|
|
6
|
+
import { AlertStatus } from '../../inbox.types';
|
|
6
7
|
let FoundationInboxCounter = class FoundationInboxCounter extends GenesisElement {
|
|
7
8
|
constructor() {
|
|
8
9
|
super(...arguments);
|
|
@@ -15,9 +16,10 @@ let FoundationInboxCounter = class FoundationInboxCounter extends GenesisElement
|
|
|
15
16
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16
17
|
_super.connectedCallback.call(this);
|
|
17
18
|
this.subscriptionHandler = ({ store }) => {
|
|
18
|
-
|
|
19
|
+
const items = ((store === null || store === void 0 ? void 0 : store.items) || []).filter((item) => item.ALERT_STATUS === AlertStatus.NEW);
|
|
20
|
+
this.value = items.length;
|
|
19
21
|
};
|
|
20
|
-
this.inboxService.subscribe(this.subscriptionHandler, false,
|
|
22
|
+
this.inboxService.subscribe(this.subscriptionHandler, false, `ALERT_STATUS=='${AlertStatus.NEW}'`);
|
|
21
23
|
});
|
|
22
24
|
}
|
|
23
25
|
disconnectedCallback() {
|
|
@@ -19,8 +19,9 @@ export const updateArray = (newData, oldData) => {
|
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
else if (newData && (!oldData || oldData.length === 0)) {
|
|
23
|
-
|
|
22
|
+
else if (Array.isArray(newData) && (!oldData || oldData.length === 0)) {
|
|
23
|
+
const inserts = newData.filter((row) => { var _a; return ((_a = row === null || row === void 0 ? void 0 : row.DETAILS) === null || _a === void 0 ? void 0 : _a.OPERATION) === 'INSERT'; });
|
|
24
|
+
oldData = [...new Set(inserts)];
|
|
24
25
|
}
|
|
25
26
|
return oldData;
|
|
26
27
|
};
|