@hgdc/ui 0.72.1 → 0.72.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/products.js +12 -3
  2. package/package.json +1 -1
package/dist/products.js CHANGED
@@ -189,11 +189,20 @@ export function shellProductEntries(options = {}) {
189
189
  }
190
190
  /** Manager du catalogue, s'il y est, sorti des autres produits : il prend la place d'Account en tête. */
191
191
  /**
192
- * L'adresse reçue, seulement pour un Manager local : les consoles passent aussi l'adresse d'Account en
193
- * production, et `account.hgdc.ch` redirige vers ID, pas vers Manager.
192
+ * L'adresse reçue, seulement pour un Manager local : en production, les consoles passent l'adresse
193
+ * d'ID (`id.hgdc.ch`, avant `account.hgdc.ch`), qui n'est pas Manager. Toute adresse `https` sous
194
+ * `hgdc.ch` garde donc le Manager du catalogue.
194
195
  */
195
196
  function localManagerHref(accountHref) {
196
- return accountHref?.startsWith("https://account.hgdc.ch") ? undefined : accountHref;
197
+ if (!accountHref)
198
+ return undefined;
199
+ try {
200
+ const { protocol, hostname } = new URL(accountHref);
201
+ return protocol === "https:" && (hostname === "hgdc.ch" || hostname.endsWith(".hgdc.ch")) ? undefined : accountHref;
202
+ }
203
+ catch {
204
+ return undefined;
205
+ }
197
206
  }
198
207
  function managerFirst(catalog) {
199
208
  const manager = catalog.find((item) => item.badge === "manager" && isProductOpen(item));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hgdc/ui",
3
- "version": "0.72.1",
3
+ "version": "0.72.2",
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",