@esri/hub-common 14.196.1 → 14.198.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.
Files changed (33) hide show
  1. package/dist/esm/core/schemas/internal/events/EventGalleryCardSchema.js +1 -1
  2. package/dist/esm/core/schemas/internal/events/EventGalleryCardSchema.js.map +1 -1
  3. package/dist/esm/groups/_internal/GroupSchema.js +84 -2
  4. package/dist/esm/groups/_internal/GroupSchema.js.map +1 -1
  5. package/dist/esm/groups/_internal/GroupUiSchemaCreate.js +376 -71
  6. package/dist/esm/groups/_internal/GroupUiSchemaCreate.js.map +1 -1
  7. package/dist/esm/groups/_internal/convertHubGroupToGroup.js +15 -0
  8. package/dist/esm/groups/_internal/convertHubGroupToGroup.js.map +1 -1
  9. package/dist/esm/groups/_internal/getPropertyMap.js +3 -0
  10. package/dist/esm/groups/_internal/getPropertyMap.js.map +1 -1
  11. package/dist/esm/groups/getWellKnownGroup.js +10 -0
  12. package/dist/esm/groups/getWellKnownGroup.js.map +1 -1
  13. package/dist/esm/permissions/PlatformPermissionPolicies.js +7 -0
  14. package/dist/esm/permissions/PlatformPermissionPolicies.js.map +1 -1
  15. package/dist/node/core/schemas/internal/events/EventGalleryCardSchema.js +1 -1
  16. package/dist/node/core/schemas/internal/events/EventGalleryCardSchema.js.map +1 -1
  17. package/dist/node/groups/_internal/GroupSchema.js +84 -2
  18. package/dist/node/groups/_internal/GroupSchema.js.map +1 -1
  19. package/dist/node/groups/_internal/GroupUiSchemaCreate.js +376 -71
  20. package/dist/node/groups/_internal/GroupUiSchemaCreate.js.map +1 -1
  21. package/dist/node/groups/_internal/convertHubGroupToGroup.js +15 -0
  22. package/dist/node/groups/_internal/convertHubGroupToGroup.js.map +1 -1
  23. package/dist/node/groups/_internal/getPropertyMap.js +3 -0
  24. package/dist/node/groups/_internal/getPropertyMap.js.map +1 -1
  25. package/dist/node/groups/getWellKnownGroup.js +10 -0
  26. package/dist/node/groups/getWellKnownGroup.js.map +1 -1
  27. package/dist/node/permissions/PlatformPermissionPolicies.js +7 -0
  28. package/dist/node/permissions/PlatformPermissionPolicies.js.map +1 -1
  29. package/dist/types/core/types/IHubGroup.d.ts +14 -0
  30. package/dist/types/groups/_internal/GroupUiSchemaCreate.d.ts +2 -1
  31. package/dist/types/groups/getWellKnownGroup.d.ts +1 -1
  32. package/dist/types/permissions/types/PlatformPrivilege.d.ts +1 -1
  33. package/package.json +1 -1
@@ -57,7 +57,7 @@ export const EventGalleryCardSchema = {
57
57
  },
58
58
  layout: {
59
59
  type: "string",
60
- enum: ["list", "map"],
60
+ enum: ["list", "map", "calendar"],
61
61
  default: "list",
62
62
  },
63
63
  },
