@edifice.io/react 2.6.10-develop-b2school.20261021144055 → 2.6.10-develop-pedago.20261021184048

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 (143) hide show
  1. package/dist/components/Checkbox/Checkbox.js +1 -1
  2. package/dist/components/Layout/Layout.js +4 -12
  3. package/dist/components/Layout/components/Header.js +4 -4
  4. package/dist/components/Layout/components/NavLink.d.ts +3 -3
  5. package/dist/components/Layout/components/NavLink.js +3 -5
  6. package/dist/homepage.js +24 -74
  7. package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +6 -2
  8. package/dist/hooks/useZendeskGuide/useZendeskGuide.js +8 -11
  9. package/dist/icons.js +402 -406
  10. package/dist/modules/HelpZone/HelpZone.js +8 -6
  11. package/dist/modules/HelpZone/HelpZoneContainer.js +5 -2
  12. package/dist/modules/homepage/components/Communities/Communities.js +4 -4
  13. package/dist/modules/homepage/components/Header/Header.js +22 -28
  14. package/dist/modules/homepage/components/HomeCard/HomeCardHeader.d.ts +1 -5
  15. package/dist/modules/homepage/components/HomeCard/HomeCardHeader.js +1 -1
  16. package/dist/modules/homepage/components/MessageFlashList/MessageFlash.js +1 -1
  17. package/dist/modules/homepage/components/Notifications/NotificationList.js +8 -7
  18. package/dist/modules/homepage/components/Notifications/NotificationListSkeleton.js +12 -7
  19. package/dist/modules/homepage/components/Notifications/NotificationSkeleton.js +4 -7
  20. package/dist/modules/homepage/components/Notifications/components/NotificationFilterMenu.js +5 -1
  21. package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.js +12 -10
  22. package/dist/modules/homepage/components/Notifications/components/NotificationOptionsMenu.js +9 -3
  23. package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.js +12 -6
  24. package/dist/modules/homepage/components/Notifications/components/notificationAdapter.js +10 -12
  25. package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.js +10 -9
  26. package/dist/modules/homepage/components/SchoolSpace/SchoolSpaceContainer.js +1 -1
  27. package/dist/modules/homepage/{hooks → components/SchoolSpace}/useUserSchools.d.ts +2 -2
  28. package/dist/modules/homepage/{hooks → components/SchoolSpace}/useUserSchools.js +4 -4
  29. package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.js +2 -2
  30. package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.js +2 -2
  31. package/dist/modules/homepage/components/UserSpace/UserSpace.d.ts +1 -3
  32. package/dist/modules/homepage/components/UserSpace/UserSpace.js +7 -13
  33. package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.d.ts +2 -4
  34. package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.js +2 -3
  35. package/dist/modules/homepage/components/index.d.ts +1 -9
  36. package/dist/modules/icons/components/index.d.ts +0 -2
  37. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +2 -0
  38. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +2 -0
  39. package/dist/modules/multimedia/MediaLibrary/MediaLibraryContext.d.ts +4 -0
  40. package/dist/modules/multimedia/MediaLibrary/innertabs/Upload.js +2 -1
  41. package/dist/modules/multimedia/MediaLibrary/innertabs/Workspace.js +3 -0
  42. package/package.json +6 -6
  43. package/dist/modules/homepage/components/Agenda/Agenda.d.ts +0 -10
  44. package/dist/modules/homepage/components/Agenda/Agenda.js +0 -54
  45. package/dist/modules/homepage/components/Agenda/AgendaContainer.d.ts +0 -1
  46. package/dist/modules/homepage/components/Agenda/AgendaContainer.js +0 -14
  47. package/dist/modules/homepage/components/Agenda/AgendaEventCard.d.ts +0 -10
  48. package/dist/modules/homepage/components/Agenda/AgendaEventCard.js +0 -30
  49. package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.d.ts +0 -14
  50. package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.js +0 -27
  51. package/dist/modules/homepage/components/Agenda/index.d.ts +0 -3
  52. package/dist/modules/homepage/components/Agenda/services/api/agendaService.d.ts +0 -24
  53. package/dist/modules/homepage/components/Agenda/services/api/agendaService.js +0 -45
  54. package/dist/modules/homepage/components/Agenda/services/api/index.d.ts +0 -4
  55. package/dist/modules/homepage/components/Agenda/services/api/index.js +0 -5
  56. package/dist/modules/homepage/components/Agenda/services/queries/agenda.d.ts +0 -19
  57. package/dist/modules/homepage/components/Agenda/services/queries/agenda.js +0 -26
  58. package/dist/modules/homepage/components/BriefMe/BriefMe.d.ts +0 -9
  59. package/dist/modules/homepage/components/BriefMe/BriefMe.js +0 -59
  60. package/dist/modules/homepage/components/BriefMe/BriefMeContainer.d.ts +0 -4
  61. package/dist/modules/homepage/components/BriefMe/BriefMeContainer.js +0 -17
  62. package/dist/modules/homepage/components/BriefMe/index.d.ts +0 -4
  63. package/dist/modules/homepage/components/BriefMe/types.d.ts +0 -17
  64. package/dist/modules/homepage/components/BriefMe/types.js +0 -8
  65. package/dist/modules/homepage/components/BriefMe/useBriefMe.d.ts +0 -31
  66. package/dist/modules/homepage/components/BriefMe/useBriefMe.js +0 -51
  67. package/dist/modules/homepage/components/Cantine/Cantine.d.ts +0 -7
  68. package/dist/modules/homepage/components/Cantine/Cantine.js +0 -44
  69. package/dist/modules/homepage/components/Cantine/CantineContainer.d.ts +0 -4
  70. package/dist/modules/homepage/components/Cantine/CantineContainer.js +0 -18
  71. package/dist/modules/homepage/components/Cantine/CantineModal.d.ts +0 -24
  72. package/dist/modules/homepage/components/Cantine/CantineModal.js +0 -88
  73. package/dist/modules/homepage/components/Cantine/CantineModalContainer.d.ts +0 -7
  74. package/dist/modules/homepage/components/Cantine/CantineModalContainer.js +0 -12
  75. package/dist/modules/homepage/components/Cantine/components/CantineLegend.d.ts +0 -5
  76. package/dist/modules/homepage/components/Cantine/components/CantineLegend.js +0 -22
  77. package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.d.ts +0 -6
  78. package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.js +0 -28
  79. package/dist/modules/homepage/components/Cantine/components/cantineLabels.d.ts +0 -12
  80. package/dist/modules/homepage/components/Cantine/components/cantineLabels.js +0 -60
  81. package/dist/modules/homepage/components/Cantine/hooks/useCantine.d.ts +0 -11
  82. package/dist/modules/homepage/components/Cantine/hooks/useCantine.js +0 -20
  83. package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.d.ts +0 -24
  84. package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.js +0 -65
  85. package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.d.ts +0 -23
  86. package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.js +0 -43
  87. package/dist/modules/homepage/components/Cantine/index.d.ts +0 -7
  88. package/dist/modules/homepage/components/Cantine/types.d.ts +0 -42
  89. package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.d.ts +0 -16
  90. package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.js +0 -48
  91. package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.d.ts +0 -4
  92. package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.js +0 -12
  93. package/dist/modules/homepage/components/GenerationHdf/formatSolde.d.ts +0 -1
  94. package/dist/modules/homepage/components/GenerationHdf/formatSolde.js +0 -6
  95. package/dist/modules/homepage/components/GenerationHdf/index.d.ts +0 -3
  96. package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.d.ts +0 -10
  97. package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.js +0 -68
  98. package/dist/modules/homepage/components/Header/AccountActionListPopover.d.ts +0 -13
  99. package/dist/modules/homepage/components/Header/AccountActionListPopover.js +0 -26
  100. package/dist/modules/homepage/components/Header/ActionItem.d.ts +0 -38
  101. package/dist/modules/homepage/components/Header/ActionItem.js +0 -34
  102. package/dist/modules/homepage/components/Header/MyAppsPopover.d.ts +0 -5
  103. package/dist/modules/homepage/components/Header/MyAppsPopover.js +0 -28
  104. package/dist/modules/homepage/components/Header/useSafeHoverPopover.js +0 -32
  105. package/dist/modules/homepage/components/Qwant/Qwant.d.ts +0 -4
  106. package/dist/modules/homepage/components/Qwant/Qwant.js +0 -41
  107. package/dist/modules/homepage/components/Qwant/QwantContainer.d.ts +0 -1
  108. package/dist/modules/homepage/components/Qwant/QwantContainer.js +0 -10
  109. package/dist/modules/homepage/components/Qwant/index.d.ts +0 -3
  110. package/dist/modules/homepage/components/Rss/Rss.d.ts +0 -11
  111. package/dist/modules/homepage/components/Rss/Rss.js +0 -64
  112. package/dist/modules/homepage/components/Rss/RssContainer.d.ts +0 -1
  113. package/dist/modules/homepage/components/Rss/RssContainer.js +0 -45
  114. package/dist/modules/homepage/components/Rss/RssFeedForm.d.ts +0 -13
  115. package/dist/modules/homepage/components/Rss/RssFeedForm.js +0 -69
  116. package/dist/modules/homepage/components/Rss/RssFeedsModal.d.ts +0 -11
  117. package/dist/modules/homepage/components/Rss/RssFeedsModal.js +0 -58
  118. package/dist/modules/homepage/components/Rss/hooks/useRssContainer.d.ts +0 -25
  119. package/dist/modules/homepage/components/Rss/hooks/useRssContainer.js +0 -43
  120. package/dist/modules/homepage/components/Rss/index.d.ts +0 -6
  121. package/dist/modules/homepage/components/Rss/services/api/index.d.ts +0 -5
  122. package/dist/modules/homepage/components/Rss/services/api/index.js +0 -5
  123. package/dist/modules/homepage/components/Rss/services/api/rssService.d.ts +0 -38
  124. package/dist/modules/homepage/components/Rss/services/api/rssService.js +0 -51
  125. package/dist/modules/homepage/components/Rss/services/queries/rss.d.ts +0 -28
  126. package/dist/modules/homepage/components/Rss/services/queries/rss.js +0 -71
  127. package/dist/modules/homepage/components/Rss/types.d.ts +0 -25
  128. package/dist/modules/homepage/components/Rss/utils.d.ts +0 -7
  129. package/dist/modules/homepage/components/Rss/utils.js +0 -19
  130. package/dist/modules/homepage/components/Universalis/Universalis.d.ts +0 -8
  131. package/dist/modules/homepage/components/Universalis/Universalis.js +0 -62
  132. package/dist/modules/homepage/components/Universalis/UniversalisContainer.d.ts +0 -1
  133. package/dist/modules/homepage/components/Universalis/UniversalisContainer.js +0 -16
  134. package/dist/modules/homepage/components/Universalis/index.d.ts +0 -3
  135. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.d.ts +0 -16
  136. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.js +0 -15
  137. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.d.ts +0 -21
  138. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.js +0 -47
  139. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/index.d.ts +0 -2
  140. package/dist/modules/icons/components/IconAddWidget.d.ts +0 -7
  141. package/dist/modules/icons/components/IconAddWidget.js +0 -12
  142. package/dist/modules/icons/components/IconLogout.d.ts +0 -7
  143. package/dist/modules/icons/components/IconLogout.js +0 -13
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useState, useEffect } from "react";
2
+ import { useState, useRef, useEffect } from "react";
3
3
  import clsx from "clsx";
