@edifice.io/react 2.6.2-develop-integration-crna.20260825143220 → 2.6.2-develop-b2school.20260825182521

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 (46) hide show
  1. package/dist/components/Layout/Layout.js +3 -5
  2. package/dist/icons-apps.js +100 -112
  3. package/dist/modules/homepage/components/Favorites/Favorites.js +3 -6
  4. package/dist/modules/homepage/components/Header/Header.js +13 -24
  5. package/dist/modules/homepage/components/Notifications/NotificationItem.js +4 -5
  6. package/dist/modules/homepage/components/Notifications/NotificationList.d.ts +1 -7
  7. package/dist/modules/homepage/components/Notifications/NotificationList.js +1 -8
  8. package/dist/modules/homepage/components/Notifications/NotificationListContainer.js +1 -4
  9. package/dist/modules/homepage/components/Notifications/components/CommonNotificationItem.d.ts +1 -2
  10. package/dist/modules/homepage/components/Notifications/components/CommonNotificationItem.js +10 -14
  11. package/dist/modules/homepage/components/Notifications/components/SystemNotificationItem.d.ts +1 -3
  12. package/dist/modules/homepage/components/Notifications/components/SystemNotificationItem.js +2 -3
  13. package/dist/modules/homepage/components/Notifications/components/UserNotificationItem.d.ts +1 -3
  14. package/dist/modules/homepage/components/Notifications/components/UserNotificationItem.js +2 -3
  15. package/dist/modules/homepage/components/Notifications/components/notificationAdapter.d.ts +0 -1
  16. package/dist/modules/homepage/components/Notifications/components/notificationAdapter.js +2 -7
  17. package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.d.ts +1 -11
  18. package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.js +2 -34
  19. package/dist/modules/homepage/components/Notifications/services/api/index.d.ts +0 -2
  20. package/dist/modules/homepage/components/Notifications/services/api/notificationService.d.ts +0 -8
  21. package/dist/modules/homepage/components/Notifications/services/api/notificationService.js +0 -12
  22. package/dist/modules/homepage/components/Notifications/services/queries/notification.d.ts +1 -13
  23. package/dist/modules/homepage/components/Notifications/services/queries/notification.js +4 -41
  24. package/dist/modules/homepage/components/UserSpace/hooks/useProfileLinks.js +18 -8
  25. package/dist/modules/icons/components/apps/index.d.ts +0 -6
  26. package/package.json +6 -6
  27. package/dist/modules/homepage/components/Notifications/components/NotificationFilterMenu.d.ts +0 -16
  28. package/dist/modules/homepage/components/Notifications/components/NotificationFilterMenu.js +0 -29
  29. package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.d.ts +0 -18
  30. package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.js +0 -67
  31. package/dist/modules/homepage/components/Notifications/components/NotificationOptionsMenu.d.ts +0 -12
  32. package/dist/modules/homepage/components/Notifications/components/NotificationOptionsMenu.js +0 -42
  33. package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.d.ts +0 -13
  34. package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.js +0 -31
  35. package/dist/modules/icons/components/apps/IconNextcloudDeck.d.ts +0 -7
  36. package/dist/modules/icons/components/apps/IconNextcloudDeck.js +0 -12
  37. package/dist/modules/icons/components/apps/IconNextcloudFiles.d.ts +0 -7
  38. package/dist/modules/icons/components/apps/IconNextcloudFiles.js +0 -12
  39. package/dist/modules/icons/components/apps/IconNextcloudForms.d.ts +0 -7
  40. package/dist/modules/icons/components/apps/IconNextcloudForms.js +0 -12
  41. package/dist/modules/icons/components/apps/IconNextcloudNotes.d.ts +0 -7
  42. package/dist/modules/icons/components/apps/IconNextcloudNotes.js +0 -12
  43. package/dist/modules/icons/components/apps/IconNextcloudTalk.d.ts +0 -7
  44. package/dist/modules/icons/components/apps/IconNextcloudTalk.js +0 -12
  45. package/dist/modules/icons/components/apps/IconPeertube.d.ts +0 -7
  46. package/dist/modules/icons/components/apps/IconPeertube.js +0 -21
