@edifice.io/react 2.6.9-develop-integration.20261012100537 → 2.6.9-develop-b2school.20261013113840
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/RadioTile/RadioTile.d.ts +35 -0
- package/dist/components/RadioTile/RadioTile.js +22 -0
- package/dist/components/RadioTile/index.d.ts +2 -0
- package/dist/components/Tree/utilities/tree.js +1 -21
- package/dist/components/index.d.ts +1 -0
- package/dist/homepage.js +10 -0
- package/dist/hooks/index.d.ts +0 -2
- 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 -194
- 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/Header/Header.js +27 -11
- 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/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 +3 -1
- 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/useGoogleDriveSearch/index.d.ts +0 -1
- package/dist/hooks/useGoogleDriveSearch/useGoogleDriveSearch.d.ts +0 -14
- 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 -100
- 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
|
@@ -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 = () => {
|
|
@@ -5,8 +5,10 @@ export type UserSpaceProps = {
|
|
|
5
5
|
avatar: string;
|
|
6
6
|
profile: UserProfile[number];
|
|
7
7
|
children?: ReactNode;
|
|
8
|
+
/** Renders a trigger button in the top-right corner when provided. */
|
|
9
|
+
onCustomizeWidgetsClick?: () => void;
|
|
8
10
|
};
|
|
9
|
-
declare function UserSpace({ name, avatar, profile, children, }: UserSpaceProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function UserSpace({ name, avatar, profile, children, onCustomizeWidgetsClick, }: UserSpaceProps): import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
declare namespace UserSpace {
|
|
11
13
|
var displayName: string;
|
|
12
14
|
}
|
|
@@ -1,27 +1,33 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
|
+
import SvgIconAddWidget from "../../../icons/components/IconAddWidget.js";
|
|
3
4
|
import SvgIconClass from "../../../icons/components/IconClass.js";
|
|
4
5
|
import { useProfileLinks } from "./hooks/useProfileLinks.js";
|
|
5
6
|
import HomeCard from "../HomeCard/HomeCard.js";
|
|
6
7
|
import Flex from "../../../../components/Flex/Flex.js";
|
|
7
8
|
import Avatar from "../../../../components/Avatar/Avatar.js";
|
|
9
|
+
import IconButton from "../../../../components/Button/IconButton.js";
|
|
8
10
|
import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
|
|
9
11
|
function UserSpace({
|
|
10
12
|
name,
|
|
11
13
|
avatar,
|
|
12
14
|
profile,
|
|
13
|
-
children
|
|
15
|
+
children,
|
|
16
|
+
onCustomizeWidgetsClick
|
|
14
17
|
}) {
|
|
15
18
|
const {
|
|
16
19
|
t
|
|
17
20
|
} = useTranslation(), links = useProfileLinks(profile);
|
|
18
21
|
return /* @__PURE__ */ jsxs(HomeCard, { variant: "user", footer: !!links && /* @__PURE__ */ jsx(Flex, { children: links.map((link, index) => /* @__PURE__ */ jsx(ButtonBeta, { size: "sm", variant: "ghost", leftIcon: /* @__PURE__ */ jsx(SvgIconClass, {}), onClick: () => window.location.href = link.url, children: link.text }, `${link.url}-${index}`)) }), children: [
|
|
19
|
-
/* @__PURE__ */ jsxs(Flex, { className: "user-space", direction: "row", gap: "8", children: [
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
/* @__PURE__ */ jsxs(Flex, { className: "user-space", direction: "row", justify: "between", gap: "8", children: [
|
|
23
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "row", gap: "8", children: [
|
|
24
|
+
/* @__PURE__ */ jsx(Avatar, { className: "user-space--avatar", size: "auto", alt: name, src: avatar, variant: "circle" }),
|
|
25
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
|
|
26
|
+
/* @__PURE__ */ jsx("div", { "data-testid": "user-space-name", className: "user-space--name", children: name }),
|
|
27
|
+
/* @__PURE__ */ jsx("div", { "data-testid": "user-space-profile", className: "user-space--profile", children: t(profile) })
|
|
28
|
+
] })
|
|
29
|
+
] }),
|
|
30
|
+
onCustomizeWidgetsClick && /* @__PURE__ */ jsx(IconButton, { className: "user-space--customize-widgets", icon: /* @__PURE__ */ jsx(SvgIconAddWidget, {}), variant: "ghost", color: "tertiary", "aria-label": t("homepage.userSpace.customizeWidgets"), onClick: onCustomizeWidgetsClick })
|
|
25
31
|
] }),
|
|
26
32
|
children && /* @__PURE__ */ jsx(HomeCard.Content, { children })
|
|
27
33
|
] });
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export interface UserSpaceContainerProps {
|
|
3
3
|
children?: ReactNode;
|
|
4
|
-
|
|
4
|
+
onCustomizeWidgetsClick?: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function UserSpaceContainer({ children, onCustomizeWidgetsClick, }: UserSpaceContainerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
5
7
|
export declare namespace UserSpaceContainer {
|
|
6
8
|
var displayName: string;
|
|
7
9
|
}
|
|
@@ -2,7 +2,8 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import UserSpace from "./UserSpace.js";
|
|
3
3
|
import useUser from "../../../../hooks/useUser/useUser.js";
|
|
4
4
|
function UserSpaceContainer({
|
|
5
|
-
children
|
|
5
|
+
children,
|
|
6
|
+
onCustomizeWidgetsClick
|
|
6
7
|
}) {
|
|
7
8
|
var _a;
|
|
8
9
|
const {
|
|
@@ -12,7 +13,7 @@ function UserSpaceContainer({
|
|
|
12
13
|
} = useUser();
|
|
13
14
|
if (!user || !userDescription) return null;
|
|
14
15
|
const name = user.username || "", profile = ((_a = userDescription.profiles) == null ? void 0 : _a[0]) || "Guest";
|
|
15
|
-
return /* @__PURE__ */ jsx(UserSpace, { name, profile, avatar, children });
|
|
16
|
+
return /* @__PURE__ */ jsx(UserSpace, { name, profile, avatar, onCustomizeWidgetsClick, children });
|
|
16
17
|
}
|
|
17
18
|
export {
|
|
18
19
|
UserSpaceContainer
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export interface WidgetToggleProps extends Omit<ComponentPropsWithoutRef<'button'>, 'onClick' | 'type' | 'role' | 'aria-checked'> {
|
|
3
|
+
'checked': boolean;
|
|
4
|
+
'onChange': () => void;
|
|
5
|
+
'aria-label': string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Dedicated on/off control for a widget row in `WidgetsPersonalizationPanel`.
|
|
9
|
+
* The generic `Switch` component doesn't match this panel's design (size,
|
|
10
|
+
* filled-vs-outlined states), so this is a small purpose-built control
|
|
11
|
+
* rather than a `Switch` variant.
|
|
12
|
+
*/
|
|
13
|
+
export declare function WidgetToggle({ checked, onChange, disabled, ...rest }: WidgetToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare namespace WidgetToggle {
|
|
15
|
+
var displayName: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
function WidgetToggle({
|
|
4
|
+
checked,
|
|
5
|
+
onChange,
|
|
6
|
+
disabled,
|
|
7
|
+
...rest
|
|
8
|
+
}) {
|
|
9
|
+
return /* @__PURE__ */ jsx("button", { type: "button", role: "switch", "aria-checked": checked, disabled, className: clsx("widget-toggle", {
|
|
10
|
+
"widget-toggle--checked": checked
|
|
11
|
+
}), onClick: onChange, ...rest, children: /* @__PURE__ */ jsx("span", { className: "widget-toggle__knob" }) });
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
WidgetToggle
|
|
15
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface WidgetPersonalizationItem {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon: ReactNode;
|
|
6
|
+
checked: boolean;
|
|
7
|
+
/** When true, the widget is pinned by an admin: no toggle, lock icon instead. */
|
|
8
|
+
locked?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface WidgetsPersonalizationPanelProps {
|
|
11
|
+
items: WidgetPersonalizationItem[];
|
|
12
|
+
isLoading?: boolean;
|
|
13
|
+
onToggle: (id: string) => void;
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
title?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function WidgetsPersonalizationPanel({ items, isLoading, onToggle, onClose, title, description, }: WidgetsPersonalizationPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare namespace WidgetsPersonalizationPanel {
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation } from "react-i18next";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import SvgIconClose from "../../../icons/components/IconClose.js";
|
|
5
|
+
import SvgIconLock from "../../../icons/components/IconLock.js";
|
|
6
|
+
import { WidgetToggle } from "./WidgetToggle.js";
|
|
7
|
+
import Heading from "../../../../components/Heading/Heading.js";
|
|
8
|
+
import IconButton from "../../../../components/Button/IconButton.js";
|
|
9
|
+
import TextSkeleton from "../../../../components/Skeleton/TextSkeleton.js";
|
|
10
|
+
const SKELETON_ROWS = 5;
|
|
11
|
+
function WidgetsPersonalizationPanel({
|
|
12
|
+
items,
|
|
13
|
+
isLoading = !1,
|
|
14
|
+
onToggle,
|
|
15
|
+
onClose,
|
|
16
|
+
title,
|
|
17
|
+
description
|
|
18
|
+
}) {
|
|
19
|
+
const {
|
|
20
|
+
t
|
|
21
|
+
} = useTranslation();
|
|
22
|
+
return /* @__PURE__ */ jsxs("div", { className: "widgets-personalization-panel", children: [
|
|
23
|
+
/* @__PURE__ */ jsxs("div", { className: "widgets-personalization-panel__header", children: [
|
|
24
|
+
/* @__PURE__ */ jsx(Heading, { level: "h2", headingStyle: "h5", className: "widgets-personalization-panel__title", children: title ?? t("homepage.widgetsPersonalization.title") }),
|
|
25
|
+
/* @__PURE__ */ jsx(IconButton, { icon: /* @__PURE__ */ jsx(SvgIconClose, {}), variant: "ghost", color: "tertiary", "aria-label": t("close"), onClick: onClose, "data-testid": "widgetspersonalization-button-close" })
|
|
26
|
+
] }),
|
|
27
|
+
/* @__PURE__ */ jsx("p", { className: "widgets-personalization-panel__description", children: description ?? t("homepage.widgetsPersonalization.description") }),
|
|
28
|
+
isLoading ? /* @__PURE__ */ jsx("ul", { className: "widgets-personalization-panel__list", "aria-hidden": "true", children: Array.from({
|
|
29
|
+
length: SKELETON_ROWS
|
|
30
|
+
}).map((_, index) => /* @__PURE__ */ jsxs("li", { className: "widgets-personalization-panel__item widgets-personalization-panel__item--skeleton", children: [
|
|
31
|
+
/* @__PURE__ */ jsx(TextSkeleton, { className: "widgets-personalization-panel__item-icon-skeleton" }),
|
|
32
|
+
/* @__PURE__ */ jsx(TextSkeleton, { className: "widgets-personalization-panel__item-label-skeleton" })
|
|
33
|
+
] }, index)) }) : items.length === 0 ? /* @__PURE__ */ jsx("div", { className: "widgets-personalization-panel__empty", children: /* @__PURE__ */ jsx("p", { className: "widgets-personalization-panel__empty-text", children: t("homepage.widgetsPersonalization.empty") }) }) : /* @__PURE__ */ jsx("ul", { className: "widgets-personalization-panel__list", children: items.map((item) => /* @__PURE__ */ jsxs("li", { className: clsx("widgets-personalization-panel__item", {
|
|
34
|
+
"widgets-personalization-panel__item--checked": item.checked && !item.locked,
|
|
35
|
+
"widgets-personalization-panel__item--locked": item.locked
|
|
36
|
+
}), "data-testid": `widgetspersonalization-item-${item.id}`, children: [
|
|
37
|
+
/* @__PURE__ */ jsx("span", { className: "widgets-personalization-panel__item-icon", "aria-hidden": "true", children: item.icon }),
|
|
38
|
+
/* @__PURE__ */ jsx("span", { className: "widgets-personalization-panel__item-label", children: item.label }),
|
|
39
|
+
item.locked ? /* @__PURE__ */ jsx("span", { className: "widgets-personalization-panel__item-lock", role: "img", "aria-label": t("homepage.widgetsPersonalization.locked"), "data-testid": `widgetspersonalization-lock-${item.id}`, children: /* @__PURE__ */ jsx(SvgIconLock, {}) }) : /* @__PURE__ */ jsx(WidgetToggle, { checked: item.checked, onChange: () => onToggle(item.id), "aria-label": t("homepage.widgetsPersonalization.toggle", {
|
|
40
|
+
label: item.label
|
|
41
|
+
}), "data-testid": `widgetspersonalization-toggle-${item.id}` })
|
|
42
|
+
] }, item.id)) })
|
|
43
|
+
] });
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
WidgetsPersonalizationPanel
|
|
47
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export * from './Agenda';
|
|
2
|
+
export * from './Communities';
|
|
1
3
|
export * from './Favorites';
|
|
2
4
|
export * from './Header';
|
|
3
5
|
export * from './HomeCard';
|
|
@@ -7,4 +9,4 @@ export * from './Notifications';
|
|
|
7
9
|
export * from './SchoolSpace';
|
|
8
10
|
export * from './UsefulLinks';
|
|
9
11
|
export * from './UserSpace';
|
|
10
|
-
export * from './
|
|
12
|
+
export * from './WidgetsPersonalizationPanel';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
interface SVGRProps {
|
|
3
|
+
title?: string;
|
|
4
|
+
titleId?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const SvgIconAddWidget: ({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default SvgIconAddWidget;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
const SvgIconAddWidget = ({
|
|
3
|
+
title,
|
|
4
|
+
titleId,
|
|
5
|
+
...props
|
|
6
|
+
}) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 20 20", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
|
|
7
|
+
title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
|
|
8
|
+
/* @__PURE__ */ jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M15.834 10.833c.46 0 .833.373.833.834v2.5h2.5a.833.833 0 0 1 0 1.666h-2.5v2.5a.833.833 0 0 1-1.667 0v-2.5h-2.5a.833.833 0 0 1 0-1.666H15v-2.5c0-.46.373-.834.834-.834M8.333 3.333A.833.833 0 0 0 7.5 2.5h-5a.833.833 0 0 0-.833.833v13.334c0 .46.373.833.833.833h5c.46 0 .833-.373.833-.833zM10 16.667a2.5 2.5 0 0 1-2.5 2.5h-5a2.5 2.5 0 0 1-2.5-2.5V3.333a2.5 2.5 0 0 1 2.5-2.5h5a2.5 2.5 0 0 1 2.5 2.5zM18.334 3.333A.833.833 0 0 0 17.5 2.5h-3.333a.833.833 0 0 0-.833.833v3.334c0 .46.373.833.833.833H17.5c.46 0 .834-.373.834-.833zM20 6.667a2.5 2.5 0 0 1-2.5 2.5h-3.333a2.5 2.5 0 0 1-2.5-2.5V3.333a2.5 2.5 0 0 1 2.5-2.5H17.5a2.5 2.5 0 0 1 2.5 2.5z", clipRule: "evenodd" })
|
|
9
|
+
] });
|
|
10
|
+
export {
|
|
11
|
+
SvgIconAddWidget as default
|
|
12
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as IconAddUser } from './IconAddUser';
|
|
2
|
+
export { default as IconAddWidget } from './IconAddWidget';
|
|
2
3
|
export { default as IconAdd } from './IconAdd';
|
|
3
4
|
export { default as IconAdjustSettings } from './IconAdjustSettings';
|
|
4
5
|
export { default as IconAiFill } from './IconAiFill';
|
|
@@ -1,6 +1,2 @@
|
|
|
1
1
|
export { default as FileCard } from './FileCard';
|
|
2
2
|
export * from './FileCard';
|
|
3
|
-
export { default as GoogleDriveFileCard } from './GoogleDriveFileCard';
|
|
4
|
-
export * from './GoogleDriveFileCard';
|
|
5
|
-
export { default as NextcloudFileCard } from './NextcloudFileCard';
|
|
6
|
-
export * from './NextcloudFileCard';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
1
|
import { App, ILinkedResource } from '@edifice.io/client';
|
|
3
2
|
/**
|
|
4
3
|
* Definition of an internal link.
|
|
@@ -33,11 +32,6 @@ export interface InternalLinkerProps {
|
|
|
33
32
|
applicationList?: ApplicationOption[];
|
|
34
33
|
/** Whether to show the application selector */
|
|
35
34
|
showApplicationSelector?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Rendered on the search row, where the application selector sits, for
|
|
38
|
-
* consumers that hide that selector but still need a filter of their own.
|
|
39
|
-
*/
|
|
40
|
-
searchFilter?: ReactNode;
|
|
41
35
|
/** Disable application selecetor */
|
|
42
36
|
disableApplicationSelector?: boolean;
|
|
43
37
|
/** Optional callback to filter resources after loading. Applied in addition to search filters. */
|
|
@@ -55,5 +49,5 @@ export interface InternalLinkerProps {
|
|
|
55
49
|
/** Label for the "load more" button. Defaults to the `bbm.linker.see.more` i18n key. */
|
|
56
50
|
loadMoreLabel?: string;
|
|
57
51
|
}
|
|
58
|
-
export declare const InternalLinker: ({ appCode, defaultAppCode, defaultResourceId, onChange, onSelect, multiple, resourceList, applicationList, showApplicationSelector,
|
|
52
|
+
export declare const InternalLinker: ({ appCode, defaultAppCode, defaultResourceId, onChange, onSelect, multiple, resourceList, applicationList, showApplicationSelector, disableApplicationSelector, resourceFilter, onSearch, hasMoreResources, onLoadMore, loadMoreLabel, }: InternalLinkerProps) => import("react/jsx-runtime").JSX.Element;
|
|
59
53
|
export default InternalLinker;
|
|
@@ -23,7 +23,6 @@ const InternalLinker = ({
|
|
|
23
23
|
resourceList,
|
|
24
24
|
applicationList,
|
|
25
25
|
showApplicationSelector = !0,
|
|
26
|
-
searchFilter,
|
|
27
26
|
disableApplicationSelector = !1,
|
|
28
27
|
resourceFilter,
|
|
29
28
|
onSearch,
|
|
@@ -132,7 +131,6 @@ const InternalLinker = ({
|
|
|
132
131
|
] }), variant: "ghost", size: "md", disabled: disableApplicationSelector }),
|
|
133
132
|
/* @__PURE__ */ jsx(Dropdown.Menu, { children: options == null ? void 0 : options.map((option) => /* @__PURE__ */ jsx(Dropdown.Item, { icon: option.icon, onClick: () => handleOptionClick(option), children: option.displayName }, option.application)) })
|
|
134
133
|
] }) }),
|
|
135
|
-
!showApplicationSelector && searchFilter && /* @__PURE__ */ jsx("div", { className: "flex-shrink-1 px-8 py-12 border-end align-self-center", children: searchFilter }),
|
|
136
134
|
/* @__PURE__ */ jsx("div", { className: "flex-grow-1 align-self-center", children: /* @__PURE__ */ jsx("form", { className: "gap-16 d-flex w-100 align-items-center px-16 py-8", onSubmit: handleSubmit, children: /* @__PURE__ */ jsx(SearchBar, { isVariant: !0, placeholder: t("search"), size: "lg", className: "w-100", disabled: !selectedApplication, onChange: handleSearchChange }) }) })
|
|
137
135
|
] }),
|
|
138
136
|
/* @__PURE__ */ jsxs("div", { className: "internal-linker flex-grow-1 w-100 rounded-bottom border gap-0 overflow-auto", children: [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WorkspaceElement, WorkspaceVisibility } from '@edifice.io/client';
|
|
2
2
|
import { TabsItemProps } from '../../../components';
|
|
3
3
|
import { ExternalLinkTabProps } from './innertabs/ExternalLink';
|
|
4
4
|
import { InternalLinkTabProps, InternalLinkTabResult } from './innertabs/InternalLink';
|
|
@@ -54,7 +54,7 @@ export interface MediaLibraryRef {
|
|
|
54
54
|
/**
|
|
55
55
|
* The resulting type depends on the actual selected Tab when modal is closed.
|
|
56
56
|
*/
|
|
57
|
-
export type MediaLibraryResult = WorkspaceElement[] | WorkspaceElement |
|
|
57
|
+
export type MediaLibraryResult = WorkspaceElement[] | WorkspaceElement | InternalLinkTabResult | string | /*TODO type des autres résultats ?*/ any;
|
|
58
58
|
/**
|
|
59
59
|
* MediaLibrary component properties
|
|
60
60
|
*/
|
|
@@ -5,7 +5,6 @@ import { useTranslation } from "react-i18next";
|
|
|
5
5
|
import SvgIconApplications from "../../icons/components/IconApplications.js";
|
|
6
6
|
import SvgIconCode from "../../icons/components/IconCode.js";
|
|
7
7
|
import SvgIconFolder from "../../icons/components/IconFolder.js";
|
|
8
|
-
import SvgIconGlobe2 from "../../icons/components/IconGlobe2.js";
|
|
9
8
|
import SvgIconGlobe from "../../icons/components/IconGlobe.js";
|
|
10
9
|
import SvgIconMic from "../../icons/components/IconMic.js";
|
|
11
10
|
import SvgIconRecordVideo from "../../icons/components/IconRecordVideo.js";
|
|
@@ -13,7 +12,6 @@ import SvgIconSmartphone from "../../icons/components/IconSmartphone.js";
|
|
|
13
12
|
import { InnerTabs } from "./innertabs/index.js";
|
|
14
13
|
import { MediaLibraryContext } from "./MediaLibraryContext.js";
|
|
15
14
|
import useHasWorkflow from "../../../hooks/useHasWorkflow/useHasWorkflow.js";
|
|
16
|
-
import usePublicConf from "../../../hooks/usePublicConf/usePublicConf.js";
|
|
17
15
|
import useHttpErrorToast from "../../../hooks/useHttpErrorToast/useHttpErrorToast.js";
|
|
18
16
|
import Modal from "../../../components/Modal/Modal.js";
|
|
19
17
|
import { Tabs } from "../../../components/Tabs/components/Tabs.js";
|
|
@@ -31,13 +29,9 @@ const orderedTabs = [
|
|
|
31
29
|
// Filesystem browser + drag'n'drop of files
|
|
32
30
|
"workspace",
|
|
33
31
|
// Media browser
|
|
34
|
-
"nextcloud",
|
|
35
|
-
// Nextcloud media browser
|
|
36
|
-
"google-drive",
|
|
37
|
-
// Google Drive media browser
|
|
38
32
|
"video-embedder"
|
|
39
33
|
// Link to a hosted video
|
|
40
|
-
],
|
|
34
|
+
], mediaLibraryTypes = {
|
|
41
35
|
none: null,
|
|
42
36
|
audio: {
|
|
43
37
|
title: "bbm.audio.modal.title",
|
|
@@ -76,7 +70,7 @@ const orderedTabs = [
|
|
|
76
70
|
onCancel,
|
|
77
71
|
onTabChange
|
|
78
72
|
}, ref) => {
|
|
79
|
-
var _a
|
|
73
|
+
var _a;
|
|
80
74
|
const linkTabProps = useRef(), refModal = useRef(null);
|
|
81
75
|
useImperativeHandle(ref, () => ({
|
|
82
76
|
show,
|
|
@@ -87,9 +81,7 @@ const orderedTabs = [
|
|
|
87
81
|
}));
|
|
88
82
|
const {
|
|
89
83
|
t
|
|
90
|
-
} = useTranslation(), workspaceCreateWorkflow = useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|addDocument"), videoCaptureWorkflow = useHasWorkflow("com.opendigitaleducation.video.controllers.VideoController|capture"),
|
|
91
|
-
data: workspacePublicConf
|
|
92
|
-
} = usePublicConf("workspace"), enableNextcloudTab = ((_a = workspacePublicConf == null ? void 0 : workspacePublicConf["folder-service"]) == null ? void 0 : _a.includes("nextcloud")) && nextcloudViewWorkflow, enableGoogleDriveTab = ((_b = workspacePublicConf == null ? void 0 : workspacePublicConf["folder-service"]) == null ? void 0 : _b.includes("google-drive")) && googleDriveViewWorkflow, [type, setType] = useState(null);
|
|
84
|
+
} = useTranslation(), workspaceCreateWorkflow = useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|addDocument"), videoCaptureWorkflow = useHasWorkflow("com.opendigitaleducation.video.controllers.VideoController|capture"), [type, setType] = useState(null);
|
|
93
85
|
useHttpErrorToast({
|
|
94
86
|
active: !!type,
|
|
95
87
|
isDismissible: !0,
|
|
@@ -104,23 +96,6 @@ const orderedTabs = [
|
|
|
104
96
|
availableFor: ["audio", "video", "image", "attachment"],
|
|
105
97
|
isEnable: null
|
|
106
98
|
},
|
|
107
|
-
nextcloud: {
|
|
108
|
-
id: "nextcloud",
|
|
109
|
-
icon: /* @__PURE__ */ jsx(SvgIconGlobe2, {}),
|
|
110
|
-
label: t("bbm.nextcloud"),
|
|
111
|
-
content: /* @__PURE__ */ jsx(InnerTabs.Nextcloud, {}),
|
|
112
|
-
availableFor: ["audio", "video", "image", "attachment"],
|
|
113
|
-
isEnable: () => !!enableNextcloudTab
|
|
114
|
-
},
|
|
115
|
-
"google-drive": {
|
|
116
|
-
id: "google-drive",
|
|
117
|
-
// FIXME No Google Drive icon in the pack yet; reusing the generic one.
|
|
118
|
-
icon: /* @__PURE__ */ jsx(SvgIconGlobe2, {}),
|
|
119
|
-
label: t("bbm.google-drive"),
|
|
120
|
-
content: /* @__PURE__ */ jsx(InnerTabs.GoogleDrive, {}),
|
|
121
|
-
availableFor: ["audio", "video", "image", "attachment"],
|
|
122
|
-
isEnable: () => !!enableGoogleDriveTab
|
|
123
|
-
},
|
|
124
99
|
upload: {
|
|
125
100
|
id: "upload",
|
|
126
101
|
icon: /* @__PURE__ */ jsx(SvgIconSmartphone, {}),
|
|
@@ -187,7 +162,7 @@ const orderedTabs = [
|
|
|
187
162
|
), [defaultTabId, setDefaultTabId] = useState(), defaultTabIdx = useMemo(() => {
|
|
188
163
|
const index = tabs.findIndex((t2) => t2.id === defaultTabId);
|
|
189
164
|
return 0 > index || index >= tabs.length ? 0 : index;
|
|
190
|
-
}, [tabs, defaultTabId]), [resultCounter, setResultCounter] = useState(), [result, setResult] = useState(), [deletionsOnCancel, setDeletionsOnCancel] = useState([]), [onSuccessAction, setPreSuccess] = useState()
|
|
165
|
+
}, [tabs, defaultTabId]), [resultCounter, setResultCounter] = useState(), [result, setResult] = useState(), [deletionsOnCancel, setDeletionsOnCancel] = useState([]), [onSuccessAction, setPreSuccess] = useState();
|
|
191
166
|
function setVisibleTab(tab) {
|
|
192
167
|
throw tabs.findIndex((t2) => t2.id === tab) < 0 ? "tab.not.visible" : "not.implemented.yet";
|
|
193
168
|
}
|
|
@@ -202,33 +177,22 @@ const orderedTabs = [
|
|
|
202
177
|
linkTabProps.current = props, "resourceId" in props || "appPrefix" in props || setDefaultTabId("external-link"), setType("hyperlink");
|
|
203
178
|
};
|
|
204
179
|
useEffect(() => {
|
|
205
|
-
var _a2,
|
|
180
|
+
var _a2, _b;
|
|
206
181
|
const typeKey = type || "none";
|
|
207
|
-
!defaultTabId && typeof ((_a2 = mediaLibraryTypes[typeKey]) == null ? void 0 : _a2.defaultTab) == "string" && setDefaultTabId((
|
|
182
|
+
!defaultTabId && typeof ((_a2 = mediaLibraryTypes[typeKey]) == null ? void 0 : _a2.defaultTab) == "string" && setDefaultTabId((_b = mediaLibraryTypes[typeKey]) == null ? void 0 : _b.defaultTab);
|
|
208
183
|
}, [defaultTabId, type]);
|
|
209
|
-
const modalHeader = t(((
|
|
184
|
+
const modalHeader = t(((_a = mediaLibraryTypes[type ?? "none"]) == null ? void 0 : _a.title) ?? "bbm"), resetState = () => {
|
|
210
185
|
linkTabProps.current = void 0, setResult(void 0), setResultCounter(void 0), setDefaultTabId(void 0), setPreSuccess(void 0), setDeletionsOnCancel([]);
|
|
211
186
|
}, handleTabChange = (tab) => {
|
|
212
187
|
onTabChange == null || onTabChange(tab, deletionsOnCancel), resetState();
|
|
213
188
|
}, handleOnSuccess = useCallback(() => {
|
|
214
|
-
if (isSubmitting) return;
|
|
215
189
|
const triggerSuccess = async (result2) => {
|
|
216
190
|
result2 instanceof Array && ["protected", "public"].findIndex((v) => v === visibility) >= 0 && (result2 = await odeServices.workspace().transferDocuments(result2, appCode ?? "media-library", visibility)), onSuccess(result2);
|
|
217
191
|
};
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
const asyncResult = await onSuccessAction();
|
|
223
|
-
await triggerSuccess(asyncResult);
|
|
224
|
-
} else result && await triggerSuccess(result);
|
|
225
|
-
resetState();
|
|
226
|
-
} catch {
|
|
227
|
-
} finally {
|
|
228
|
-
setIsSubmitting(!1);
|
|
229
|
-
}
|
|
230
|
-
})();
|
|
231
|
-
}, [isSubmitting, onSuccessAction, result, onSuccess, visibility, appCode]), handleOnCancel = () => {
|
|
192
|
+
onSuccessAction ? onSuccessAction().then((result2) => {
|
|
193
|
+
triggerSuccess(result2);
|
|
194
|
+
}) : result && triggerSuccess(result), resetState();
|
|
195
|
+
}, [onSuccessAction, result, onSuccess, visibility, appCode]), handleOnCancel = () => {
|
|
232
196
|
onCancel(deletionsOnCancel), resetState();
|
|
233
197
|
};
|
|
234
198
|
return type && /* @__PURE__ */ jsx(MediaLibraryContext.Provider, { value: {
|
|
@@ -250,7 +214,7 @@ const orderedTabs = [
|
|
|
250
214
|
] }) }),
|
|
251
215
|
/* @__PURE__ */ jsxs(Modal.Footer, { children: [
|
|
252
216
|
/* @__PURE__ */ jsx(Button, { type: "button", color: "tertiary", variant: "ghost", onClick: handleOnCancel, children: t("cancel") }),
|
|
253
|
-
/* @__PURE__ */ jsx(Button, { type: "button", color: "primary", variant: "filled", disabled: typeof result > "u"
|
|
217
|
+
/* @__PURE__ */ jsx(Button, { type: "button", color: "primary", variant: "filled", disabled: typeof result > "u", onClick: handleOnSuccess, children: resultCounter && resultCounter > 1 ? t("addMultiple", {
|
|
254
218
|
number: resultCounter
|
|
255
219
|
}) : t("add") })
|
|
256
220
|
] })
|
|
@@ -4,8 +4,6 @@ export declare const InnerTabs: {
|
|
|
4
4
|
Upload: () => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
ExternalLink: ({ link, multiNodeSelected, }: import('./ExternalLink').ExternalLinkTabProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
Workspace: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
Nextcloud: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
GoogleDrive: () => import("react/jsx-runtime").JSX.Element;
|
|
9
7
|
InternalLink: ({ target, resourceId, appPrefix, }: import('./InternalLink').InternalLinkTabProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
8
|
Iframe: () => import("react/jsx-runtime").JSX.Element;
|
|
11
9
|
VideoEmbedder: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Audio } from "./Audio.js";
|
|
2
2
|
import { ExternalLink } from "./ExternalLink.js";
|
|
3
|
-
import { GoogleDrive } from "./GoogleDrive.js";
|
|
4
3
|
import { Iframe } from "./Iframe.js";
|
|
5
4
|
import { InternalLink } from "./InternalLink.js";
|
|
6
|
-
import { Nextcloud } from "./Nextcloud.js";
|
|
7
5
|
import { Upload } from "./Upload.js";
|
|
8
6
|
import { Video } from "./Video.js";
|
|
9
7
|
import { VideoEmbedder } from "./VideoEmbedder.js";
|
|
@@ -14,8 +12,6 @@ const InnerTabs = {
|
|
|
14
12
|
Upload,
|
|
15
13
|
ExternalLink,
|
|
16
14
|
Workspace,
|
|
17
|
-
Nextcloud,
|
|
18
|
-
GoogleDrive,
|
|
19
15
|
InternalLink,
|
|
20
16
|
Iframe,
|
|
21
17
|
VideoEmbedder
|
|
@@ -6,7 +6,6 @@ import SvgIconSortAscendingLetters from "../../icons/components/IconSortAscendin
|
|
|
6
6
|
import SvgIconSortDescendingLetters from "../../icons/components/IconSortDescendingLetters.js";
|
|
7
7
|
import SvgIconSortTime from "../../icons/components/IconSortTime.js";
|
|
8
8
|
import illuTrash from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-trash.svg";
|
|
9
|
-
import useHasWorkflow from "../../../hooks/useHasWorkflow/useHasWorkflow.js";
|
|
10
9
|
import useWorkspaceSearch from "../../../hooks/useWorkspaceSearch/useWorkspaceSearch.js";
|
|
11
10
|
import { Grid } from "../../../components/Grid/Grid.js";
|
|
12
11
|
import TreeView from "../../../components/TreeView/TreeView.js";
|
|
@@ -16,7 +15,7 @@ import LoadingScreen from "../../../components/LoadingScreen/LoadingScreen.js";
|
|
|
16
15
|
import FileCard from "../FileCard/FileCard.js";
|
|
17
16
|
import EmptyScreen from "../../../components/EmptyScreen/EmptyScreen.js";
|
|
18
17
|
import { findTreeNode } from "../../../components/TreeView/utilities/treeview.js";
|
|
19
|
-
const
|
|
18
|
+
const Workspace = ({
|
|
20
19
|
roles,
|
|
21
20
|
onSelect,
|
|
22
21
|
multiple = !0,
|
|
@@ -26,7 +25,7 @@ const WORKSPACE_VIEW_WORKFLOW = "org.entcore.workspace.controllers.WorkspaceCont
|
|
|
26
25
|
}) => {
|
|
27
26
|
const {
|
|
28
27
|
t
|
|
29
|
-
} = useTranslation(),
|
|
28
|
+
} = useTranslation(), {
|
|
30
29
|
root: ownerRoot,
|
|
31
30
|
loadContent: loadOwnerDocs
|
|
32
31
|
} = useWorkspaceSearch("root", t("workspace.tree.owner"), "owner", roles), {
|
|
@@ -112,9 +111,7 @@ const WORKSPACE_VIEW_WORKFLOW = "org.entcore.workspace.controllers.WorkspaceCont
|
|
|
112
111
|
return;
|
|
113
112
|
}
|
|
114
113
|
(_a = ref == null ? void 0 : ref.current) == null || _a.select("root");
|
|
115
|
-
}, [currentFilter]), useEffect(() => {
|
|
116
|
-
hasWorkspaceViewRight === !1 && (currentFilter === "owner" || currentFilter === "shared") && selectAndLoadContent("protected", "root");
|
|
117
|
-
}, [hasWorkspaceViewRight]), useEffect(loadContent, [loadContent]), useEffect(() => {
|
|
114
|
+
}, [currentFilter]), useEffect(loadContent, [loadContent]), useEffect(() => {
|
|
118
115
|
if (currentNode.files) {
|
|
119
116
|
let list = [].concat(currentNode.files);
|
|
120
117
|
searchTerm && (list = list.filter((f) => f.name.indexOf(searchTerm) >= 0));
|
|
@@ -143,8 +140,8 @@ const WORKSPACE_VIEW_WORKFLOW = "org.entcore.workspace.controllers.WorkspaceCont
|
|
|
143
140
|
top: 0,
|
|
144
141
|
paddingTop: "1.2rem"
|
|
145
142
|
}, children: [
|
|
146
|
-
|
|
147
|
-
|
|
143
|
+
/* @__PURE__ */ jsx(TreeView, { ref: ownerRef, data: ownerRoot, onTreeItemClick: (nodeId) => selectAndLoadContent("owner", nodeId), onTreeItemUnfold: (nodeId) => selectAndLoadContent("owner", nodeId) }),
|
|
144
|
+
/* @__PURE__ */ jsx(TreeView, { ref: sharedRef, data: sharedRoot, onTreeItemClick: (nodeId) => selectAndLoadContent("shared", nodeId), onTreeItemUnfold: (nodeId) => selectAndLoadContent("shared", nodeId) }),
|
|
148
145
|
/* @__PURE__ */ jsx(TreeView, { ref: protectRef, data: protectRoot, onTreeItemClick: (nodeId) => selectAndLoadContent("protected", nodeId), onTreeItemUnfold: (nodeId) => selectAndLoadContent("protected", nodeId) }),
|
|
149
146
|
showPublicFolder && /* @__PURE__ */ jsx(TreeView, { ref: publicRef, data: publicRoot, onTreeItemClick: (nodeId) => selectAndLoadContent("public", nodeId), onTreeItemUnfold: (nodeId) => selectAndLoadContent("public", nodeId) })
|
|
150
147
|
] }) }),
|
|
@@ -5,8 +5,6 @@ export * from './ImagePicker';
|
|
|
5
5
|
export * from './FileCard';
|
|
6
6
|
export * from './Linker';
|
|
7
7
|
export * from './MediaLibrary';
|
|
8
|
-
export * from './GoogleDrive';
|
|
9
|
-
export * from './Nextcloud';
|
|
10
8
|
export * from './UploadCard';
|
|
11
9
|
export * from './VideoEmbed';
|
|
12
10
|
export * from './VideoRecorder';
|