4
4
  import { createPortal } from "react-dom";
5
5
  import { useTranslation } from "react-i18next";
@@ -16,20 +16,22 @@ const HelpZone = ({
16
16
  }) => {
17
17
  const {
18
18
  t
19
- } = useTranslation(), [portalRoot, setPortalRoot] = useState(null), [isCompact, setIsCompact] = useState(!1);
19
+ } = useTranslation(), [portalRoot, setPortalRoot] = useState(null), [isCompact, setIsCompact] = useState(!1), questionButtonRef = useRef(null);
20
20
  if (useEffect(() => (document.body.classList.add("help-zone-active"), setPortalRoot(document.getElementById("portal")), () => {
21
21
  document.body.classList.remove("help-zone-active");
22
22
  }), []), useEffect(() => {
23
23
  if (isCompact)
24
24
  return;
25
- const goCompact = () => setIsCompact(!0);
25
+ const goCompact = () => setIsCompact(!0), handleClick = (event) => {
26
+ questionButtonRef.current && event.target instanceof Node && questionButtonRef.current.contains(event.target) || goCompact();
27
+ };
26
28
  return document.addEventListener("scroll", goCompact, {
27
29
  capture: !0,
28
30
  passive: !0
29
- }), () => {
31
+ }), document.addEventListener("click", handleClick), () => {
30
32
  document.removeEventListener("scroll", goCompact, {
31
33
  capture: !0
32
- });
34
+ }), document.removeEventListener("click", handleClick);
33
35
  };
34
36
  }, [isCompact]), !isReady || !portalRoot)
35
37
  return null;
@@ -42,7 +44,7 @@ const HelpZone = ({
42
44
  "help-zone-logo--full": !isCompact
43
45
  }), children: isCompact ? /* @__PURE__ */ jsx(SvgIconLogoEdificeSmall, { width: 18, height: 18 }) : /* @__PURE__ */ jsx(SvgIconLogoEdificeFull, { width: 81, height: 18 }) }) }) }),
