@gooddata/sdk-ui-ext 10.18.0-alpha.9 → 10.18.0-beta.1

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 (132) hide show
  1. package/NOTICE +3 -3
  2. package/esm/index.d.ts +10 -2
  3. package/esm/index.d.ts.map +1 -1
  4. package/esm/index.js +9 -2
  5. package/esm/index.js.map +1 -1
  6. package/esm/internal/translations/de-DE.json +25 -1
  7. package/esm/internal/translations/en-AU.json +25 -1
  8. package/esm/internal/translations/en-GB.json +25 -1
  9. package/esm/internal/translations/en-US.json +16 -1
  10. package/esm/internal/translations/es-419.json +25 -1
  11. package/esm/internal/translations/es-ES.json +25 -1
  12. package/esm/internal/translations/fi-FI.json +25 -1
  13. package/esm/internal/translations/fr-CA.json +25 -1
  14. package/esm/internal/translations/fr-FR.json +25 -1
  15. package/esm/internal/translations/it-IT.json +25 -1
  16. package/esm/internal/translations/ja-JP.json +25 -1
  17. package/esm/internal/translations/nl-NL.json +25 -1
  18. package/esm/internal/translations/pt-BR.json +25 -1
  19. package/esm/internal/translations/pt-PT.json +25 -1
  20. package/esm/internal/translations/zh-HK.json +25 -1
  21. package/esm/internal/translations/zh-Hans.json +25 -1
  22. package/esm/internal/translations/zh-Hant.json +25 -1
  23. package/esm/notificationsPanel/@staging/OrganizationContext/OrganizationContext.d.ts +12 -0
  24. package/esm/notificationsPanel/@staging/OrganizationContext/OrganizationContext.d.ts.map +1 -1
  25. package/esm/notificationsPanel/@staging/OrganizationContext/OrganizationContext.js +10 -1
  26. package/esm/notificationsPanel/@staging/OrganizationContext/OrganizationContext.js.map +1 -1
  27. package/esm/notificationsPanel/@staging/OrganizationContext/useFetchOrganization.d.ts +6 -4
  28. package/esm/notificationsPanel/@staging/OrganizationContext/useFetchOrganization.d.ts.map +1 -1
  29. package/esm/notificationsPanel/@staging/OrganizationContext/useFetchOrganization.js +1 -1
  30. package/esm/notificationsPanel/@staging/OrganizationContext/useFetchOrganization.js.map +1 -1
  31. package/esm/notificationsPanel/Notification/AlertNotification.d.ts +2 -2
  32. package/esm/notificationsPanel/Notification/AlertNotification.d.ts.map +1 -1
  33. package/esm/notificationsPanel/Notification/AlertNotification.js +40 -12
  34. package/esm/notificationsPanel/Notification/AlertNotification.js.map +1 -1
  35. package/esm/notificationsPanel/Notification/DefaultNotification.d.ts +17 -4
  36. package/esm/notificationsPanel/Notification/DefaultNotification.d.ts.map +1 -1
  37. package/esm/notificationsPanel/Notification/DefaultNotification.js +6 -4
  38. package/esm/notificationsPanel/Notification/DefaultNotification.js.map +1 -1
  39. package/esm/notificationsPanel/NotificationFiltersDetail/NotificationFiltersDetail.js +1 -1
  40. package/esm/notificationsPanel/NotificationFiltersDetail/NotificationFiltersDetail.js.map +1 -1
  41. package/esm/notificationsPanel/NotificationFiltersDetail/NotificationFiltersDetailDialog.js +2 -2
  42. package/esm/notificationsPanel/NotificationFiltersDetail/NotificationFiltersDetailDialog.js.map +1 -1
  43. package/esm/notificationsPanel/NotificationTriggersDetail/NotificationTriggersDetail.d.ts +4 -1
  44. package/esm/notificationsPanel/NotificationTriggersDetail/NotificationTriggersDetail.d.ts.map +1 -1
  45. package/esm/notificationsPanel/NotificationTriggersDetail/NotificationTriggersDetail.js +9 -5
  46. package/esm/notificationsPanel/NotificationTriggersDetail/NotificationTriggersDetail.js.map +1 -1
  47. package/esm/notificationsPanel/NotificationTriggersDetail/NotificationTriggersDetailDialog.d.ts +4 -1
  48. package/esm/notificationsPanel/NotificationTriggersDetail/NotificationTriggersDetailDialog.d.ts.map +1 -1
  49. package/esm/notificationsPanel/NotificationTriggersDetail/NotificationTriggersDetailDialog.js +1 -1
  50. package/esm/notificationsPanel/NotificationTriggersDetail/NotificationTriggersDetailDialog.js.map +1 -1
  51. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsList.d.ts +66 -4
  52. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsList.d.ts.map +1 -1
  53. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsList.js +16 -15
  54. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsList.js.map +1 -1
  55. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsListEmptyState.d.ts +9 -2
  56. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsListEmptyState.d.ts.map +1 -1
  57. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsListEmptyState.js +4 -2
  58. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsListEmptyState.js.map +1 -1
  59. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsListErrorState.d.ts +9 -2
  60. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsListErrorState.d.ts.map +1 -1
  61. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsListErrorState.js +4 -2
  62. package/esm/notificationsPanel/NotificationsList/DefaultNotificationsListErrorState.js.map +1 -1
  63. package/esm/notificationsPanel/NotificationsList/DefaultSkeletonItem.d.ts +19 -0
  64. package/esm/notificationsPanel/NotificationsList/DefaultSkeletonItem.d.ts.map +1 -0
  65. package/esm/notificationsPanel/NotificationsList/DefaultSkeletonItem.js +9 -0
  66. package/esm/notificationsPanel/NotificationsList/DefaultSkeletonItem.js.map +1 -0
  67. package/esm/notificationsPanel/NotificationsPanel/DefaultNotificationsPanel.d.ts +95 -5
  68. package/esm/notificationsPanel/NotificationsPanel/DefaultNotificationsPanel.d.ts.map +1 -1
  69. package/esm/notificationsPanel/NotificationsPanel/DefaultNotificationsPanel.js +7 -5
  70. package/esm/notificationsPanel/NotificationsPanel/DefaultNotificationsPanel.js.map +1 -1
  71. package/esm/notificationsPanel/NotificationsPanel/{DefaultOpenNotificationsPanelButton.d.ts → DefaultNotificationsPanelButton.d.ts} +8 -6
  72. package/esm/notificationsPanel/NotificationsPanel/DefaultNotificationsPanelButton.d.ts.map +1 -0
  73. package/esm/notificationsPanel/NotificationsPanel/{DefaultOpenNotificationsPanelButton.js → DefaultNotificationsPanelButton.js} +7 -5
  74. package/esm/notificationsPanel/NotificationsPanel/DefaultNotificationsPanelButton.js.map +1 -0
  75. package/esm/notificationsPanel/NotificationsPanel/DefaultNotificationsPanelHeader.d.ts +8 -4
  76. package/esm/notificationsPanel/NotificationsPanel/DefaultNotificationsPanelHeader.d.ts.map +1 -1
  77. package/esm/notificationsPanel/NotificationsPanel/DefaultNotificationsPanelHeader.js +6 -4
  78. package/esm/notificationsPanel/NotificationsPanel/DefaultNotificationsPanelHeader.js.map +1 -1
  79. package/esm/notificationsPanel/NotificationsPanel/NotificationsPanel.d.ts +75 -11
  80. package/esm/notificationsPanel/NotificationsPanel/NotificationsPanel.d.ts.map +1 -1
  81. package/esm/notificationsPanel/NotificationsPanel/NotificationsPanel.js +23 -11
  82. package/esm/notificationsPanel/NotificationsPanel/NotificationsPanel.js.map +1 -1
  83. package/esm/notificationsPanel/bem.d.ts +5 -0
  84. package/esm/notificationsPanel/bem.d.ts.map +1 -1
  85. package/esm/notificationsPanel/bem.js +6 -1
  86. package/esm/notificationsPanel/bem.js.map +1 -1
  87. package/esm/notificationsPanel/components/Popup.d.ts +9 -0
  88. package/esm/notificationsPanel/components/Popup.d.ts.map +1 -0
  89. package/esm/notificationsPanel/components/Popup.js +15 -0
  90. package/esm/notificationsPanel/components/Popup.js.map +1 -0
  91. package/esm/notificationsPanel/data/NotificationsContext.d.ts +16 -1
  92. package/esm/notificationsPanel/data/NotificationsContext.d.ts.map +1 -1
  93. package/esm/notificationsPanel/data/NotificationsContext.js +9 -3
  94. package/esm/notificationsPanel/data/NotificationsContext.js.map +1 -1
  95. package/esm/notificationsPanel/data/useFetchNotifications.d.ts +11 -8
  96. package/esm/notificationsPanel/data/useFetchNotifications.d.ts.map +1 -1
  97. package/esm/notificationsPanel/data/useFetchNotifications.js +18 -7
  98. package/esm/notificationsPanel/data/useFetchNotifications.js.map +1 -1
  99. package/esm/notificationsPanel/data/useNotificationFiltersDetail.d.ts +1 -0
  100. package/esm/notificationsPanel/data/useNotificationFiltersDetail.d.ts.map +1 -1
  101. package/esm/notificationsPanel/data/useNotificationFiltersDetail.js +34 -17
  102. package/esm/notificationsPanel/data/useNotificationFiltersDetail.js.map +1 -1
  103. package/esm/notificationsPanel/data/useNotifications.d.ts +24 -4
  104. package/esm/notificationsPanel/data/useNotifications.d.ts.map +1 -1
  105. package/esm/notificationsPanel/data/useNotifications.js +15 -10
  106. package/esm/notificationsPanel/data/useNotifications.js.map +1 -1
  107. package/esm/notificationsPanel/types.d.ts +3 -1
  108. package/esm/notificationsPanel/types.d.ts.map +1 -1
  109. package/esm/notificationsPanel/types.js +1 -1
  110. package/esm/notificationsPanel/types.js.map +1 -1
  111. package/esm/sdk-ui-ext.d.ts +349 -52
  112. package/package.json +17 -18
  113. package/src/notificationsPanel/Notification/DefaultNotification.scss +28 -5
  114. package/src/notificationsPanel/NotificationsList/DefaultNotificationsList.scss +3 -0
  115. package/src/notificationsPanel/NotificationsPanel/DefaultNotificationsPanel.scss +8 -4
  116. package/src/notificationsPanel/NotificationsPanel/{DefaultOpenNotificationsPanelButton.scss → DefaultNotificationsPanelButton.scss} +2 -2
  117. package/src/notificationsPanel/NotificationsPanel/DefaultNotificationsPanelHeader.scss +8 -3
  118. package/src/notificationsPanel/notificationPanel.scss +9 -4
  119. package/styles/css/main.css +987 -51
  120. package/styles/css/main.css.map +1 -1
  121. package/esm/notificationsPanel/NotificationsPanel/DefaultOpenNotificationsPanelButton.d.ts.map +0 -1
  122. package/esm/notificationsPanel/NotificationsPanel/DefaultOpenNotificationsPanelButton.js.map +0 -1
  123. package/esm/notificationsPanel/components/Skeleton.d.ts +0 -8
  124. package/esm/notificationsPanel/components/Skeleton.d.ts.map +0 -1
  125. package/esm/notificationsPanel/components/Skeleton.js +0 -11
  126. package/esm/notificationsPanel/components/Skeleton.js.map +0 -1
  127. package/esm/notificationsPanel/components/VirtualList.d.ts +0 -15
  128. package/esm/notificationsPanel/components/VirtualList.d.ts.map +0 -1
  129. package/esm/notificationsPanel/components/VirtualList.js +0 -77
  130. package/esm/notificationsPanel/components/VirtualList.js.map +0 -1
  131. package/src/notificationsPanel/components/Skeleton.scss +0 -25
  132. package/src/notificationsPanel/components/VirtualList.scss +0 -26
