@7365admin1/layer-common 4.97.1-staging.722 → 4.97.1-staging.723

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.
@@ -316,8 +316,25 @@ export default function useUtils() {
316
316
  return `${day}/${month}/${year}`;
317
317
  }
318
318
 
319
+ /*
320
+ * A nature is stored as a slug (`mechanical_electrical_services`), so
321
+ * title-casing it cannot bring back what the slug never held: the "&" of
322
+ * "Mechanical & Electrical Services", or the product name "iRanger365".
323
+ * Natures whose name is not their slug in words are spelt here exactly as
324
+ * the Invite Client dropdown spells them (`InvitationClientForm.vue`
325
+ * APP_LIST); every other value - including ones the model does not list,
326
+ * like `property_owner` - is still title-cased.
327
+ */
328
+ const NATURE_LABELS: Readonly<Record<string, string>> = {
329
+ mechanical_electrical_services: "Mechanical & Electrical Services",
330
+ estate_ranger_services: "iRanger365",
331
+ };
332
+
319
333
  function formatNature(value: string): string {
320
334
  if (!value) return "";
335
+ if (Object.prototype.hasOwnProperty.call(NATURE_LABELS, value)) {
336
+ return NATURE_LABELS[value];
337
+ }
321
338
  return value
322
339
  .split("_")
323
340
  .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "4.97.1-staging.722",
5
+ "version": "4.97.1-staging.723",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",