44
46
  /* @__PURE__ */ jsx("span", { className: "help-zone-divider" }),
45
- /* @__PURE__ */ jsx(ButtonBeta, { className: "help-zone-question", "aria-label": t("help-zone.support.open"), color: "tertiary", variant: "ghost", onClick: handleOpenHelpZone, children: /* @__PURE__ */ jsx(Tooltip, { message: t("help-zone.support.open"), placement: "top", children: /* @__PURE__ */ jsx(SvgIconQuestion, { width: 24, height: 24, color: "white" }) }) })
47
+ /* @__PURE__ */ jsx(ButtonBeta, { ref: questionButtonRef, className: "help-zone-question", "aria-label": t("help-zone.support.open"), color: "tertiary", variant: "ghost", onClick: handleOpenHelpZone, children: /* @__PURE__ */ jsx(Tooltip, { message: t("help-zone.support.open"), placement: "top", children: /* @__PURE__ */ jsx(SvgIconQuestion, { width: 24, height: 24, color: "white" }) }) })
46
48
  ] }), portalRoot);
47
49
  };
48
50
  export {
@@ -1,13 +1,16 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import HelpZone from "./HelpZone.js";
3
3
  import useZendeskGuide from "../../hooks/useZendeskGuide/useZendeskGuide.js";
4
+ function getHeaderColor() {
5
+ return getComputedStyle(document.documentElement).getPropertyValue("--primitive-blue-400").trim();
6
+ }
4
7
  function HelpZoneContainer() {
5
- const {
8
+ const headerColor = getHeaderColor(), {
6
9
  isReady,
7
10
  isOpen,
8
11
  open,
9
12
  close
10
- } = useZendeskGuide();
13
+ } = useZendeskGuide(headerColor);
11
14
  return /* @__PURE__ */ jsx(HelpZone, { isReady, isOpen, onOpen: open, onClose: close });
12
15
  }
13
16
  export {
@@ -22,11 +22,11 @@ const Communities = ({
22
22
  height: 80
23
23
  } }),
24
24
  /* @__PURE__ */ jsx("div", { className: "communities-empty-content", children: canCreateCommunity ? /* @__PURE__ */ jsxs(Fragment, { children: [
25
- /* @__PURE__ */ jsx("p", { className: "communities-empty-title", children: t("homepage.communities.subtitle.teacher") }),
26
- /* @__PURE__ */ jsx("p", { className: "communities-empty-description", children: t("homepage.communities.description.teacher") })
25
+ /* @__PURE__ */ jsx("p", { className: "communities-empty-title", children: t("homepage.communities.subtitle.teacher", "Réunissez vos élèves avec Communautés !") }),
26
+ /* @__PURE__ */ jsx("p", { className: "communities-empty-description", children: t("homepage.communities.description.teacher", "Centralisez et organisez les documents et les ressources pour vos groupes d'élèves.") })
27
27
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
28
- /* @__PURE__ */ jsx("p", { className: "communities-empty-title", children: t("homepage.communities.subtitle.student") }),
29
- /* @__PURE__ */ jsx("p", { className: "communities-empty-description", children: t("homepage.communities.description.student") })
28
+ /* @__PURE__ */ jsx("p", { className: "communities-empty-title", children: t("homepage.communities.subtitle.student", "Retrouvez toutes vos communautés ici ! ") }),
29
+ /* @__PURE__ */ jsx("p", { className: "communities-empty-description", children: t("homepage.communities.description.student", `Consultez l'onglet "Nouveaux partages" pour découvrir si vous avez été ajouté à une nouvelle communauté.`) })
30
30
  ] }) })
31
31
  ] }) }) })
32
32
  ] });
@@ -2,14 +2,13 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import clsx from "clsx";
3
3
  import { useTranslation } from "react-i18next";
4
4
  import { useId } from "react";
5
- import { AccountActionListPopover } from "./AccountActionListPopover.js";
6
- import { MyAppsPopoverBody, MyAppsPopoverFooter } from "./MyAppsPopover.js";
7
- import { useSafeHoverPopover } from "./useSafeHoverPopover.js";
8
5
  import { Navbar } from "../../../../components/Layout/components/Navbar.js";
9
6
  import { NavItem } from "../../../../components/Layout/components/NavItem.js";
10
7
  import { NavLink } from "../../../../components/Layout/components/NavLink.js";
11
8
  import useHeader from "../../../../components/Layout/hooks/useHeader.js";
9
+ import SvgIconSetBackground from "../../../icons/components/IconSetBackground.js";
12
10
  import SvgIconCommunitiesBeta from "../../../icons/components/nav/IconCommunitiesBeta.js";
11
+ import SvgIconDisconnect from "../../../icons/components/nav/IconDisconnect.js";
13
12
  import SvgIconHomeBeta from "../../../icons/components/nav/IconHomeBeta.js";
14
13
  import SvgIconMessagesBeta from "../../../icons/components/nav/IconMessagesBeta.js";
15
14
  import SvgIconMyAppsBeta from "../../../icons/components/nav/IconMyAppsBeta.js";
@@ -19,13 +18,13 @@ import useConversation from "../../../../hooks/useConversation/useConversation.j
19
18
  import useUser from "../../../../hooks/useUser/useUser.js";
20
19
  import useCarbonioUnread from "../../../../hooks/useCarbonioUnread/useCarbonioUnread.js";
21
20
  import { useEdificeTheme } from "../../../../providers/EdificeThemeProvider/EdificeThemeProvider.hook.js";
22
- import useBreakpoint from "../../../../hooks/useBreakpoint/useBreakpoint.js";
21
+ import useHover from "../../../../hooks/useHover/useHover.js";
23
22
  import LogoBeta from "../../../../components/LogoBeta/LogoBeta.js";
24
23
  import Badge from "../../../../components/Badge/Badge.js";
25
24
  import VisuallyHidden from "../../../../components/VisuallyHidden/VisuallyHidden.js";
26
25
  import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
27
26
  import Avatar from "../../../../components/Avatar/Avatar.js";