@@ -3,20 +3,23 @@ import React from "react";
3
3
  import { ILocale } from "@gooddata/sdk-ui";
4
4
  import { INotification } from "@gooddata/sdk-model";
5
5
  import { INotificationsPanelHeaderComponentProps } from "./DefaultNotificationsPanelHeader.js";
6
- import { IOpenNotificationsPanelButtonComponentProps } from "./DefaultOpenNotificationsPanelButton.js";
6
+ import { INotificationsPanelButtonComponentProps } from "./DefaultNotificationsPanelButton.js";
7
7
  import { INotificationsPanelComponentProps } from "./DefaultNotificationsPanel.js";
8
8
  import { INotificationsListComponentProps } from "../NotificationsList/DefaultNotificationsList.js";
9
9
  import { INotificationsListEmptyStateComponentProps } from "../NotificationsList/DefaultNotificationsListEmptyState.js";
10
10
  import { INotificationsListErrorStateComponentProps } from "../NotificationsList/DefaultNotificationsListErrorState.js";
11
11
  import { INotificationComponentProps } from "../Notification/DefaultNotification.js";
12
+ import { INotificationSkeletonItemComponentProps } from "../NotificationsList/DefaultSkeletonItem.js";
12
13
  /**
13
- * @alpha
14
+ * @public
14
15
  */
