@hgdc/ui 0.66.0 → 0.66.1
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/app-shell.js +1 -1
- package/dist/products.js +11 -2
- package/package.json +1 -1
package/dist/app-shell.js
CHANGED
|
@@ -102,7 +102,7 @@ export function AppShell({ product, organization, productRail: productRailOption
|
|
|
102
102
|
useAssistantShortcut(assistant);
|
|
103
103
|
const otherView = viewOption === undefined ? null : _jsx(OtherViewLink, { product: product, view: viewOption });
|
|
104
104
|
// Dans la barre de Basalte, seul Réglages reste au-dessus du compte : le reste passe dans son menu.
|
|
105
|
-
const footer = (_jsxs(_Fragment, { children: [account !== undefined ? sidebarFooter : null, productRail && project ? (_jsx("div", { className: "
|
|
105
|
+
const footer = (_jsxs(_Fragment, { children: [account !== undefined ? sidebarFooter : null, productRail && project ? (_jsx("div", { className: "pb-1", children: _jsxs("a", { href: project.settingsHref, className: SIDEBAR_ITEM, children: [_jsx(HugeiconsIcon, { icon: Settings02Icon, strokeWidth: 1.8, "aria-hidden": true, className: "size-5 shrink-0 lg:size-[1.125rem]" }), _jsx("span", { className: "truncate lg:rail:sr-only", children: "R\u00E9glages du projet" })] }) })) : null, _jsx(ShellCommonLinks, { links: productRail ? { ...(links?.settings ? { settings: links.settings } : {}), status: false } : (links ?? {}), statusPageUrl: statusPageUrl, otherView: productRail ? null : otherView }), account ?? sidebarFooter] }));
|
|
106
106
|
const menuLinks = productRail
|
|
107
107
|
? {
|
|
108
108
|
documentation: links?.documentation,
|
package/dist/products.js
CHANGED
|
@@ -106,7 +106,8 @@ export function isProductOpen(item) {
|
|
|
106
106
|
export function productMenuEntries(options = {}) {
|
|
107
107
|
const current = options.current?.toLowerCase();
|
|
108
108
|
const { manager, others } = managerFirst(options.catalog ?? HGDC_PRODUCTS);
|
|
109
|
-
const
|
|
109
|
+
const local = localManagerHref(options.accountHref);
|
|
110
|
+
const head = manager && local ? { ...manager, entryHref: local } : manager;
|
|
110
111
|
return [...(head ? [head] : []), ...others.filter(isProductOpen)].map((item) => ({
|
|
111
112
|
name: item.name,
|
|
112
113
|
href: item.entryHref,
|
|
@@ -159,12 +160,20 @@ export function shellProductEntries(options = {}) {
|
|
|
159
160
|
};
|
|
160
161
|
const { manager, others } = managerFirst(options.catalog ?? HGDC_PRODUCTS);
|
|
161
162
|
const head = manager ?? HGDC_MANAGER;
|
|
163
|
+
const local = localManagerHref(options.accountHref);
|
|
162
164
|
return {
|
|
163
165
|
products: others.filter(isProductOpen).map((item) => entry(item, item.entryHref, true)),
|
|
164
|
-
account: entry(head,
|
|
166
|
+
account: entry(head, local ?? head.entryHref, local === undefined),
|
|
165
167
|
};
|
|
166
168
|
}
|
|
167
169
|
/** Manager du catalogue, s'il y est, sorti des autres produits : il prend la place d'Account en tête. */
|
|
170
|
+
/**
|
|
171
|
+
* L'adresse reçue, seulement pour un Manager local : les consoles passent aussi l'adresse d'Account en
|
|
172
|
+
* production, et `account.hgdc.ch` redirige vers ID, pas vers Manager.
|
|
173
|
+
*/
|
|
174
|
+
function localManagerHref(accountHref) {
|
|
175
|
+
return accountHref?.startsWith("https://account.hgdc.ch") ? undefined : accountHref;
|
|
176
|
+
}
|
|
168
177
|
function managerFirst(catalog) {
|
|
169
178
|
const manager = catalog.find((item) => item.badge === "manager" && isProductOpen(item));
|
|
170
179
|
return { manager, others: catalog.filter((item) => item !== manager) };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hgdc/ui",
|
|
3
|
-
"version": "0.66.
|
|
3
|
+
"version": "0.66.1",
|
|
4
4
|
"description": "Interface de la H Collection : jetons de la DA, thèmes, polices et composants.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://github.com/hugogebel-boop/hgdc-kit/tree/main/packages/ui#readme",
|