28
- import { Popover, PopoverBody, PopoverFooter } from "../../../../components/Popover/Popover.js";
27
+ import { Popover, PopoverBody } from "../../../../components/Popover/Popover.js";
29
28
  const Header = ({
30
29
  src = "",
31
30
  onNotificationsClick,
@@ -45,21 +44,13 @@ const Header = ({
45
44
  userAvatar,
46
45
  userName,
47
46
  communitiesWorkflow,
48
- conversationWorflow,
49
- bookmarkedApps
47
+ conversationWorflow
50
48
  } = useHeader({
51
49
  user,
52
50
  avatar
53
51
  }), {
54
52
  theme
55
- } = useEdificeTheme(), hasMessages = messages > 0, hasNotificationToday = useHasNotificationToday(), popoverUserId = useId(), popoverAppsId = useId(), {
56
- lg: isDesktop
57
- } = useBreakpoint(), myApps = useSafeHoverPopover({
58
- hoverEnabled: isDesktop,
59
- clickEnabled: !isDesktop
60
- }), userMenu = useSafeHoverPopover(), handleMyAppsClick = (event) => {
61
- isDesktop || event.preventDefault();
62
- }, handleNotificationsClick = () => {
53
+ } = useEdificeTheme(), hasMessages = messages > 0, hasNotificationToday = useHasNotificationToday(), [userRef, isUserHovered] = useHover(), popoverUserId = useId(), handleNotificationsClick = () => {
63
54
  onNotificationsClick == null || onNotificationsClick();
64
55
  };
65
56
  return /* @__PURE__ */ jsx("header", { className: classes, "data-product": dataProduct, children: /* @__PURE__ */ jsxs(Navbar, { className: "px-24", children: [
@@ -82,15 +73,7 @@ const Header = ({
82
73
  }, className: "position-absolute", children: carbonioUnreadCount }),
83
74
  /* @__PURE__ */ jsx(VisuallyHidden, { children: t("conversation") })
84
75
  ] }) }),
85
- /* @__PURE__ */ jsxs(NavItem, { className: "position-relative", children: [
86
- /* @__PURE__ */ jsx(NavLink, { ref: myApps.setReference, link: "/welcome", translate: t("navbar.applications"), id: popoverAppsId, "aria-haspopup": "true", "aria-expanded": myApps.open, "data-testid": "header-my-apps-button", ...myApps.getReferenceProps({
87
- onClick: handleMyAppsClick
88
- }), children: /* @__PURE__ */ jsx(SvgIconMyAppsBeta, {}) }),
89
- /* @__PURE__ */ jsxs(Popover, { ref: myApps.setFloating, className: "my-apps-popover", id: popoverAppsId, isVisible: myApps.open, ...myApps.getFloatingProps(), children: [
90
- /* @__PURE__ */ jsx(PopoverBody, { children: /* @__PURE__ */ jsx(MyAppsPopoverBody, { bookmarkedApps }) }),
91
- /* @__PURE__ */ jsx(PopoverFooter, { className: "d-flex justify-content-center", children: /* @__PURE__ */ jsx(MyAppsPopoverFooter, {}) })
92
- ] })
93
- ] }),
76
+ /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsx(NavLink, { link: "/welcome", translate: t("navbar.applications"), "data-testid": "header-my-apps-button", children: /* @__PURE__ */ jsx(SvgIconMyAppsBeta, {}) }) }),
94
77
  /* @__PURE__ */ jsxs(NavItem, { className: "position-relative", children: [
95
78
  /* @__PURE__ */ jsx(ButtonBeta, { leftIcon: /* @__PURE__ */ jsx(SvgIconNotificationBeta, {}), variant: "ghost", onClick: handleNotificationsClick }),
96
79
  hasNotificationToday && /* @__PURE__ */ jsx("span", { style: {
@@ -105,11 +88,22 @@ const Header = ({
105
88
  pointerEvents: "none",
106
89
  zIndex: 1,
107
90
  display: "block"
108
- }, "aria-label": t("homepage.notifications.new-badge") })
91
+ }, "aria-label": t("homepage.notifications.new-badge", {
92
+ defaultValue: "Nouvelle notification"
93
+ }) })
109
94
  ] }),
110
- /* @__PURE__ */ jsxs(NavItem, { className: "position-relative", children: [
111
- /* @__PURE__ */ jsx(NavLink, { ref: userMenu.setReference, link: "/userbook/mon-compte", translate: t("navbar.myaccount"), id: popoverUserId, "aria-haspopup": "true", "aria-expanded": userMenu.open, "data-testid": "header-user-profile-button", ...userMenu.getReferenceProps(), children: /* @__PURE__ */ jsx(Avatar, { alt: userName, size: "sm", src: userAvatar, variant: "circle", className: "bg-white", width: "32", height: "32" }) }),
112
- /* @__PURE__ */ jsx(AccountActionListPopover, { ref: userMenu.setFloating, align: "end", id: popoverUserId, isVisible: userMenu.open, logoutCallback: theme == null ? void 0 : theme.logoutCallback, ...userMenu.getFloatingProps() })
95
+ /* @__PURE__ */ jsxs(NavItem, { className: "position-relative", ref: userRef, id: popoverUserId, "aria-haspopup": "true", "aria-expanded": isUserHovered, "data-testid": "header-user-menu-button", children: [
96
+ /* @__PURE__ */ jsx(NavLink, { link: "/userbook/mon-compte", translate: t("navbar.myaccount"), "data-testid": "header-user-profile-button", children: /* @__PURE__ */ jsx(Avatar, { alt: userName, size: "sm", src: userAvatar, variant: "circle", className: "bg-white", width: "32", height: "32" }) }),
97
+ /* @__PURE__ */ jsx(Popover, { align: "end", className: "widget", id: popoverUserId, isVisible: isUserHovered, children: /* @__PURE__ */ jsxs(PopoverBody, { children: [
98
+ /* @__PURE__ */ jsxs("a", { href: "/timeline/customize?callback=" + encodeURIComponent(`${window.location.pathname}${window.location.search}`), className: "nav-link customize d-flex align-items-center gap-8", "data-testid": "header-customize-button", children: [
99
+ /* @__PURE__ */ jsx(SvgIconSetBackground, { className: "icon" }),
100
+ /* @__PURE__ */ jsx("span", { id: "cutomize-label", className: "nav-text", children: t("navbar.customize") })
101
+ ] }),
102
+ /* @__PURE__ */ jsxs("a", { href: "/auth/logout?callback=" + ((theme == null ? void 0 : theme.logoutCallback) ?? ""), className: "nav-link logout d-flex align-items-center gap-8", "data-testid": "header-logout-button", children: [
103
+ /* @__PURE__ */ jsx(SvgIconDisconnect, { className: "icon logout" }),
104
+ /* @__PURE__ */ jsx("span", { id: "logout-label", className: "nav-text", children: t("navbar.disconnect") })
105
+ ] })
106
+ ] }) })
113
107
  ] })
114
108
  ] })
115
109
  ] }) });
