@edifice.io/react 2.6.9-develop-integration.20261015175127 → 2.6.9-develop-b2school.20261016112251
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Layout/Layout.js +12 -4
- package/dist/components/Layout/components/Header.js +4 -4
- package/dist/components/Layout/components/NavLink.d.ts +3 -3
- package/dist/components/Layout/components/NavLink.js +5 -3
- package/dist/components/Tree/utilities/tree.js +1 -21
- package/dist/homepage.js +54 -24
- package/dist/hooks/index.d.ts +0 -3
- package/dist/hooks/useBackground/useBackground.d.ts +1 -1
- package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +2 -6
- package/dist/hooks/useZendeskGuide/useZendeskGuide.js +11 -8
- package/dist/icons.js +404 -402
- package/dist/index.js +184 -198
- package/dist/modules/HelpZone/HelpZone.js +6 -8
- package/dist/modules/HelpZone/HelpZoneContainer.js +2 -5
- package/dist/modules/homepage/components/Agenda/Agenda.d.ts +10 -0
- package/dist/modules/homepage/components/Agenda/Agenda.js +54 -0
- package/dist/modules/homepage/components/Agenda/AgendaContainer.d.ts +1 -0
- package/dist/modules/homepage/components/Agenda/AgendaContainer.js +14 -0
- package/dist/modules/homepage/components/Agenda/AgendaEventCard.d.ts +10 -0
- package/dist/modules/homepage/components/Agenda/AgendaEventCard.js +30 -0
- package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.d.ts +14 -0
- package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.js +27 -0
- package/dist/modules/homepage/components/Agenda/index.d.ts +3 -0
- package/dist/modules/homepage/components/Agenda/services/api/agendaService.d.ts +24 -0
- package/dist/modules/homepage/components/Agenda/services/api/agendaService.js +45 -0
- package/dist/modules/homepage/components/Agenda/services/api/index.d.ts +4 -0
- package/dist/modules/homepage/components/Agenda/services/api/index.js +5 -0
- package/dist/modules/homepage/components/Agenda/services/queries/agenda.d.ts +19 -0
- package/dist/modules/homepage/components/Agenda/services/queries/agenda.js +26 -0
- package/dist/modules/homepage/components/BriefMe/BriefMe.d.ts +9 -0
- package/dist/modules/homepage/components/BriefMe/BriefMe.js +59 -0
- package/dist/modules/homepage/components/BriefMe/BriefMeContainer.d.ts +4 -0
- package/dist/modules/homepage/components/BriefMe/BriefMeContainer.js +17 -0
- package/dist/modules/homepage/components/BriefMe/index.d.ts +4 -0
- package/dist/modules/homepage/components/BriefMe/types.d.ts +17 -0
- package/dist/modules/homepage/components/BriefMe/types.js +8 -0
- package/dist/modules/homepage/components/BriefMe/useBriefMe.d.ts +31 -0
- package/dist/modules/homepage/components/BriefMe/useBriefMe.js +51 -0
- package/dist/modules/homepage/components/Communities/Communities.js +4 -4
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.d.ts +16 -0
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.js +48 -0
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.d.ts +4 -0
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.js +12 -0
- package/dist/modules/homepage/components/GenerationHdf/formatSolde.d.ts +1 -0
- package/dist/modules/homepage/components/GenerationHdf/formatSolde.js +6 -0
- package/dist/modules/homepage/components/GenerationHdf/index.d.ts +3 -0
- package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.d.ts +10 -0
- package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.js +68 -0
- package/dist/modules/homepage/components/Header/Header.js +30 -21
- package/dist/modules/homepage/components/Header/MyAppsPopover.d.ts +5 -0
- package/dist/modules/homepage/components/Header/MyAppsPopover.js +28 -0
- package/dist/modules/homepage/components/Header/useSafeHoverPopover.js +32 -0
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.d.ts +5 -1
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.js +1 -1
- package/dist/modules/homepage/components/MessageFlashList/MessageFlash.js +1 -1
- package/dist/modules/homepage/components/Notifications/NotificationList.js +5 -5
- package/dist/modules/homepage/components/Notifications/NotificationSkeleton.js +2 -2
- package/dist/modules/homepage/components/Notifications/components/NotificationFilterMenu.js +1 -5
- package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.js +10 -12
- package/dist/modules/homepage/components/Notifications/components/NotificationOptionsMenu.js +3 -9
- package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.js +6 -12
- package/dist/modules/homepage/components/Notifications/components/notificationAdapter.js +12 -10
- package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.js +9 -10
- package/dist/modules/homepage/components/Qwant/Qwant.d.ts +4 -0
- package/dist/modules/homepage/components/Qwant/Qwant.js +41 -0
- package/dist/modules/homepage/components/Qwant/QwantContainer.d.ts +1 -0
- package/dist/modules/homepage/components/Qwant/QwantContainer.js +10 -0
- package/dist/modules/homepage/components/Qwant/index.d.ts +3 -0
- package/dist/modules/homepage/components/SchoolSpace/SchoolSpaceContainer.js +1 -1
- package/dist/modules/homepage/components/Universalis/Universalis.d.ts +8 -0
- package/dist/modules/homepage/components/Universalis/Universalis.js +62 -0
- package/dist/modules/homepage/components/Universalis/UniversalisContainer.d.ts +1 -0
- package/dist/modules/homepage/components/Universalis/UniversalisContainer.js +16 -0
- package/dist/modules/homepage/components/Universalis/index.d.ts +3 -0
- package/dist/modules/homepage/components/UserSpace/UserSpace.d.ts +3 -1
- package/dist/modules/homepage/components/UserSpace/UserSpace.js +13 -7
- package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.d.ts +4 -2
- package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.js +3 -2
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.d.ts +16 -0
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.js +15 -0
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.d.ts +21 -0
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.js +47 -0
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/index.d.ts +2 -0
- package/dist/modules/homepage/components/index.d.ts +7 -1
- package/dist/modules/homepage/{components/SchoolSpace → hooks}/useUserSchools.d.ts +2 -2
- package/dist/modules/homepage/{components/SchoolSpace → hooks}/useUserSchools.js +4 -4
- package/dist/modules/icons/components/IconAddWidget.d.ts +7 -0
- package/dist/modules/icons/components/IconAddWidget.js +12 -0
- package/dist/modules/icons/components/index.d.ts +1 -0
- package/dist/modules/multimedia/FileCard/index.d.ts +0 -4
- package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.d.ts +1 -7
- package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.js +0 -2
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +2 -2
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +12 -48
- package/dist/modules/multimedia/MediaLibrary/innertabs/index.d.ts +0 -2
- package/dist/modules/multimedia/MediaLibrary/innertabs/index.js +0 -4
- package/dist/modules/multimedia/Workspace/Workspace.js +5 -8
- package/dist/modules/multimedia/index.d.ts +0 -2
- package/dist/multimedia.js +18 -26
- package/package.json +6 -6
- package/dist/hooks/useCarbonioUnread/index.d.ts +0 -1
- package/dist/hooks/useCarbonioUnread/useCarbonioUnread.d.ts +0 -5
- package/dist/hooks/useCarbonioUnread/useCarbonioUnread.js +0 -24
- package/dist/hooks/useGoogleDriveSearch/index.d.ts +0 -1
- package/dist/hooks/useGoogleDriveSearch/useGoogleDriveSearch.d.ts +0 -19
- package/dist/hooks/useGoogleDriveSearch/useGoogleDriveSearch.js +0 -60
- package/dist/hooks/useNextcloudSearch/index.d.ts +0 -1
- package/dist/hooks/useNextcloudSearch/useNextcloudSearch.d.ts +0 -14
- package/dist/hooks/useNextcloudSearch/useNextcloudSearch.js +0 -64
- package/dist/modules/multimedia/FileCard/GoogleDriveFileCard.d.ts +0 -25
- package/dist/modules/multimedia/FileCard/GoogleDriveFileCard.js +0 -102
- package/dist/modules/multimedia/FileCard/NextcloudFileCard.d.ts +0 -25
- package/dist/modules/multimedia/FileCard/NextcloudFileCard.js +0 -102
- package/dist/modules/multimedia/GoogleDrive/GoogleDrive.d.ts +0 -24
- package/dist/modules/multimedia/GoogleDrive/GoogleDrive.js +0 -103
- package/dist/modules/multimedia/GoogleDrive/index.d.ts +0 -2
- package/dist/modules/multimedia/MediaLibrary/innertabs/GoogleDrive.d.ts +0 -1
- package/dist/modules/multimedia/MediaLibrary/innertabs/GoogleDrive.js +0 -61
- package/dist/modules/multimedia/MediaLibrary/innertabs/Nextcloud.d.ts +0 -1
- package/dist/modules/multimedia/MediaLibrary/innertabs/Nextcloud.js +0 -48
- package/dist/modules/multimedia/Nextcloud/Nextcloud.d.ts +0 -24
- package/dist/modules/multimedia/Nextcloud/Nextcloud.js +0 -124
- package/dist/modules/multimedia/Nextcloud/index.d.ts +0 -2
|
@@ -2,6 +2,8 @@ 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 { MyAppsPopoverBody, MyAppsPopoverFooter } from "./MyAppsPopover.js";
|
|
6
|
+
import { useSafeHoverPopover } from "./useSafeHoverPopover.js";
|
|
5
7
|
import { Navbar } from "../../../../components/Layout/components/Navbar.js";
|
|
6
8
|
import { NavItem } from "../../../../components/Layout/components/NavItem.js";
|
|
7
9
|
import { NavLink } from "../../../../components/Layout/components/NavLink.js";
|
|
@@ -16,15 +18,15 @@ import SvgIconNotificationBeta from "../../../icons/components/nav/IconNotificat
|
|
|
16
18
|
import { useHasNotificationToday } from "../Notifications/hooks/useNotificationList.js";
|
|
17
19
|
import useConversation from "../../../../hooks/useConversation/useConversation.js";
|
|
18
20
|
import useUser from "../../../../hooks/useUser/useUser.js";
|
|
19
|
-
import
|
|
21
|
+
import useHasWorkflow from "../../../../hooks/useHasWorkflow/useHasWorkflow.js";
|
|
20
22
|
import { useEdificeTheme } from "../../../../providers/EdificeThemeProvider/EdificeThemeProvider.hook.js";
|
|
21
|
-
import
|
|
23
|
+
import useBreakpoint from "../../../../hooks/useBreakpoint/useBreakpoint.js";
|
|
22
24
|
import LogoBeta from "../../../../components/LogoBeta/LogoBeta.js";
|
|
23
25
|
import Badge from "../../../../components/Badge/Badge.js";
|
|
24
26
|
import VisuallyHidden from "../../../../components/VisuallyHidden/VisuallyHidden.js";
|
|
25
27
|
import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
|
|
26
28
|
import Avatar from "../../../../components/Avatar/Avatar.js";
|
|
27
|
-
import { Popover, PopoverBody } from "../../../../components/Popover/Popover.js";
|
|
29
|
+
import { Popover, PopoverBody, PopoverFooter } from "../../../../components/Popover/Popover.js";
|
|
28
30
|
const Header = ({
|
|
29
31
|
src = "",
|
|
30
32
|
onNotificationsClick,
|
|
@@ -37,20 +39,25 @@ const Header = ({
|
|
|
37
39
|
} = useConversation(), {
|
|
38
40
|
user,
|
|
39
41
|
avatar
|
|
40
|
-
} = useUser(), {
|
|
41
|
-
hasCarbonioWorkflow,
|
|
42
|
-
unreadCount: carbonioUnreadCount
|
|
43
|
-
} = useCarbonioUnread(), classes = clsx("header-beta d-print-none no-2d no-1d"), {
|
|
42
|
+
} = useUser(), hasCarbonioPreauthWorkflow = useHasWorkflow("org.entcore.auth.controllers.CarbonioPreauthController|preauth") || !1, classes = clsx("header-beta d-print-none no-2d no-1d"), {
|
|
44
43
|
userAvatar,
|
|
45
44
|
userName,
|
|
46
45
|
communitiesWorkflow,
|
|
47
|
-
conversationWorflow
|
|
46
|
+
conversationWorflow,
|
|
47
|
+
bookmarkedApps
|
|
48
48
|
} = useHeader({
|
|
49
49
|
user,
|
|
50
50
|
avatar
|
|
51
51
|
}), {
|
|
52
52
|
theme
|
|
53
|
-
} = useEdificeTheme(), hasMessages = messages > 0, hasNotificationToday = useHasNotificationToday(),
|
|
53
|
+
} = useEdificeTheme(), hasMessages = messages > 0, hasNotificationToday = useHasNotificationToday(), popoverUserId = useId(), popoverAppsId = useId(), {
|
|
54
|
+
lg: isDesktop
|
|
55
|
+
} = useBreakpoint(), myApps = useSafeHoverPopover({
|
|
56
|
+
hoverEnabled: isDesktop,
|
|
57
|
+
clickEnabled: !isDesktop
|
|
58
|
+
}), userMenu = useSafeHoverPopover(), handleMyAppsClick = (event) => {
|
|
59
|
+
isDesktop || event.preventDefault();
|
|
60
|
+
}, handleNotificationsClick = () => {
|
|
54
61
|
onNotificationsClick == null || onNotificationsClick();
|
|
55
62
|
};
|
|
56
63
|
return /* @__PURE__ */ jsx("header", { className: classes, "data-product": dataProduct, children: /* @__PURE__ */ jsxs(Navbar, { className: "px-24", children: [
|
|
@@ -65,15 +72,19 @@ const Header = ({
|
|
|
65
72
|
level: "danger"
|
|
66
73
|
}, className: "position-absolute", children: messages })
|
|
67
74
|
] }) }),
|
|
68
|
-
|
|
75
|
+
hasCarbonioPreauthWorkflow && /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsxs("a", { className: "nav-link position-relative", href: "/auth/carbonio/preauth", target: "_blank", "data-testid": "header-messagerie-button", children: [
|
|
69
76
|
/* @__PURE__ */ jsx(SvgIconMessagesBeta, {}),
|
|
70
|
-
carbonioUnreadCount > 0 && /* @__PURE__ */ jsx(Badge, { variant: {
|
|
71
|
-
type: "notification",
|
|
72
|
-
level: "danger"
|
|
73
|
-
}, className: "position-absolute", children: carbonioUnreadCount }),
|
|
74
77
|
/* @__PURE__ */ jsx(VisuallyHidden, { children: t("conversation") })
|
|
75
78
|
] }) }),
|
|
76
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ jsxs(NavItem, { className: "position-relative", children: [
|
|
80
|
+
/* @__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({
|
|
81
|
+
onClick: handleMyAppsClick
|
|
82
|
+
}), children: /* @__PURE__ */ jsx(SvgIconMyAppsBeta, {}) }),
|
|
83
|
+
/* @__PURE__ */ jsxs(Popover, { ref: myApps.setFloating, className: "my-apps-popover", id: popoverAppsId, isVisible: myApps.open, ...myApps.getFloatingProps(), children: [
|
|
84
|
+
/* @__PURE__ */ jsx(PopoverBody, { children: /* @__PURE__ */ jsx(MyAppsPopoverBody, { bookmarkedApps }) }),
|
|
85
|
+
/* @__PURE__ */ jsx(PopoverFooter, { className: "d-flex justify-content-center", children: /* @__PURE__ */ jsx(MyAppsPopoverFooter, {}) })
|
|
86
|
+
] })
|
|
87
|
+
] }),
|
|
77
88
|
/* @__PURE__ */ jsxs(NavItem, { className: "position-relative", children: [
|
|
78
89
|
/* @__PURE__ */ jsx(ButtonBeta, { leftIcon: /* @__PURE__ */ jsx(SvgIconNotificationBeta, {}), variant: "ghost", onClick: handleNotificationsClick }),
|
|
79
90
|
hasNotificationToday && /* @__PURE__ */ jsx("span", { style: {
|
|
@@ -88,13 +99,11 @@ const Header = ({
|
|
|
88
99
|
pointerEvents: "none",
|
|
89
100
|
zIndex: 1,
|
|
90
101
|
display: "block"
|
|
91
|
-
}, "aria-label": t("homepage.notifications.new-badge"
|
|
92
|
-
defaultValue: "Nouvelle notification"
|
|
93
|
-
}) })
|
|
102
|
+
}, "aria-label": t("homepage.notifications.new-badge") })
|
|
94
103
|
] }),
|
|
95
|
-
/* @__PURE__ */ jsxs(NavItem, { className: "position-relative",
|
|
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:
|
|
104
|
+
/* @__PURE__ */ jsxs(NavItem, { className: "position-relative", children: [
|
|
105
|
+
/* @__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" }) }),
|
|
106
|
+
/* @__PURE__ */ jsx(Popover, { ref: userMenu.setFloating, align: "end", className: "widget", id: popoverUserId, isVisible: userMenu.open, ...userMenu.getFloatingProps(), children: /* @__PURE__ */ jsxs(PopoverBody, { children: [
|
|
98
107
|
/* @__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
108
|
/* @__PURE__ */ jsx(SvgIconSetBackground, { className: "icon" }),
|
|
100
109
|
/* @__PURE__ */ jsx("span", { id: "cutomize-label", className: "nav-text", children: t("navbar.customize") })
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IWebApp } from '@edifice.io/client';
|
|
2
|
+
export declare const MyAppsPopoverFooter: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const MyAppsPopoverBody: ({ bookmarkedApps, }: {
|
|
4
|
+
bookmarkedApps: IWebApp[] | undefined;
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation } from "react-i18next";
|
|
3
|
+
import illuEmptyFavorite from "@edifice.io/bootstrap/dist/images/homepage/illu-empty-favorite.svg";
|
|
4
|
+
import Flex from "../../../../components/Flex/Flex.js";
|
|
5
|
+
import AppIcon from "../../../../components/AppIcon/AppIcon.js";
|
|
6
|
+
const MAX_VISIBLE_APPS = 10, appToOpenOnBlank = ["Administration"], MyAppsPopoverFooter = () => {
|
|
7
|
+
const {
|
|
8
|
+
t
|
|
9
|
+
} = useTranslation();
|
|
10
|
+
return /* @__PURE__ */ jsx("a", { href: "/welcome", className: "btn-beta btn-beta-tertiary btn-beta--ghost btn-beta--small", "data-testid": "header-my-apps-popover-more", children: /* @__PURE__ */ jsx("span", { children: t("homepage.header.myapps.seeMore") }) });
|
|
11
|
+
}, MyAppsPopoverBody = ({
|
|
12
|
+
bookmarkedApps
|
|
13
|
+
}) => {
|
|
14
|
+
const {
|
|
15
|
+
t
|
|
16
|
+
} = useTranslation(), getAppName = (app) => app.prefix && app.prefix.length > 1 ? t(app.prefix.substring(1)) : t(app.displayName) || "";
|
|
17
|
+
return bookmarkedApps != null && bookmarkedApps.length ? /* @__PURE__ */ jsx("div", { className: "my-apps-popover-grid", "data-testid": "header-my-apps-popover", children: bookmarkedApps.slice(0, MAX_VISIBLE_APPS).map((app, index) => {
|
|
18
|
+
const opensInNewTab = appToOpenOnBlank.includes(app.name) || app.isExternal || app.target === "_blank", appName = getAppName(app);
|
|
19
|
+
return /* @__PURE__ */ jsx("a", { href: app.address, title: appName, "aria-label": appName, className: "my-apps-popover-item", "data-testid": "header-my-apps-popover-item", target: opensInNewTab ? "_blank" : void 0, rel: opensInNewTab ? "noopener noreferrer" : void 0, children: /* @__PURE__ */ jsx(AppIcon, { app, size: "32" }) }, index);
|
|
20
|
+
}) }) : /* @__PURE__ */ jsxs(Flex, { direction: "column", align: "center", gap: "8", children: [
|
|
21
|
+
/* @__PURE__ */ jsx("img", { src: illuEmptyFavorite, alt: "", width: 50, height: 50 }),
|
|
22
|
+
/* @__PURE__ */ jsx("span", { className: "my-apps-popover-empty-text text-center", children: t("homepage.header.myapps.empty") })
|
|
23
|
+
] });
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
MyAppsPopoverBody,
|
|
27
|
+
MyAppsPopoverFooter
|
|
28
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { useFloating, useHover, safePolygon, useClick, useDismiss, useFocus, useInteractions } from "@floating-ui/react";
|
|
3
|
+
function useSafeHoverPopover({
|
|
4
|
+
hoverEnabled = !0,
|
|
5
|
+
clickEnabled = !1
|
|
6
|
+
} = {}) {
|
|
7
|
+
const [open, setOpen] = useState(!1), {
|
|
8
|
+
refs,
|
|
9
|
+
context
|
|
10
|
+
} = useFloating({
|
|
11
|
+
open,
|
|
12
|
+
onOpenChange: setOpen
|
|
13
|
+
}), hover = useHover(context, {
|
|
14
|
+
enabled: hoverEnabled,
|
|
15
|
+
handleClose: safePolygon()
|
|
16
|
+
}), click = useClick(context, {
|
|
17
|
+
enabled: clickEnabled
|
|
18
|
+
}), dismiss = useDismiss(context), focus = useFocus(context), {
|
|
19
|
+
getReferenceProps,
|
|
20
|
+
getFloatingProps
|
|
21
|
+
} = useInteractions([hover, click, dismiss, focus]);
|
|
22
|
+
return {
|
|
23
|
+
open,
|
|
24
|
+
setReference: refs.setReference,
|
|
25
|
+
setFloating: refs.setFloating,
|
|
26
|
+
getReferenceProps,
|
|
27
|
+
getFloatingProps
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
useSafeHoverPopover
|
|
32
|
+
};
|
|
@@ -3,7 +3,11 @@ 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
|
-
/**
|
|
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
|
+
*/
|
|
7
11
|
actionLabel?: ReactNode;
|
|
8
12
|
/** Callback invoked when the action button is clicked. */
|
|
9
13
|
onActionClick?: MouseEventHandler<HTMLButtonElement>;
|
|
@@ -12,7 +12,7 @@ const HomeCardHeader = ({
|
|
|
12
12
|
className,
|
|
13
13
|
...rest
|
|
14
14
|
}) => {
|
|
15
|
-
const hasAction = !!
|
|
15
|
+
const hasAction = !!onActionClick && (!!actionLabel || !!actionLeftIcon || !!actionRightIcon);
|
|
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("warning") : t("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("homepage.messageFlash.warning") : t("homepage.messageFlash.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,19 +25,19 @@ const NotificationList = ({
|
|
|
25
25
|
t
|
|
26
26
|
} = useTranslation(), loadNextRef = useInfiniteScroll({
|
|
27
27
|
callback: () => onLoadNextPage == null ? void 0 : onLoadNextPage()
|
|
28
|
-
}), handleCloseClick = () => {
|
|
28
|
+
}), handleFilterChange = (types) => onFilterChange == null ? void 0 : onFilterChange(types), handleCloseClick = () => {
|
|
29
29
|
onCloseNotifications && onCloseNotifications();
|
|
30
30
|
};
|
|
31
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
|
|
35
|
+
notificationTypes && notificationTypes.length > 0 && /* @__PURE__ */ jsx(NotificationFilterMenu, { notificationTypes, selectedTypes, onFilterChange: handleFilterChange })
|
|
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
|
-
(notifications
|
|
40
|
-
/* @__PURE__ */ jsx("ul", { children: notifications
|
|
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: [
|
|
41
41
|
/* @__PURE__ */ jsx(NotificationItem, { notification }),
|
|
42
42
|
/* @__PURE__ */ jsx(Divider, { className: "border-grey-300 my-0" })
|
|
43
43
|
] }, "notification-list-" + notification._id + "-" + index)) }),
|
|
@@ -3,9 +3,9 @@ import React from "react";
|
|
|
3
3
|
import Flex from "../../../../components/Flex/Flex.js";
|
|
4
4
|
import Avatar from "../../../../components/Avatar/Avatar.js";
|
|
5
5
|
import TextSkeleton from "../../../../components/Skeleton/TextSkeleton.js";
|
|
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: [
|
|
6
|
+
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: [
|
|
7
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: [
|
|
8
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "8", className: "notification-item-message", children: [
|
|
9
9
|
/* @__PURE__ */ jsx(TextSkeleton, {}),
|
|
10
10
|
/* @__PURE__ */ jsx(TextSkeleton, {}),
|
|
11
11
|
/* @__PURE__ */ jsx("div", { className: "placeholder col-4", style: {
|
|
@@ -16,11 +16,7 @@ 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",
|
|
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" }),
|
|
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" }),
|
|
24
20
|
isOpen && /* @__PURE__ */ jsx(NotificationFilterModal, { isOpen, allTypes: notificationTypes, appliedTypes: selectedTypes, onCancel: () => setIsOpen(!1), onApply: handleApply })
|
|
25
21
|
] });
|
|
26
22
|
};
|
package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
-
import { useState,
|
|
3
|
+
import { useState, useMemo } 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
|
|
7
|
+
import ModalBeta from "../../../../../components/ModalBeta/ModalBeta.js";
|
|
8
8
|
import Flex from "../../../../../components/Flex/Flex.js";
|
|
9
|
+
import Checkbox from "../../../../../components/Checkbox/Checkbox.js";
|
|
9
10
|
import AppIcon from "../../../../../components/AppIcon/AppIcon.js";
|
|
10
11
|
import ButtonBeta from "../../../../../components/ButtonBeta/ButtonBeta.js";
|
|
11
12
|
const NotificationFilterModal = ({
|
|
@@ -18,7 +19,7 @@ const NotificationFilterModal = ({
|
|
|
18
19
|
const {
|
|
19
20
|
t,
|
|
20
21
|
i18n
|
|
21
|
-
} = useTranslation(), [selected, setSelected] = useState(appliedTypes),
|
|
22
|
+
} = useTranslation(), [selected, setSelected] = useState(appliedTypes), allTypesSorted = useMemo(() => allTypes.map((type) => {
|
|
22
23
|
const [appCode, appI18nKey] = getAppCodeAndI18nKey(type), label = t(appI18nKey, {
|
|
23
24
|
defaultValue: appCode
|
|
24
25
|
});
|
|
@@ -35,16 +36,13 @@ const NotificationFilterModal = ({
|
|
|
35
36
|
}, toggleAll = () => {
|
|
36
37
|
setSelected(selected.length === allTypes.length ? [] : allTypes);
|
|
37
38
|
};
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
|
|
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: [
|
|
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: [
|
|
44
42
|
/* @__PURE__ */ jsxs(Flex, { align: "center", gap: "8", className: "mb-24", children: [
|
|
45
43
|
/* @__PURE__ */ jsxs("label", { className: "notification-filter-select-all notification-filter-chip", children: [
|
|
46
44
|
/* @__PURE__ */ jsx("span", { children: t("homepage.notifications.filter-modal.select-all") }),
|
|
47
|
-
/* @__PURE__ */ jsx(
|
|
45
|
+
/* @__PURE__ */ jsx(Checkbox, { checked: selected.length === allTypes.length, indeterminate: selected.length > 0 && selected.length < allTypes.length, onChange: toggleAll })
|
|
48
46
|
] }),
|
|
49
47
|
/* @__PURE__ */ jsx("span", { className: "notification-filter-count", children: t("homepage.notifications.filter-modal.count", {
|
|
50
48
|
selected: selected.length,
|
|
@@ -62,11 +60,11 @@ const NotificationFilterModal = ({
|
|
|
62
60
|
}), children: [
|
|
63
61
|
/* @__PURE__ */ jsx(AppIcon, { app: appCode, size: "24", iconFit: "contain" }),
|
|
64
62
|
/* @__PURE__ */ jsx("span", { children: label }),
|
|
65
|
-
/* @__PURE__ */ jsx(
|
|
63
|
+
/* @__PURE__ */ jsx(Checkbox, { checked, onChange: () => toggleType(type) })
|
|
66
64
|
] }, type);
|
|
67
65
|
}) })
|
|
68
66
|
] }),
|
|
69
|
-
/* @__PURE__ */ jsxs(
|
|
67
|
+
/* @__PURE__ */ jsxs(ModalBeta.Footer, { children: [
|
|
70
68
|
/* @__PURE__ */ jsx(ButtonBeta, { color: "tertiary", onClick: onCancel, type: "button", variant: "ghost", children: t("cancel") }),
|
|
71
69
|
/* @__PURE__ */ jsx(ButtonBeta, { color: "default", onClick: () => onApply(selected), type: "button", variant: "filled", rightIcon: /* @__PURE__ */ jsx(SvgIconCheck, {}), children: t("homepage.notifications.filter-modal.confirm") })
|
|
72
70
|
] })
|
package/dist/modules/homepage/components/Notifications/components/NotificationOptionsMenu.js
CHANGED
|
@@ -20,16 +20,10 @@ 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", {
|
|
24
|
-
defaultValue: "Options de la notification"
|
|
25
|
-
}), 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"), color: "tertiary", variant: "ghost", icon: /* @__PURE__ */ jsx(SvgIconOptions, {}), "data-testid": "notification-item-options-button" }),
|
|
26
24
|
/* @__PURE__ */ jsxs(Dropdown.Menu, { children: [
|
|
27
|
-
/* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconAlertTriangle, {}), onClick: () => setIsReportModalOpen(!0), children: t("homepage.notifications.options.report",
|
|
28
|
-
|
|
29
|
-
}) }),
|
|
30
|
-
/* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconDelete, {}), onClick: () => deleteNotification(notificationId), children: t("homepage.notifications.options.delete", {
|
|
31
|
-
defaultValue: "Supprimer"
|
|
32
|
-
}) })
|
|
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") })
|
|
33
27
|
] })
|
|
34
28
|
] }) }),
|
|
35
29
|
isReportModalOpen && /* @__PURE__ */ jsx(ReportNotificationModal, { isOpen: isReportModalOpen, onCancel: () => setIsReportModalOpen(!1), onConfirm: () => {
|
package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.js
CHANGED
|
@@ -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
|
|
4
|
+
import ModalBeta from "../../../../../components/ModalBeta/ModalBeta.js";
|
|
5
5
|
import ButtonBeta from "../../../../../components/ButtonBeta/ButtonBeta.js";
|
|
6
6
|
const ReportNotificationModal = ({
|
|
7
7
|
isOpen,
|
|
@@ -11,18 +11,12 @@ const ReportNotificationModal = ({
|
|
|
11
11
|
const {
|
|
12
12
|
t
|
|
13
13
|
} = useTranslation();
|
|
14
|
-
return /* @__PURE__ */ jsxs(
|
|
15
|
-
/* @__PURE__ */ jsx(
|
|
16
|
-
|
|
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: [
|
|
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: [
|
|
22
18
|
/* @__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
|
-
}) })
|
|
19
|
+
/* @__PURE__ */ jsx(ButtonBeta, { color: "default", onClick: onConfirm, type: "button", variant: "filled", leftIcon: /* @__PURE__ */ jsx(SvgIconAlertTriangle, {}), children: t("homepage.notifications.report-modal.confirm") })
|
|
26
20
|
] })
|
|
27
21
|
] });
|
|
28
22
|
};
|
|
@@ -8,34 +8,36 @@ 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
|
-
|
|
11
|
+
const appI18nKey = `homepage.notification.type.${appCode}`;
|
|
12
12
|
switch (appCode) {
|
|
13
|
+
case "collaborativeeditor":
|
|
14
|
+
appCode = "pad";
|
|
15
|
+
break;
|
|
13
16
|
case "collaborativewall":
|
|
14
17
|
appCode = "collaborative-wall";
|
|
15
18
|
break;
|
|
16
19
|
case "formulaire":
|
|
17
|
-
|
|
20
|
+
appCode = "forms";
|
|
18
21
|
break;
|
|
19
22
|
case "messagerie":
|
|
20
|
-
|
|
23
|
+
appCode = "conversation";
|
|
21
24
|
break;
|
|
22
25
|
case "news":
|
|
23
|
-
|
|
26
|
+
appCode = "actualites";
|
|
24
27
|
break;
|
|
25
28
|
case "homeworks":
|
|
26
29
|
appCode = "cahier-de-texte";
|
|
27
30
|
break;
|
|
28
31
|
case "userbook_motto":
|
|
29
|
-
appI18nKey = "userbook_motto", appCode = "userbook";
|
|
30
|
-
break;
|
|
31
32
|
case "userbook_mood":
|
|
32
|
-
appI18nKey = "userbook_mood", appCode = "userbook";
|
|
33
|
-
break;
|
|
34
33
|
case "userbook_discovervisiblegroups":
|
|
35
|
-
|
|
34
|
+
appCode = "userbook";
|
|
35
|
+
break;
|
|
36
|
+
case "viescolaire":
|
|
37
|
+
appCode = "vie-scolaire";
|
|
36
38
|
break;
|
|
37
39
|
default:
|
|
38
|
-
|
|
40
|
+
appCode = appCode.replace(/_/g, "-");
|
|
39
41
|
}
|
|
40
42
|
return [appCode, appI18nKey];
|
|
41
43
|
}, notificationAdapter = (notification) => {
|
|
@@ -14,31 +14,30 @@ const useNotificationListContainer = () => {
|
|
|
14
14
|
mutate: saveTimelinePreference
|
|
15
15
|
} = useSaveTimelinePreference(), [selectedTypes, setSelectedTypesState] = useState();
|
|
16
16
|
useEffect(() => {
|
|
17
|
-
|
|
18
|
-
const preferredTypes = preference == null ? void 0 : preference.type;
|
|
19
|
-
setSelectedTypesState(preferredTypes && preferredTypes.length > 0 ? preferredTypes : notificationTypes ?? []);
|
|
20
|
-
}
|
|
17
|
+
selectedTypes === void 0 && isFetchedTypes && isFetchedPreference && setSelectedTypesState((preference == null ? void 0 : preference.type) ?? notificationTypes ?? []);
|
|
21
18
|
}, [selectedTypes, isFetchedTypes, isFetchedPreference, preference, notificationTypes]);
|
|
22
19
|
const setSelectedTypes = (types) => {
|
|
23
20
|
setSelectedTypesState(types), saveTimelinePreference({
|
|
24
21
|
...preference,
|
|
25
22
|
type: types
|
|
26
23
|
});
|
|
27
|
-
}, {
|
|
28
|
-
data
|
|
24
|
+
}, hasNoTypeSelected = (selectedTypes == null ? void 0 : selectedTypes.length) === 0, {
|
|
25
|
+
data,
|
|
29
26
|
hasNextPage,
|
|
30
27
|
isLoading: isLoadingNotifications,
|
|
31
28
|
error: errorNotifications,
|
|
32
29
|
fetchNextPage
|
|
33
|
-
} = useNotifications(selectedTypes ?? [], isFetchedTypes && !!selectedTypes);
|
|
30
|
+
} = useNotifications(selectedTypes ?? [], isFetchedTypes && !!selectedTypes && !hasNoTypeSelected);
|
|
34
31
|
return {
|
|
35
|
-
notifications,
|
|
32
|
+
notifications: hasNoTypeSelected ? [] : data,
|
|
36
33
|
notificationTypes,
|
|
37
34
|
selectedTypes,
|
|
38
35
|
setSelectedTypes,
|
|
39
|
-
hasNextPage,
|
|
36
|
+
hasNextPage: hasNoTypeSelected ? !1 : hasNextPage,
|
|
40
37
|
loadNextPage: () => fetchNextPage(),
|
|
41
|
-
|
|
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,
|
|
42
41
|
error: errorTypes || errorNotifications
|
|
43
42
|
};
|
|
44
43
|
}, useHasNotificationToday = () => {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import illuQwant from "@edifice.io/bootstrap/dist/images/homepage/illu-qwant.png";
|
|
3
|
+
import { useForm } from "react-hook-form";
|
|
4
|
+
import { useTranslation } from "react-i18next";
|
|
5
|
+
import SvgIconExternalLink from "../../../icons/components/IconExternalLink.js";
|
|
6
|
+
import SvgIconSearch from "../../../icons/components/IconSearch.js";
|
|
7
|
+
import HomeCard from "../HomeCard/HomeCard.js";
|
|
8
|
+
import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
|
|
9
|
+
import Image from "../../../../components/Image/Image.js";
|
|
10
|
+
import FormControl from "../../../../components/Form/FormControl.js";
|
|
11
|
+
import Input from "../../../../components/Input/Input.js";
|
|
12
|
+
function Qwant({
|
|
13
|
+
handleActionClick
|
|
14
|
+
}) {
|
|
15
|
+
const {
|
|
16
|
+
t
|
|
17
|
+
} = useTranslation(), {
|
|
18
|
+
register
|
|
19
|
+
} = useForm();
|
|
20
|
+
return /* @__PURE__ */ jsxs(HomeCard, { variant: "primary", children: [
|
|
21
|
+
/* @__PURE__ */ jsxs("div", { className: "qwant__header", children: [
|
|
22
|
+
/* @__PURE__ */ jsx("h3", { className: "qwant__title", children: t("homepage.widget.qwant.title") }),
|
|
23
|
+
/* @__PURE__ */ jsx(ButtonBeta, { className: "qwant__header-button", "data-testid": "qwant-button-open", "aria-label": t("homepage.widget.qwant.open"), onClick: handleActionClick, leftIcon: /* @__PURE__ */ jsx(SvgIconExternalLink, {}), variant: "ghost", color: "tertiary" })
|
|
24
|
+
] }),
|
|
25
|
+
/* @__PURE__ */ jsx(HomeCard.Content, { children: /* @__PURE__ */ jsxs("div", { className: "qwant", children: [
|
|
26
|
+
/* @__PURE__ */ jsxs("div", { className: "qwant__intro", children: [
|
|
27
|
+
/* @__PURE__ */ jsx(Image, { src: illuQwant, alt: "Qwant", className: "qwant__logo" }),
|
|
28
|
+
/* @__PURE__ */ jsx("p", { className: "qwant__description", children: t("homepage.widget.qwant.description") })
|
|
29
|
+
] }),
|
|
30
|
+
/* @__PURE__ */ jsx("form", { method: "GET", action: "https://www.qwant.com", target: "_blank", className: "qwant__search", children: /* @__PURE__ */ jsxs(FormControl, { id: "inputQwantQuery", className: "qwant__search-field", children: [
|
|
31
|
+
/* @__PURE__ */ jsx(FormControl.Label, { className: "visually-hidden", children: t("search") }),
|
|
32
|
+
/* @__PURE__ */ jsx(Input, { "data-testid": "qwant-search-input", placeholder: t("search"), size: "md", type: "text", maxLength: 255, ...register("q") }),
|
|
33
|
+
/* @__PURE__ */ jsx("input", { type: "hidden", name: "l", value: "fr" }),
|
|
34
|
+
/* @__PURE__ */ jsx(ButtonBeta, { leftIcon: /* @__PURE__ */ jsx(SvgIconSearch, {}), type: "submit", "aria-label": t("search"), variant: "filled", color: "default" })
|
|
35
|
+
] }) })
|
|
36
|
+
] }) })
|
|
37
|
+
] });
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
Qwant as default
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function QwantContainer(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import Qwant from "./Qwant.js";
|
|
3
|
+
function QwantContainer() {
|
|
4
|
+
return /* @__PURE__ */ jsx(Qwant, { handleActionClick: () => {
|
|
5
|
+
window.open("https://www.qwant.com", "_blank", "noopener,noreferrer");
|
|
6
|
+
} });
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
QwantContainer
|
|
10
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import SchoolSpace from "./SchoolSpace.js";
|
|
3
|
-
import { useUserSchools } from "
|
|
3
|
+
import { useUserSchools } from "../../hooks/useUserSchools.js";
|
|
4
4
|
function SchoolSpaceContainer() {
|
|
5
5
|
const {
|
|
6
6
|
handleSelectedSchoolChange,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { School } from '@edifice.io/client';
|
|
2
|
+
export interface UniversalisProps {
|
|
3
|
+
handleActionClick: () => void;
|
|
4
|
+
selectedSchool?: School;
|
|
5
|
+
onSelectedSchoolChange?: (school: School) => void;
|
|
6
|
+
schools?: School[];
|
|
7
|
+
}
|
|
8
|
+
export default function Universalis({ handleActionClick, selectedSchool, onSelectedSchoolChange, schools, }: UniversalisProps): import("react/jsx-runtime").JSX.Element;
|