@@ -1 +1 @@
1
- {"version":3,"file":"EventGalleryCardSchema.js","sourceRoot":"","sources":["../../../../../../src/core/schemas/internal/events/EventGalleryCardSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAGjC,MAAM,CAAC,MAAM,sBAAsB,GAAyB;IAC1D,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,aAAa,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;YAC3B,OAAO,EAAE,SAAS;SACnB;QACD,SAAS,EAAE;YACT,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;aACf;YACD,OAAO,EAAE,EAAE;SACZ;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;aACf;YACD,OAAO,EAAE,EAAE;SACZ;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;YACzB,OAAO,EAAE,QAAQ;SAClB;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC;YACxC,OAAO,EAAE,MAAM;SAChB;QACD,kBAAkB,EAAE;YAClB,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,IAAI;SACd;QACD,MAAM,EAAE;YACN,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC;aACnC;YACD,OAAO,EAAE,EAAE;SACZ;QACD,IAAI,EAAE,kBAAkB;QACxB,UAAU,EAAE,wBAAwB;QACpC,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;YAC1C,OAAO,EAAE,IAAI;SACd;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;YACrB,OAAO,EAAE,MAAM;SAChB;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;YACrB,OAAO,EAAE,MAAM;SAChB;KACF;CACF,CAAC"}
1
+ {"version":3,"file":"EventGalleryCardSchema.js","sourceRoot":"","sources":["../../../../../../src/core/schemas/internal/events/EventGalleryCardSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAGjC,MAAM,CAAC,MAAM,sBAAsB,GAAyB;IAC1D,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,aAAa,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;YAC3B,OAAO,EAAE,SAAS;SACnB;QACD,SAAS,EAAE;YACT,IAAI,EAAE,OAAO;YACb,KAAK,EA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26
  description: { type: "string" },
27
27
  _thumbnail: ENTITY_IMAGE_SCHEMA,
28
+ access: {
29
+ type: "string",
30
+ enum: ["private", "org", "public"],
31
+ default: "private",
32
+ },
28
33
  isSharedUpdate: { type: "boolean", enum: [false, true], default: false },
34
+ leavingDisallowed: { type: "boolean", enum: [false, true], default: false },
35
+ isOpenData: { type: "boolean", enum: [false, true], default: false },
29
36
  membershipAccess: {
30
37
  type: "string",
31
38
  enum: ["organization", "collaborators", "anyone"],
32
- default: "anyone",
39
+ default: "organization",
33
40
  },
34
41
  isViewOnly: {
35
42
  type: "boolean",
36
43
  enum: [false, true],
37
44
  default: false,
38
45
  },
46
+ _join: {
47
+ type: "string",
48
+ enum: ["invite", "request", "auto"],
49
+ default: "invite",
50
+ },
51
+ hiddenMembers: {
52
+ type: "boolean",
53
+ enum: [false, true],
54
+ default: false,
55
+ },
39
56
  isDiscussable: ENTITY_IS_DISCUSSABLE_SCHEMA,
40
57
  },
41
58
  allOf: [
42
- // if the group is a shared update group, it must have a membershipAccess of org or collaborators
59
+ // if the group is not public, isOpenData must be false
60
+ {
61
+ if: {
62
+ properties: {
63
+ access: { pattern: "(private|org)" },
64
+ },
65
+ },
66
+ then: {
67
+ properties: {
68
+ isOpenData: { const: false },
69
+ },
70
+ },
71
+ },
72
+ // if the group is is an admin group (leavingDisallowed === true), it must have a membershipAccess of organization
73
+ {
74
+ if: {
75
+ properties: {
76
+ leavingDisallowed: { const: true },
77
+ },
78
+ },
79
+ then: {
80
+ properties: {
81
+ membershipAccess: {
82
+ type: "string",
83
+ const: "organization",
84
+ },
85
+ },
86
+ },
87
+ },
88
+ // if the group is a shared update group (isSharedUpdate === true), it must have a membershipAccess of org or collaborators
43
89
  {
44
90
  if: {
45
91
  properties: {
@@ -49,11 +95,47 @@ export const GroupSchema = {
49
95
  then: {
50
96
  properties: {
51
97
  membershipAccess: {
98
+ type: "string",
52
99
  pattern: "(organization|collaborators)",
53
100
  },
54
101
  },
55
102
  },
56
103
  },
104
+ // if the group has access === 'private', then the _join must be 'invite'
105
+ {
106
+ if: {
107
+ properties: {
108
+ access: { const: "private" },
109
+ },
110
+ },
111
+ then: {
112
+ properties: {
113
+ _join: { const: "invite" },
114
+ },
115
+ },
116
+ },
117
+ // if the group is admin (leavingDisallowed === true) or isSharedUpdate === true, _join must be 'invite' or 'request'
118
+ {
119
+ if: {
120
+ anyOf: [
121
+ {
122
+ properties: {
123
+ leavingDisallowed: { const: true },
124
+ },
125
+ },
126
+ {
127
+ properties: {
128
+ isSharedUpdate: { const: true },
129
+ },
130
+ },
131
+ ],
132
+ },
133
+ then: {
134
+ properties: {
135
+ _join: { pattern: "(invite|request)" },
136
+ },
137
+ },
138
+ },
57
139
  ],
58
140
  };
59
141
  //# sourceMappingURL=GroupSchema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GroupSchema.js","sourceRoot":"","sources":["../../../../src/groups/_internal/GroupSchema.ts"],"names":[],"mappings":"AACA,OAAO,EACL,mBAAmB,EACnB,4BAA4B,EAC5B,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AAGnC,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,gBAAgB;IAChB,oBAAoB;IACpB,uBAAuB;IACvB,qCAAqC;IACrC,4BAA4B;IAC5B,wCAAwC;IACxC,8BAA8B;IAC9B,uBAAuB;IACvB,uBAAuB;IACvB,kBAAkB;CACV,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAyB;IAC/C,QAAQ,EAAE,CAAC,MAAM,CAAC;IAClB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,IAAI,EAAE,kBAAkB;QACxB,OAAO,kCACF,qBAAqB;YACxB,wDAAwD;YACxD,0BAA0B;YAC1B,SAAS,EAAE,GAAG,GACf;QACD,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC/B,UAAU,EAAE,mBAAmB;QAC/B,cAAc,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE;QACxE,gBAAgB,EAAE;YAChB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,cAAc,EAAE,eAAe,EAAE,QAAQ,CAAC;YACjD,OAAO,EAAE,QAAQ;SAClB;QACD,UAAU,EAAE;YACV,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC;YACnB,OAAO,EAAE,KAAK;SACf;QACD,aAAa,EAAE,4BAA4B;KAC5C;IACD,KAAK,EAAE;QACL,iGAAiG;QACjG;YACE,EAAE,EAAE;gBACF,UAAU,EAAE;oBACV,cAAc,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;iBAChC;aACF;YACD,IAAI,EAAE;gBACJ,UAAU,EAAE;oBACV,gBAAgB,EAAE;wBAChB,OAAO,EAAE,8BAA8B;qBACxC;iBACF;aACF;SACF;KACF;CACsB,CAAC"}
1
+ {"version":3,"file":"GroupSchema.js","sourceRoot":"","sources":["../../../../src/groups/_internal/GroupSchema.ts"],"names":[],"mappings":"AACA,OAAO,EACL,mBAAmB,EACnB,4BAA4B,EAC5B,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AAGnC,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,gBAAgB;IAChB,oBAAoB;IACpB,uBAAuB;IACvB,qCAAqC;IACrC,4BAA4B;IAC5B,wCAAwC;IACxC,8BAA8B;IAC9B,uBAAuB;IACvB,uBAAuB;IACvB,kBAAkB;CACV,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAyB;IAC/C,QAAQ,EAAE,CAAC,MAAM,CAAC;IAClB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,IAAI,EAAE,kBAAkB;QACxB,OAAO,kCACF,qBAAqB;YACxB,wDAAwD;YACxD,0BAA0B;YAC1B,SAAS,EAA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Effects, } from "../../core/schemas/types";
2
2
  import { checkPermission } from "../../permissions";
3
3
  import { getWellKnownGroup } from "../getWellKnownGroup";
4
+ import { getProp } from "../../objects";
4
5
  /**
5
6
  * @private
6
7
  * constructs the complete uiSchema for creating a view
@@ -12,104 +13,408 @@ export const buildUiSchema = async (i18nScope, options, context) => {
12
13
  type: "Layout",
13
14
  elements: [
14
15
  {
15
- labelKey: `${i18nScope}.fields.name.label`,
16
- scope: "/properties/name",
17
- type: "Control",
18
- options: {
19
- messages: [
20
- {
21
- type: "ERROR",
22
- keyword: "required",
23
- icon: true,
24
- labelKey: `${i18nScope}.fields.name.requiredError`,
16
+ type: "Section",
17
+ labelKey: `${i18nScope}.sections.basicInfo.label`,
18
+ elements: [
19
+ {
20
+ labelKey: `${i18nScope}.fields.name.label`,
21
+ scope: "/properties/name",
22
+ type: "Control",
23
+ options: {
24
+ messages: [
25
+ {
26
+ type: "ERROR",
27
+ keyword: "required",
28
+ icon: true,
29
+ labelKey: `${i18nScope}.fields.name.requiredError`,
30
+ },
31
+ {
32
+ type: "ERROR",
33
+ keyword: "maxLength",
34
+ icon: true,
35
+ labelKey: `${i18nScope}.fields.name.maxLengthError`,
36
+ },
37
+ ],
25
38
  },
26
- {
27
- type: "ERROR",
28
- keyword: "maxLength",
29
- icon: true,
30
- labelKey: `${i18nScope}.fields.name.maxLengthError`,
39
+ },
40
+ {
41
+ labelKey: `${i18nScope}.fields.access.label`,
42
+ scope: "/properties/access",
43
+ type: "Control",
44
+ options: {
45
+ control: "hub-field-input-tile-select",
46
+ descriptions: [
47
+ `{{${i18nScope}.fields.access.private.description:translate}}`,
48
+ `{{${i18nScope}.fields.access.org.description:translate}}`,
49
+ `{{${i18nScope}.fields.access.public.description:translate}}`,
50
+ ],
51
+ icons: ["users", "organization", "globe"],
52
+ labels: [
53
+ `{{${i18nScope}.fields.access.private.label:translate}}`,
54
+ `{{${i18nScope}.fields.access.org.label:translate}}`,
55
+ `{{${i18nScope}.fields.access.public.label:translate}}`,
56
+ ],
57
+ rules: [
58
+ {
59
+ effect: UiSchemaRuleEffects.NONE,
60
+ },
61
+ {
62
+ effect: UiSchemaRuleEffects.ENABLE,
63
+ conditions: [
64
+ checkPermission("platform:portal:user:shareGroupToOrg", context).access,
65
+ ],
66
+ },
67
+ {
68
+ effect: UiSchemaRuleEffects.ENABLE,
69
+ conditions: [
70
+ checkPermission("platform:portal:user:shareGroupToPublic", context).access,
71
+ ],
72
+ },
73
+ ],
31
74
  },
32
- ],
33
- },
75
+ },
76
+ ],
34
77
  },
35
78
  {
36
- labelKey: `${i18nScope}.fields.isSharedUpdate.label`,
37
- scope: "/properties/isSharedUpdate",
38
- type: "Control",
39
- options: {
40
- control: "hub-field-input-switch",
41
- helperText: {
42
- labelKey: `${i18nScope}.fields.isSharedUpdate.helperText`,
79
+ type: "Section",
80
+ labelKey: `${i18nScope}.sections.capabilities.label`,
81
+ elements: [
82
+ {
83
+ labelKey: `${i18nScope}.fields.isSharedUpdate.label`,
84
+ scope: "/properties/isSharedUpdate",
85
+ type: "Control",
86
+ options: {
87
+ control: "hub-field-input-switch",
88
+ helperText: {
89
+ labelKey: `${i18nScope}.fields.isSharedUpdate.helperText`,
90
+ },
91
+ },
92
+ rule: {
93
+ effect: UiSchemaRuleEffects.ENABLE,
94
+ conditions: [
95
+ checkPermission("platform:portal:admin:createUpdateCapableGroup", context).access,
96
+ ],
97
+ },
98
+ },
99
+ {
100
+ labelKey: `${i18nScope}.fields.isAdmin.label`,
101
+ scope: "/properties/leavingDisallowed",
102
+ type: "Control",
103
+ options: {
104
+ control: "hub-field-input-switch",
105
+ helperText: {
106
+ labelKey: `${i18nScope}.fields.isAdmin.helperText`,
107
+ },
108
+ },
109
+ rules: [
110
+ {
111
+ effect: UiSchemaRuleEffects.ENABLE,
112
+ conditions: [
113
+ checkPermission("platform:portal:admin:createLeavingDisallowedGroup", context).access,
114
+ ],
115
+ },
116
+ ],
117
+ },
118
+ {
119
+ labelKey: `${i18nScope}.fields.isOpenData.label`,
120
+ scope: "/properties/isOpenData",
121
+ type: "Control",
122
+ options: {
123
+ control: "hub-field-input-switch",
124
+ helperText: {
125
+ labelKey: `${i18nScope}.fields.isOpenData.helperText`,
126
+ },
127
+ messages: [
128
+ {
129
+ type: "ERROR",
130
+ keyword: "const",
131
+ icon: true,
132
+ labelKey: `${i18nScope}.fields.isOpenData.constError`,
133
+ },
134
+ ],
135
+ },
136
+ rules: [
137
+ {
138
+ effect: UiSchemaRuleEffects.ENABLE,
139
+ conditions: [
140
+ {
141
+ scope: "/properties/access",
142
+ schema: { const: "public" },
143
+ },
144
+ checkPermission("platform:opendata:user:designateGroup", context).access,
145
+ ],
146
+ },
147
+ {
148
+ effect: UiSchemaRuleEffects.RESET,
149
+ conditions: [
150
+ {
151
+ scope: "/properties/access",
152
+ schema: { not: { const: "public" } },
153
+ },
154
+ ],
155
+ },
156
+ {
157
+ effect: UiSchemaRuleEffects.SHOW,
158
+ conditions: [
159
+ // should only exist if user's org has portal.portalProperties.opendata.enabled: true
160
+ !!getProp(context, "portal.portalProperties.openData.enabled"),
161
+ ],
162
+ },
163
+ ],
43
164
  },
44
- },
165
+ ],
45
166
  },
46
167
  {
47
- labelKey: `${i18nScope}.fields.membershipAccess.label`,
48
- scope: "/properties/membershipAccess",
49
- type: "Control",
50
- options: {
51
- control: "hub-field-input-radio",
52
- labels: [
53
- `{{${i18nScope}.fields.membershipAccess.org:translate}}`,
54
- `{{${i18nScope}.fields.membershipAccess.collab:translate}}`,
55
- `{{${i18nScope}.fields.membershipAccess.any:translate}}`,
56
- ],
57
- rules: [
58
- [
59
- // we should be able to use undefined in this position but when used with entityEditor, we run this through interpolateTranslations
60
- // which filters out the undefined which makes this not work as expected
61
- // so for now we add a rule that doesn't do anything
168
+ type: "Section",
169
+ labelKey: `${i18nScope}.sections.membershipAccess.label`,
170
+ elements: [
171
+ {
172
+ labelKey: `${i18nScope}.fields.membershipAccess.label`,
173
+ scope: "/properties/membershipAccess",
174
+ type: "Control",
175
+ options: {
176
+ control: "hub-field-input-tile-select",
177
+ labels: [
178
+ `{{${i18nScope}.fields.membershipAccess.org.label:translate}}`,
179
+ `{{${i18nScope}.fields.membershipAccess.collab.label:translate}}`,
180
+ `{{${i18nScope}.fields.membershipAccess.any.label:translate}}`,
181
+ ],
182
+ descriptions: [
183
+ `{{${i18nScope}.fields.membershipAccess.org.description:translate}}`,
184
+ `{{${i18nScope}.fields.membershipAccess.collab.description:translate}}`,
185
+ `{{${i18nScope}.fields.membershipAccess.any.description:translate}}`,
186
+ ],
187
+ // rules that pertain to the individual options
188
+ rules: [
189
+ [
190
+ {
191
+ effect: UiSchemaRuleEffects.NONE,
192
+ },
193
+ ],
194
+ [
195
+ {
196
+ effect: UiSchemaRuleEffects.DISABLE,
197
+ conditions: [
198
+ {
199
+ scope: "/properties/leavingDisallowed",
200
+ schema: { const: true },
201
+ },
202
+ ],
203
+ },
204
+ ],
205
+ [
206
+ {
207
+ effect: UiSchemaRuleEffects.DISABLE,
208
+ conditions: [
209
+ {
210
+ scope: "/properties/leavingDisallowed",
211
+ schema: { const: true },
212
+ },
213
+ ],
214
+ },
215
+ {
216
+ effect: UiSchemaRuleEffects.DISABLE,
217
+ conditions: [
218
+ {
219
+ scope: "/properties/isSharedUpdate",
220
+ schema: { const: true },
221
+ },
222
+ ],
223
+ },
224
+ ],
225
+ ],
226
+ messages: [
227
+ {
228
+ type: "ERROR",
229
+ keyword: "pattern",
230
+ icon: true,
231
+ labelKey: `${i18nScope}.fields.membershipAccess.patternError`,
232
+ },
233
+ {
234
+ type: "ERROR",
235
+ keyword: "const",
236
+ icon: true,
237
+ labelKey: `${i18nScope}.fields.membershipAccess.constError`,
238
+ },
239
+ ],
240
+ },
241
+ // rules that pertain to the control as a whole
242
+ rules: [
62
243
  {
63
- effect: UiSchemaRuleEffects.NONE,
244
+ effect: UiSchemaRuleEffects.RESET,
245
+ conditions: [
246
+ {
247
+ scope: "/properties/leavingDisallowed",
248
+ schema: { const: true },
249
+ },
250
+ ],
64
251
  },
65
- ],
66
- [
67
252
  {
68
- effect: UiSchemaRuleEffects.DISABLE,
253
+ effect: UiSchemaRuleEffects.RESET,
69
254
  conditions: [
70
- !checkPermission("platform:portal:user:addExternalMembersToGroup", context).access,
255
+ {
256
+ scope: "/properties/isSharedUpdate",
257
+ schema: { const: true },
258
+ },
259
+ {
260
+ scope: "/properties/membershipAccess",
261
+ schema: { const: "anyone" },
262
+ },
71
263
  ],
72
264
  },
73
265
  ],
74
- [
266
+ },
267
+ {
268
+ labelKey: `${i18nScope}.fields.join.label`,
269
+ scope: "/properties/_join",
270
+ type: "Control",
271
+ options: {
272
+ control: "hub-field-input-tile-select",
273
+ labels: [
274
+ `{{${i18nScope}.fields.join.invite.label:translate}}`,
275
+ `{{${i18nScope}.fields.join.request.label:translate}}`,
276
+ `{{${i18nScope}.fields.join.auto.label:translate}}`,
277
+ ],
278
+ descriptions: [
279
+ `{{${i18nScope}.fields.join.invite.description:translate}}`,
280
+ `{{${i18nScope}.fields.join.request.description:translate}}`,
281
+ `{{${i18nScope}.fields.join.auto.description:translate}}`,
282
+ ],
283
+ // rules that pertain to the individual options
284
+ rules: [
285
+ [
286
+ {
287
+ effect: UiSchemaRuleEffects.NONE,
288
+ },
289
+ ],
290
+ [
291
+ {
292
+ effect: UiSchemaRuleEffects.DISABLE,
293
+ conditions: [
294
+ {
295
+ scope: "/properties/access",
296
+ schema: { const: "private" },
297
+ },
298
+ ],
299
+ },
300
+ ],
301
+ [
302
+ {
303
+ effect: UiSchemaRuleEffects.DISABLE,
304
+ conditions: [
305
+ {
306
+ scope: "/properties/access",
307
+ schema: { const: "private" },
308
+ },
309
+ ],
310
+ },
311
+ {
312
+ effect: UiSchemaRuleEffects.DISABLE,
313
+ conditions: [
314
+ {
315
+ scope: "/properties/leavingDisallowed",
316
+ schema: { const: true },
317
+ },
318
+ ],
319
+ },
320
+ {
321
+ effect: UiSchemaRuleEffects.DISABLE,
322
+ conditions: [
323
+ {
324
+ scope: "/properties/isSharedUpdate",
325
+ schema: { const: true },
326
+ },
327
+ ],
328
+ },
329
+ ],
330
+ ],
331
+ messages: [
332
+ {
333
+ type: "ERROR",
334
+ keyword: "const",
335
+ icon: true,
336
+ labelKey: `${i18nScope}.fields.join.constError`,
337
+ },
338
+ {
339
+ type: "ERROR",
340
+ keyword: "pattern",
341
+ icon: true,
342
+ labelKey: `${i18nScope}.fields.join.patternError`,
343
+ },
344
+ ],
345
+ },
346
+ // rules that pertain to the control as a whole
347
+ rules: [
75
348
  {
76
- effect: UiSchemaRuleEffects.DISABLE,
349
+ effect: UiSchemaRuleEffects.RESET,
77
350
  conditions: [
78
- !checkPermission("platform:portal:user:addExternalMembersToGroup", context).access,
351
+ {
352
+ scope: "/properties/access",
353
+ schema: { const: "private" },
354
+ },
355
+ ],
356
+ },
357
+ {
358
+ effect: UiSchemaRuleEffects.RESET,
359
+ conditions: [
360
+ {
361
+ scope: "/properties/leavingDisallowed",
362
+ schema: { const: true },
363
+ },
364
+ {
365
+ scope: "/properties/_join",
366
+ schema: { const: "auto" },
367
+ },
79
368
  ],
80
369
  },
81
370
  {
82
- effect: UiSchemaRuleEffects.DISABLE,
371
+ effect: UiSchemaRuleEffects.RESET,
83
372
  conditions: [
84
373
  {
85
374
  scope: "/properties/isSharedUpdate",
86
375
  schema: { const: true },
87
376
  },
377
+ {
378
+ scope: "/properties/_join",
379
+ schema: { const: "auto" },
380
+ },
88
381
  ],
89
382
  },
90
383
  ],
91
- ],
92
- messages: [
93
- {
94
- type: "ERROR",
95
- keyword: "enum",
96
- icon: true,
97
- labelKey: `${i18nScope}.fields.membershipAccess.enumError`,
384
+ },
385
+ {
386
+ labelKey: `${i18nScope}.fields.hiddenMembers.label`,
387
+ scope: "/properties/hiddenMembers",
388
+ type: "Control",
389
+ options: {
390
+ control: "hub-field-input-tile-select",
391
+ labels: [
392
+ `{{${i18nScope}.fields.hiddenMembers.members.label:translate}}`,
393
+ `{{${i18nScope}.fields.hiddenMembers.admins.label:translate}}`,
394
+ ],
395
+ descriptions: [
396
+ `{{${i18nScope}.fields.hiddenMembers.members.description:translate}}`,
397
+ `{{${i18nScope}.fields.hiddenMembers.admins.description:translate}}`,
398
+ ],
98
399
  },
99
- ],
100
- },
101
- },
102
- {
103
- labelKey: `${i18nScope}.fields.contributeContent.label`,
104
- scope: "/properties/isViewOnly",
105
- type: "Control",
106
- options: {
107
- control: "hub-field-input-radio",
108
- labels: [
109
- `{{${i18nScope}.fields.contributeContent.all:translate}}`,
110
- `{{${i18nScope}.fields.contributeContent.admins:translate}}`,
111
- ],
112
- },
400
+ },
401
+ {
402
+ labelKey: `${i18nScope}.fields.contributeContent.label`,
403
+ scope: "/properties/isViewOnly",
404
+ type: "Control",
405
+ options: {
406
+ control: "hub-field-input-tile-select",
407
+ labels: [
408
+ `{{${i18nScope}.fields.contributeContent.members.label:translate}}`,
409
+ `{{${i18nScope}.fields.contributeContent.admins.label:translate}}`,
410
+ ],
411
+ descriptions: [
412
+ `{{${i18nScope}.fields.contributeContent.members.description:translate}}`,
413
+ `{{${i18nScope}.fields.contributeContent.admins.description:translate}}`,
414
+ ],
415
+ },
416
+ },
417
+ ],
113
418
  },
114
419
  ],
115
420
  };
@@ -125,6 +430,6 @@ export const buildUiSchema = async (i18nScope, options, context) => {
125
430
  * @returns
126
431
  */
127
432
  export const buildDefaults = async (i18nScope, options, context) => {
128
- return Object.assign(Object.assign({}, getWellKnownGroup("hubViewGroup", context)), { membershipAccess: "organization" });
433
+ return Object.assign(Object.assign({}, getWellKnownGroup("hubGroup", context)), options);
129
434
  };
130
435
  //# sourceMappingURL=GroupUiSchemaCreate.js.map