@edifice.io/react 2.6.3-develop-b2school.20260826103236 → 2.6.3-develop-pedago.20260826173028
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/Badge/Badge.d.ts +6 -1
- package/dist/components/Badge/Badge.js +1 -1
- package/dist/components/Layout/components/Header.js +0 -6
- package/dist/components/Layout/hooks/useHeader.js +2 -3
- package/dist/modules/homepage/components/Header/Header.js +4 -11
- package/dist/modules/homepage/components/UserSpace/hooks/useProfileLinks.js +8 -18
- package/package.json +6 -6
|
@@ -6,6 +6,11 @@ export type NotificationBadgeVariant = {
|
|
|
6
6
|
type: 'notification';
|
|
7
7
|
level: 'success' | 'warning' | 'danger' | 'info';
|
|
8
8
|
};
|
|
9
|
+
/** Badge variant : status */
|
|
10
|
+
export type StatusBadgeVariant = {
|
|
11
|
+
type: 'status';
|
|
12
|
+
level: 'validate' | 'success' | 'warning' | 'danger' | 'info';
|
|
13
|
+
};
|
|
9
14
|
/** Badge variant : content */
|
|
10
15
|
export type ContentBadgeVariant = {
|
|
11
16
|
type: 'content';
|
|
@@ -49,7 +54,7 @@ export type AppVersionBadgeVariant = {
|
|
|
49
54
|
color?: string;
|
|
50
55
|
app?: IWebApp;
|
|
51
56
|
};
|
|
52
|
-
export type BadgeVariants = NotificationBadgeVariant | ContentBadgeVariant | ProfileBadgeVariant | ChipBadgeVariant | LinkBadgeVariant | AppVersionBadgeVariant;
|
|
57
|
+
export type BadgeVariants = NotificationBadgeVariant | StatusBadgeVariant | ContentBadgeVariant | ProfileBadgeVariant | ChipBadgeVariant | LinkBadgeVariant | AppVersionBadgeVariant;
|
|
53
58
|
export interface BadgeProps extends React.ComponentPropsWithRef<'span'> {
|
|
54
59
|
/**
|
|
55
60
|
* Badge variant : notification, link or profile (Teacher|Student|Relative|Personnel)
|
|
@@ -21,7 +21,7 @@ const Badge = /* @__PURE__ */ forwardRef(({
|
|
|
21
21
|
const colorAppClassName = getIconClass(variant.app), backgroundLightAppClassName = getBackgroundLightIconClass(variant.app), borderAppClassName = getBorderIconClass(variant.app);
|
|
22
22
|
appVersionBadgeColorClassName = `${colorAppClassName} ${backgroundLightAppClassName} ${borderAppClassName}`;
|
|
23
23
|
}
|
|
24
|
-
const classes = clsx("badge rounded-pill", (variant.type === "content" || variant.type === "user") && "background" in variant ? "bg-gray-200" : (variant.type === "content" || variant.type === "user") && !("background" in variant) ? "border border-0" : "", variant.type === "content" && `text-${variant.level}`, variant.type === "notification" && `badge-notification bg-${variant.level} text-light border border-0`, variant.type === "user" && `badge-profile-${variant.profile.toLowerCase()}`, variant.type === "link" && "badge-link border border-0", variant.type === "chip" && "bg-gray-200", variant.type === "appVersion" && appVersionBadgeColorClassName, className);
|
|
24
|
+
const classes = clsx("badge rounded-pill", (variant.type === "content" || variant.type === "user") && "background" in variant ? "bg-gray-200" : (variant.type === "content" || variant.type === "user") && !("background" in variant) ? "border border-0" : "", variant.type === "content" && `text-${variant.level}`, variant.type === "notification" && `badge-notification bg-${variant.level} text-light border border-0`, variant.type === "status" && `badge-status badge-status-${variant.level} caption fw-normal`, variant.type === "user" && `badge-profile-${variant.profile.toLowerCase()}`, variant.type === "link" && "badge-link border border-0", variant.type === "chip" && "bg-gray-200", variant.type === "appVersion" && appVersionBadgeColorClassName, className);
|
|
25
25
|
return /* @__PURE__ */ jsxs("span", { ref, className: classes, ...restProps, children: [
|
|
26
26
|
variant.type === "chip" && /* @__PURE__ */ jsx("div", { className: "d-flex fw-800 align-items-center", children }),
|
|
27
27
|
variant.type === "appVersion" && (children ?? "BÊTA"),
|
|
@@ -5,7 +5,6 @@ import { useEdificeClient } from "../../../providers/EdificeClientProvider/Edifi
|
|
|
5
5
|
import { useEdificeTheme } from "../../../providers/EdificeThemeProvider/EdificeThemeProvider.hook.js";
|
|
6
6
|
import SvgIconRafterDown from "../../../modules/icons/components/IconRafterDown.js";
|
|
7
7
|
import SvgIconCommunities from "../../../modules/icons/components/nav/IconCommunities.js";
|
|
8
|
-
import SvgIconCommunity from "../../../modules/icons/components/nav/IconCommunity.js";
|
|
9
8
|
import SvgIconDisconnect from "../../../modules/icons/components/nav/IconDisconnect.js";
|
|
10
9
|
import SvgIconHome from "../../../modules/icons/components/nav/IconHome.js";
|
|
11
10
|
import SvgIconMyApps from "../../../modules/icons/components/nav/IconMyApps.js";
|
|
@@ -67,7 +66,6 @@ const Header = ({
|
|
|
67
66
|
userAvatar,
|
|
68
67
|
userName,
|
|
69
68
|
welcomeUser,
|
|
70
|
-
communityWorkflow,
|
|
71
69
|
communitiesWorkflow,
|
|
72
70
|
conversationWorflow,
|
|
73
71
|
searchWorkflow,
|
|
@@ -176,10 +174,6 @@ const Header = ({
|
|
|
176
174
|
/* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsxs("div", { className: "dropdown", children: [
|
|
177
175
|
/* @__PURE__ */ jsx("button", { className: "nav-link btn btn-naked d-md-none", type: "button", "aria-controls": "dropdown-navbar", "aria-expanded": !isCollapsed, "aria-label": t("navbar.open.menu"), onClick: toggleCollapsedNav, children: /* @__PURE__ */ jsx(SvgIconRafterDown, { className: "icon rafter-down", width: "20", height: "20", color: "#fff" }) }),
|
|
178
176
|
/* @__PURE__ */ jsxs("ul", { className: `dropdown-menu dropdown-menu-end ${isCollapsed ? "" : "show"}`, id: "dropdown-navbar", children: [
|
|
179
|
-
communityWorkflow && /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsxs("a", { href: "/community", className: "nav-link dropdown-item", children: [
|
|
180
|
-
/* @__PURE__ */ jsx(SvgIconCommunity, { className: "icon community" }),
|
|
181
|
-
/* @__PURE__ */ jsx("span", { className: "nav-text", children: t("navbar.community") })
|
|
182
|
-
] }) }),
|
|
183
177
|
communitiesWorkflow && /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsxs("a", { href: "/communities", className: "nav-link dropdown-item", children: [
|
|
184
178
|
/* @__PURE__ */ jsx(SvgIconCommunities, { className: "icon communities" }),
|
|
185
179
|
/* @__PURE__ */ jsx("span", { className: "nav-text", children: t("navbar.community") })
|
|
@@ -14,7 +14,7 @@ function useHeader({
|
|
|
14
14
|
t
|
|
15
15
|
} = useTranslation(), title = t(appCode), [isCollapsed, setIsCollapsed] = useState(!0), [appsRef, isAppsHovered] = useHover(), popoverAppsId = useId(), popoverSearchId = useId(), userAvatar = avatar, userName = user == null ? void 0 : user.username, welcomeUser = t("welcome", {
|
|
16
16
|
username: user == null ? void 0 : user.firstName
|
|
17
|
-
}), bookmarkedApps = useBookmark(),
|
|
17
|
+
}), bookmarkedApps = useBookmark(), communitiesWorkflow = useHasWorkflow("community.access"), conversationWorflow = useHasWorkflow("org.entcore.conversation.controllers.ConversationController|view"), searchWorkflow = useHasWorkflow("fr.openent.searchengine.controllers.SearchEngineController|view"), toggleCollapsedNav = useCallback(() => {
|
|
18
18
|
setIsCollapsed(!isCollapsed);
|
|
19
19
|
}, [isCollapsed]);
|
|
20
20
|
return useMemo(() => ({
|
|
@@ -27,13 +27,12 @@ function useHeader({
|
|
|
27
27
|
userAvatar,
|
|
28
28
|
userName,
|
|
29
29
|
welcomeUser,
|
|
30
|
-
communityWorkflow,
|
|
31
30
|
communitiesWorkflow,
|
|
32
31
|
conversationWorflow,
|
|
33
32
|
searchWorkflow,
|
|
34
33
|
isCollapsed,
|
|
35
34
|
toggleCollapsedNav
|
|
36
|
-
}), [appsRef, bookmarkedApps, communitiesWorkflow,
|
|
35
|
+
}), [appsRef, bookmarkedApps, communitiesWorkflow, conversationWorflow, isAppsHovered, isCollapsed, popoverAppsId, popoverSearchId, searchWorkflow, title, toggleCollapsedNav, userAvatar, userName, welcomeUser]);
|
|
37
36
|
}
|
|
38
37
|
export {
|
|
39
38
|
useHeader as default
|
|
@@ -6,7 +6,6 @@ import { Navbar } from "../../../../components/Layout/components/Navbar.js";
|
|
|
6
6
|
import { NavItem } from "../../../../components/Layout/components/NavItem.js";
|
|
7
7
|
import { NavLink } from "../../../../components/Layout/components/NavLink.js";
|
|
8
8
|
import useHeader from "../../../../components/Layout/hooks/useHeader.js";
|
|
9
|
-
import SvgIconSetBackground from "../../../icons/components/IconSetBackground.js";
|
|
10
9
|
import SvgIconCommunitiesBeta from "../../../icons/components/nav/IconCommunitiesBeta.js";
|
|
11
10
|
import SvgIconDisconnect from "../../../icons/components/nav/IconDisconnect.js";
|
|
12
11
|
import SvgIconHomeBeta from "../../../icons/components/nav/IconHomeBeta.js";
|
|
@@ -87,16 +86,10 @@ const Header = ({
|
|
|
87
86
|
] }),
|
|
88
87
|
/* @__PURE__ */ jsxs(NavItem, { className: "position-relative", ref: userRef, id: popoverUserId, "aria-haspopup": "true", "aria-expanded": isUserHovered, "data-testid": "header-user-menu-button", children: [
|
|
89
88
|
/* @__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" }) }),
|
|
90
|
-
/* @__PURE__ */ jsx(Popover, { align: "end", className: "widget", id: popoverUserId, isVisible: isUserHovered, children: /* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
] }),
|
|
95
|
-
/* @__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: [
|
|
96
|
-
/* @__PURE__ */ jsx(SvgIconDisconnect, { className: "icon logout" }),
|
|
97
|
-
/* @__PURE__ */ jsx("span", { id: "logout-label", className: "nav-text", children: t("navbar.disconnect") })
|
|
98
|
-
] })
|
|
99
|
-
] }) })
|
|
89
|
+
/* @__PURE__ */ jsx(Popover, { align: "end", className: "widget", id: popoverUserId, isVisible: isUserHovered, children: /* @__PURE__ */ jsx(PopoverBody, { children: /* @__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: [
|
|
90
|
+
/* @__PURE__ */ jsx(SvgIconDisconnect, { className: "icon logout" }),
|
|
91
|
+
/* @__PURE__ */ jsx("span", { id: "logout-label", className: "nav-text", children: t("navbar.disconnect") })
|
|
92
|
+
] }) }) })
|
|
100
93
|
] })
|
|
101
94
|
] })
|
|
102
95
|
] }) });
|
|
@@ -17,20 +17,18 @@ function useProfileLinks(profile) {
|
|
|
17
17
|
structure: structureId
|
|
18
18
|
});
|
|
19
19
|
return `${baseUrl}?${params.toString()}`;
|
|
20
|
-
}, buildClassesUrl = (
|
|
21
|
-
const params = new URLSearchParams(
|
|
20
|
+
}, buildClassesUrl = (classIds = []) => {
|
|
21
|
+
const params = new URLSearchParams({
|
|
22
|
+
filters: "groups",
|
|
23
|
+
structure: structureId
|
|
24
|
+
});
|
|
22
25
|
return classIds.forEach((c) => params.append("class", String(c))), `${baseUrl}?${params.toString()}`;
|
|
23
26
|
};
|
|
24
27
|
switch (profile) {
|
|
25
28
|
case "Teacher":
|
|
26
29
|
return [{
|
|
27
30
|
text: t("homepage.userspace.teacher.link.classes"),
|
|
28
|
-
url: buildClassesUrl(
|
|
29
|
-
{
|
|
30
|
-
filters: "groups"
|
|
31
|
-
}
|
|
32
|
-
/* Do not explicitely add classes ids, because none <=> see all*/
|
|
33
|
-
)
|
|
31
|
+
url: buildClassesUrl(user.classes)
|
|
34
32
|
}];
|
|
35
33
|
case "Student":
|
|
36
34
|
return [{
|
|
@@ -38,12 +36,7 @@ function useProfileLinks(profile) {
|
|
|
38
36
|
url: "/userbook/annuaire#/search?filters=groups&profile=Teacher"
|
|
39
37
|
}, {
|
|
40
38
|
text: t("homepage.userspace.student.link.classes"),
|
|
41
|
-
url: buildClassesUrl(
|
|
42
|
-
{
|
|
43
|
-
filters: "groups"
|
|
44
|
-
}
|
|
45
|
-
/* Do not explicitely add classes ids, because none <=> see all*/
|
|
46
|
-
)
|
|
39
|
+
url: buildClassesUrl(user.classes)
|
|
47
40
|
}];
|
|
48
41
|
case "Relative":
|
|
49
42
|
return children != null && children.length ? children.map((child) => {
|
|
@@ -52,10 +45,7 @@ function useProfileLinks(profile) {
|
|
|
52
45
|
text: t("homepage.userspace.relative.link.classes", {
|
|
53
46
|
childName: child.firstName
|
|
54
47
|
}),
|
|
55
|
-
url: buildClassesUrl({
|
|
56
|
-
filters: "groups",
|
|
57
|
-
structure: structureId
|
|
58
|
-
}, (_a2 = child.classes) == null ? void 0 : _a2.map(({
|
|
48
|
+
url: buildClassesUrl((_a2 = child.classes) == null ? void 0 : _a2.map(({
|
|
59
49
|
id
|
|
60
50
|
}) => id))
|
|
61
51
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.6.3-develop-
|
|
3
|
+
"version": "2.6.3-develop-pedago.20260826173028",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -140,9 +140,9 @@
|
|
|
140
140
|
"swiper": "10.1.0",
|
|
141
141
|
"ua-parser-js": "1.0.36",
|
|
142
142
|
"zustand": "4.5.7",
|
|
143
|
-
"@edifice.io/bootstrap": "2.6.3-develop-
|
|
144
|
-
"@edifice.io/tiptap-extensions": "2.6.3-develop-
|
|
145
|
-
"@edifice.io/utilities": "2.6.3-develop-
|
|
143
|
+
"@edifice.io/bootstrap": "2.6.3-develop-pedago.20260826173028",
|
|
144
|
+
"@edifice.io/tiptap-extensions": "2.6.3-develop-pedago.20260826173028",
|
|
145
|
+
"@edifice.io/utilities": "2.6.3-develop-pedago.20260826173028"
|
|
146
146
|
},
|
|
147
147
|
"devDependencies": {
|
|
148
148
|
"@babel/plugin-transform-react-pure-annotations": "7.27.1",
|
|
@@ -173,8 +173,8 @@
|
|
|
173
173
|
"vite": "5.4.14",
|
|
174
174
|
"vite-plugin-dts": "4.5.4",
|
|
175
175
|
"vite-tsconfig-paths": "5.1.4",
|
|
176
|
-
"@edifice.io/client": "2.6.3-develop-
|
|
177
|
-
"@edifice.io/config": "2.6.3-develop-
|
|
176
|
+
"@edifice.io/client": "2.6.3-develop-pedago.20260826173028",
|
|
177
|
+
"@edifice.io/config": "2.6.3-develop-pedago.20260826173028"
|
|
178
178
|
},
|
|
179
179
|
"peerDependencies": {
|
|
180
180
|
"@react-spring/web": "9.7.5",
|