@asaleh37/ui-base 25.6.2-0.2 → 25.6.2-0.3
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/.github/workflows/publish-npm.yml +18 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/common/MyNotificationsPanel.tsx +8 -2
- package/src/layout/TopBar.tsx +5 -2
- package/src/redux/features/common/AppInfoSlice.ts +2 -0
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@ const MyNotificationsPanel: React.FC = () => {
|
|
|
12
12
|
const AppLayout = useSelector((state: any) => state.AppLayout);
|
|
13
13
|
const { handleGetRequest, handlePostRequest } = useAxios();
|
|
14
14
|
const [notifications, setNotifications] = useState<Array<Notification>>([]);
|
|
15
|
-
|
|
15
|
+
const AppInfo = useSelector((state: any) => state.AppInfo.value);
|
|
16
16
|
const acknowledgeAllCurrentNotifications = async () => {
|
|
17
17
|
await handlePostRequest({
|
|
18
18
|
endPointURI: "api/v1/public/notification/all/notified",
|
|
@@ -38,7 +38,13 @@ const MyNotificationsPanel: React.FC = () => {
|
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
-
|
|
41
|
+
if (AppInfo?.enableUINotifications === true) {
|
|
42
|
+
useInterval(
|
|
43
|
+
loadUserNotifications,
|
|
44
|
+
notificationsCheckIntervalSeconds * 1000
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
42
48
|
return (
|
|
43
49
|
<>
|
|
44
50
|
<Box
|
package/src/layout/TopBar.tsx
CHANGED
|
@@ -190,8 +190,11 @@ const TopBar: React.FC = () => {
|
|
|
190
190
|
) : (
|
|
191
191
|
<></>
|
|
192
192
|
)}
|
|
193
|
-
|
|
194
|
-
|
|
193
|
+
{AppInfo?.enableUINotifications === true ? (
|
|
194
|
+
<NotificationButton />
|
|
195
|
+
) : (
|
|
196
|
+
<></>
|
|
197
|
+
)}
|
|
195
198
|
<AttachmentImageViewer
|
|
196
199
|
showAsAvatar={true}
|
|
197
200
|
attachmentCode="EMPLOYEE_PHOTOS"
|
|
@@ -19,6 +19,7 @@ export type AppInfo = {
|
|
|
19
19
|
businessCommonStoresMetaData?: { [key: string]: StoreMetaData };
|
|
20
20
|
muiPremiumKey: string;
|
|
21
21
|
enableAdministrationModule: boolean;
|
|
22
|
+
enableUINotifications: Boolean;
|
|
22
23
|
appTheme?: {
|
|
23
24
|
light: { primaryColor: string; secondaryColor: string };
|
|
24
25
|
dark: { primaryColor: string; secondaryColor: string };
|
|
@@ -38,6 +39,7 @@ const initialState: AppInfoProp = {
|
|
|
38
39
|
appLogo: null,
|
|
39
40
|
muiPremiumKey: null,
|
|
40
41
|
enableAdministrationModule: false,
|
|
42
|
+
enableUINotifications: false,
|
|
41
43
|
businessRoutes: [],
|
|
42
44
|
businessNavigationItems: [],
|
|
43
45
|
businessReduxReducers: {},
|