@@ -3,11 +3,7 @@ import { ButtonBeta } from '../../../../components';
3
3
  export interface HomeCardHeaderProps extends Omit<ComponentPropsWithoutRef<'div'>, 'title'> {
4
4
  /** Title displayed on the left side of the header. */
5
5
  title: ReactNode;
6
- /**
7
- * Label of the action button displayed on the right side of the header.
8
- * Can be omitted for an icon-only button — pass `aria-label` via
9
- * `actionProps` in that case.
10
- */
6
+ /** Label of the action button displayed on the right side of the header. */
11
7
  actionLabel?: ReactNode;
12
8
  /** Callback invoked when the action button is clicked. */
13
9
  onActionClick?: MouseEventHandler<HTMLButtonElement>;
@@ -12,7 +12,7 @@ const HomeCardHeader = ({
12
12
  className,
13
13
  ...rest
14
14
  }) => {
15
- const hasAction = !!onActionClick && (!!actionLabel || !!actionLeftIcon || !!actionRightIcon);
15
+ const hasAction = !!actionLabel && !!onActionClick;
16
16
  return /* @__PURE__ */ jsxs(Flex, { align: "center", justify: "between", gap: "8", wrap: "wrap", className: clsx("home-card-header", className), ...rest, children: [
17
17
  /* @__PURE__ */ jsx("h3", { className: "home-card-header-title", children: title }),
18
18
  hasAction && /* @__PURE__ */ jsx(ButtonBeta, { color: "tertiary", size: "sm", variant: "ghost", onClick: onActionClick, className: "home-card-header-action", leftIcon: actionLeftIcon, rightIcon: actionRightIcon, "data-testid": "home-card-header-action", ...actionProps, children: actionLabel })
@@ -47,7 +47,7 @@ const MessageFlash = ({
47
47
  }), title: t("close.message", {
48
48
  title: message.title
49
49
  }) }),
50
- /* @__PURE__ */ jsx("div", { className: "message-flash-icon", role: "img", "aria-label": message.color === "red" ? t("homepage.messageFlash.warning") : t("homepage.messageFlash.information"), children: message.color && message.color === "red" ? /* @__PURE__ */ jsx(SvgIconAlertTriangle, {}) : /* @__PURE__ */ jsx(SvgIconInfoCircle, {}) }),
50
+ /* @__PURE__ */ jsx("div", { className: "message-flash-icon", role: "img", "aria-label": message.color === "red" ? t("warning") : t("information"), children: message.color && message.color === "red" ? /* @__PURE__ */ jsx(SvgIconAlertTriangle, {}) : /* @__PURE__ */ jsx(SvgIconInfoCircle, {}) }),
51
51
  /* @__PURE__ */ jsxs(Flex, { direction: "column", className: "w-100 message-flash-body", children: [
52
52
  /* @__PURE__ */ jsx(Card.Title, { children: message.title }),
53
53
  /* @__PURE__ */ jsx("div", { ref: contentRef, className: classesContent, dangerouslySetInnerHTML: {
@@ -14,7 +14,7 @@ import Divider from "../../../../components/Divider/Divider.js";
14
14
  const NotificationList = ({
15
15
  notifications,
16
16
  notificationTypes,
17
- selectedTypes = [],
17
+ selectedTypes,
18
18
  onFilterChange,
19
19
  onCloseNotifications,
20
20
  onLoadNextPage,
@@ -25,23 +25,24 @@ const NotificationList = ({
25
25
  t
26
26
  } = useTranslation(), loadNextRef = useInfiniteScroll({
27
27
  callback: () => onLoadNextPage == null ? void 0 : onLoadNextPage()
28
- }), handleFilterChange = (types) => onFilterChange == null ? void 0 : onFilterChange(types), handleCloseClick = () => {
28
+ }), handleCloseClick = () => {
29
29
  onCloseNotifications && onCloseNotifications();
30
30
  };
31
- return /* @__PURE__ */ jsx("section", { role: "region", className: "notification-list", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", className: "notification-list-body", children: [
31
+ return /* @__PURE__ */ jsx("section", { role: "region", className: "notification-list", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
32
32
  /* @__PURE__ */ jsxs(Flex, { justify: "between", align: "center", wrap: "nowrap", className: "py-16 ps-24 pe-8", children: [
33
33
  /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "8", className: "notification-list-title", children: [
34
34
  /* @__PURE__ */ jsx("h4", { className: "text-truncate", children: t("homepage.notifications-list.title") }),
35
- notificationTypes && notificationTypes.length > 0 && /* @__PURE__ */ jsx(NotificationFilterMenu, { notificationTypes, selectedTypes, onFilterChange: handleFilterChange })
35
+ notificationTypes && notificationTypes.length > 0 && /* @__PURE__ */ jsx(NotificationFilterMenu, { notificationTypes, selectedTypes: selectedTypes ?? notificationTypes, onFilterChange: (types) => onFilterChange == null ? void 0 : onFilterChange(types) })
36
36
  ] }),
37
37
  onCloseNotifications && /* @__PURE__ */ jsx(ButtonBeta, { color: "tertiary", variant: "ghost", rightIcon: /* @__PURE__ */ jsx(SvgIconClose, {}), onClick: handleCloseClick, "aria-label": t("homepage.notifications-list.close"), title: t("homepage.notifications-list.close"), "data-testid": "notification-list-close-button" })
38
38
  ] }),
39
- isLoading && !(notifications != null && notifications.length) ? /* @__PURE__ */ jsx(NotificationListSkeleton, {}) : !notifications || notifications.length === 0 ? /* @__PURE__ */ jsx("div", { className: "mx-24", children: /* @__PURE__ */ jsx(EmptyScreen, { size: 135, imageSrc: illuEmptyNotification, imageAlt: t("homepage.notifications-list.empty.description"), text: t("homepage.notifications-list.empty.description") }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
40
- /* @__PURE__ */ jsx("ul", { children: notifications.map((notification, index) => /* @__PURE__ */ jsxs("li", { children: [
39
+ (notifications == null ? void 0 : notifications.length) === 0 ? /* @__PURE__ */ jsx("div", { className: "mx-24", children: /* @__PURE__ */ jsx(EmptyScreen, { size: 135, imageSrc: illuEmptyNotification, imageAlt: t("homepage.notifications-list.empty.description"), text: t("homepage.notifications-list.empty.description") }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
40
+ /* @__PURE__ */ jsx("ul", { children: notifications == null ? void 0 : notifications.map((notification, index) => /* @__PURE__ */ jsxs("li", { children: [
41
41
  /* @__PURE__ */ jsx(NotificationItem, { notification }),
42
42
  /* @__PURE__ */ jsx(Divider, { className: "border-grey-300 my-0" })
43
43
  ] }, "notification-list-" + notification._id + "-" + index)) }),
44
- hasNextPage && /* @__PURE__ */ jsx(NotificationSkeleton, { ref: loadNextRef })
44
+ hasNextPage && /* @__PURE__ */ jsx(NotificationSkeleton, { ref: loadNextRef }),
45
+ isLoading && /* @__PURE__ */ jsx(NotificationListSkeleton, {})
45
46
  ] })
46
47
  ] }) });
47
48
  };
@@ -1,12 +1,17 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import NotificationSkeleton from "./NotificationSkeleton.js";
3
3
  import Divider from "../../../../components/Divider/Divider.js";
4
- const SKELETON_COUNT = 8, NotificationListSkeleton = () => /* @__PURE__ */ jsx("ul", { className: "notification-list-skeleton", "aria-hidden": "true", children: Array.from({
5
- length: SKELETON_COUNT
6
- }, (_, index) => /* @__PURE__ */ jsxs("li", { children: [
7
- /* @__PURE__ */ jsx(NotificationSkeleton, {}),
8
- index < SKELETON_COUNT - 1 && /* @__PURE__ */ jsx(Divider, { className: "border-grey-300 my-0" })
9
- ] }, index)) });
4
+ const NotificationListSkeleton = () => /* @__PURE__ */ jsxs("ul", { children: [
5
+ /* @__PURE__ */ jsxs("li", { children: [
6
+ /* @__PURE__ */ jsx(NotificationSkeleton, {}),
7
+ /* @__PURE__ */ jsx(Divider, { className: "border-grey-300 my-0" })
8
+ ] }),
9
+ /* @__PURE__ */ jsxs("li", { children: [
10
+ /* @__PURE__ */ jsx(NotificationSkeleton, {}),
11
+ /* @__PURE__ */ jsx(Divider, { className: "border-grey-300 my-0" })
12
+ ] }),
13
+ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(NotificationSkeleton, {}) })
14
+ ] });
10
15
  export {
11
16
  NotificationListSkeleton as default
12
17
  };
@@ -1,14 +1,11 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import React from "react";
3
3
  import Flex from "../../../../components/Flex/Flex.js";
4
+ import Avatar from "../../../../components/Avatar/Avatar.js";
4
5
  import TextSkeleton from "../../../../components/Skeleton/TextSkeleton.js";
5
- const NotificationSkeleton = /* @__PURE__ */ React.forwardRef((_props, ref) => /* @__PURE__ */ jsx(Flex, { direction: "column", className: "notification-item", gap: "8", ref, children: /* @__PURE__ */ jsxs(Flex, { direction: "row", gap: "8", children: [
6
- /* @__PURE__ */ jsx("div", { className: "notification-item-picture", children: /* @__PURE__ */ jsx("div", { className: "placeholder col-4", style: {
7
- height: "3.2rem",
8
- width: "3.2rem",
9
- borderRadius: "50%"
10
- } }) }),
11
- /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "8", className: "notification-item-message", children: [
6
+ const NotificationSkeleton = /* @__PURE__ */ React.forwardRef((_props, ref) => /* @__PURE__ */ jsx(Flex, { direction: "column", className: "notification", gap: "8", ref, children: /* @__PURE__ */ jsxs(Flex, { direction: "row", gap: "8", children: [
7
+ /* @__PURE__ */ jsx("div", { className: "notification-item-picture", children: /* @__PURE__ */ jsx(Avatar, { alt: "Notification Picture", variant: "circle", className: "notification-item-avatar" }) }),
8
+ /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "8", className: "notification-message", children: [
12
9
  /* @__PURE__ */ jsx(TextSkeleton, {}),
13
10
  /* @__PURE__ */ jsx(TextSkeleton, {}),
14
11
  /* @__PURE__ */ jsx("div", { className: "placeholder col-4", style: {
@@ -16,7 +16,11 @@ const NotificationFilterMenu = ({
16
16
  onFilterChange(types), setIsOpen(!1);
17
17
  };
18
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"), title: t("homepage.notifications.filter-modal.trigger"), onClick: () => setIsOpen(!0), "data-testid": "notification-filter-button" }),
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" }),
20
24
  isOpen && /* @__PURE__ */ jsx(NotificationFilterModal, { isOpen, allTypes: notificationTypes, appliedTypes: selectedTypes, onCancel: () => setIsOpen(!1), onApply: handleApply })
21
25
  ] });
22
26
  };
@@ -1,12 +1,11 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import clsx from "clsx";
3
- import { useState, useMemo } from "react";
3
+ import { useState, useRef, useMemo, useEffect } from "react";
4
4
  import { useTranslation } from "react-i18next";
5
5
  import SvgIconCheck from "../../../../icons/components/IconCheck.js";
6
6
  import { getAppCodeAndI18nKey } from "./notificationAdapter.js";
7
- import ModalBeta from "../../../../../components/ModalBeta/ModalBeta.js";
7
+ import Modal from "../../../../../components/Modal/Modal.js";
8
8
  import Flex from "../../../../../components/Flex/Flex.js";
9
- import Checkbox from "../../../../../components/Checkbox/Checkbox.js";
10
9
  import AppIcon from "../../../../../components/AppIcon/AppIcon.js";
11
10
  import ButtonBeta from "../../../../../components/ButtonBeta/ButtonBeta.js";
12
11
  const NotificationFilterModal = ({
@@ -19,7 +18,7 @@ const NotificationFilterModal = ({
19
18
  const {
20
19
  t,
21
20
  i18n
22
- } = useTranslation(), [selected, setSelected] = useState(appliedTypes), allTypesSorted = useMemo(() => allTypes.map((type) => {
21
+ } = useTranslation(), [selected, setSelected] = useState(appliedTypes), refSelectAllCheckbox = useRef(null), allTypesSorted = useMemo(() => allTypes.map((type) => {
23
22
  const [appCode, appI18nKey] = getAppCodeAndI18nKey(type), label = t(appI18nKey, {
24
23
  defaultValue: appCode
25
24
  });
@@ -36,13 +35,16 @@ const NotificationFilterModal = ({
36
35
  }, toggleAll = () => {
37
36
  setSelected(selected.length === allTypes.length ? [] : allTypes);
38
37
  };
39
- return /* @__PURE__ */ jsxs(ModalBeta, { id: "notification-filter-modal", size: "l", isOpen, onModalClose: onCancel, children: [
40
- /* @__PURE__ */ jsx(ModalBeta.Header, { subtitle: t("homepage.notifications.filter-modal.subtitle"), onModalClose: onCancel, children: t("homepage.notifications.filter-modal.title") }),
41
- /* @__PURE__ */ jsxs(ModalBeta.Body, { children: [
38
+ return useEffect(() => {
39
+ refSelectAllCheckbox.current && (refSelectAllCheckbox.current.indeterminate = selected.length > 0 && selected.length < allTypes.length);
40
+ }, [selected.length, allTypes.length]), /* @__PURE__ */ jsxs(Modal, { id: "notification-filter-modal", size: "lg", scrollable: !0, isOpen, onModalClose: onCancel, children: [
41
+ /* @__PURE__ */ jsx(Modal.Header, { onModalClose: onCancel, children: t("homepage.notifications.filter-modal.title") }),
42
+ /* @__PURE__ */ jsx(Modal.Subtitle, { children: t("homepage.notifications.filter-modal.subtitle") }),
43
+ /* @__PURE__ */ jsxs(Modal.Body, { children: [
42
44
  /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "8", className: "mb-24", children: [
43
45
  /* @__PURE__ */ jsxs("label", { className: "notification-filter-select-all notification-filter-chip", children: [
44
46
  /* @__PURE__ */ jsx("span", { children: t("homepage.notifications.filter-modal.select-all") }),
45
- /* @__PURE__ */ jsx(Checkbox, { checked: selected.length === allTypes.length, indeterminate: selected.length > 0 && selected.length < allTypes.length, onChange: toggleAll })
47
+ /* @__PURE__ */ jsx("input", { type: "checkbox", ref: refSelectAllCheckbox, checked: selected.length === allTypes.length, className: "notification-filter-checkbox", onChange: toggleAll })
46
48
  ] }),
47
49
  /* @__PURE__ */ jsx("span", { className: "notification-filter-count", children: t("homepage.notifications.filter-modal.count", {
48
50
  selected: selected.length,
@@ -60,11 +62,11 @@ const NotificationFilterModal = ({
60
62
  }), children: [
61
63
  /* @__PURE__ */ jsx(AppIcon, { app: appCode, size: "24", iconFit: "contain" }),
62
64
  /* @__PURE__ */ jsx("span", { children: label }),
63
- /* @__PURE__ */ jsx(Checkbox, { checked, onChange: () => toggleType(type) })
65
+ /* @__PURE__ */ jsx("input", { type: "checkbox", className: "notification-filter-checkbox", checked, onChange: () => toggleType(type) })
64
66
  ] }, type);
65
67
  }) })
66
68
  ] }),
67
- /* @__PURE__ */ jsxs(ModalBeta.Footer, { children: [
69
+ /* @__PURE__ */ jsxs(Modal.Footer, { children: [
68
70
  /* @__PURE__ */ jsx(ButtonBeta, { color: "tertiary", onClick: onCancel, type: "button", variant: "ghost", children: t("cancel") }),
69
71
  /* @__PURE__ */ jsx(ButtonBeta, { color: "default", onClick: () => onApply(selected), type: "button", variant: "filled", rightIcon: /* @__PURE__ */ jsx(SvgIconCheck, {}), children: t("homepage.notifications.filter-modal.confirm") })
70
72
  ] })
@@ -20,10 +20,16 @@ const NotificationOptionsMenu = ({
20
20
  } = useDeleteNotification(), [isReportModalOpen, setIsReportModalOpen] = useState(!1);
21
21
  return /* @__PURE__ */ jsxs(Fragment, { children: [
22
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"), color: "tertiary", variant: "ghost", icon: /* @__PURE__ */ jsx(SvgIconOptions, {}), "data-testid": "notification-item-options-button" }),
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" }),
24
26
  /* @__PURE__ */ jsxs(Dropdown.Menu, { children: [
25
- /* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconAlertTriangle, {}), onClick: () => setIsReportModalOpen(!0), children: t("homepage.notifications.options.report") }),
26
- /* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconDelete, {}), onClick: () => deleteNotification(notificationId), children: t("homepage.notifications.options.delete") })
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
+ }) })
27
33
  ] })
28
34
  ] }) }),
29
35
  isReportModalOpen && /* @__PURE__ */ jsx(ReportNotificationModal, { isOpen: isReportModalOpen, onCancel: () => setIsReportModalOpen(!1), onConfirm: () => {
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useTranslation } from "react-i18next";
3
3
  import SvgIconAlertTriangle from "../../../../icons/components/IconAlertTriangle.js";
4
- import ModalBeta from "../../../../../components/ModalBeta/ModalBeta.js";
4
+ import Modal from "../../../../../components/Modal/Modal.js";
5
5
  import ButtonBeta from "../../../../../components/ButtonBeta/ButtonBeta.js";
6
6
  const ReportNotificationModal = ({
7
7
  isOpen,
@@ -11,12 +11,18 @@ const ReportNotificationModal = ({
11
11
  const {
12
12
  t
13
13
  } = useTranslation();
14
- return /* @__PURE__ */ jsxs(ModalBeta, { id: "report-notification-modal", size: "m", isOpen, onModalClose: onCancel, children: [
15
- /* @__PURE__ */ jsx(ModalBeta.Header, { onModalClose: onCancel, children: t("homepage.notifications.report-modal.title") }),
16
- /* @__PURE__ */ jsx(ModalBeta.Body, { children: /* @__PURE__ */ jsx("p", { children: t("homepage.notifications.report-modal.body") }) }),
17
- /* @__PURE__ */ jsxs(ModalBeta.Footer, { children: [
14
+ return /* @__PURE__ */ jsxs(Modal, { id: "report-notification-modal", size: "sm", 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: [
18
22
  /* @__PURE__ */ jsx(ButtonBeta, { color: "tertiary", onClick: onCancel, type: "button", variant: "ghost", children: t("cancel") }),
19
- /* @__PURE__ */ jsx(ButtonBeta, { color: "default", onClick: onConfirm, type: "button", variant: "filled", leftIcon: /* @__PURE__ */ jsx(SvgIconAlertTriangle, {}), children: t("homepage.notifications.report-modal.confirm") })
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
+ }) })
20
26
  ] })
21
27
  ] });
22
28
  };
@@ -8,36 +8,34 @@ const resolveNotificationResourceUri = (params, type, appCode, eventType) => {
8
8
  return value;
9
9
  }, parseNotificationMessage = (message) => message.replace(/<\/a>/gi, "</strong>").replace(/<a\b[^>]*>/gi, "<strong>"), getAppCodeAndI18nKey = (appCode) => {
10
10
  appCode = appCode.toLowerCase();
11
- const appI18nKey = `homepage.notification.type.${appCode}`;
11
+ let appI18nKey = appCode;
12
12
  switch (appCode) {
13
- case "collaborativeeditor":
14
- appCode = "pad";
15
- break;
16
13
  case "collaborativewall":
17
14
  appCode = "collaborative-wall";
18
15
  break;
19
16
  case "formulaire":
20
- appCode = "forms";
17
+ appI18nKey = "formulaire", appCode = "forms";
21
18
  break;
22
19
  case "messagerie":
23
- appCode = "conversation";
20
+ appI18nKey = appCode = "conversation";
24
21
  break;
25
22
  case "news":
26
- appCode = "actualites";
23
+ appI18nKey = appCode = "actualites";
27
24
  break;
28
25
  case "homeworks":
29
26
  appCode = "cahier-de-texte";
30
27
  break;
31
28
  case "userbook_motto":
29
+ appI18nKey = "userbook_motto", appCode = "userbook";
30
+ break;
32
31
  case "userbook_mood":
33
- case "userbook_discovervisiblegroups":
34
- appCode = "userbook";
32
+ appI18nKey = "userbook_mood", appCode = "userbook";
35
33
  break;
36
- case "viescolaire":
37
- appCode = "vie-scolaire";
34
+ case "userbook_discovervisiblegroups":
35
+ appI18nKey = "userbook_discovervisiblegroups", appCode = "userbook";
38
36
  break;
39
37
  default:
40
- appCode = appCode.replace(/_/g, "-");
38
+ appI18nKey = appCode = appCode.replace(/_/g, "-");
41
39
  }
42
40
  return [appCode, appI18nKey];
43
41
  }, notificationAdapter = (notification) => {
@@ -14,30 +14,31 @@ const useNotificationListContainer = () => {
14
14
  mutate: saveTimelinePreference
15
15
  } = useSaveTimelinePreference(), [selectedTypes, setSelectedTypesState] = useState();
16
16
  useEffect(() => {
17
- selectedTypes === void 0 && isFetchedTypes && isFetchedPreference && setSelectedTypesState((preference == null ? void 0 : preference.type) ?? notificationTypes ?? []);
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
+ }
18
21
  }, [selectedTypes, isFetchedTypes, isFetchedPreference, preference, notificationTypes]);
19
22
  const setSelectedTypes = (types) => {
20
23
  setSelectedTypesState(types), saveTimelinePreference({
21
24
  ...preference,
22
25
  type: types
23
26
  });
24
- }, hasNoTypeSelected = (selectedTypes == null ? void 0 : selectedTypes.length) === 0, {
25
- data,
27
+ }, {
28
+ data: notifications,
26
29
  hasNextPage,
27
30
  isLoading: isLoadingNotifications,
28
31
  error: errorNotifications,
29
32
  fetchNextPage
30
- } = useNotifications(selectedTypes ?? [], isFetchedTypes && !!selectedTypes && !hasNoTypeSelected);
33
+ } = useNotifications(selectedTypes ?? [], isFetchedTypes && !!selectedTypes);
31
34
  return {
32
- notifications: hasNoTypeSelected ? [] : data,
35
+ notifications,
33
36
  notificationTypes,
34
37
  selectedTypes,
35
38
  setSelectedTypes,
36
- hasNextPage: hasNoTypeSelected ? !1 : hasNextPage,
39
+ hasNextPage,
37
40
  loadNextPage: () => fetchNextPage(),
38
- // The notification query stays disabled until the saved filter is
39
- // read, so this wait must count as loading too.
40
- isLoading: isLoadingTypes || selectedTypes === void 0 || isLoadingNotifications,
41
+ isLoading: isLoadingTypes || isLoadingNotifications,
41
42
  error: errorTypes || errorNotifications
42
43
  };
43
44
  }, useHasNotificationToday = () => {
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import SchoolSpace from "./SchoolSpace.js";
3
- import { useUserSchools } from "../../hooks/useUserSchools.js";
3
+ import { useUserSchools } from "./useUserSchools.js";
4
4
  function SchoolSpaceContainer() {
5
5
  const {
6
6
  handleSelectedSchoolChange,
@@ -1,5 +1,5 @@
1
- import { School, WidgetName } from '@edifice.io/client';
2
- export declare function useUserSchools(widgetName?: WidgetName): {
1
+ import { School } from '@edifice.io/client';
2
+ export declare function useUserSchools(): {
3
3
  schools: School[];
4
4
  selectedSchool: School | undefined;
5
5
  handleSelectedSchoolChange: (school: School) => void;
@@ -1,15 +1,15 @@
1
1
  import { WIDGET_NAME } from "@edifice.io/client";
2
2
  import { useState, useEffect } from "react";
3
- import useWidget from "./useWidget.js";
4
- import useSession from "../../../hooks/useSession/useSession.js";
5
- function useUserSchools(widgetName = WIDGET_NAME.SCHOOL) {
3
+ import useWidget from "../../hooks/useWidget.js";
4
+ import useSession from "../../../../hooks/useSession/useSession.js";
5
+ function useUserSchools() {
6
6
  var _a, _b;
7
7
  const {
8
8
  data: session
9
9
  } = useSession(), {
10
10
  preference,
11
11
  savePreference
12
- } = useWidget(widgetName), [selectedSchool, setSelectedSchool] = useState(), [schools, setSchools] = useState((_a = session == null ? void 0 : session.userDescription) == null ? void 0 : _a.schools);
12
+ } = useWidget(WIDGET_NAME.SCHOOL), [selectedSchool, setSelectedSchool] = useState(), [schools, setSchools] = useState((_a = session == null ? void 0 : session.userDescription) == null ? void 0 : _a.schools);
13
13
  return useEffect(() => {
14
14
  var _a2;
15
15
  const newSchools = (_a2 = session == null ? void 0 : session.userDescription) == null ? void 0 : _a2.schools;
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useTranslation } from "react-i18next";
3
- import illuEmptyFeeds from "@edifice.io/bootstrap/dist/images/homepage/illu-empty-useful-links.png";
3
+ import illuEmptyUsefulLinks from "@edifice.io/bootstrap/dist/images/homepage/illu-empty-useful-links.png";
4
4
  import SvgIconEdit from "../../../icons/components/IconEdit.js";
5
5
  import HomeCard from "../HomeCard/HomeCard.js";
6
6
  import Image from "../../../../components/Image/Image.js";
@@ -18,7 +18,7 @@ function UsefulLinks({
18
18
  "data-testid": "usefullinks-button-edit"
19
19
  } }),
20
20
  /* @__PURE__ */ jsx(HomeCard.Content, { children: links.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "useful-links-widget__empty", children: [
21
- /* @__PURE__ */ jsx(Image, { src: illuEmptyFeeds, alt: "", "aria-hidden": "true", style: {
21
+ /* @__PURE__ */ jsx(Image, { src: illuEmptyUsefulLinks, alt: "", "aria-hidden": "true", style: {
22
22
  width: 160,
23
23
  height: 87
24
24
  } }),