15
16
  export interface INotificationsPanelCustomComponentsProps {
16
17
  /**
17
18
  * Custom open notifications panel button component.
19
+ *
20
+ * - Required if renderInline is not enabled.
18
21
  */
19
- OpenNotificationsPanelButton: React.ComponentType<IOpenNotificationsPanelButtonComponentProps>;
22
+ NotificationsPanelButton?: React.ComponentType<INotificationsPanelButtonComponentProps>;
20
23
  /**
21
24
  * Custom notifications panel component.
22
25
  */
@@ -41,36 +44,97 @@ export interface INotificationsPanelCustomComponentsProps {
41
44
  * Custom notification component.
42
45
  */
43
46
  Notification?: React.ComponentType<INotificationComponentProps>;
47
+ /**
48
+ * Custom notification skeleton item component.
49
+ */
50
+ NotificationSkeletonItem?: React.ComponentType<INotificationSkeletonItemComponentProps>;
44
51
  }
45
52
  /**
46
- * @alpha
53
+ * @public
47
54
  */
48
55
  export interface INotificationsPanelProps extends INotificationsPanelCustomComponentsProps {
56
+ /**
57
+ * Locale to use.
58
+ */
59
+ locale?: ILocale;
49
60
  /**
50
61
  * Backend to use.
62
+ *
63
+ * - If not defined, the backend from the BackendProvider context will be used.
51
64
  */
52
65
  backend?: IAnalyticalBackend;
53
66
  /**
54
67
  * Workspace ID to use.
68
+ *
69
+ * - If not defined, the workspace ID from the WorkspaceProvider context will be used.
70
+ * - If workspace is not defined and there is no WorkspaceProvider, notifications will be loaded from all workspaces.
55
71
  */
56
72
  workspace?: string;
73
+ /**
74
+ * Enable inline rendering of the notifications panel
75
+ *
76
+ * - Default: false
77
+ * - If enabled, NotificationsPanelButton won't be rendered, and NotificationsPanel won't be rendered inside modal
78
+ * - This is useful when you want to render notifications panel in a custom modal.
79
+ */
80
+ renderInline?: boolean;
57
81
  /**
58
82
  * Refresh interval in milliseconds.
59
- * Default is 10 minutes.
60
- * If set to 0, notifications will not be refreshed automatically.
83
+ *
84
+ * - Default: 600000 (10 minutes)
85
+ * - If set to 0, notifications won't be refreshed automatically.
61
86
  */
62
87
  refreshInterval?: number;
63
88
  /**
64
- * Locale to use.
89
+ * Number of notifications to load per page.
90
+ *
91
+ * - Default: 50
65
92
  */
66
- locale?: ILocale;
93
+ itemsPerPage?: number;
94
+ /**
95
+ * Number of skeleton items to render when loading notifications.
96
+ *
97
+ * - Default: 5
98
+ */
99
+ skeletonItemsCount?: number;
100
+ /**
101
+ * Height of the item in notifications list in pixels.
102
+ *
103
+ * - Default: 52
104
+ */
105
+ itemHeight?: number;
106
+ /**
107
+ * Optionally override max width of the notifications panel.
108
+ *
109
+ * - Does not have effect when renderInline is true - inline rendering always fills the parent container.
110
+ */
111
+ maxWidth?: number | string;
112
+ /**
113
+ * Maximum height of the notifications list in pixels.
114
+ *
115
+ * - Default: 527
116
+ * - Does not have effect when renderInline is true - inline rendering always fills the parent container.
117
+ */
118
+ maxListHeight?: number;
119
+ /**
120
+ * Gap between notification items in the list in pixels.
121
+ *
122
+ * - Default: 10
123
+ */
124
+ itemsGap?: number;
125
+ /**
126
+ * Padding of the notification item (from left and right) in pixels.
127
+ *
128
+ * - Default: 15
129
+ */
130
+ itemPadding?: number;
67
131
  /**
68
- * Handler for notification click.
132
+ * Callback for notification click.
69
133
  */
70
- onNotificationClick: (notification: INotification) => void;
134
+ onNotificationClick?: (notification: INotification) => void;
71
135
  }
72
136
  /**
73
- * @alpha
137
+ * @public
74
138
  */
75
139
  export declare function NotificationsPanel(props: INotificationsPanelProps): React.JSX.Element;
76
140
  //# sourceMappingURL=NotificationsPanel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationsPanel.d.ts","sourceRoot":"","sources":["../../../src/notificationsPanel/NotificationsPanel/NotificationsPanel.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAiD,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAe,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKjE,OAAO,EACH,uCAAuC,EAE1C,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,2CAA2C,EAAE,MAAM,0CAA0C,CAAC;AACvG,OAAO,EAA6B,iCAAiC,EAAE,MAAM,gCAAgC,CAAC;AAE9G,OAAO,EAEH,gCAAgC,EACnC,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAEH,0CAA0C,EAC7C,MAAM,4DAA4D,CAAC;AACpE,OAAO,EAEH,0CAA0C,EAC7C,MAAM,4DAA4D,CAAC;AACpE,OAAO,EAAuB,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAM1G;;GAEG;AACH,MAAM,WAAW,wCAAwC;IACrD;;OAEG;IACH,4BAA4B,EAAE,KAAK,CAAC,aAAa,CAAC,2CAA2C,CAAC,CAAC;IAE/F;;OAEG;IACH,kBAAkB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,iCAAiC,CAAC,CAAC;IAE5E;;OAEG;IACH,wBAAwB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,uCAAuC,CAAC,CAAC;IAExF;;OAEG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,gCAAgC,CAAC,CAAC;IAE1E;;OAEG;IACH,2BAA2B,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,0CAA0C,CAAC,CAAC;IAE9F;;OAEG;IACH,2BAA2B,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,0CAA0C,CAAC,CAAC;IAC9F;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,2BAA2B,CAAC,CAAC;CACnE;AAED;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,wCAAwC;IACtF;;OAEG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAE7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,mBAAmB,EAAE,CAAC,YAAY,EAAE,aAAa,KAAK,IAAI,CAAC;CAC9D;AAOD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,wBAAwB,qBAYjE"}
1
+ {"version":3,"file":"NotificationsPanel.d.ts","sourceRoot":"","sources":["../../../src/notificationsPanel/NotificationsPanel/NotificationsPanel.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAiD,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAe,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAOjE,OAAO,EACH,uCAAuC,EAE1C,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAA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AAC;IAE7B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE3B;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,mBAAmB,CAAC,EAAE,CAAC,YAAY,EAAE,aAAa,KAAK,IAAI,CAAC;CAC/D;AAOD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,wBAAwB,qBAiBjE"}
@@ -1,59 +1,69 @@
1
1
  import React, { useCallback, useMemo, useRef, useState } from "react";
2
2
  import { assertNever } from "@gooddata/sdk-model";
3
+ import { Overlay, alignConfigToAlignPoint } from "@gooddata/sdk-ui-kit";
4
+ import { invariant } from "ts-invariant";
3
5
  import { NotificationsProvider, useNotificationsContext } from "../data/NotificationsContext.js";
4
6
  import { OrganizationProvider } from "../@staging/OrganizationContext/OrganizationContext.js";
5
7
  import { IntlWrapper } from "../localization/IntlWrapper.js";
6
8
  import { DefaultNotificationsPanelHeader, } from "./DefaultNotificationsPanelHeader.js";
7
9
  import { DefaultNotificationsPanel } from "./DefaultNotificationsPanel.js";
8
- import { Overlay, alignConfigToAlignPoint } from "@gooddata/sdk-ui-kit";
9
10
  import { DefaultNotificationsList, } from "../NotificationsList/DefaultNotificationsList.js";
10
11
  import { DefaultNotificationsListEmptyState, } from "../NotificationsList/DefaultNotificationsListEmptyState.js";
11
12
  import { DefaultNotificationsListErrorState, } from "../NotificationsList/DefaultNotificationsListErrorState.js";
12
13
  import { DefaultNotification } from "../Notification/DefaultNotification.js";
14
+ import { DefaultNotificationSkeletonItem, } from "../NotificationsList/DefaultSkeletonItem.js";
13
15
  const ALIGN_POINTS = [
14
16
  alignConfigToAlignPoint({ triggerAlignPoint: "bottom-right", overlayAlignPoint: "top-right" }),
17
+ alignConfigToAlignPoint({ triggerAlignPoint: "bottom-left", overlayAlignPoint: "top-left" }),
18
+ alignConfigToAlignPoint({ triggerAlignPoint: "top-right", overlayAlignPoint: "bottom-right" }),
19
+ alignConfigToAlignPoint({ triggerAlignPoint: "top-left", overlayAlignPoint: "bottom-left" }),
15
20
  ];
16
21
  /**
17
22
  * 10 minutes in milliseconds.
18
23
  */
19
24
  const TEN_MINUTES = 1000 * 60 * 10;
20
25
  /**
21
- * @alpha
26
+ * @public
22
27
  */
23
28
  export function NotificationsPanel(props) {
24
- const { locale, refreshInterval = TEN_MINUTES, backend, workspace } = props;
29
+ const { locale, refreshInterval = TEN_MINUTES, itemsPerPage = 50, backend, workspace } = props;
25
30
  return (React.createElement(OrganizationProvider, null,
26
- React.createElement(NotificationsProvider, { backend: backend, workspace: workspace, refreshInterval: refreshInterval },
31
+ React.createElement(NotificationsProvider, { backend: backend, workspace: workspace, refreshInterval: refreshInterval, itemsPerPage: itemsPerPage },
27
32
  React.createElement(IntlWrapper, { locale: locale },
28
33
  React.createElement(NotificationsPanelController, { ...props })))));
29
34
  }
30
35
  /**
31
36
  * @internal
32
37
  */
33
- function NotificationsPanelController({ OpenNotificationsPanelButton, NotificationsPanel = DefaultNotificationsPanel, NotificationsPanelHeader = DefaultNotificationsPanelHeader, NotificationsList = DefaultNotificationsList, NotificationsListEmptyState = DefaultNotificationsListEmptyState, NotificationsListErrorState = DefaultNotificationsListErrorState, Notification = DefaultNotification, onNotificationClick, }) {
38
+ function NotificationsPanelController({ NotificationsPanelButton, NotificationsPanel = DefaultNotificationsPanel, NotificationsPanelHeader = DefaultNotificationsPanelHeader, NotificationsList = DefaultNotificationsList, NotificationsListEmptyState = DefaultNotificationsListEmptyState, NotificationsListErrorState = DefaultNotificationsListErrorState, Notification = DefaultNotification, NotificationSkeletonItem = DefaultNotificationSkeletonItem, onNotificationClick, renderInline = false, itemHeight = 52, maxWidth = 370, maxListHeight = 527, itemsGap = 10, itemPadding = 15, skeletonItemsCount = 5, }) {
34
39
  const { buttonRef, isOpen, openNotificationsPanel, closeNotificationsPanel, toggleNotificationsPanel,
35
40
  //
36
41
  activeView, changeActiveView,
37
42
  //
38
- markNotificationAsRead, markAllNotificationsAsRead, unreadNotificationsCount, activeNotifications,
43
+ markNotificationAsRead, markAllNotificationsAsRead, unreadNotificationsCount, hasUnreadNotifications, activeNotifications,
39
44
  //
40
45
  status, error, loadNextPage, hasNextPage, } = useNotificationsPanelController();
41
46
  const handleNotificationClick = useCallback((notification) => {
42
- markNotificationAsRead(notification.id);
47
+ if (!notification.isRead) {
48
+ markNotificationAsRead(notification.id);
49
+ }
43
50
  closeNotificationsPanel();
44
51
  onNotificationClick?.(notification);
45
52
  }, [markNotificationAsRead, closeNotificationsPanel, onNotificationClick]);
53
+ const notificationsPanel = (React.createElement(NotificationsPanel, { NotificationsPanelHeader: NotificationsPanelHeader, NotificationsList: NotificationsList, NotificationsListEmptyState: NotificationsListEmptyState, NotificationsListErrorState: NotificationsListErrorState, Notification: Notification, NotificationSkeletonItem: NotificationSkeletonItem, toggleNotificationsPanel: toggleNotificationsPanel, openNotificationsPanel: openNotificationsPanel, closeNotificationsPanel: closeNotificationsPanel, activeView: activeView, changeActiveView: changeActiveView, markNotificationAsRead: markNotificationAsRead, markAllNotificationsAsRead: markAllNotificationsAsRead, unreadNotificationsCount: unreadNotificationsCount, hasUnreadNotifications: hasUnreadNotifications, activeNotifications: activeNotifications, onNotificationClick: handleNotificationClick, status: status, error: error, loadNextPage: loadNextPage, hasNextPage: hasNextPage, itemHeight: itemHeight, itemsGap: itemsGap, itemPadding: itemPadding, skeletonItemsCount: skeletonItemsCount, maxListHeight: renderInline ? undefined : maxListHeight }));
54
+ if (renderInline) {
55
+ return notificationsPanel;
56
+ }
57
+ invariant(NotificationsPanelButton, "If renderInline is not enabled, NotificationsPanelButton is required.");
46
58
  return (React.createElement(React.Fragment, null,
47
- React.createElement(OpenNotificationsPanelButton, { buttonRef: buttonRef, isNotificationPanelOpen: isOpen, toggleNotificationPanel: toggleNotificationsPanel, openNotificationPanel: openNotificationsPanel, closeNotificationPanel: closeNotificationsPanel, hasUnreadNotifications: unreadNotificationsCount > 0 }),
48
- isOpen ? (React.createElement(Overlay, { isModal: false, alignTo: buttonRef.current, alignPoints: ALIGN_POINTS, closeOnEscape: true, closeOnOutsideClick: true, closeOnParentScroll: false, closeOnMouseDrag: false, onClose: closeNotificationsPanel },
49
- React.createElement(NotificationsPanel, { NotificationsPanelHeader: NotificationsPanelHeader, NotificationsList: NotificationsList, NotificationsListEmptyState: NotificationsListEmptyState, NotificationsListErrorState: NotificationsListErrorState, Notification: Notification, toggleNotificationsPanel: toggleNotificationsPanel, openNotificationsPanel: openNotificationsPanel, closeNotificationsPanel: closeNotificationsPanel, activeView: activeView, changeActiveView: changeActiveView, markNotificationAsRead: markNotificationAsRead, markAllNotificationsAsRead: markAllNotificationsAsRead, unreadNotificationsCount: unreadNotificationsCount, activeNotifications: activeNotifications, onNotificationClick: handleNotificationClick, status: status, error: error, loadNextPage: loadNextPage, hasNextPage: hasNextPage }))) : null));
59
+ React.createElement(NotificationsPanelButton, { buttonRef: buttonRef, isNotificationPanelOpen: isOpen, toggleNotificationPanel: toggleNotificationsPanel, openNotificationPanel: openNotificationsPanel, closeNotificationPanel: closeNotificationsPanel, hasUnreadNotifications: hasUnreadNotifications }),
60
+ isOpen ? (React.createElement(Overlay, { isModal: false, alignTo: buttonRef.current, alignPoints: ALIGN_POINTS, closeOnEscape: true, closeOnOutsideClick: true, closeOnParentScroll: false, closeOnMouseDrag: false, onClose: closeNotificationsPanel, width: "100%", maxWidth: maxWidth }, notificationsPanel)) : null));
50
61
  }
51
62
  function useNotificationsPanelController() {
52
63
  const [isOpen, setIsOpen] = useState(false);
53
64
  const openNotificationsPanel = useCallback(() => setIsOpen(true), []);
54
65
  const closeNotificationsPanel = useCallback(() => setIsOpen(false), []);
55
66
  const toggleNotificationsPanel = useCallback(() => setIsOpen((x) => !x), []);
56
- //
57
67
  const changeActiveView = useCallback((view) => setActiveView(view), []);
58
68
  const [activeView, setActiveView] = useState("unread");
59
69
  const buttonRef = useRef(null);
@@ -73,6 +83,7 @@ function useNotificationsPanelController() {
73
83
  const error = activeView === "unread" ? unreadNotificationsError : notificationsError;
74
84
  const loadNextPage = activeView === "unread" ? unreadNotificationsLoadNextPage : notificationsLoadNextPage;
75
85
  const hasNextPage = activeView === "unread" ? unreadNotificationsHasNextPage : notificationsHasNextPage;
86
+ const hasUnreadNotifications = unreadNotificationsCount > 0;
76
87
  return {
77
88
  buttonRef,
78
89
  isOpen,
@@ -85,6 +96,7 @@ function useNotificationsPanelController() {
85
96
  //
86
97
  markNotificationAsRead,
87
98
  markAllNotificationsAsRead,
99
+ hasUnreadNotifications,
88
100
  unreadNotificationsCount,
89
101
  activeNotifications,
90
102
  //
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationsPanel.js","sourceRoot":"","sources":["../../../src/notificationsPanel/NotificationsPanel/NotificationsPanel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,WAAW,EAAiB,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AACjG,OAAO,EAAE,oBAAoB,EAAE,MAAM,wDAAwD,CAAC;AAC9F,OAAO,EAAE,WAAW,EAAE,MAAM,gCAA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wB,EACxB,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,EAC1B,sBAAsB,GACzB,GAAG,uBAAuB,EAAE,CAAC;IAE9B,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,EAAE;QACrC,QAAQ,UAAU,EAAE,CAAC;YACjB,KAAK,QAAQ;gBACT,OAAO,mBAAmB,CAAC;YAC/B,KAAK,KAAK;gBACN,OAAO,aAAa,CAAC;YACzB;gBACI,WAAW,CAAC,UAAU,CAAC,CAAC;gBACxB,OAAO,EAAE,CAAC;QAClB,CAAC;IACL,CAAC,EAAE,CAAC,UAAU,EAAE,mBAAmB,EAAE,aAAa,CAAC,CAAC,CAAC;IAErD,MAAM,MAAM,GAAG,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,mBAAmB,CAAC;IAEzF,MAAM,KAAK,GAAG,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,kBAAkB,CAAC;IAEtF,MAAM,YAAY,GACd,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAC,yBAAyB,CAAC;IAE1F,MAAM,WAAW,GAAG,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC,wBAAwB,CAAC;IAExG,OAAO;QACH,SAAS;QACT,MAAM;QACN,sBAAsB;QACtB,uBAAuB;QACvB,wBAAwB;QACxB,EAAE;QACF,UAAU;QACV,gBAAgB;QAChB,EAAE;QACF,sBAAsB;QACtB,0BAA0B;QAC1B,wBAAwB;QACxB,mBAAmB;QACnB,EAAE;QACF,MAAM;QACN,KAAK;QACL,YAAY;QACZ,WAAW;KACd,CAAC;AACN,CAAC"}
1
+ {"version":3,"file":"NotificationsPanel.js","sourceRoot":"","sources":["../../../src/notificationsPanel/NotificationsPanel/NotificationsPanel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAA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sBAAsB;QACtB,wBAAwB;QACxB,mBAAmB;QACnB,EAAE;QACF,MAAM;QACN,KAAK;QACL,YAAY;QACZ,WAAW;KACd,CAAC;AACN,CAAC"}
@@ -1,3 +1,8 @@
1
+ /**
2
+ * BEM factory for sdk-ui-ext
3
+ *
4
+ * @internal
5
+ */
1
6
  export declare const bem: (block: `gd-ui-ext-${string}`) => {
2
7
  b: (props?: import("@gooddata/sdk-ui-kit").StyleProps) => string;
3
8
  e: (element: string, props?: import("@gooddata/sdk-ui-kit").StyleProps) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"bem.d.ts","sourceRoot":"","sources":["../../src/notificationsPanel/bem.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,GAAG,UAAW,aAAa,MAAM,EAAE;;;CAAmC,CAAC"}
1
+ {"version":3,"file":"bem.d.ts","sourceRoot":"","sources":["../../src/notificationsPanel/bem.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,GAAG,UAAW,aAAa,MAAM,EAAE;;;CAAmC,CAAC"}
@@ -1,4 +1,9 @@
1
- // (C) 2024 GoodData Corporation
1
+ // (C) 2024-2025 GoodData Corporation
2
2
  import { bemFactory } from "@gooddata/sdk-ui-kit";
3
+ /**
4
+ * BEM factory for sdk-ui-ext
5
+ *
6
+ * @internal
7
+ */
3
8
  export const bem = (block) => bemFactory(block);
4
9
  //# sourceMappingURL=bem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bem.js","sourceRoot":"","sources":["../../src/notificationsPanel/bem.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,KAA4B,EAAE,EAAE,CAAC,UAAU,CAAc,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"bem.js","sourceRoot":"","sources":["../../src/notificationsPanel/bem.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD;;;;GAIG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,KAA4B,EAAE,EAAE,CAAC,UAAU,CAAc,KAAK,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ export declare function Popup({ children, popup, }: {
3
+ children: ({ toggle, id }: {
4
+ toggle: () => void;
5
+ id: string;
6
+ }) => React.ReactNode;
7
+ popup: React.ReactNode;
8
+ }): React.JSX.Element;
9
+ //# sourceMappingURL=Popup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Popup.d.ts","sourceRoot":"","sources":["../../../src/notificationsPanel/components/Popup.tsx"],"names":[],"mappings":"AACA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAM7D,wBAAgB,KAAK,CAAC,EAClB,QAAQ,EACR,KAAK,GACR,EAAE;IACC,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,IAAI,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC;IAClF,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,qBAsBA"}
@@ -0,0 +1,15 @@
1
+ // (C) 2024-2025 GoodData Corporation
2
+ import React, { useRef, useState, useCallback } from "react";
3
+ import { Bubble } from "@gooddata/sdk-ui-kit";
4
+ import { v4 as uuidv4 } from "uuid";
5
+ const ALIGN_POINTS = [{ align: "bc tr" }, { align: "tc br" }];
6
+ export function Popup({ children, popup, }) {
7
+ const [isOpen, setIsOpen] = useState(false);
8
+ const { current: id } = useRef(`popup-${uuidv4()}`);
9
+ const toggle = useCallback(() => setIsOpen((x) => !x), []);
10
+ const close = useCallback(() => setIsOpen(false), []);
11
+ return (React.createElement(React.Fragment, null,
12
+ children({ toggle, id }),
13
+ isOpen ? (React.createElement(Bubble, { alignPoints: ALIGN_POINTS, alignTo: `#${id}`, closeOnOutsideClick: true, closeOnParentScroll: true, onClose: close }, popup)) : null));
14
+ }
15
+ //# sourceMappingURL=Popup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Popup.js","sourceRoot":"","sources":["../../../src/notificationsPanel/components/Popup.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,MAAM,YAAY,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;AAE9D,MAAM,UAAU,KAAK,CAAC,EAClB,QAAQ,EACR,KAAK,GAIR;IACG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC,SAAS,MAAM,EAAE,EAAE,CAAC,CAAC;IACpD,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC3D,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;IAEtD,OAAO,CACH;QACK,QAAQ,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;QACxB,MAAM,CAAC,CAAC,CAAC,CACN,oBAAC,MAAM,IACH,WAAW,EAAE,YAAY,EACzB,OAAO,EAAE,IAAI,EAAE,EAAE,EACjB,mBAAmB,QACnB,mBAAmB,QACnB,OAAO,EAAE,KAAK,IAEb,KAAK,CACD,CACZ,CAAC,CAAC,CAAC,IAAI,CACT,CACN,CAAC;AACN,CAAC"}
@@ -1,27 +1,42 @@
1
1
  import React from "react";
2
2
  import { IAnalyticalBackend } from "@gooddata/sdk-backend-spi";
3
3
  import { useNotifications } from "./useNotifications.js";
4
+ /**
5
+ * @internal
6
+ */
4
7
  export type INotificationsContext = ReturnType<typeof useNotifications>;
8
+ /**
9
+ * @internal
10
+ */
5
11
  export declare const useNotificationsContext: () => {
6
12
  notifications: import("@gooddata/sdk-model").INotification[];
7
13
  notificationsStatus: "error" | "loading" | "pending" | "success";
8
14
  notificationsError: import("@gooddata/sdk-ui").GoodDataSdkError;
9
15
  notificationsHasNextPage: boolean;
10
16
  notificationsLoadNextPage: () => void;
17
+ notificationsReset: () => void;
11
18
  unreadNotifications: import("@gooddata/sdk-model").INotification[];
12
19
  unreadNotificationsStatus: "error" | "loading" | "pending" | "success";
13
20
  unreadNotificationsError: import("@gooddata/sdk-ui").GoodDataSdkError;
14
21
  unreadNotificationsHasNextPage: boolean;
15
22
  unreadNotificationsLoadNextPage: () => void;
23
+ unreadNotificationsReset: () => void;
16
24
  unreadNotificationsCount: number;
17
25
  markNotificationAsRead: (notificationId: string) => Promise<void>;
18
26
  markAllNotificationsAsRead: () => Promise<void>;
19
27
  };
28
+ /**
29
+ * @internal
30
+ */
20
31
  export interface INotificationsProviderProps {
21
32
  backend?: IAnalyticalBackend;
22
33
  workspace?: string;
23
34
  children?: React.ReactNode;
24
- refreshInterval?: number;
35
+ refreshInterval: number;
36
+ itemsPerPage: number;
25
37
  }
38
+ /**
39
+ * @internal
40
+ */
26
41
  export declare const NotificationsProvider: React.FC<INotificationsProviderProps>;
27
42
  //# sourceMappingURL=NotificationsContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationsContext.d.ts","sourceRoot":"","sources":["../../../src/notificationsPanel/data/NotificationsContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAKxE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;CAMnC,CAAC;AAEF,MAAM,WAAW,2BAA2B;IACxC,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CASvE,CAAC"}
1
+ {"version":3,"file":"NotificationsContext.d.ts","sourceRoot":"","sources":["../../../src/notificationsPanel/data/NotificationsContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAKxE;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;CAMnC,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,2BAA2B;IACxC,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAUvE,CAAC"}
@@ -1,9 +1,12 @@
1
- // (C) 2019-2024 GoodData Corporation
1
+ // (C) 2019-2025 GoodData Corporation
2
2
  import React from "react";
3
3
  import { useNotifications } from "./useNotifications.js";
4
4
  import { UnexpectedSdkError } from "@gooddata/sdk-ui";
5
5
  const NotificationsContext = React.createContext(null);
6
6
  NotificationsContext.displayName = "NotificationsContext";
7
+ /**
8
+ * @internal
9
+ */
7
10
  export const useNotificationsContext = () => {
8
11
  const context = React.useContext(NotificationsContext);
9
12
  if (!context) {
@@ -11,8 +14,11 @@ export const useNotificationsContext = () => {
11
14
  }
12
15
  return context;
13
16
  };
14
- export const NotificationsProvider = ({ children, backend, workspace, refreshInterval, }) => {
15
- const notifications = useNotifications({ backend, workspace, refreshInterval });
17
+ /**
18
+ * @internal
19
+ */
20
+ export const NotificationsProvider = ({ children, backend, workspace, refreshInterval, itemsPerPage, }) => {
21
+ const notifications = useNotifications({ backend, workspace, refreshInterval, itemsPerPage });
16
22
  return React.createElement(NotificationsContext.Provider, { value: notifications }, children);
17
23
  };
18
24
  //# sourceMappingURL=NotificationsContext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationsContext.js","sourceRoot":"","sources":["../../../src/notificationsPanel/data/NotificationsContext.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAItD,MAAM,oBAAoB,GAAG,KAAK,CAAC,aAAa,CAA+B,IAAI,CAAC,CAAC;AACrF,oBAAoB,CAAC,WAAW,GAAG,sBAAsB,CAAC;AAE1D,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,EAAE;IACxC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACvD,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,IAAI,kBAAkB,CAAC,qEAAqE,CAAC,CAAC;IACxG,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AASF,MAAM,CAAC,MAAM,qBAAqB,GAA0C,CAAC,EACzE,QAAQ,EACR,OAAO,EACP,SAAS,EACT,eAAe,GAClB,EAAE,EAAE;IACD,MAAM,aAAa,GAAG,gBAAgB,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC,CAAC;IAEhF,OAAO,oBAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,aAAa,IAAG,QAAQ,CAAiC,CAAC;AAC3G,CAAC,CAAC"}
1
+ {"version":3,"file":"NotificationsContext.js","sourceRoot":"","sources":["../../../src/notificationsPanel/data/NotificationsContext.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAOtD,MAAM,oBAAoB,GAAG,KAAK,CAAC,aAAa,CAA+B,IAAI,CAAC,CAAC;AACrF,oBAAoB,CAAC,WAAW,GAAG,sBAAsB,CAAC;AAE1D;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,EAAE;IACxC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACvD,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,IAAI,kBAAkB,CAAC,qEAAqE,CAAC,CAAC;IACxG,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AAaF;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAA0C,CAAC,EACzE,QAAQ,EACR,OAAO,EACP,SAAS,EACT,eAAe,EACf,YAAY,GACf,EAAE,EAAE;IACD,MAAM,aAAa,GAAG,gBAAgB,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC,CAAC;IAE9F,OAAO,oBAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,aAAa,IAAG,QAAQ,CAAiC,CAAC;AAC3G,CAAC,CAAC"}
@@ -1,33 +1,36 @@
1
1
  import { GoodDataSdkError } from "@gooddata/sdk-ui";
2
2
  import { INotification } from "@gooddata/sdk-model";
3
3
  /**
4
- * @alpha
4
+ * @internal
5
5
  */
6
6
  export interface IUseFetchNotificationsProps {
7
7
  /**
8
- * Workspace to use.
9
- * If not provided, it will be taken from the WorkspaceProvider context.
8
+ * Filter notifications by workspace.
10
9
  */
11
10
  workspace?: string;
12
11
  /**
13
12
  * Filter notifications by status.
14
- * If not provided, all notifications will be fetched.
15
13
  */
16
14
  readStatus?: "unread" | "read";
17
15
  /**
18
16
  * Refresh interval in milliseconds.
19
17
  */
20
18
  refreshInterval: number;
19
+ /**
20
+ * Number of items to fetch per page.
21
+ */
22
+ itemsPerPage: number;
21
23
  }
22
24
  /**
23
- * @alpha
25
+ * @internal
24
26
  */
25
- export declare function useFetchNotifications({ workspace, readStatus, refreshInterval, }: IUseFetchNotificationsProps): {
26
- notifications: INotification[];
27
+ export declare function useFetchNotifications({ workspace, readStatus, refreshInterval, itemsPerPage, }: IUseFetchNotificationsProps): {
27
28
  status: "error" | "loading" | "pending" | "success";
28
29
  error: GoodDataSdkError;
29
30
  hasNextPage: boolean;
30
- loadNextPage: () => void;
31
+ notifications: INotification[];
31
32
  totalNotificationsCount: number;
33
+ loadNextPage: () => void;
34
+ reset: () => void;
32
35
  };
33
36
  //# sourceMappingURL=useFetchNotifications.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFetchNotifications.d.ts","sourceRoot":"","sources":["../../../src/notificationsPanel/data/useFetchNotifications.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAsC,MAAM,kBAAkB,CAAC;AAExF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIpD;;GAEG;AACH,MAAM,WAAW,2BAA2B;IACxC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,UAAU,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAE/B;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,EAClC,SAAS,EACT,UAAU,EACV,eAAe,GAClB,EAAE,2BAA2B;;;;;;;EAqE7B"}
1
+ {"version":3,"file":"useFetchNotifications.d.ts","sourceRoot":"","sources":["../../../src/notificationsPanel/data/useFetchNotifications.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAsC,MAAM,kBAAkB,CAAC;AAExF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIpD;;GAEG;AACH,MAAM,WAAW,2BAA2B;IACxC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAE/B;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,EAClC,SAAS,EACT,UAAU,EACV,eAAe,EACf,YAAY,GACf,EAAE,2BAA2B;;;;;;;;EAkF7B"}
@@ -1,11 +1,11 @@
1
- // (C) 2024 GoodData Corporation
1
+ // (C) 2024-2025 GoodData Corporation
2
2
  import { useCancelablePromise, useWorkspace } from "@gooddata/sdk-ui";
3
3
  import { useOrganization } from "../@staging/OrganizationContext/OrganizationContext.js";
4
4
  import { useCallback, useEffect, useState } from "react";
5
5
  /**
6
- * @alpha
6
+ * @internal
7
7
  */
8
- export function useFetchNotifications({ workspace, readStatus, refreshInterval, }) {
8
+ export function useFetchNotifications({ workspace, readStatus, refreshInterval, itemsPerPage, }) {
9
9
  const effectiveWorkspace = useWorkspace(workspace);
10
10
  const { result: organizationService } = useOrganization();
11
11
  const [page, setPage] = useState(0);
@@ -30,10 +30,13 @@ export function useFetchNotifications({ workspace, readStatus, refreshInterval,
30
30
  promise: !organizationService
31
31
  ? null
32
32
  : async () => {
33
- let query = organizationService.notifications().getNotificationsQuery().withSize(50);
33
+ let query = organizationService.notifications().getNotificationsQuery();
34
34
  if (effectiveWorkspace) {
35
35
  query = query.withWorkspace(effectiveWorkspace);
36
36
  }
37
+ if (itemsPerPage) {
38
+ query = query.withSize(itemsPerPage);
39
+ }
37
40
  if (page) {
38
41
  query = query.withPage(page);
39
42
  }
@@ -43,7 +46,7 @@ export function useFetchNotifications({ workspace, readStatus, refreshInterval,
43
46
  return query.query();
44
47
  },
45
48
  onSuccess: (result) => {
46
- const hasNextPage = result.totalCount > (page + 1) * 50;
49
+ const hasNextPage = result.totalCount > (page + 1) * itemsPerPage;
47
50
  setHasNextPage(hasNextPage);
48
51
  setNotifications((prev) => [...prev, ...result.items]);
49
52
  setTotalNotificationsCount(result.totalCount);
@@ -54,13 +57,21 @@ export function useFetchNotifications({ workspace, readStatus, refreshInterval,
54
57
  setPage((x) => x + 1);
55
58
  }
56
59
  }, [status, hasNextPage]);
60
+ const reset = useCallback(() => {
61
+ setPage(0);
62
+ setNotifications([]);
63
+ setHasNextPage(false);
64
+ setTotalNotificationsCount(0);
65
+ setInvalidationId((x) => x + 1);
66
+ }, []);
57
67
  return {
58
- notifications,
59
68
  status,
60
69
  error,
61
70
  hasNextPage,
62
- loadNextPage,
71
+ notifications,
63
72
  totalNotificationsCount,
73
+ loadNextPage,
74
+ reset,
64
75
  };
65
76
  }
66
77
  //# sourceMappingURL=useFetchNotifications.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFetchNotifications.js","sourceRoot":"","sources":["../../../src/notificationsPanel/data/useFetchNotifications.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,OAAO,EAAoB,oBAAoB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAA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CAAC;IACL,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;IAE1B,OAAO;QACH,aAAa;QACb,MAAM;QACN,KAAK;QACL,WAAW;QACX,YAAY;QACZ,uBAAuB;KAC1B,CAAC;AACN,CAAC"}
1
+ {"version":3,"file":"useFetchNotifications.js","sourceRoot":"","sources":["../../../src/notificationsPanel/data/useFetchNotifications.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,EAAoB,oBAAoB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AAEzF,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AA4BzD;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,EAClC,SAAS,EACT,UAAU,EACV,eAAe,EACf,YAAY,GACc;IAC1B,MAAM,kBAAkB,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IACnD,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,eAAe,EAAE,CAAC;IAC1D,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAkB,EAAE,CAAC,CAAC;IACxE,MAAM,CAAC,uBAAuB,EAAE,0BAA0B,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC1E,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAS,CAAC,CAAC,CAAC;IAEhE,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,QAAwB,CAAC;QAC7B,IAAI,eAAe,GAAG,CAAC,EAAE,CAAC;YACtB,QAAQ,GAAG,WAAW,CAA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5B,gBAAgB,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACvD,0BAA0B,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAClD,CAAC;KACJ,EACD,CAAC,kBAAkB,EAAE,mBAAmB,EAAE,IAAI,EAAE,cAAc,CAAC,CAClE,CAAC;IAEF,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE;QAClC,IAAI,MAAM,KAAK,SAAS,IAAI,WAAW,EAAE,CAAC;YACtC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAC1B,CAAC;IACL,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;IAE1B,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE;QAC3B,OAAO,CAAC,CAAC,CAAC,CAAC;QACX,gBAAgB,CAAC,EAAE,CAAC,CAAC;QACrB,cAAc,CAAC,KAAK,CAAC,CAAC;QACtB,0BAA0B,CAAC,CAAC,CAAC,CAAC;QAC9B,iBAAiB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACpC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACH,MAAM;QACN,KAAK;QACL,WAAW;QACX,aAAa;QACb,uBAAuB;QACvB,YAAY;QACZ,KAAK;KACR,CAAC;AACN,CAAC"}
@@ -6,6 +6,7 @@ export declare function useNotificationsFilterDetail(notification: IAlertNotific
6
6
  }[];
7
7
  automationPromise: import("@gooddata/sdk-ui").UseCancelablePromiseState<{
8
8
  automation: import("@gooddata/sdk-model").IAutomationMetadataObject;
9
+ dashboard: any;
9
10
  labels: import("@gooddata/sdk-model").IAttributeDisplayFormMetadataObject[];
10
11
  }, any>;
11
12
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useNotificationFiltersDetail.d.ts","sourceRoot":"","sources":["../../../src/notificationsPanel/data/useNotificationFiltersDetail.tsx"],"names":[],"mappings":"AACA,OAAO,EAQH,kBAAkB,EAErB,MAAM,qBAAqB,CAAC;AAuB7B,wBAAgB,4BAA4B,CAAC,YAAY,EAAE,kBAAkB;;eAwFpC,MAAM;kBAAY,MAAM;;;;;;EAIhE"}
1
+ {"version":3,"file":"useNotificationFiltersDetail.d.ts","sourceRoot":"","sources":["../../../src/notificationsPanel/data/useNotificationFiltersDetail.tsx"],"names":[],"mappings":"AACA,OAAO,EAQH,kBAAkB,EAMrB,MAAM,qBAAqB,CAAC;AAoC7B,wBAAgB,4BAA4B,CAAC,YAAY,EAAE,kBAAkB;;eA0GpC,MAAM;kBAAY,MAAM;;;;;;;EAIhE"}