@crombolo/core 0.60.0 → 0.62.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crombolo/core",
3
- "version": "0.60.0",
3
+ "version": "0.62.0",
4
4
  "description": "Internal to crombolo, with no compatibility promise: use @crombolo/crombolo. Domain model, entity keys and shared contracts for crombolo. No I/O.",
5
5
  "license": "MIT",
6
6
  "author": "Crombolo",
@@ -29,6 +29,6 @@
29
29
  "access": "public"
30
30
  },
31
31
  "dependencies": {
32
- "@crombolo/common": "0.60.0"
32
+ "@crombolo/common": "0.62.0"
33
33
  }
34
34
  }
@@ -143,12 +143,9 @@ export const SECTION_NAMES: ReadonlyArray<{ name: keyof typeof SECTION_ALIASES;
143
143
  { name: 'translation', says: 'Dictionary items: words the site shows in each language' },
144
144
  { name: 'workflow', says: 'Approvals: pages waiting for someone to approve them' },
145
145
  {
146
- name: 'structure',
147
- says: 'Content types, data types and languages, which shape the whole site',
146
+ name: 'settings',
147
+ says: 'Types, templates, languages, workflows, extensions and the rest of the setup',
148
148
  },
149
- { name: 'components', says: 'Templates, components, stylesheets and scripts' },
150
- { name: 'workflowSetup', says: 'Setting up approval workflows, not deciding on them' },
151
- { name: 'settings', says: 'Types, templates, languages, bundles and the rest of the setup' },
152
149
  ]
153
150
 
154
151
  /** An event's plain name from its display name: "Content Published" is `content-published`. */
package/src/sections.ts CHANGED
@@ -27,40 +27,19 @@ export const SECTION_ALIASES = {
27
27
  forms: 'Crombolo.Section.Forms',
28
28
  // Approval workflows: Umbraco Workflow's section, in core here (story 028).
29
29
  workflow: 'Crombolo.Section.Workflow',
30
- // Parts of Settings a group can be given without the rest (story 296). None has
31
- // a header tab: each is a choice in a group, and an item in the menu under Content.
32
- structure: 'Crombolo.Section.Structure',
33
- components: 'Crombolo.Section.Components',
34
- workflowSetup: 'Crombolo.Section.WorkflowSetup',
35
30
  } as const
36
31
 
37
- /** Told to the client when someone has the whole of Settings, not only a part of it. */
38
- export const ALL_SETTINGS = 'Crombolo.Section.AllSettings'
39
-
40
32
  /**
41
- * The sections the client is told of, which aren't quite those a user holds. The
42
- * client opens Settings' screens only for someone with Settings, so a part of it
43
- * says Settings too, and `ALL_SETTINGS` marks those with the whole of it. The server
44
- * goes by what the user really holds, whatever the client is told.
33
+ * Stored aliases that no longer name a section, read and dropped so a group made
34
+ * or written before still loads: `packages` (story 238), and the parts of Settings
35
+ * a group could hold alone between stories 296 and 322.
45
36
  */
46
- export function clientSections(user: {
47
- allowedSections: readonly string[]
48
- isAdmin: boolean
49
- }): string[] {
50
- const held = new Set(user.allowedSections.map(sectionKey))
51
- const out = new Set(user.allowedSections)
52
- if (held.has('settings')) {
53
- out.add(ALL_SETTINGS)
54
- out.add(SECTION_ALIASES.structure)
55
- out.add(SECTION_ALIASES.components)
56
- }
57
- if (held.has('structure') || held.has('components')) out.add(SECTION_ALIASES.settings)
58
- if (user.isAdmin || held.has(sectionKey(SECTION_ALIASES.workflowSetup))) {
59
- out.add(SECTION_ALIASES.workflowSetup)
60
- out.add(SECTION_ALIASES.forms)
61
- }
62
- return [...out]
63
- }
37
+ export const RETIRED_SECTIONS: ReadonlySet<string> = new Set([
38
+ 'packages',
39
+ 'structure',
40
+ 'components',
41
+ 'workflowSetup',
42
+ ])
64
43
 
65
44
  export type AppAlias = keyof typeof SECTION_ALIASES
66
45
  export type SectionAlias = (typeof SECTION_ALIASES)[AppAlias]