@esri/hub-common 14.110.1 → 14.111.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/esm/core/EntityEditor.js +4 -0
- package/dist/esm/core/EntityEditor.js.map +1 -1
- package/dist/esm/core/fetchHubEntity.js +4 -0
- package/dist/esm/core/fetchHubEntity.js.map +1 -1
- package/dist/esm/core/getTypeFromEntity.js +3 -0
- package/dist/esm/core/getTypeFromEntity.js.map +1 -1
- package/dist/esm/core/schemas/internal/getEditorSchemas.js +13 -0
- package/dist/esm/core/schemas/internal/getEditorSchemas.js.map +1 -1
- package/dist/esm/core/schemas/internal/metrics/MetricSchema.js +4 -0
- package/dist/esm/core/schemas/internal/metrics/MetricSchema.js.map +1 -1
- package/dist/esm/core/schemas/types.js +2 -0
- package/dist/esm/core/schemas/types.js.map +1 -1
- package/dist/esm/core/types/HubEntityType.js +1 -0
- package/dist/esm/core/types/HubEntityType.js.map +1 -1
- package/dist/esm/core/updateHubEntity.js +8 -0
- package/dist/esm/core/updateHubEntity.js.map +1 -1
- package/dist/esm/discussions/_internal/DiscussionBusinessRules.js +7 -0
- package/dist/esm/discussions/_internal/DiscussionBusinessRules.js.map +1 -1
- package/dist/esm/discussions/api/settings/getDefaultEntitySettings.js +1 -0
- package/dist/esm/discussions/api/settings/getDefaultEntitySettings.js.map +1 -1
- package/dist/esm/events/HubEvent.js +149 -0
- package/dist/esm/events/HubEvent.js.map +1 -0
- package/dist/esm/events/_internal/EventBusinessRules.js +115 -0
- package/dist/esm/events/_internal/EventBusinessRules.js.map +1 -0
- package/dist/esm/events/_internal/EventSchemaCreate.js +50 -0
- package/dist/esm/events/_internal/EventSchemaCreate.js.map +1 -0
- package/dist/esm/events/_internal/EventSchemaEdit.js +77 -0
- package/dist/esm/events/_internal/EventSchemaEdit.js.map +1 -0
- package/dist/esm/events/_internal/EventUiSchemaCreate.js +165 -0
- package/dist/esm/events/_internal/EventUiSchemaCreate.js.map +1 -0
- package/dist/esm/events/_internal/EventUiSchemaEdit.js +371 -0
- package/dist/esm/events/_internal/EventUiSchemaEdit.js.map +1 -0
- package/dist/esm/events/_internal/PropertyMapper.js +134 -0
- package/dist/esm/events/_internal/PropertyMapper.js.map +1 -0
- package/dist/esm/events/_internal/getDefaultEventDatesAndTimes.js +28 -0
- package/dist/esm/events/_internal/getDefaultEventDatesAndTimes.js.map +1 -0
- package/dist/esm/events/_internal/getISOStringFromClientDateTime.js +28 -0
- package/dist/esm/events/_internal/getISOStringFromClientDateTime.js.map +1 -0
- package/dist/esm/events/_internal/getPropertyMap.js +47 -0
- package/dist/esm/events/_internal/getPropertyMap.js.map +1 -0
- package/dist/esm/events/_internal/validations.js +53 -0
- package/dist/esm/events/_internal/validations.js.map +1 -0
- package/dist/esm/events/defaults.js +32 -0
- package/dist/esm/events/defaults.js.map +1 -0
- package/dist/esm/events/edit.js +81 -0
- package/dist/esm/events/edit.js.map +1 -0
- package/dist/esm/events/fetch.js +29 -0
- package/dist/esm/events/fetch.js.map +1 -0
- package/dist/esm/events/index.js +4 -1
- package/dist/esm/events/index.js.map +1 -1
- package/dist/esm/events/types.js +12 -0
- package/dist/esm/events/types.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/permissions/HubPermissionPolicies.js +2 -0
- package/dist/esm/permissions/HubPermissionPolicies.js.map +1 -1
- package/dist/esm/permissions/types/Permission.js +2 -0
- package/dist/esm/permissions/types/Permission.js.map +1 -1
- package/dist/esm/surveys/HubSurvey.js +24 -0
- package/dist/esm/surveys/HubSurvey.js.map +1 -1
- package/dist/esm/surveys/_internal/SurveyBusinessRules.js +14 -1
- package/dist/esm/surveys/_internal/SurveyBusinessRules.js.map +1 -1
- package/dist/esm/utils/date/getDatePickerDate.js +27 -0
- package/dist/esm/utils/date/getDatePickerDate.js.map +1 -0
- package/dist/esm/utils/date/getTimePickerTime.js +33 -0
- package/dist/esm/utils/date/getTimePickerTime.js.map +1 -0
- package/dist/esm/utils/date/guessTimeZone.js +8 -0
- package/dist/esm/utils/date/guessTimeZone.js.map +1 -0
- package/dist/esm/utils/date/index.js +4 -0
- package/dist/esm/utils/date/index.js.map +1 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/node/core/EntityEditor.js +4 -0
- package/dist/node/core/EntityEditor.js.map +1 -1
- package/dist/node/core/fetchHubEntity.js +4 -0
- package/dist/node/core/fetchHubEntity.js.map +1 -1
- package/dist/node/core/getTypeFromEntity.js +3 -0
- package/dist/node/core/getTypeFromEntity.js.map +1 -1
- package/dist/node/core/schemas/internal/getEditorSchemas.js +13 -0
- package/dist/node/core/schemas/internal/getEditorSchemas.js.map +1 -1
- package/dist/node/core/schemas/internal/metrics/MetricSchema.js +4 -0
- package/dist/node/core/schemas/internal/metrics/MetricSchema.js.map +1 -1
- package/dist/node/core/schemas/types.js +2 -0
- package/dist/node/core/schemas/types.js.map +1 -1
- package/dist/node/core/types/HubEntityType.js +1 -0
- package/dist/node/core/types/HubEntityType.js.map +1 -1
- package/dist/node/core/updateHubEntity.js +8 -0
- package/dist/node/core/updateHubEntity.js.map +1 -1
- package/dist/node/discussions/_internal/DiscussionBusinessRules.js +7 -0
- package/dist/node/discussions/_internal/DiscussionBusinessRules.js.map +1 -1
- package/dist/node/discussions/api/settings/getDefaultEntitySettings.js +1 -0
- package/dist/node/discussions/api/settings/getDefaultEntitySettings.js.map +1 -1
- package/dist/node/events/HubEvent.js +153 -0
- package/dist/node/events/HubEvent.js.map +1 -0
- package/dist/node/events/_internal/EventBusinessRules.js +118 -0
- package/dist/node/events/_internal/EventBusinessRules.js.map +1 -0
- package/dist/node/events/_internal/EventSchemaCreate.js +53 -0
- package/dist/node/events/_internal/EventSchemaCreate.js.map +1 -0
- package/dist/node/events/_internal/EventSchemaEdit.js +80 -0
- package/dist/node/events/_internal/EventSchemaEdit.js.map +1 -0
- package/dist/node/events/_internal/EventUiSchemaCreate.js +168 -0
- package/dist/node/events/_internal/EventUiSchemaCreate.js.map +1 -0
- package/dist/node/events/_internal/EventUiSchemaEdit.js +374 -0
- package/dist/node/events/_internal/EventUiSchemaEdit.js.map +1 -0
- package/dist/node/events/_internal/PropertyMapper.js +138 -0
- package/dist/node/events/_internal/PropertyMapper.js.map +1 -0
- package/dist/node/events/_internal/getDefaultEventDatesAndTimes.js +31 -0
- package/dist/node/events/_internal/getDefaultEventDatesAndTimes.js.map +1 -0
- package/dist/node/events/_internal/getISOStringFromClientDateTime.js +32 -0
- package/dist/node/events/_internal/getISOStringFromClientDateTime.js.map +1 -0
- package/dist/node/events/_internal/getPropertyMap.js +51 -0
- package/dist/node/events/_internal/getPropertyMap.js.map +1 -0
- package/dist/node/events/_internal/validations.js +56 -0
- package/dist/node/events/_internal/validations.js.map +1 -0
- package/dist/node/events/defaults.js +37 -0
- package/dist/node/events/defaults.js.map +1 -0
- package/dist/node/events/edit.js +86 -0
- package/dist/node/events/edit.js.map +1 -0
- package/dist/node/events/fetch.js +34 -0
- package/dist/node/events/fetch.js.map +1 -0
- package/dist/node/events/index.js +4 -1
- package/dist/node/events/index.js.map +1 -1
- package/dist/node/events/types.js +15 -0
- package/dist/node/events/types.js.map +1 -0
- package/dist/node/index.js +1 -0
- package/dist/node/index.js.map +1 -1
- package/dist/node/permissions/HubPermissionPolicies.js +2 -0
- package/dist/node/permissions/HubPermissionPolicies.js.map +1 -1
- package/dist/node/permissions/types/Permission.js +2 -0
- package/dist/node/permissions/types/Permission.js.map +1 -1
- package/dist/node/surveys/HubSurvey.js +24 -0
- package/dist/node/surveys/HubSurvey.js.map +1 -1
- package/dist/node/surveys/_internal/SurveyBusinessRules.js +14 -1
- package/dist/node/surveys/_internal/SurveyBusinessRules.js.map +1 -1
- package/dist/node/utils/date/getDatePickerDate.js +31 -0
- package/dist/node/utils/date/getDatePickerDate.js.map +1 -0
- package/dist/node/utils/date/getTimePickerTime.js +37 -0
- package/dist/node/utils/date/getTimePickerTime.js.map +1 -0
- package/dist/node/utils/date/guessTimeZone.js +12 -0
- package/dist/node/utils/date/guessTimeZone.js.map +1 -0
- package/dist/node/utils/date/index.js +7 -0
- package/dist/node/utils/date/index.js.map +1 -0
- package/dist/node/utils/index.js +1 -0
- package/dist/node/utils/index.js.map +1 -1
- package/dist/types/core/schemas/types.d.ts +2 -2
- package/dist/types/core/types/HubEntity.d.ts +2 -1
- package/dist/types/core/types/HubEntityType.d.ts +1 -1
- package/dist/types/core/types/IHubEvent.d.ts +113 -5
- package/dist/types/discussions/_internal/DiscussionBusinessRules.d.ts +1 -1
- package/dist/types/events/HubEvent.d.ts +77 -0
- package/dist/types/events/_internal/EventBusinessRules.d.ts +12 -0
- package/dist/types/events/_internal/EventSchemaCreate.d.ts +8 -0
- package/dist/types/events/_internal/EventSchemaEdit.d.ts +6 -0
- package/dist/types/events/_internal/EventUiSchemaCreate.d.ts +10 -0
- package/dist/types/events/_internal/EventUiSchemaEdit.d.ts +10 -0
- package/dist/types/events/_internal/PropertyMapper.d.ts +35 -0
- package/dist/types/events/_internal/getDefaultEventDatesAndTimes.d.ts +14 -0
- package/dist/types/events/_internal/getISOStringFromClientDateTime.d.ts +18 -0
- package/dist/types/events/_internal/getPropertyMap.d.ts +8 -0
- package/dist/types/events/_internal/validations.d.ts +58 -0
- package/dist/types/events/defaults.d.ts +10 -0
- package/dist/types/events/edit.d.ts +21 -0
- package/dist/types/events/fetch.d.ts +19 -0
- package/dist/types/events/index.d.ts +4 -1
- package/dist/types/events/types.d.ts +9 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/permissions/types/Permission.d.ts +2 -1
- package/dist/types/surveys/HubSurvey.d.ts +7 -0
- package/dist/types/surveys/_internal/SurveyBusinessRules.d.ts +1 -1
- package/dist/types/utils/date/getDatePickerDate.d.ts +17 -0
- package/dist/types/utils/date/getTimePickerTime.d.ts +17 -0
- package/dist/types/utils/date/guessTimeZone.d.ts +5 -0
- package/dist/types/utils/date/index.d.ts +3 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { ENTITY_CATEGORIES_SCHEMA, ENTITY_NAME_SCHEMA, ENTITY_SUMMARY_SCHEMA, ENTITY_TAGS_SCHEMA, } from "../../core/schemas/shared/subschemas";
|
|
2
|
+
import { HubEventAttendanceType, HubEventOnlineCapacityType } from "../types";
|
|
3
|
+
import { URL_VALIDATIONS_WHEN_ONLINE_OR_HYBRID, TIME_VALIDATIONS_WHEN_NOT_ALL_DAY, FIXED_ONLINE_ATTENDANCE_VALIDATIONS, } from "./validations";
|
|
4
|
+
import { getDefaultEventDatesAndTimes } from "./getDefaultEventDatesAndTimes";
|
|
5
|
+
/**
|
|
6
|
+
* @private
|
|
7
|
+
* Builds a schema for creating a new Event that enforces a startDate relative to the user's locale
|
|
8
|
+
*/
|
|
9
|
+
export const buildSchema = () => {
|
|
10
|
+
const { startDate: minStartDate } = getDefaultEventDatesAndTimes();
|
|
11
|
+
return {
|
|
12
|
+
required: ["name", "description", "startDate", "endDate"],
|
|
13
|
+
properties: {
|
|
14
|
+
name: ENTITY_NAME_SCHEMA,
|
|
15
|
+
description: {
|
|
16
|
+
type: "string",
|
|
17
|
+
},
|
|
18
|
+
attendanceType: {
|
|
19
|
+
type: "string",
|
|
20
|
+
enum: [
|
|
21
|
+
HubEventAttendanceType.InPerson,
|
|
22
|
+
HubEventAttendanceType.Online,
|
|
23
|
+
HubEventAttendanceType.Both,
|
|
24
|
+
],
|
|
25
|
+
default: HubEventAttendanceType.InPerson,
|
|
26
|
+
},
|
|
27
|
+
startDate: {
|
|
28
|
+
type: "string",
|
|
29
|
+
format: "date",
|
|
30
|
+
formatMinimum: minStartDate,
|
|
31
|
+
},
|
|
32
|
+
endDate: {
|
|
33
|
+
type: "string",
|
|
34
|
+
format: "date",
|
|
35
|
+
formatMinimum: {
|
|
36
|
+
$data: "1/startDate",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
startTime: {
|
|
40
|
+
type: "string",
|
|
41
|
+
},
|
|
42
|
+
endTime: {
|
|
43
|
+
type: "string",
|
|
44
|
+
},
|
|
45
|
+
isAllDay: {
|
|
46
|
+
type: "boolean",
|
|
47
|
+
default: false,
|
|
48
|
+
},
|
|
49
|
+
onlineUrl: {
|
|
50
|
+
type: "string",
|
|
51
|
+
},
|
|
52
|
+
onlineDetails: {
|
|
53
|
+
type: "string",
|
|
54
|
+
},
|
|
55
|
+
onlineCapacity: {
|
|
56
|
+
type: "number",
|
|
57
|
+
},
|
|
58
|
+
onlineCapacityType: {
|
|
59
|
+
type: "string",
|
|
60
|
+
enum: [
|
|
61
|
+
HubEventOnlineCapacityType.Unlimited,
|
|
62
|
+
HubEventOnlineCapacityType.Fixed,
|
|
63
|
+
],
|
|
64
|
+
default: HubEventOnlineCapacityType.Unlimited,
|
|
65
|
+
},
|
|
66
|
+
summary: ENTITY_SUMMARY_SCHEMA,
|
|
67
|
+
tags: ENTITY_TAGS_SCHEMA,
|
|
68
|
+
categories: ENTITY_CATEGORIES_SCHEMA,
|
|
69
|
+
},
|
|
70
|
+
allOf: [
|
|
71
|
+
URL_VALIDATIONS_WHEN_ONLINE_OR_HYBRID,
|
|
72
|
+
TIME_VALIDATIONS_WHEN_NOT_ALL_DAY,
|
|
73
|
+
FIXED_ONLINE_ATTENDANCE_VALIDATIONS,
|
|
74
|
+
],
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=EventSchemaEdit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventSchemaEdit.js","sourceRoot":"","sources":["../../../../src/events/_internal/EventSchemaEdit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAC9E,OAAO,EACL,q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AAS;oBACpC,0BAA0B,CAAC,KAAK;iBACjC;gBACD,OAAO,EAAE,0BAA0B,CAAC,SAAS;aAC9C;YACD,OAAO,EAAE,qBAAqB;YAC9B,IAAI,EAAE,kBAAkB;YACxB,UAAU,EAAE,wBAAwB;SACrC;QACD,KAAK,EAAE;YACL,qCAAqC;YACrC,iCAAiC;YACjC,mCAAmC;SACpC;KACsB,CAAC;AAC5B,CAAC,CAAC"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { UiSchemaRuleEffects } from "../../core/schemas/types";
|
|
2
|
+
import { getDatePickerDate } from "../../utils/date/getDatePickerDate";
|
|
3
|
+
import { HubEventAttendanceType } from "../types";
|
|
4
|
+
/**
|
|
5
|
+
* @private
|
|
6
|
+
* constructs the complete create uiSchema for Hub Events.
|
|
7
|
+
* This defines how the schema properties should be
|
|
8
|
+
* rendered in the event creation experience
|
|
9
|
+
*/
|
|
10
|
+
export const buildUiSchema = async (i18nScope, options, context) => {
|
|
11
|
+
const minStartDate = getDatePickerDate(new Date(), options.timeZone);
|
|
12
|
+
return {
|
|
13
|
+
type: "Layout",
|
|
14
|
+
elements: [
|
|
15
|
+
{
|
|
16
|
+
labelKey: `${i18nScope}.fields.name.label`,
|
|
17
|
+
scope: "/properties/name",
|
|
18
|
+
type: "Control",
|
|
19
|
+
options: {
|
|
20
|
+
messages: [
|
|
21
|
+
{
|
|
22
|
+
type: "ERROR",
|
|
23
|
+
keyword: "required",
|
|
24
|
+
icon: true,
|
|
25
|
+
labelKey: `${i18nScope}.fields.name.requiredError`,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
type: "ERROR",
|
|
29
|
+
keyword: "maxLength",
|
|
30
|
+
icon: true,
|
|
31
|
+
labelKey: `shared.fields.title.maxLengthError`,
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
labelKey: `${i18nScope}.fields.date.label`,
|
|
38
|
+
scope: "/properties/startDate",
|
|
39
|
+
type: "Control",
|
|
40
|
+
options: {
|
|
41
|
+
control: "hub-field-input-date",
|
|
42
|
+
min: minStartDate,
|
|
43
|
+
messages: [
|
|
44
|
+
{
|
|
45
|
+
type: "ERROR",
|
|
46
|
+
keyword: "required",
|
|
47
|
+
icon: true,
|
|
48
|
+
labelKey: `${i18nScope}.fields.date.requiredError`,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: "ERROR",
|
|
52
|
+
keyword: "formatMinimum",
|
|
53
|
+
icon: true,
|
|
54
|
+
labelKey: `${i18nScope}.fields.date.minDateError`,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
labelKey: `${i18nScope}.fields.allDay.label`,
|
|
61
|
+
type: "Control",
|
|
62
|
+
scope: "/properties/isAllDay",
|
|
63
|
+
options: {
|
|
64
|
+
control: "hub-field-input-switch",
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
labelKey: `${i18nScope}.fields.startTime.label`,
|
|
69
|
+
scope: "/properties/startTime",
|
|
70
|
+
type: "Control",
|
|
71
|
+
rule: {
|
|
72
|
+
condition: {
|
|
73
|
+
scope: "/properties/isAllDay",
|
|
74
|
+
schema: { const: false },
|
|
75
|
+
},
|
|
76
|
+
effect: UiSchemaRuleEffects.SHOW,
|
|
77
|
+
},
|
|
78
|
+
options: {
|
|
79
|
+
control: "hub-field-input-time",
|
|
80
|
+
messages: [
|
|
81
|
+
{
|
|
82
|
+
type: "ERROR",
|
|
83
|
+
keyword: "required",
|
|
84
|
+
icon: true,
|
|
85
|
+
labelKey: `${i18nScope}.fields.startTime.requiredError`,
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
labelKey: `${i18nScope}.fields.endTime.label`,
|
|
92
|
+
scope: "/properties/endTime",
|
|
93
|
+
type: "Control",
|
|
94
|
+
rule: {
|
|
95
|
+
condition: {
|
|
96
|
+
scope: "/properties/isAllDay",
|
|
97
|
+
schema: { const: false },
|
|
98
|
+
},
|
|
99
|
+
effect: UiSchemaRuleEffects.SHOW,
|
|
100
|
+
},
|
|
101
|
+
options: {
|
|
102
|
+
control: "hub-field-input-time",
|
|
103
|
+
messages: [
|
|
104
|
+
{
|
|
105
|
+
type: "ERROR",
|
|
106
|
+
keyword: "required",
|
|
107
|
+
icon: true,
|
|
108
|
+
labelKey: `${i18nScope}.fields.endTime.requiredError`,
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
type: "ERROR",
|
|
112
|
+
keyword: "formatExclusiveMinimum",
|
|
113
|
+
icon: true,
|
|
114
|
+
labelKey: `${i18nScope}.fields.endTime.minTimeError`,
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
labelKey: `${i18nScope}.fields.attendanceType.label`,
|
|
121
|
+
scope: "/properties/attendanceType",
|
|
122
|
+
type: "Control",
|
|
123
|
+
options: {
|
|
124
|
+
control: "hub-field-input-radio-group",
|
|
125
|
+
enum: { i18nScope: `${i18nScope}.fields.attendanceType` },
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
labelKey: `${i18nScope}.fields.onlineUrl.label`,
|
|
130
|
+
scope: "/properties/onlineUrl",
|
|
131
|
+
type: "Control",
|
|
132
|
+
rule: {
|
|
133
|
+
condition: {
|
|
134
|
+
scope: "/properties/attendanceType",
|
|
135
|
+
schema: {
|
|
136
|
+
enum: [
|
|
137
|
+
HubEventAttendanceType.Online,
|
|
138
|
+
HubEventAttendanceType.Both,
|
|
139
|
+
],
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
effect: UiSchemaRuleEffects.SHOW,
|
|
143
|
+
},
|
|
144
|
+
options: {
|
|
145
|
+
control: "hub-field-input-input",
|
|
146
|
+
messages: [
|
|
147
|
+
{
|
|
148
|
+
type: "ERROR",
|
|
149
|
+
keyword: "required",
|
|
150
|
+
icon: true,
|
|
151
|
+
labelKey: `${i18nScope}.fields.onlineUrl.requiredError`,
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
type: "ERROR",
|
|
155
|
+
keyword: "format",
|
|
156
|
+
icon: true,
|
|
157
|
+
labelKey: `${i18nScope}.fields.onlineUrl.linkHrefFormatError`,
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
//# sourceMappingURL=EventUiSchemaCreate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventUiSchemaCreate.js","sourceRoot":"","sources":["../../../../src/events/_internal/EventUiSchemaCreate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAElD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAChC,SAAiB,EACjB,OAA4B,EAC5B,OAAuB,EACH,EAAE;IACtB,MAAM,YAAY,GAAG,iBAAiB,CACpC,IAAI,IAAI,EAAE,EACT,OAAqB,CAAC,QAAQ,CAChC,CAAC;IACF,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE;YACR;gBACE,QAAQ,EAAE,GAAG,SAAS,oBAAoB;gBAC1C,KAAK,EAAE,kBAAkB;gBACzB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE;oBACP,QAAQ,EAAE;wBACR;4BACE,IAAI,EAAE,OAAO;4BACb,OAAO,EAAE,UAAU;4BACnB,IAAI,EAAE,IAAI;4BACV,QAAQ,EAAE,GAAG,SAAS,4BAA4B;yBACnD;wBACD;4BACE,IAAI,EAAE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UAAU;4BACnB,IAAI,EAAE,IAAI;4BACV,QAAQ,EAAE,GAAG,SAAS,iCAAiC;yBACxD;wBACD;4BACE,IAAI,EAAE,OAAO;4BACb,OAAO,EAAE,QAAQ;4BACjB,IAAI,EAAE,IAAI;4BACV,QAAQ,EAAE,GAAG,SAAS,uCAAuC;yBAC9D;qBACF;iBACF;aACF;SACF;KACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
import { UiSchemaRuleEffects } from "../../core/schemas/types";
|
|
2
|
+
import { getDatePickerDate } from "../../utils/date/getDatePickerDate";
|
|
3
|
+
import { getCategoryItems } from "../../core/schemas/internal/getCategoryItems";
|
|
4
|
+
import { getTagItems } from "../../core/schemas/internal/getTagItems";
|
|
5
|
+
import { HubEventAttendanceType, HubEventOnlineCapacityType } from "../types";
|
|
6
|
+
/**
|
|
7
|
+
* @private
|
|
8
|
+
* constructs the complete edit uiSchema for Hub Events.
|
|
9
|
+
* This defines how the schema properties should be
|
|
10
|
+
* rendered in the event creation experience
|
|
11
|
+
*/
|
|
12
|
+
export const buildUiSchema = async (i18nScope, options, context) => {
|
|
13
|
+
const minStartEndDate = getDatePickerDate(new Date(), options.timeZone);
|
|
14
|
+
return {
|
|
15
|
+
type: "Layout",
|
|
16
|
+
elements: [
|
|
17
|
+
{
|
|
18
|
+
type: "Section",
|
|
19
|
+
labelKey: `${i18nScope}.sections.eventInfo.label`,
|
|
20
|
+
elements: [
|
|
21
|
+
{
|
|
22
|
+
labelKey: `${i18nScope}.fields.name.label`,
|
|
23
|
+
scope: "/properties/name",
|
|
24
|
+
type: "Control",
|
|
25
|
+
options: {
|
|
26
|
+
messages: [
|
|
27
|
+
{
|
|
28
|
+
type: "ERROR",
|
|
29
|
+
keyword: "required",
|
|
30
|
+
icon: true,
|
|
31
|
+
labelKey: `${i18nScope}.fields.name.requiredError`,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: "ERROR",
|
|
35
|
+
keyword: "maxLength",
|
|
36
|
+
icon: true,
|
|
37
|
+
labelKey: `shared.fields.title.maxLengthError`,
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
labelKey: `${i18nScope}.fields.description.label`,
|
|
44
|
+
scope: "/properties/description",
|
|
45
|
+
type: "Control",
|
|
46
|
+
options: {
|
|
47
|
+
control: "hub-field-input-rich-text",
|
|
48
|
+
type: "textarea",
|
|
49
|
+
helperText: {
|
|
50
|
+
labelKey: `${i18nScope}.fields.description.helperText`,
|
|
51
|
+
},
|
|
52
|
+
messages: [
|
|
53
|
+
{
|
|
54
|
+
type: "ERROR",
|
|
55
|
+
keyword: "required",
|
|
56
|
+
icon: true,
|
|
57
|
+
labelKey: `${i18nScope}.fields.description.requiredError`,
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
type: "Section",
|
|
66
|
+
labelKey: `${i18nScope}.sections.dateTime.label`,
|
|
67
|
+
elements: [
|
|
68
|
+
{
|
|
69
|
+
labelKey: `${i18nScope}.fields.startDate.label`,
|
|
70
|
+
scope: "/properties/startDate",
|
|
71
|
+
type: "Control",
|
|
72
|
+
options: {
|
|
73
|
+
control: "hub-field-input-date",
|
|
74
|
+
min: minStartEndDate,
|
|
75
|
+
messages: [
|
|
76
|
+
{
|
|
77
|
+
type: "ERROR",
|
|
78
|
+
keyword: "required",
|
|
79
|
+
icon: true,
|
|
80
|
+
labelKey: `${i18nScope}.fields.startDate.requiredError`,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
type: "ERROR",
|
|
84
|
+
keyword: "formatMinimum",
|
|
85
|
+
icon: true,
|
|
86
|
+
labelKey: `${i18nScope}.fields.startDate.minDateError`,
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
labelKey: `${i18nScope}.fields.endDate.label`,
|
|
93
|
+
scope: "/properties/endDate",
|
|
94
|
+
type: "Control",
|
|
95
|
+
options: {
|
|
96
|
+
control: "hub-field-input-date",
|
|
97
|
+
min: minStartEndDate,
|
|
98
|
+
messages: [
|
|
99
|
+
{
|
|
100
|
+
type: "ERROR",
|
|
101
|
+
keyword: "required",
|
|
102
|
+
icon: true,
|
|
103
|
+
labelKey: `${i18nScope}.fields.endDate.requiredError`,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
type: "ERROR",
|
|
107
|
+
keyword: "formatMinimum",
|
|
108
|
+
icon: true,
|
|
109
|
+
labelKey: `${i18nScope}.fields.endDate.minDateError`,
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
labelKey: `${i18nScope}.fields.allDay.label`,
|
|
116
|
+
type: "Control",
|
|
117
|
+
scope: "/properties/isAllDay",
|
|
118
|
+
options: {
|
|
119
|
+
control: "hub-field-input-switch",
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
labelKey: `${i18nScope}.fields.startTime.label`,
|
|
124
|
+
scope: "/properties/startTime",
|
|
125
|
+
type: "Control",
|
|
126
|
+
rule: {
|
|
127
|
+
condition: {
|
|
128
|
+
scope: "/properties/isAllDay",
|
|
129
|
+
schema: { const: false },
|
|
130
|
+
},
|
|
131
|
+
effect: UiSchemaRuleEffects.SHOW,
|
|
132
|
+
},
|
|
133
|
+
options: {
|
|
134
|
+
control: "hub-field-input-time",
|
|
135
|
+
messages: [
|
|
136
|
+
{
|
|
137
|
+
type: "ERROR",
|
|
138
|
+
keyword: "required",
|
|
139
|
+
icon: true,
|
|
140
|
+
labelKey: `${i18nScope}.fields.startTime.requiredError`,
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
labelKey: `${i18nScope}.fields.endTime.label`,
|
|
147
|
+
scope: "/properties/endTime",
|
|
148
|
+
type: "Control",
|
|
149
|
+
rule: {
|
|
150
|
+
condition: {
|
|
151
|
+
scope: "/properties/isAllDay",
|
|
152
|
+
schema: { const: false },
|
|
153
|
+
},
|
|
154
|
+
effect: UiSchemaRuleEffects.SHOW,
|
|
155
|
+
},
|
|
156
|
+
options: {
|
|
157
|
+
control: "hub-field-input-time",
|
|
158
|
+
messages: [
|
|
159
|
+
{
|
|
160
|
+
type: "ERROR",
|
|
161
|
+
keyword: "required",
|
|
162
|
+
icon: true,
|
|
163
|
+
labelKey: `${i18nScope}.fields.endTime.requiredError`,
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
type: "ERROR",
|
|
167
|
+
keyword: "formatExclusiveMinimum",
|
|
168
|
+
icon: true,
|
|
169
|
+
labelKey: `${i18nScope}.fields.endTime.minTimeError`,
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
type: "Section",
|
|
178
|
+
labelKey: `${i18nScope}.sections.location.label`,
|
|
179
|
+
elements: [
|
|
180
|
+
{
|
|
181
|
+
labelKey: `${i18nScope}.fields.attendanceType.label`,
|
|
182
|
+
scope: "/properties/attendanceType",
|
|
183
|
+
type: "Control",
|
|
184
|
+
options: {
|
|
185
|
+
control: "hub-field-input-radio-group",
|
|
186
|
+
enum: { i18nScope: `${i18nScope}.fields.attendanceType` },
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
labelKey: `${i18nScope}.fields.onlineUrl.label`,
|
|
191
|
+
scope: "/properties/onlineUrl",
|
|
192
|
+
type: "Control",
|
|
193
|
+
rule: {
|
|
194
|
+
condition: {
|
|
195
|
+
scope: "/properties/attendanceType",
|
|
196
|
+
schema: {
|
|
197
|
+
enum: [
|
|
198
|
+
HubEventAttendanceType.Online,
|
|
199
|
+
HubEventAttendanceType.Both,
|
|
200
|
+
],
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
effect: UiSchemaRuleEffects.SHOW,
|
|
204
|
+
},
|
|
205
|
+
options: {
|
|
206
|
+
control: "hub-field-input-input",
|
|
207
|
+
messages: [
|
|
208
|
+
{
|
|
209
|
+
type: "ERROR",
|
|
210
|
+
keyword: "required",
|
|
211
|
+
icon: true,
|
|
212
|
+
labelKey: `${i18nScope}.fields.onlineUrl.requiredError`,
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
type: "ERROR",
|
|
216
|
+
keyword: "format",
|
|
217
|
+
icon: true,
|
|
218
|
+
labelKey: `${i18nScope}.fields.onlineUrl.linkHrefFormatError`,
|
|
219
|
+
},
|
|
220
|
+
],
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
labelKey: `${i18nScope}.fields.onlineDetails.label`,
|
|
225
|
+
scope: "/properties/onlineDetails",
|
|
226
|
+
type: "Control",
|
|
227
|
+
rule: {
|
|
228
|
+
condition: {
|
|
229
|
+
scope: "/properties/attendanceType",
|
|
230
|
+
schema: {
|
|
231
|
+
enum: [
|
|
232
|
+
HubEventAttendanceType.Online,
|
|
233
|
+
HubEventAttendanceType.Both,
|
|
234
|
+
],
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
effect: UiSchemaRuleEffects.SHOW,
|
|
238
|
+
},
|
|
239
|
+
options: {
|
|
240
|
+
control: "hub-field-input-rich-text",
|
|
241
|
+
type: "textarea",
|
|
242
|
+
helperText: {
|
|
243
|
+
labelKey: `${i18nScope}.fields.onlineDetails.helperText`,
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
labelKey: `${i18nScope}.fields.onlineCapacityType.label`,
|
|
249
|
+
scope: "/properties/onlineCapacityType",
|
|
250
|
+
type: "Control",
|
|
251
|
+
rule: {
|
|
252
|
+
condition: {
|
|
253
|
+
scope: "/properties/attendanceType",
|
|
254
|
+
schema: {
|
|
255
|
+
enum: [
|
|
256
|
+
HubEventAttendanceType.Online,
|
|
257
|
+
HubEventAttendanceType.Both,
|
|
258
|
+
],
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
effect: UiSchemaRuleEffects.SHOW,
|
|
262
|
+
},
|
|
263
|
+
options: {
|
|
264
|
+
control: "hub-field-input-radio-group",
|
|
265
|
+
enum: { i18nScope: `${i18nScope}.fields.onlineCapacityType` },
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
labelKey: `${i18nScope}.fields.onlineCapacity.label`,
|
|
270
|
+
scope: "/properties/onlineCapacity",
|
|
271
|
+
type: "Control",
|
|
272
|
+
rule: {
|
|
273
|
+
condition: {
|
|
274
|
+
schema: {
|
|
275
|
+
properties: {
|
|
276
|
+
attendanceType: {
|
|
277
|
+
enum: [
|
|
278
|
+
HubEventAttendanceType.Online,
|
|
279
|
+
HubEventAttendanceType.Both,
|
|
280
|
+
],
|
|
281
|
+
},
|
|
282
|
+
onlineCapacityType: {
|
|
283
|
+
const: HubEventOnlineCapacityType.Fixed,
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
effect: UiSchemaRuleEffects.SHOW,
|
|
289
|
+
},
|
|
290
|
+
options: {
|
|
291
|
+
control: "hub-field-input-input",
|
|
292
|
+
type: "number",
|
|
293
|
+
messages: [
|
|
294
|
+
{
|
|
295
|
+
type: "ERROR",
|
|
296
|
+
keyword: "required",
|
|
297
|
+
icon: true,
|
|
298
|
+
labelKey: `${i18nScope}.fields.onlineCapacity.requiredError`,
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
type: "ERROR",
|
|
302
|
+
keyword: "minimum",
|
|
303
|
+
icon: true,
|
|
304
|
+
labelKey: `${i18nScope}.fields.onlineCapacity.minimumError`,
|
|
305
|
+
},
|
|
306
|
+
],
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
],
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
type: "Section",
|
|
313
|
+
labelKey: `${i18nScope}.sections.discoverability.label`,
|
|
314
|
+
elements: [
|
|
315
|
+
{
|
|
316
|
+
labelKey: `${i18nScope}.fields.tags.label`,
|
|
317
|
+
scope: "/properties/tags",
|
|
318
|
+
type: "Control",
|
|
319
|
+
options: {
|
|
320
|
+
control: "hub-field-input-combobox",
|
|
321
|
+
items: await getTagItems(options.tags, context.portal.id, context.hubRequestOptions),
|
|
322
|
+
allowCustomValues: true,
|
|
323
|
+
selectionMode: "multiple",
|
|
324
|
+
placeholderIcon: "label",
|
|
325
|
+
helperText: {
|
|
326
|
+
labelKey: `${i18nScope}.fields.tags.helperText`,
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
labelKey: `${i18nScope}.fields.categories.label`,
|
|
332
|
+
scope: "/properties/categories",
|
|
333
|
+
type: "Control",
|
|
334
|
+
options: {
|
|
335
|
+
control: "hub-field-input-combobox",
|
|
336
|
+
items: await getCategoryItems(context.portal.id, context.hubRequestOptions),
|
|
337
|
+
allowCustomValues: false,
|
|
338
|
+
selectionMode: "multiple",
|
|
339
|
+
placeholderIcon: "select-category",
|
|
340
|
+
helperText: {
|
|
341
|
+
labelKey: `${i18nScope}.fields.categories.helperText`,
|
|
342
|
+
},
|
|
343
|
+
},
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
labelKey: `${i18nScope}.fields.summary.label`,
|
|
347
|
+
scope: "/properties/summary",
|
|
348
|
+
type: "Control",
|
|
349
|
+
options: {
|
|
350
|
+
control: "hub-field-input-input",
|
|
351
|
+
type: "textarea",
|
|
352
|
+
rows: 4,
|
|
353
|
+
helperText: {
|
|
354
|
+
labelKey: `${i18nScope}.fields.summary.helperText`,
|
|
355
|
+
},
|
|
356
|
+
messages: [
|
|
357
|
+
{
|
|
358
|
+
type: "ERROR",
|
|
359
|
+
keyword: "maxLength",
|
|
360
|
+
icon: true,
|
|
361
|
+
labelKey: `shared.fields.summary.maxLengthError`,
|
|
362
|
+
},
|
|
363
|
+
],
|
|
364
|
+
},
|
|
365
|
+
},
|
|
366
|
+
],
|
|
367
|
+
},
|
|
368
|
+
],
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
//# sourceMappingURL=EventUiSchemaEdit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventUiSchemaEdit.js","sourceRoot":"","sources":["../../../../src/events/_internal/EventUiSchemaEdit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAE9E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAChC,SAAiB,EACjB,OAA4B,EAC5B,OAAuB,EACH,EAAE;IACtB,MAAM,eAAe,GAAG,iBAAiB,CACvC,IAAI,IAAI,EAAE,EACT,OAAqB,CAAC,QAAQ,CAChC,CAAC;IACF,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,SAAS;gBACf,QAAQ,EAAE,GAAG,SAAS,2BAA2B;gBACjD,QAAQ,EAAE;oBACR;wBACE,QAAQ,EAAE,GAAG,SAAS,oBAAoB;wBAC1C,KAAK,EAAE,kBAAkB;wBACzB,IAAI,EAAE,SAAS;wBACf,OAAO,EAAE;4BACP,QAAQ,EAAE;gCACR;oCACE,IAAI,EAAE,OAAO;oCACb,OAAO,EAAE,UAAU;oCACnB,IAAI,EAAE,IAAI;oCACV,QAAQ,EAAE,G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