@@ -14,7 +14,7 @@ const resolveNotificationResourceUri = (params, type, appCode, eventType) => {
14
14
  appCode = "collaborative-wall";
15
15
  break;
16
16
  case "formulaire":
17
- appI18nKey = "formulaire", appCode = "forms";
17
+ appI18nKey = appCode = "forms";
18
18
  break;
19
19
  case "messagerie":
20
20
  appI18nKey = appCode = "conversation";
@@ -26,13 +26,9 @@ const resolveNotificationResourceUri = (params, type, appCode, eventType) => {
26
26
  appCode = "cahier-de-texte";
27
27
  break;
28
28
  case "userbook_motto":
29
- appI18nKey = "userbook_motto", appCode = "userbook";
30
- break;
31
29
  case "userbook_mood":
32
- appI18nKey = "userbook_mood", appCode = "userbook";
33
- break;
34
30
  case "userbook_discovervisiblegroups":
35
- appI18nKey = "userbook_discovervisiblegroups", appCode = "userbook";
31
+ appCode = "userbook";
36
32
  break;
37
33
  default:
38
34
  appI18nKey = appCode = appCode.replace(/_/g, "-");
@@ -66,6 +62,5 @@ const resolveNotificationResourceUri = (params, type, appCode, eventType) => {
66
62
  };
67
63
  };
68
64
  export {
69
- getAppCodeAndI18nKey,
70
65
  notificationAdapter
71
66
  };
@@ -2,12 +2,8 @@ import { NotificationModel } from '@edifice.io/client';
2
2
  export interface UseNotificationListContainerReturn {
3
3
  /** Array of notifications */
4
4
  notifications: NotificationModel[] | undefined;
5
- /** Array of all notification types available */
5
+ /** Array of notification types */
6
6
  notificationTypes: string[] | undefined;
7
- /** Array of notification types currently selected as filter */
8
- selectedTypes: string[] | undefined;
9
- /** Callback to change the selected notification types filter */
10
- setSelectedTypes: (types: string[]) => void;
11
7
  /** Indicates if there are more notifications to load */
12
8
  hasNextPage: boolean | undefined;
13
9
  /** Callback to load the next page of notifications */
@@ -22,9 +18,3 @@ export interface UseNotificationListContainerReturn {
22
18
  * @returns Object containing notifications, loading state, and error state
23
19
  */
24
20
  export declare const useNotificationListContainer: () => UseNotificationListContainerReturn;
25
- /**
26
- * Indicates whether the user has at least one notification dated today,
27
- * across all notification types. Used to display a "new notification"
28
- * badge on the notification bell icon, independently of the list overlay.
29
- */
30
- export declare const useHasNotificationToday: () => boolean;
@@ -1,6 +1,4 @@
1
- import { useState, useEffect } from "react";
2
- import { useNotificationTypes, useNotifications, useTimelinePreference, useSaveTimelinePreference } from "../services/queries/notification.js";
3
- import useDate from "../../../../../hooks/useDate/useDate.js";
1
+ import { useNotificationTypes, useNotifications } from "../services/queries/notification.js";
4
2
  const useNotificationListContainer = () => {
5
3
  const {
6
4
  data: notificationTypes,
@@ -8,51 +6,21 @@ const useNotificationListContainer = () => {
8
6
  isFetched: isFetchedTypes,
9
7
  error: errorTypes
10
8
  } = useNotificationTypes(), {
11
- data: preference,
12
- isFetched: isFetchedPreference
13
- } = useTimelinePreference(), {
14
- mutate: saveTimelinePreference
15
- } = useSaveTimelinePreference(), [selectedTypes, setSelectedTypesState] = useState();
16
- useEffect(() => {
17
- if (selectedTypes === void 0 && isFetchedTypes && isFetchedPreference) {
18
- const preferredTypes = preference == null ? void 0 : preference.type;
19
- setSelectedTypesState(preferredTypes && preferredTypes.length > 0 ? preferredTypes : notificationTypes ?? []);
20
- }
21
- }, [selectedTypes, isFetchedTypes, isFetchedPreference, preference, notificationTypes]);
22
- const setSelectedTypes = (types) => {
23
- setSelectedTypesState(types), saveTimelinePreference({
24
- ...preference,
25
- type: types
26
- });
27
- }, {
28
9
  data: notifications,
29
10
  hasNextPage,
30
11
  isLoading: isLoadingNotifications,
31
12
  error: errorNotifications,
32
13
  fetchNextPage
33
- } = useNotifications(selectedTypes ?? [], isFetchedTypes && !!selectedTypes);
14
+ } = useNotifications(notificationTypes ?? [], isFetchedTypes && !!notificationTypes);
34
15
  return {
35
16
  notifications,
36
17
  notificationTypes,
37
- selectedTypes,
38
- setSelectedTypes,
39
18
  hasNextPage,
40
19
  loadNextPage: () => fetchNextPage(),
41
20
  isLoading: isLoadingTypes || isLoadingNotifications,
42
21
  error: errorTypes || errorNotifications
43
22
  };
44
- }, useHasNotificationToday = () => {
45
- const {
46
- dateIsToday
47
- } = useDate(), {
48
- data: notificationTypes,
49
- isFetched: isFetchedTypes
50
- } = useNotificationTypes(), {
51
- data: notifications
52
- } = useNotifications(notificationTypes ?? [], isFetchedTypes);
53
- return (notifications == null ? void 0 : notifications.some((notification) => dateIsToday(notification.date))) ?? !1;
54
23
  };
55
24
  export {
56
- useHasNotificationToday,
57
25
  useNotificationListContainer
58
26
  };
@@ -1,6 +1,4 @@
1
1
  export declare const notificationService: {
2
2
  getNotifications(types: string[], page: number): Promise<import('@edifice.io/client').NotificationModel[]>;
3
3
  getNotificationTypes(): Promise<string[]>;
4
- reportNotification(id: string): Promise<any>;
5
- deleteNotification(id: string): Promise<any>;
6
4
  };
@@ -12,12 +12,4 @@ export declare const createNotificationService: (baseURL: string) => {
12
12
  */
13
13
  getNotifications(types: string[], page: number): Promise<NotificationModel[]>;
14
14
  getNotificationTypes(): Promise<string[]>;
15
- /**
16
- * Report a notification as inappropriate.
17
- */
18
- reportNotification(id: string): Promise<any>;
19
- /**
20
- * Delete a notification.
21
- */
22
- deleteNotification(id: string): Promise<any>;
23
15
  };
@@ -14,18 +14,6 @@ const createNotificationService = (baseURL) => ({
14
14
  },
15
15
  getNotificationTypes() {
16
16
  return odeServices.http().get(`${baseURL}/timeline/types`);
17
- },
18
- /**
19
- * Report a notification as inappropriate.
20
- */
21
- reportNotification(id) {
22
- return odeServices.http().put(`${baseURL}/timeline/${id}/report`);
23
- },
24
- /**
25
- * Delete a notification.
26
- */
27
- deleteNotification(id) {
28
- return odeServices.http().put(`${baseURL}/timeline/${id}`);
29
17
  }
30
18
  });
31
19
  export {
@@ -1,22 +1,14 @@
1
1
  import { NotificationModel } from '@edifice.io/client';
2
- import { InfiniteData } from '@tanstack/react-query';
3
- /** Shape of the `timeline` userbook preference (only `type` is read/written here). */
4
- export interface TimelinePreference {
5
- page?: number;
6
- type: string[];
7
- config?: Record<string, unknown>;
8
- }
9
2
  export declare const notificationQueryKeys: {
10
3
  all: () => readonly ["notifications"];
11
4
  notifications: (types?: string[]) => readonly ["notifications", "list", string[]];
12
5
  types: () => readonly ["notifications", "types"];
13
- preference: () => readonly ["notifications", "preference"];
14
6
  };
15
7
  export declare const notificationQueryOptions: {
16
8
  getNotifications(types: string[], enabled: boolean): import('@tanstack/react-query').OmitKeyof<import('@tanstack/react-query').UseInfiniteQueryOptions<NotificationModel[], Error, NotificationModel[], NotificationModel[], readonly ["notifications", "list", string[]], number>, "queryFn"> & {
17
9
  queryFn?: import('@tanstack/react-query').QueryFunction<NotificationModel[], readonly ["notifications", "list", string[]], number> | undefined;
18
10
  } & {
19
- queryKey: import('@tanstack/react-query').DataTag<readonly ["notifications", "list", string[]], InfiniteData<NotificationModel[], unknown>>;
11
+ queryKey: import('@tanstack/react-query').DataTag<readonly ["notifications", "list", string[]], import('@tanstack/react-query').InfiniteData<NotificationModel[], unknown>>;
20
12
  };
21
13
  getNotificationTypes(): import('@tanstack/react-query').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<string[], Error, string[], import('@tanstack/react-query').QueryKey>, "queryFn"> & {
22
14
  queryFn?: import('@tanstack/react-query').QueryFunction<string[], import('@tanstack/react-query').QueryKey, never> | undefined;
@@ -26,7 +18,3 @@ export declare const notificationQueryOptions: {
26
18
  };
27
19
  export declare const useNotifications: (types?: string[], enabled?: boolean) => import('@tanstack/react-query').UseInfiniteQueryResult<NotificationModel[], Error>;
28
20
  export declare const useNotificationTypes: () => import('@tanstack/react-query').UseQueryResult<string[], Error>;
29
- export declare const useTimelinePreference: () => import('@tanstack/react-query').UseQueryResult<TimelinePreference, Error>;
30
- export declare const useSaveTimelinePreference: () => import('@tanstack/react-query').UseMutationResult<void, Error, TimelinePreference, unknown>;
31
- export declare const useReportNotification: () => import('@tanstack/react-query').UseMutationResult<any, Error, string, unknown>;
32
- export declare const useDeleteNotification: () => import('@tanstack/react-query').UseMutationResult<any, Error, string, unknown>;
@@ -1,11 +1,9 @@
1
- import { odeServices } from "@edifice.io/client";
2
- import { useQuery, useInfiniteQuery, useMutation, useQueryClient, queryOptions, infiniteQueryOptions } from "@tanstack/react-query";
1
+ import { useQuery, useInfiniteQuery, queryOptions, infiniteQueryOptions } from "@tanstack/react-query";
3
2
  import { notificationService } from "../api/index.js";
4
3
  const notificationQueryKeys = {
5
4
  all: () => ["notifications"],
6
5
  notifications: (types = []) => [...notificationQueryKeys.all(), "list", types],
7
- types: () => [...notificationQueryKeys.all(), "types"],
8
- preference: () => [...notificationQueryKeys.all(), "preference"]
6
+ types: () => [...notificationQueryKeys.all(), "types"]
9
7
  }, notificationQueryOptions = {
10
8
  getNotifications(types, enabled) {
11
9
  return infiniteQueryOptions({
@@ -33,45 +31,10 @@ const notificationQueryKeys = {
33
31
  queryFn: async () => notificationService.getNotificationTypes()
34
32
  });
35
33
  }
36
- }, useNotifications = (types = [], enabled = !0) => useInfiniteQuery(notificationQueryOptions.getNotifications(types, enabled)), useNotificationTypes = () => useQuery(notificationQueryOptions.getNotificationTypes()), useTimelinePreference = () => useQuery({
37
- queryKey: notificationQueryKeys.preference(),
38
- queryFn: () => odeServices.conf().getPreference("timeline")
39
- }), useSaveTimelinePreference = () => {
40
- const queryClient = useQueryClient();
41
- return useMutation({
42
- mutationFn: (preference) => odeServices.conf().savePreference("timeline", preference),
43
- onSuccess: (_data, preference) => {
44
- queryClient.setQueryData(notificationQueryKeys.preference(), preference);
45
- },
46
- onError: () => {
47
- queryClient.invalidateQueries({
48
- queryKey: notificationQueryKeys.preference()
49
- });
50
- }
51
- });
52
- }, useReportNotification = () => useMutation({
53
- mutationFn: (id) => notificationService.reportNotification(id)
54
- }), useDeleteNotification = () => {
55
- const queryClient = useQueryClient();
56
- return useMutation({
57
- mutationFn: (id) => notificationService.deleteNotification(id),
58
- onSuccess: (_data, id) => {
59
- queryClient.setQueriesData({
60
- queryKey: [...notificationQueryKeys.all(), "list"]
61
- }, (data) => data && {
62
- ...data,
63
- pages: data.pages.map((page) => page.filter((notification) => notification._id !== id))
64
- });
65
- }
66
- });
67
- };
34
+ }, useNotifications = (types = [], enabled = !0) => useInfiniteQuery(notificationQueryOptions.getNotifications(types, enabled)), useNotificationTypes = () => useQuery(notificationQueryOptions.getNotificationTypes());
68
35
  export {
69
36
  notificationQueryKeys,
70
37
  notificationQueryOptions,
71
- useDeleteNotification,
72
38
  useNotificationTypes,
73
- useNotifications,
74
- useReportNotification,
75
- useSaveTimelinePreference,
76
- useTimelinePreference
39
+ useNotifications
77
40
  };
@@ -17,18 +17,20 @@ function useProfileLinks(profile) {
17
17
  structure: structureId
18
18
  });
19
19
  return `${baseUrl}?${params.toString()}`;
20
- }, buildClassesUrl = (classIds = []) => {
21
- const params = new URLSearchParams({
22
- filters: "groups",
23
- structure: structureId
24
- });
20
+ }, buildClassesUrl = (parameters, classIds = []) => {
21
+ const params = new URLSearchParams(parameters);
25
22
  return classIds.forEach((c) => params.append("class", String(c))), `${baseUrl}?${params.toString()}`;
26
23
  };
27
24
  switch (profile) {
28
25
  case "Teacher":
29
26
  return [{
30
27
  text: t("homepage.userspace.teacher.link.classes"),
31
- url: buildClassesUrl(user.classes)
28
+ url: buildClassesUrl(
29
+ {
30
+ filters: "groups"
31
+ }
32
+ /* Do not explicitely add classes ids, because none <=> see all*/
33
+ )
32
34
  }];
33
35
  case "Student":
34
36
  return [{
@@ -36,7 +38,12 @@ function useProfileLinks(profile) {
36
38
  url: "/userbook/annuaire#/search?filters=groups&profile=Teacher"
37
39
  }, {
38
40
  text: t("homepage.userspace.student.link.classes"),
39
- url: buildClassesUrl(user.classes)
41
+ url: buildClassesUrl(
42
+ {
43
+ filters: "groups"
44
+ }
45
+ /* Do not explicitely add classes ids, because none <=> see all*/
46
+ )
40
47
  }];
41
48
  case "Relative":
42
49
  return children != null && children.length ? children.map((child) => {
@@ -45,7 +52,10 @@ function useProfileLinks(profile) {
45
52
  text: t("homepage.userspace.relative.link.classes", {
46
53
  childName: child.firstName
47
54
  }),
48
- url: buildClassesUrl((_a2 = child.classes) == null ? void 0 : _a2.map(({
55
+ url: buildClassesUrl({
56
+ filters: "groups",
57
+ structure: structureId
58
+ }, (_a2 = child.classes) == null ? void 0 : _a2.map(({
49
59
  id
50
60
  }) => id))
51
61
  };
@@ -75,11 +75,6 @@ export { default as IconMuseefrancaisphoto } from './IconMuseefrancaisphoto';
75
75
  export { default as IconMyNetwork } from './IconMyNetwork';
76
76
  export { default as IconNabook } from './IconNabook';
77
77
  export { default as IconNetvibes } from './IconNetvibes';
78
- export { default as IconNextcloudDeck } from './IconNextcloudDeck';
79
- export { default as IconNextcloudFiles } from './IconNextcloudFiles';
80
- export { default as IconNextcloudForms } from './IconNextcloudForms';
81
- export { default as IconNextcloudNotes } from './IconNextcloudNotes';
82
- export { default as IconNextcloudTalk } from './IconNextcloudTalk';
83
78
  export { default as IconNote } from './IconNote';
84
79
  export { default as IconNotebook } from './IconNotebook';
85
80
  export { default as IconNotes } from './IconNotes';
@@ -92,7 +87,6 @@ export { default as IconParametrages } from './IconParametrages';
92
87
  export { default as IconParaschool } from './IconParaschool';
93
88
  export { default as IconParcours } from './IconParcours';
94
89
  export { default as IconPearltrees } from './IconPearltrees';
95
- export { default as IconPeertube } from './IconPeertube';
96
90
  export { default as IconPicardieCursus } from './IconPicardieCursus';
97
91
  export { default as IconPlaceholder } from './IconPlaceholder';
98
92
  export { default as IconPoll } from './IconPoll';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/react",
3
- "version": "2.6.2-develop-integration-crna.20260825143220",
3
+ "version": "2.6.2-develop-b2school.20260825182521",
4
4
  "description": "Edifice React Library",
5
5
  "keywords": [
6
6
  "react",
@@ -140,9 +140,9 @@
140
140
  "swiper": "10.1.0",
141
141
  "ua-parser-js": "1.0.36",
142
142
  "zustand": "4.5.7",
143
- "@edifice.io/bootstrap": "2.6.2-develop-integration-crna.20260825143220",
144
- "@edifice.io/tiptap-extensions": "2.6.2-develop-integration-crna.20260825143220",
145
- "@edifice.io/utilities": "2.6.2-develop-integration-crna.20260825143220"
143
+ "@edifice.io/bootstrap": "2.6.2-develop-b2school.20260825182521",
144
+ "@edifice.io/utilities": "2.6.2-develop-b2school.20260825182521",
145
+ "@edifice.io/tiptap-extensions": "2.6.2-develop-b2school.20260825182521"
146
146
  },
147
147
  "devDependencies": {
148
148
  "@babel/plugin-transform-react-pure-annotations": "7.27.1",
@@ -173,8 +173,8 @@
173
173
  "vite": "5.4.14",
174
174
  "vite-plugin-dts": "4.5.4",
175
175
  "vite-tsconfig-paths": "5.1.4",
176
- "@edifice.io/client": "2.6.2-develop-integration-crna.20260825143220",
177
- "@edifice.io/config": "2.6.2-develop-integration-crna.20260825143220"
176
+ "@edifice.io/client": "2.6.2-develop-b2school.20260825182521",
177
+ "@edifice.io/config": "2.6.2-develop-b2school.20260825182521"
178
178
  },
179
179
  "peerDependencies": {
180
180
  "@react-spring/web": "9.7.5",
@@ -1,16 +0,0 @@
1
- export type NotificationFilterMenuProps = {
2
- /** All notification types available */
3
- notificationTypes: string[];
4
- /** Notification types currently applied as filter */
5
- selectedTypes: string[];
6
- /** Callback when the user validates a new filter selection */
7
- onFilterChange: (types: string[]) => void;
8
- };
9
- /**
10
- * Trigger button opening the notification types filter modal.
11
- */
12
- declare const NotificationFilterMenu: {
13
- ({ notificationTypes, selectedTypes, onFilterChange, }: NotificationFilterMenuProps): import("react/jsx-runtime").JSX.Element;
14
- displayName: string;
15
- };
16
- export default NotificationFilterMenu;
@@ -1,29 +0,0 @@
1
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { useState } from "react";
3
- import { useTranslation } from "react-i18next";
4
- import SvgIconFilter from "../../../../icons/components/IconFilter.js";
5
- import SvgIconRafterDown from "../../../../icons/components/IconRafterDown.js";
6
- import NotificationFilterModal from "./NotificationFilterModal.js";
7
- import ButtonBeta from "../../../../../components/ButtonBeta/ButtonBeta.js";
8
- const NotificationFilterMenu = ({
9
- notificationTypes,
10
- selectedTypes,
11
- onFilterChange
12
- }) => {
13
- const {
14
- t
15
- } = useTranslation(), [isOpen, setIsOpen] = useState(!1), handleApply = (types) => {
16
- onFilterChange(types), setIsOpen(!1);
17
- };
18
- return /* @__PURE__ */ jsxs(Fragment, { children: [
19
- /* @__PURE__ */ jsx(ButtonBeta, { type: "button", color: "secondary", variant: "outline", size: "md", leftIcon: /* @__PURE__ */ jsx(SvgIconFilter, {}), rightIcon: /* @__PURE__ */ jsx(SvgIconRafterDown, {}), "aria-label": t("homepage.notifications.filter-modal.trigger", {
20
- defaultValue: "Filtrer les notifications"
21
- }), title: t("homepage.notifications.filter-modal.trigger", {
22
- defaultValue: "Filtrer les notifications"
23
- }), onClick: () => setIsOpen(!0), "data-testid": "notification-filter-button" }),
24
- isOpen && /* @__PURE__ */ jsx(NotificationFilterModal, { isOpen, allTypes: notificationTypes, appliedTypes: selectedTypes, onCancel: () => setIsOpen(!1), onApply: handleApply })
25
- ] });
26
- };
27
- export {
28
- NotificationFilterMenu as default
29
- };
@@ -1,18 +0,0 @@
1
- export type NotificationFilterModalProps = {
2
- isOpen: boolean;
3
- /** All notification types available */
4
- allTypes: string[];
5
- /** Notification types currently applied as filter */
6
- appliedTypes: string[];
7
- onCancel: () => void;
8
- onApply: (types: string[]) => void;
9
- };
10
- /**
11
- * Modal letting the user choose which notification types to display in the
12
- * homepage notifications list.
13
- */
14
- declare const NotificationFilterModal: {
15
- ({ isOpen, allTypes, appliedTypes, onCancel, onApply, }: NotificationFilterModalProps): import("react/jsx-runtime").JSX.Element;
16
- displayName: string;
17
- };
18
- export default NotificationFilterModal;
@@ -1,67 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import clsx from "clsx";
3
- import { useState } from "react";
4
- import { useTranslation } from "react-i18next";
5
- import SvgIconCheck from "../../../../icons/components/IconCheck.js";
6
- import { getAppCodeAndI18nKey } from "./notificationAdapter.js";
7
- import Modal from "../../../../../components/Modal/Modal.js";
8
- import Flex from "../../../../../components/Flex/Flex.js";
9
- import Checkbox from "../../../../../components/Checkbox/Checkbox.js";
10
- import AppIcon from "../../../../../components/AppIcon/AppIcon.js";
11
- import ButtonBeta from "../../../../../components/ButtonBeta/ButtonBeta.js";
12
- const NotificationFilterModal = ({
13
- isOpen,
14
- allTypes,
15
- appliedTypes,
16
- onCancel,
17
- onApply
18
- }) => {
19
- const {
20
- t
21
- } = useTranslation(), [selected, setSelected] = useState(appliedTypes), toggleType = (type) => {
22
- setSelected((current) => current.includes(type) ? current.filter((value) => value !== type) : [...current, type]);
23
- }, toggleAll = () => {
24
- setSelected(selected.length === allTypes.length ? [] : allTypes);
25
- };
26
- return /* @__PURE__ */ jsxs(Modal, { id: "notification-filter-modal", size: "lg", scrollable: !0, isOpen, onModalClose: onCancel, children: [
27
- /* @__PURE__ */ jsx(Modal.Header, { onModalClose: onCancel, children: t("homepage.notifications.filter-modal.title", {
28
- defaultValue: "Filtrer les notifications"
29
- }) }),
30
- /* @__PURE__ */ jsx(Modal.Subtitle, { children: t("homepage.notifications.filter-modal.subtitle", {
31
- defaultValue: "Sélectionnez seulement les notifications importantes pour vous"
32
- }) }),
33
- /* @__PURE__ */ jsxs(Modal.Body, { children: [
34
- /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "8", className: "mb-16", children: [
35
- /* @__PURE__ */ jsx("div", { className: "notification-filter-select-all", children: /* @__PURE__ */ jsx(Checkbox, { label: t("homepage.notifications.filter-modal.select-all", {
36
- defaultValue: "Tout sélectionner"
37
- }), checked: selected.length === allTypes.length, indeterminate: selected.length > 0 && selected.length < allTypes.length, onChange: toggleAll }) }),
38
- /* @__PURE__ */ jsx("span", { className: "notification-filter-count", children: t("homepage.notifications.filter-modal.count", {
39
- selected: selected.length,
40
- total: allTypes.length,
41
- defaultValue: "[[selected]] / [[total]] sélectionnées"
42
- }) })
43
- ] }),
44
- /* @__PURE__ */ jsx(Flex, { wrap: "wrap", gap: "8", className: "notification-filter-options", children: allTypes.map((type) => {
45
- const [appCode, appI18nKey] = getAppCodeAndI18nKey(type), checked = selected.includes(type);
46
- return /* @__PURE__ */ jsxs("label", { className: clsx("notification-filter-chip", {
47
- "is-checked": checked
48
- }), children: [
49
- /* @__PURE__ */ jsx(AppIcon, { app: appCode, size: "24", iconFit: "contain" }),
50
- /* @__PURE__ */ jsx("span", { children: t(appI18nKey, {
51
- defaultValue: appCode
52
- }) }),
53
- /* @__PURE__ */ jsx("input", { type: "checkbox", className: "form-check-input", checked, onChange: () => toggleType(type) })
54
- ] }, type);
55
- }) })
56
- ] }),
57
- /* @__PURE__ */ jsxs(Modal.Footer, { children: [
58
- /* @__PURE__ */ jsx(ButtonBeta, { color: "tertiary", onClick: onCancel, type: "button", variant: "ghost", children: t("cancel") }),
59
- /* @__PURE__ */ jsx(ButtonBeta, { color: "default", onClick: () => onApply(selected), type: "button", variant: "filled", rightIcon: /* @__PURE__ */ jsx(SvgIconCheck, {}), children: t("homepage.notifications.filter-modal.confirm", {
60
- defaultValue: "Enregistrer"
61
- }) })
62
- ] })
63
- ] });
64
- };
65
- export {
66
- NotificationFilterModal as default
67
- };
@@ -1,12 +0,0 @@
1
- export type NotificationOptionsMenuProps = {
2
- notificationId: string;
3
- };
4
- /**
5
- * Options menu for a single notification row, allowing the user to report
6
- * or delete it.
7
- */
8
- declare const NotificationOptionsMenu: {
9
- ({ notificationId, }: NotificationOptionsMenuProps): import("react/jsx-runtime").JSX.Element;
10
- displayName: string;
11
- };
12
- export default NotificationOptionsMenu;
@@ -1,42 +0,0 @@
1
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { useState } from "react";
3
- import { useTranslation } from "react-i18next";
4
- import SvgIconAlertTriangle from "../../../../icons/components/IconAlertTriangle.js";
5
- import SvgIconDelete from "../../../../icons/components/IconDelete.js";
6
- import SvgIconOptions from "../../../../icons/components/IconOptions.js";
7
- import { useReportNotification, useDeleteNotification } from "../services/queries/notification.js";
8
- import ReportNotificationModal from "./ReportNotificationModal.js";
9
- import Dropdown from "../../../../../components/Dropdown/Dropdown.js";
10
- import IconButton from "../../../../../components/Button/IconButton.js";
11
- const NotificationOptionsMenu = ({
12
- notificationId
13
- }) => {
14
- const {
15
- t
16
- } = useTranslation(), {
17
- mutate: reportNotification
18
- } = useReportNotification(), {
19
- mutate: deleteNotification
20
- } = useDeleteNotification(), [isReportModalOpen, setIsReportModalOpen] = useState(!1);
21
- return /* @__PURE__ */ jsxs(Fragment, { children: [
22
- /* @__PURE__ */ jsx(Dropdown, { overflow: !1, children: (triggerProps) => /* @__PURE__ */ jsxs(Fragment, { children: [
23
- /* @__PURE__ */ jsx(IconButton, { ...triggerProps, type: "button", "aria-label": t("homepage.notifications.options.label", {
24
- defaultValue: "Options de la notification"
25
- }), color: "tertiary", variant: "ghost", icon: /* @__PURE__ */ jsx(SvgIconOptions, {}), "data-testid": "notification-item-options-button" }),
26
- /* @__PURE__ */ jsxs(Dropdown.Menu, { children: [
27
- /* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconAlertTriangle, {}), onClick: () => setIsReportModalOpen(!0), children: t("homepage.notifications.options.report", {
28
- defaultValue: "Signaler"
29
- }) }),
30
- /* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconDelete, {}), onClick: () => deleteNotification(notificationId), children: t("homepage.notifications.options.delete", {
31
- defaultValue: "Supprimer"
32
- }) })
33
- ] })
34
- ] }) }),
35
- isReportModalOpen && /* @__PURE__ */ jsx(ReportNotificationModal, { isOpen: isReportModalOpen, onCancel: () => setIsReportModalOpen(!1), onConfirm: () => {
36
- reportNotification(notificationId), setIsReportModalOpen(!1);
37
- } })
38
- ] });
39
- };
40
- export {
41
- NotificationOptionsMenu as default
42
- };
@@ -1,13 +0,0 @@
1
- export type ReportNotificationModalProps = {
2
- isOpen: boolean;
3
- onCancel: () => void;
4
- onConfirm: () => void;
5
- };
6
- /**
7
- * Confirmation modal shown before reporting a notification as inappropriate.
8
- */
9
- declare const ReportNotificationModal: {
10
- ({ isOpen, onCancel, onConfirm, }: ReportNotificationModalProps): import("react/jsx-runtime").JSX.Element;
11
- displayName: string;
12
- };
13
- export default ReportNotificationModal;
@@ -1,31 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useTranslation } from "react-i18next";
3
- import SvgIconAlertTriangle from "../../../../icons/components/IconAlertTriangle.js";
4
- import Modal from "../../../../../components/Modal/Modal.js";
5
- import ButtonBeta from "../../../../../components/ButtonBeta/ButtonBeta.js";
6
- const ReportNotificationModal = ({
7
- isOpen,
8
- onCancel,
9
- onConfirm
10
- }) => {
11
- const {
12
- t
13
- } = useTranslation();
14
- return /* @__PURE__ */ jsxs(Modal, { id: "report-notification-modal", size: "lg", isOpen, onModalClose: onCancel, children: [
15
- /* @__PURE__ */ jsx(Modal.Header, { onModalClose: onCancel, children: t("homepage.notifications.report-modal.title", {
16
- defaultValue: "Signaler une notification"
17
- }) }),
18
- /* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsx("p", { children: t("homepage.notifications.report-modal.body", {
19
- defaultValue: "Attention ! Vous souhaitez signaler une notification inappropriée ou qui ne respecte pas les conditions d'utilisation de ONE. L'heure et l'origine de ce signalement seront enregistrées et transmises à un administrateur pour traitement."
20
- }) }) }),
21
- /* @__PURE__ */ jsxs(Modal.Footer, { children: [
22
- /* @__PURE__ */ jsx(ButtonBeta, { color: "tertiary", onClick: onCancel, type: "button", variant: "ghost", children: t("cancel") }),
23
- /* @__PURE__ */ jsx(ButtonBeta, { color: "default", onClick: onConfirm, type: "button", variant: "filled", leftIcon: /* @__PURE__ */ jsx(SvgIconAlertTriangle, {}), children: t("homepage.notifications.report-modal.confirm", {
24
- defaultValue: "Signaler la notification"
25
- }) })
26
- ] })
27
- ] });
28
- };
29
- export {
30
- ReportNotificationModal as default
31
- };
@@ -1,7 +0,0 @@
1
- import { SVGProps } from 'react';
2
- interface SVGRProps {
3
- title?: string;
4
- titleId?: string;
5
- }
6
- declare const SvgIconNextcloudDeck: ({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps) => import("react/jsx-runtime").JSX.Element;
7
- export default SvgIconNextcloudDeck;
@@ -1,12 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- const SvgIconNextcloudDeck = ({
3
- title,
4
- titleId,
5
- ...props
6
- }) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: "24", height: "24", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
7
- title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
8
- /* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M5.1 14.2h21.7c1 0 1.8.8 1.8 1.8v10.9c0 1-.8 1.8-1.8 1.8H5.1c-1 0-1.8-.8-1.8-1.8V16c0-1 .8-1.8 1.8-1.8m.9-3.6h20c.5 0 .9.4.9.9s-.4.9-.9.9H6c-.5 0-.9-.4-.9-.9s.4-.9.9-.9M7.9 7h16.3c.4 0 .8.4.8.9s-.4.9-.9.9H7.9c-.5 0-.9-.4-.9-.9s.4-.9.9-.9m1.8-3.7h12.7c.5 0 .9.4.9.9s-.4.9-.9.9H9.7c-.5 0-.9-.4-.9-.9s.4-.9.9-.9" })
9
- ] });
10
- export {
11
- SvgIconNextcloudDeck as default
12
- };
@@ -1,7 +0,0 @@
1
- import { SVGProps } from 'react';
2
- interface SVGRProps {
3
- title?: string;
4
- titleId?: string;
5
- }
6
- declare const SvgIconNextcloudFiles: ({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps) => import("react/jsx-runtime").JSX.Element;
7
- export default SvgIconNextcloudFiles;
@@ -1,12 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- const SvgIconNextcloudFiles = ({
3
- title,
4
- titleId,
5
- ...props
6
- }) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32", width: "24", height: "24", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
7
- title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
8
- /* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M13.5 6.1H6.1c-1.4 0-2.5 1.1-2.5 2.5v14.9c0 1.4 1.1 2.5 2.5 2.5H26c1.4 0 2.5-1.1 2.5-2.5V11c0-1.4-1.1-2.5-2.5-2.5H16z" })
9
- ] });
10
- export {
11
- SvgIconNextcloudFiles as default
12
- };