@esri/hub-common 18.12.1 → 18.13.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/dist/esm/core/EntityEditor.js +0 -4
- package/dist/esm/core/EntityEditor.js.map +1 -1
- package/dist/esm/core/fetchHubEntity.js +0 -4
- package/dist/esm/core/fetchHubEntity.js.map +1 -1
- package/dist/esm/core/getTypeFromEntity.js +11 -6
- package/dist/esm/core/getTypeFromEntity.js.map +1 -1
- package/dist/esm/core/schemas/internal/getEditorSchemas.js +0 -10
- package/dist/esm/core/schemas/internal/getEditorSchemas.js.map +1 -1
- package/dist/esm/core/schemas/types.js +0 -2
- package/dist/esm/core/schemas/types.js.map +1 -1
- package/dist/esm/core/types/index.js +0 -1
- package/dist/esm/core/types/index.js.map +1 -1
- package/dist/esm/core/updateHubEntity.js +0 -4
- package/dist/esm/core/updateHubEntity.js.map +1 -1
- package/dist/esm/permissions/HubPermissionPolicies.js +0 -2
- package/dist/esm/permissions/HubPermissionPolicies.js.map +1 -1
- package/dist/esm/permissions/types/Permission.js +0 -2
- package/dist/esm/permissions/types/Permission.js.map +1 -1
- package/dist/esm/sites/HubSites.js +12 -4
- package/dist/esm/sites/HubSites.js.map +1 -1
- package/dist/esm/sites/_internal/subdomains.js +38 -0
- package/dist/esm/sites/_internal/subdomains.js.map +1 -0
- package/dist/esm/sites/domains/_lookup-portal.js +2 -1
- package/dist/esm/sites/domains/_lookup-portal.js.map +1 -1
- package/dist/esm/surveys/index.js +0 -5
- package/dist/esm/surveys/index.js.map +1 -1
- package/dist/esm/surveys/utils/index.js +0 -10
- package/dist/esm/surveys/utils/index.js.map +1 -1
- package/dist/node/core/EntityEditor.js +0 -4
- package/dist/node/core/EntityEditor.js.map +1 -1
- package/dist/node/core/fetchHubEntity.js +6 -10
- package/dist/node/core/fetchHubEntity.js.map +1 -1
- package/dist/node/core/getTypeFromEntity.js +11 -6
- package/dist/node/core/getTypeFromEntity.js.map +1 -1
- package/dist/node/core/schemas/internal/getEditorSchemas.js +0 -10
- package/dist/node/core/schemas/internal/getEditorSchemas.js.map +1 -1
- package/dist/node/core/schemas/types.js +0 -2
- package/dist/node/core/schemas/types.js.map +1 -1
- package/dist/node/core/types/index.js +0 -1
- package/dist/node/core/types/index.js.map +1 -1
- package/dist/node/core/updateHubEntity.js +0 -4
- package/dist/node/core/updateHubEntity.js.map +1 -1
- package/dist/node/permissions/HubPermissionPolicies.js +0 -2
- package/dist/node/permissions/HubPermissionPolicies.js.map +1 -1
- package/dist/node/permissions/types/Permission.js +0 -2
- package/dist/node/permissions/types/Permission.js.map +1 -1
- package/dist/node/sites/HubSites.js +12 -4
- package/dist/node/sites/HubSites.js.map +1 -1
- package/dist/node/sites/_internal/subdomains.js +43 -0
- package/dist/node/sites/_internal/subdomains.js.map +1 -0
- package/dist/node/sites/domains/_lookup-portal.js +2 -1
- package/dist/node/sites/domains/_lookup-portal.js.map +1 -1
- package/dist/node/surveys/index.js +0 -5
- package/dist/node/surveys/index.js.map +1 -1
- package/dist/node/surveys/utils/index.js +0 -10
- package/dist/node/surveys/utils/index.js.map +1 -1
- package/dist/types/core/schemas/types.d.ts +2 -2
- package/dist/types/core/types/HubEntity.d.ts +1 -2
- package/dist/types/core/types/index.d.ts +0 -1
- package/dist/types/permissions/types/Permission.d.ts +1 -2
- package/dist/types/sites/_internal/subdomains.d.ts +24 -0
- package/dist/types/surveys/index.d.ts +0 -5
- package/dist/types/surveys/utils/index.d.ts +0 -10
- package/package.json +1 -1
- package/dist/esm/core/types/IHubSurvey.js +0 -1
- package/dist/esm/core/types/IHubSurvey.js.map +0 -1
- package/dist/esm/surveys/HubSurvey.js +0 -155
- package/dist/esm/surveys/HubSurvey.js.map +0 -1
- package/dist/esm/surveys/_internal/SurveyBusinessRules.js +0 -124
- package/dist/esm/surveys/_internal/SurveyBusinessRules.js.map +0 -1
- package/dist/esm/surveys/_internal/SurveySchema.js +0 -18
- package/dist/esm/surveys/_internal/SurveySchema.js.map +0 -1
- package/dist/esm/surveys/_internal/SurveyUiSchemaEdit.js +0 -144
- package/dist/esm/surveys/_internal/SurveyUiSchemaEdit.js.map +0 -1
- package/dist/esm/surveys/_internal/SurveyUiSchemaSettings.js +0 -73
- package/dist/esm/surveys/_internal/SurveyUiSchemaSettings.js.map +0 -1
- package/dist/esm/surveys/_internal/computeProps.js +0 -30
- package/dist/esm/surveys/_internal/computeProps.js.map +0 -1
- package/dist/esm/surveys/_internal/getPropertyMap.js +0 -12
- package/dist/esm/surveys/_internal/getPropertyMap.js.map +0 -1
- package/dist/esm/surveys/constants.js +0 -2
- package/dist/esm/surveys/constants.js.map +0 -1
- package/dist/esm/surveys/defaults.js +0 -9
- package/dist/esm/surveys/defaults.js.map +0 -1
- package/dist/esm/surveys/edit.js +0 -49
- package/dist/esm/surveys/edit.js.map +0 -1
- package/dist/esm/surveys/fetch.js +0 -45
- package/dist/esm/surveys/fetch.js.map +0 -1
- package/dist/esm/surveys/types.js +0 -1
- package/dist/esm/surveys/types.js.map +0 -1
- package/dist/esm/surveys/utils/decode-form.js +0 -35
- package/dist/esm/surveys/utils/decode-form.js.map +0 -1
- package/dist/esm/surveys/utils/get-form-info-json.js +0 -12
- package/dist/esm/surveys/utils/get-form-info-json.js.map +0 -1
- package/dist/esm/surveys/utils/get-form-json.js +0 -69
- package/dist/esm/surveys/utils/get-form-json.js.map +0 -1
- package/dist/esm/surveys/utils/get-map-question.js +0 -31
- package/dist/esm/surveys/utils/get-map-question.js.map +0 -1
- package/dist/esm/surveys/utils/has-map-question.js +0 -11
- package/dist/esm/surveys/utils/has-map-question.js.map +0 -1
- package/dist/esm/surveys/utils/is-map-question.js +0 -16
- package/dist/esm/surveys/utils/is-map-question.js.map +0 -1
- package/dist/esm/surveys/utils/is-page-question.js +0 -9
- package/dist/esm/surveys/utils/is-page-question.js.map +0 -1
- package/dist/esm/surveys/utils/is-survey123-connect.js +0 -16
- package/dist/esm/surveys/utils/is-survey123-connect.js.map +0 -1
- package/dist/esm/surveys/utils/set-display-map-keyword.js +0 -15
- package/dist/esm/surveys/utils/set-display-map-keyword.js.map +0 -1
- package/dist/esm/surveys/utils/should-display-map.js +0 -10
- package/dist/esm/surveys/utils/should-display-map.js.map +0 -1
- package/dist/node/core/types/IHubSurvey.js +0 -3
- package/dist/node/core/types/IHubSurvey.js.map +0 -1
- package/dist/node/surveys/HubSurvey.js +0 -159
- package/dist/node/surveys/HubSurvey.js.map +0 -1
- package/dist/node/surveys/_internal/SurveyBusinessRules.js +0 -127
- package/dist/node/surveys/_internal/SurveyBusinessRules.js.map +0 -1
- package/dist/node/surveys/_internal/SurveySchema.js +0 -21
- package/dist/node/surveys/_internal/SurveySchema.js.map +0 -1
- package/dist/node/surveys/_internal/SurveyUiSchemaEdit.js +0 -147
- package/dist/node/surveys/_internal/SurveyUiSchemaEdit.js.map +0 -1
- package/dist/node/surveys/_internal/SurveyUiSchemaSettings.js +0 -76
- package/dist/node/surveys/_internal/SurveyUiSchemaSettings.js.map +0 -1
- package/dist/node/surveys/_internal/computeProps.js +0 -34
- package/dist/node/surveys/_internal/computeProps.js.map +0 -1
- package/dist/node/surveys/_internal/getPropertyMap.js +0 -16
- package/dist/node/surveys/_internal/getPropertyMap.js.map +0 -1
- package/dist/node/surveys/constants.js +0 -5
- package/dist/node/surveys/constants.js.map +0 -1
- package/dist/node/surveys/defaults.js +0 -12
- package/dist/node/surveys/defaults.js.map +0 -1
- package/dist/node/surveys/edit.js +0 -54
- package/dist/node/surveys/edit.js.map +0 -1
- package/dist/node/surveys/fetch.js +0 -50
- package/dist/node/surveys/fetch.js.map +0 -1
- package/dist/node/surveys/types.js +0 -3
- package/dist/node/surveys/types.js.map +0 -1
- package/dist/node/surveys/utils/decode-form.js +0 -38
- package/dist/node/surveys/utils/decode-form.js.map +0 -1
- package/dist/node/surveys/utils/get-form-info-json.js +0 -15
- package/dist/node/surveys/utils/get-form-info-json.js.map +0 -1
- package/dist/node/surveys/utils/get-form-json.js +0 -72
- package/dist/node/surveys/utils/get-form-json.js.map +0 -1
- package/dist/node/surveys/utils/get-map-question.js +0 -34
- package/dist/node/surveys/utils/get-map-question.js.map +0 -1
- package/dist/node/surveys/utils/has-map-question.js +0 -14
- package/dist/node/surveys/utils/has-map-question.js.map +0 -1
- package/dist/node/surveys/utils/is-map-question.js +0 -19
- package/dist/node/surveys/utils/is-map-question.js.map +0 -1
- package/dist/node/surveys/utils/is-page-question.js +0 -12
- package/dist/node/surveys/utils/is-page-question.js.map +0 -1
- package/dist/node/surveys/utils/is-survey123-connect.js +0 -19
- package/dist/node/surveys/utils/is-survey123-connect.js.map +0 -1
- package/dist/node/surveys/utils/set-display-map-keyword.js +0 -19
- package/dist/node/surveys/utils/set-display-map-keyword.js.map +0 -1
- package/dist/node/surveys/utils/should-display-map.js +0 -13
- package/dist/node/surveys/utils/should-display-map.js.map +0 -1
- package/dist/types/core/types/IHubSurvey.d.ts +0 -11
- package/dist/types/surveys/HubSurvey.d.ts +0 -57
- package/dist/types/surveys/_internal/SurveyBusinessRules.d.ts +0 -12
- package/dist/types/surveys/_internal/SurveySchema.d.ts +0 -7
- package/dist/types/surveys/_internal/SurveyUiSchemaEdit.d.ts +0 -10
- package/dist/types/surveys/_internal/SurveyUiSchemaSettings.d.ts +0 -10
- package/dist/types/surveys/_internal/computeProps.d.ts +0 -12
- package/dist/types/surveys/_internal/getPropertyMap.d.ts +0 -8
- package/dist/types/surveys/constants.d.ts +0 -1
- package/dist/types/surveys/defaults.d.ts +0 -3
- package/dist/types/surveys/edit.d.ts +0 -17
- package/dist/types/surveys/fetch.d.ts +0 -20
- package/dist/types/surveys/types.d.ts +0 -15
- package/dist/types/surveys/utils/decode-form.d.ts +0 -8
- package/dist/types/surveys/utils/get-form-info-json.d.ts +0 -9
- package/dist/types/surveys/utils/get-form-json.d.ts +0 -8
- package/dist/types/surveys/utils/get-map-question.d.ts +0 -7
- package/dist/types/surveys/utils/has-map-question.d.ts +0 -8
- package/dist/types/surveys/utils/is-map-question.d.ts +0 -7
- package/dist/types/surveys/utils/is-page-question.d.ts +0 -7
- package/dist/types/surveys/utils/is-survey123-connect.d.ts +0 -8
- package/dist/types/surveys/utils/set-display-map-keyword.d.ts +0 -7
- package/dist/types/surveys/utils/should-display-map.d.ts +0 -7
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IHubRequestOptions } from "../../hub-types";
|
|
2
|
+
import { IHubSite } from "../../core/types/IHubSite";
|
|
3
|
+
/**
|
|
4
|
+
* Get the subdomain type keyword
|
|
5
|
+
* @param subdomain The subdomain to get the keyword for
|
|
6
|
+
* @returns The subdomain type keyword
|
|
7
|
+
*/
|
|
8
|
+
export declare function getSubdomainKeyword(subdomain: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Adds/Updates the subdomain typekeyword
|
|
11
|
+
* Returns a new array of keywords
|
|
12
|
+
*
|
|
13
|
+
* @param typeKeywords A collection of typekeywords
|
|
14
|
+
* @param subdomain The subdomain to add/update
|
|
15
|
+
* @returns An updated collection of typekeywords
|
|
16
|
+
*/
|
|
17
|
+
export declare function setSubdomainKeyword(typeKeywords: string[], subdomain: string): string[];
|
|
18
|
+
/**
|
|
19
|
+
* Update the site properties related to subdomain
|
|
20
|
+
* after the subdomain has been changed.
|
|
21
|
+
* @param site The site to update
|
|
22
|
+
* @param requestOptions
|
|
23
|
+
*/
|
|
24
|
+
export declare const handleSubdomainChange: (site: Partial<IHubSite>, requestOptions: IHubRequestOptions) => void;
|
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
export * from "./decode-form";
|
|
2
|
-
export * from "./get-form-info-json";
|
|
3
|
-
export * from "./get-form-json";
|
|
4
1
|
export * from "./get-input-feature-service-model";
|
|
5
|
-
export * from "./get-map-question";
|
|
6
2
|
export * from "./get-s123-edit-url";
|
|
7
3
|
export * from "./get-s123-share-url";
|
|
8
4
|
export * from "./get-source-feature-service-model-from-fieldworker";
|
|
9
5
|
export * from "./get-stakeholder-model";
|
|
10
6
|
export * from "./get-survey-models";
|
|
11
|
-
export * from "./has-map-question";
|
|
12
7
|
export * from "./is-draft";
|
|
13
8
|
export * from "./is-fieldworker-view";
|
|
14
|
-
export * from "./is-map-question";
|
|
15
|
-
export * from "./is-page-question";
|
|
16
|
-
export * from "./is-survey123-connect";
|
|
17
|
-
export * from "./set-display-map-keyword";
|
|
18
|
-
export * from "./should-display-map";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=IHubSurvey.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IHubSurvey.js","sourceRoot":"","sources":["../../../../src/core/types/IHubSurvey.ts"],"names":[],"mappings":""}
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import { HubItemEntity } from "../core/HubItemEntity";
|
|
2
|
-
import { enrichEntity } from "../core/enrichEntity";
|
|
3
|
-
import { getEditorConfig } from "../core/schemas/getEditorConfig";
|
|
4
|
-
import { DEFAULT_SURVEY } from "./defaults";
|
|
5
|
-
import { cloneObject } from "../util";
|
|
6
|
-
import { deleteSurvey, updateSurvey } from "./edit";
|
|
7
|
-
import { fetchSurvey } from "./fetch";
|
|
8
|
-
/**
|
|
9
|
-
* Hub Survey Class
|
|
10
|
-
*/
|
|
11
|
-
export class HubSurvey extends HubItemEntity {
|
|
12
|
-
/**
|
|
13
|
-
* Create an instance from a HubSurvey object
|
|
14
|
-
* @param json - JSON object to create a HubSurvey from
|
|
15
|
-
* @param context - ArcGIS context
|
|
16
|
-
* @returns
|
|
17
|
-
*/
|
|
18
|
-
static fromJson(json, context) {
|
|
19
|
-
// merge what we have with the default values
|
|
20
|
-
const pojo = this.applyDefaults(json, context);
|
|
21
|
-
return new HubSurvey(pojo, context);
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Fetch a Survey from the backing store and return a HubSurvey instance.
|
|
25
|
-
* @param identifier - Identifier of the survey to load
|
|
26
|
-
* @param context
|
|
27
|
-
* @returns
|
|
28
|
-
*/
|
|
29
|
-
static async fetch(identifier, context) {
|
|
30
|
-
// fetch the survey by id
|
|
31
|
-
try {
|
|
32
|
-
const survey = await fetchSurvey(identifier, context.userRequestOptions);
|
|
33
|
-
// create an instance of HubSurvey from the survey
|
|
34
|
-
return HubSurvey.fromJson(survey, context);
|
|
35
|
-
}
|
|
36
|
-
catch (ex) {
|
|
37
|
-
if (ex.message ===
|
|
38
|
-
"CONT_0001: Item does not exist or is inaccessible.") {
|
|
39
|
-
throw new Error(`Survey not found.`);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
throw ex;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
static applyDefaults(partialSurvey, context) {
|
|
47
|
-
// ensure we have the orgUrlKey
|
|
48
|
-
if (!partialSurvey.orgUrlKey) {
|
|
49
|
-
partialSurvey.orgUrlKey = context.portal.urlKey;
|
|
50
|
-
}
|
|
51
|
-
// extend the partial over the defaults
|
|
52
|
-
const pojo = Object.assign(Object.assign({}, DEFAULT_SURVEY), partialSurvey);
|
|
53
|
-
return pojo;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Apply a new state to the instance
|
|
57
|
-
* @param changes A partial IHubSurvey
|
|
58
|
-
*/
|
|
59
|
-
update(changes) {
|
|
60
|
-
if (this.isDestroyed) {
|
|
61
|
-
throw new Error("HubSurvey is already destroyed.");
|
|
62
|
-
}
|
|
63
|
-
// merge partial onto existing entity
|
|
64
|
-
this.entity = Object.assign(Object.assign({}, this.entity), changes);
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Save the class instance
|
|
68
|
-
*/
|
|
69
|
-
async save() {
|
|
70
|
-
if (this.isDestroyed) {
|
|
71
|
-
throw new Error("HubSurvey is already destroyed.");
|
|
72
|
-
}
|
|
73
|
-
if (this.entity.id) {
|
|
74
|
-
// update it
|
|
75
|
-
this.entity = await updateSurvey(this.entity, this.context.userRequestOptions);
|
|
76
|
-
}
|
|
77
|
-
// call the after save hook on superclass
|
|
78
|
-
await super.afterSave();
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Delete the HubSurvey object from the store
|
|
83
|
-
* set a flag to indicate that it is destroyed
|
|
84
|
-
* @returns a promise
|
|
85
|
-
*/
|
|
86
|
-
async delete() {
|
|
87
|
-
if (this.isDestroyed) {
|
|
88
|
-
throw new Error("HubSurvey is already destroyed.");
|
|
89
|
-
}
|
|
90
|
-
this.isDestroyed = true;
|
|
91
|
-
// Delegate to module fn
|
|
92
|
-
await deleteSurvey(this.entity.id, this.context.userRequestOptions);
|
|
93
|
-
}
|
|
94
|
-
/*
|
|
95
|
-
* Get the editor config for the HubSurvey entity.
|
|
96
|
-
* @param i18nScope translation scope to be interpolated into the uiSchema
|
|
97
|
-
* @param type editor type - corresonds to the returned uiSchema
|
|
98
|
-
*/
|
|
99
|
-
getEditorConfig(i18nScope, type) {
|
|
100
|
-
// delegate to the schema subsystem
|
|
101
|
-
return getEditorConfig(i18nScope, type, this.entity, this.context);
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Return the Survey object as an editor object
|
|
105
|
-
* @param editorContext
|
|
106
|
-
* @param include
|
|
107
|
-
* @returns
|
|
108
|
-
*/
|
|
109
|
-
async toEditor(editorContext, include = []) {
|
|
110
|
-
// 1. optionally enrich entity and cast to editor
|
|
111
|
-
const editor = include.length
|
|
112
|
-
? (await enrichEntity(cloneObject(this.entity), include, this.context.hubRequestOptions))
|
|
113
|
-
: cloneObject(this.entity);
|
|
114
|
-
// 2. Apply transforms to relevant entity values so they
|
|
115
|
-
// can be consumed by the editor
|
|
116
|
-
return editor;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Load the Survey object from the editor object
|
|
120
|
-
* @param editor
|
|
121
|
-
* @param editorContext
|
|
122
|
-
* @returns IHubSurvey
|
|
123
|
-
*/
|
|
124
|
-
async fromEditor(editor, _editorContext) {
|
|
125
|
-
var _a, _b;
|
|
126
|
-
// Setting the thumbnailCache will ensure that
|
|
127
|
-
// the thumbnail is updated on next save
|
|
128
|
-
if (editor._thumbnail) {
|
|
129
|
-
const thumb = editor._thumbnail;
|
|
130
|
-
if (thumb.blob) {
|
|
131
|
-
this.thumbnailCache = {
|
|
132
|
-
file: thumb.blob,
|
|
133
|
-
filename: thumb.fileName,
|
|
134
|
-
clear: false,
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
this.thumbnailCache = {
|
|
139
|
-
clear: true,
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
delete editor._thumbnail;
|
|
144
|
-
// convert back to an entity. Apply any reverse transforms used in
|
|
145
|
-
// of the toEditor method
|
|
146
|
-
const entity = cloneObject(editor);
|
|
147
|
-
// copy the location extent up one level
|
|
148
|
-
entity.extent = (_b = (_a = editor.location) === null || _a === void 0 ? void 0 : _a.extent) !== null && _b !== void 0 ? _b : [];
|
|
149
|
-
// Save, which will also create new content if new
|
|
150
|
-
this.entity = entity;
|
|
151
|
-
await this.save();
|
|
152
|
-
return this.entity;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
//# sourceMappingURL=HubSurvey.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HubSurvey.js","sourceRoot":"","sources":["../../../src/surveys/HubSurvey.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAM5C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC;;GA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AEnD,wDAAwD;QACxD,gCAAgC;QAChC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,UAAU,CACd,MAAuB,EACvB,cAAqC;;QAErC,8CAA8C;QAC9C,wCAAwC;QACxC,IAAI,MAAM,CAAC,UAAU,EAAE;YACrB,MAAM,KAAK,GAAG,MAAM,CAAC,UAAgD,CAAC;YACtE,IAAI,KAAK,CAAC,IAAI,EAAE;gBACd,IAAI,CAAC,cAAc,GAAG;oBACpB,IAAI,EAAE,KAAK,CAAC,IAAI;oBAChB,QAAQ,EAAE,KAAK,CAAC,QAAQ;oBACxB,KAAK,EAAE,KAAK;iBACb,CAAC;aACH;iBAAM;gBACL,IAAI,CAAC,cAAc,GAAG;oBACpB,KAAK,EAAE,IAAI;iBACZ,CAAC;aACH;SACF;QAED,OAAO,MAAM,CAAC,UAAU,CAAC;QAEzB,kEAAkE;QAClE,yBAAyB;QACzB,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAe,CAAC;QAEjD,wCAAwC;QACxC,MAAM,CAAC,MAAM,eACV,MAAiD,CAAC,QAAQ,0CAAE,MAAM,mCAAI,EAAE,CAAC;QAE5E,kDAAkD;QAClD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAElB,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* survey Permission Policies
|
|
3
|
-
* These define the requirements any user must meet to perform related actions
|
|
4
|
-
* @private
|
|
5
|
-
*/
|
|
6
|
-
export const SurveyPermissions = [
|
|
7
|
-
"hub:survey",
|
|
8
|
-
"hub:survey:create",
|
|
9
|
-
"hub:survey:delete",
|
|
10
|
-
"hub:survey:edit",
|
|
11
|
-
"hub:survey:view",
|
|
12
|
-
"hub:survey:view:related",
|
|
13
|
-
"hub:survey:owner",
|
|
14
|
-
"hub:survey:canChangeAccess",
|
|
15
|
-
"hub:survey:workspace",
|
|
16
|
-
"hub:survey:workspace:dashboard",
|
|
17
|
-
"hub:survey:workspace:details",
|
|
18
|
-
"hub:survey:workspace:settings",
|
|
19
|
-
"hub:survey:workspace:collaborators",
|
|
20
|
-
"hub:survey:manage",
|
|
21
|
-
];
|
|
22
|
-
/**
|
|
23
|
-
* Survey permission policies
|
|
24
|
-
* @private
|
|
25
|
-
*/
|
|
26
|
-
export const SurveyPermissionPolicies = [
|
|
27
|
-
{
|
|
28
|
-
permission: "hub:survey",
|
|
29
|
-
services: ["portal"],
|
|
30
|
-
licenses: ["hub-basic", "hub-premium"],
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
permission: "hub:survey:view",
|
|
34
|
-
dependencies: ["hub:survey"],
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
permission: "hub:survey:view:related",
|
|
38
|
-
dependencies: ["hub:survey:view"],
|
|
39
|
-
services: ["hub-search"],
|
|
40
|
-
assertions: [
|
|
41
|
-
{
|
|
42
|
-
property: "entity:access",
|
|
43
|
-
type: "eq",
|
|
44
|
-
value: "public",
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
permission: "hub:survey:create",
|
|
50
|
-
authenticated: true,
|
|
51
|
-
dependencies: ["hub:survey"],
|
|
52
|
-
privileges: [
|
|
53
|
-
"features:user:edit",
|
|
54
|
-
"portal:publisher:publishFeatures",
|
|
55
|
-
"portal:user:createItem",
|
|
56
|
-
"portal:user:shareToGroup",
|
|
57
|
-
],
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
permission: "hub:survey:edit",
|
|
61
|
-
authenticated: true,
|
|
62
|
-
dependencies: ["hub:survey"],
|
|
63
|
-
entityEdit: true,
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
permission: "hub:survey:delete",
|
|
67
|
-
authenticated: true,
|
|
68
|
-
dependencies: ["hub:survey"],
|
|
69
|
-
entityDelete: true,
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
permission: "hub:survey:owner",
|
|
73
|
-
dependencies: ["hub:survey"],
|
|
74
|
-
authenticated: true,
|
|
75
|
-
entityOwner: true,
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
permission: "hub:survey:canChangeAccess",
|
|
79
|
-
dependencies: ["hub:survey"],
|
|
80
|
-
authenticated: true,
|
|
81
|
-
assertions: [
|
|
82
|
-
{
|
|
83
|
-
property: "context:currentUser.privileges",
|
|
84
|
-
type: "contains-some",
|
|
85
|
-
value: [
|
|
86
|
-
"portal:admin:shareToPublic",
|
|
87
|
-
"portal:admin:shareToOrg",
|
|
88
|
-
"portal:user:shareToPublic",
|
|
89
|
-
"portal:user:shareToOrg",
|
|
90
|
-
],
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
property: "entity:itemControl",
|
|
94
|
-
type: "eq",
|
|
95
|
-
value: "admin",
|
|
96
|
-
},
|
|
97
|
-
],
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
permission: "hub:survey:workspace",
|
|
101
|
-
dependencies: ["hub:feature:workspace"],
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
permission: "hub:survey:workspace:dashboard",
|
|
105
|
-
dependencies: ["hub:survey:workspace", "hub:survey:view"],
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
permission: "hub:survey:workspace:details",
|
|
109
|
-
dependencies: ["hub:survey:workspace", "hub:survey:edit"],
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
permission: "hub:survey:workspace:settings",
|
|
113
|
-
dependencies: ["hub:survey:workspace", "hub:survey:edit"],
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
permission: "hub:survey:workspace:collaborators",
|
|
117
|
-
dependencies: ["hub:survey:workspace", "hub:survey:edit"],
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
permission: "hub:survey:manage",
|
|
121
|
-
dependencies: ["hub:survey:edit"],
|
|
122
|
-
},
|
|
123
|
-
];
|
|
124
|
-
//# sourceMappingURL=SurveyBusinessRules.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SurveyBusinessRules.js","sourceRoot":"","sources":["../../../../src/surveys/_internal/SurveyBusinessRules.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,YAAY;IACZ,mBAAmB;IACnB,mBAAmB;IACnB,iBAAiB;IACjB,iBAAiB;IACjB,yBAAyB;IACzB,kBAAkB;IAClB,4BAA4B;IAC5B,sBAAsB;IACtB,gCAAgC;IAChC,8BAA8B;IAC9B,+BAA+B;IAC/B,oCAAoC;IACpC,mBAAmB;CACX,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAwB;IAC3D;QACE,UAAU,EAAE,YAAY;QACxB,QAAQ,EAAE,CAAC,QAAQ,CAAC;QACpB,QAAQ,EAAE,CAAC,WAAW,EAAE,aAAa,CAAC;KACvC;IACD;QACE,UAAU,EAAE,iBAAiB;QAC7B,YAAY,EAAE,CAAC,YAAY,CAAC;KAC7B;IACD;QACE,UAAU,EAAE,yBAAyB;QACrC,YAAY,EAAE,CAAC,iBAAiB,CAAC;QACjC,QAAQ,EAAE,CAAC,YAAY,CAAC;QACxB,UAAU,EAAE;YACV;gBACE,QAAQ,EAAE,eAAe;gBACzB,IAAI,EAAE,IAAI;gBACV,KAAK,EAAE,QAAQ;aAChB;SACF;KACF;IACD;QACE,UAAU,EAAE,mBAAmB;QAC/B,aAAa,EAAE,IAAI;QACnB,YAAY,EAAE,CAAC,YAAY,CAAC;QAC5B,UAAU,EAAE;YACV,oBAAoB;YACpB,kCAAkC;YAClC,wBAAwB;YACxB,0BAA0B;SAC3B;KACF;IACD;QACE,UAAU,EAAE,iBAAiB;QAC7B,aAAa,EAAE,IAAI;QACnB,YAAY,EAAE,CAAC,YAAY,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/schemas/shared/HubItemEntitySchema";
|
|
2
|
-
export const SurveyEditorTypes = [
|
|
3
|
-
"hub:survey:edit",
|
|
4
|
-
"hub:survey:settings",
|
|
5
|
-
];
|
|
6
|
-
/**
|
|
7
|
-
* defines the JSON schema for a Survey entity's editable fields
|
|
8
|
-
*/
|
|
9
|
-
export const SurveySchema = Object.assign(Object.assign({}, HubItemEntitySchema), { properties: Object.assign({ displayMap: {
|
|
10
|
-
type: "boolean",
|
|
11
|
-
enum: [true, false],
|
|
12
|
-
default: false,
|
|
13
|
-
}, hasMapQuestion: {
|
|
14
|
-
type: "boolean",
|
|
15
|
-
enum: [true, false],
|
|
16
|
-
default: false,
|
|
17
|
-
} }, HubItemEntitySchema.properties) });
|
|
18
|
-
//# sourceMappingURL=SurveySchema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SurveySchema.js","sourceRoot":"","sources":["../../../../src/surveys/_internal/SurveySchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AAIpF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,iBAAiB;IACjB,qBAAqB;CACb,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAyB,gCAC7C,mBAAmB,KACtB,UAAU,kBACR,UAAU,EAAE;YACV,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;YACnB,OAAO,EAAE,KAAK;SACf,EACD,cAAc,EAAE;YACd,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;YACnB,OAAO,EAAE,KAAK;SACf,IACE,mBAAmB,CAAC,UAAU,IAEZ,CAAC"}
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { fetchCategoriesUiSchemaElement } from "../../core/schemas/internal/fetchCategoriesUiSchemaElement";
|
|
2
|
-
import { getTagItems } from "../../core/schemas/internal/getTagItems";
|
|
3
|
-
import { getThumbnailUiSchemaElement } from "../../core/schemas/internal/getThumbnailUiSchemaElement";
|
|
4
|
-
import { getLocationExtent } from "../../core/schemas/internal/getLocationExtent";
|
|
5
|
-
import { getLocationOptions } from "../../core/schemas/internal/getLocationOptions";
|
|
6
|
-
/**
|
|
7
|
-
* @private
|
|
8
|
-
* constructs the complete edit uiSchema for Hub Survey.
|
|
9
|
-
* This defines how the schema properties should be
|
|
10
|
-
* rendered in the survey editing experience
|
|
11
|
-
*/
|
|
12
|
-
export const buildUiSchema = async (i18nScope, options, context) => {
|
|
13
|
-
return {
|
|
14
|
-
type: "Layout",
|
|
15
|
-
elements: [
|
|
16
|
-
{
|
|
17
|
-
type: "Section",
|
|
18
|
-
labelKey: `${i18nScope}.sections.basicInfo.label`,
|
|
19
|
-
options: {
|
|
20
|
-
helperText: {
|
|
21
|
-
labelKey: `${i18nScope}.sections.basicInfo.helperText`,
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
elements: [
|
|
25
|
-
{
|
|
26
|
-
labelKey: `${i18nScope}.fields.name.label`,
|
|
27
|
-
scope: "/properties/name",
|
|
28
|
-
type: "Control",
|
|
29
|
-
options: {
|
|
30
|
-
messages: [
|
|
31
|
-
{
|
|
32
|
-
type: "ERROR",
|
|
33
|
-
keyword: "required",
|
|
34
|
-
icon: true,
|
|
35
|
-
labelKey: `${i18nScope}.fields.name.requiredError`,
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
type: "ERROR",
|
|
39
|
-
keyword: "maxLength",
|
|
40
|
-
icon: true,
|
|
41
|
-
labelKey: `shared.fields.title.maxLengthError`,
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
type: "ERROR",
|
|
45
|
-
keyword: "format",
|
|
46
|
-
icon: true,
|
|
47
|
-
labelKey: `${i18nScope}.fields.name.entityTitleValidatorError`,
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
// getSlugSchemaElement(i18nScope),
|
|
53
|
-
{
|
|
54
|
-
labelKey: `${i18nScope}.fields.summary.label`,
|
|
55
|
-
scope: "/properties/summary",
|
|
56
|
-
type: "Control",
|
|
57
|
-
options: {
|
|
58
|
-
control: "hub-field-input-input",
|
|
59
|
-
type: "textarea",
|
|
60
|
-
rows: 4,
|
|
61
|
-
messages: [
|
|
62
|
-
{
|
|
63
|
-
type: "ERROR",
|
|
64
|
-
keyword: "maxLength",
|
|
65
|
-
icon: true,
|
|
66
|
-
labelKey: `shared.fields.purpose.maxLengthError`,
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
...getThumbnailUiSchemaElement(i18nScope, options.thumbnail, options.thumbnailUrl, "survey", context.requestOptions),
|
|
72
|
-
{
|
|
73
|
-
type: "Section",
|
|
74
|
-
labelKey: `${i18nScope}.sections.description.label`,
|
|
75
|
-
options: {
|
|
76
|
-
section: "block",
|
|
77
|
-
},
|
|
78
|
-
elements: [
|
|
79
|
-
// description
|
|
80
|
-
{
|
|
81
|
-
labelKey: `${i18nScope}.fields.description.label`,
|
|
82
|
-
scope: "/properties/description",
|
|
83
|
-
type: "Control",
|
|
84
|
-
options: {
|
|
85
|
-
control: "hub-field-input-rich-text",
|
|
86
|
-
type: "textarea",
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
],
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
type: "Section",
|
|
93
|
-
labelKey: `${i18nScope}.sections.discoverability.label`,
|
|
94
|
-
options: {
|
|
95
|
-
section: "block",
|
|
96
|
-
helperText: {
|
|
97
|
-
labelKey: `${i18nScope}.sections.discoverability.helperText`,
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
elements: [
|
|
101
|
-
// tags
|
|
102
|
-
{
|
|
103
|
-
labelKey: `${i18nScope}.fields.tags.label`,
|
|
104
|
-
scope: "/properties/tags",
|
|
105
|
-
type: "Control",
|
|
106
|
-
options: {
|
|
107
|
-
control: "hub-field-input-combobox",
|
|
108
|
-
items: await getTagItems(options.tags, context.portal.id, context.hubRequestOptions),
|
|
109
|
-
allowCustomValues: true,
|
|
110
|
-
selectionMode: "multiple",
|
|
111
|
-
placeholderIcon: "label",
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
// categories
|
|
115
|
-
...(await fetchCategoriesUiSchemaElement({
|
|
116
|
-
source: "org",
|
|
117
|
-
currentValues: options.categories,
|
|
118
|
-
context,
|
|
119
|
-
})),
|
|
120
|
-
],
|
|
121
|
-
},
|
|
122
|
-
],
|
|
123
|
-
},
|
|
124
|
-
// location section
|
|
125
|
-
{
|
|
126
|
-
type: "Section",
|
|
127
|
-
labelKey: `${i18nScope}.sections.location.label`,
|
|
128
|
-
elements: [
|
|
129
|
-
{
|
|
130
|
-
scope: "/properties/location",
|
|
131
|
-
type: "Control",
|
|
132
|
-
options: {
|
|
133
|
-
control: "hub-field-input-location-picker",
|
|
134
|
-
extent: await getLocationExtent(options.location, context.hubRequestOptions),
|
|
135
|
-
options: await getLocationOptions(options.id, options.type, options.location, context.portal.name, context.hubRequestOptions),
|
|
136
|
-
noticeTitleElementAriaLevel: 3,
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
],
|
|
140
|
-
},
|
|
141
|
-
],
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
//# sourceMappingURL=SurveyUiSchemaEdit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SurveyUiSchemaEdit.js","sourceRoot":"","sources":["../../../../src/surveys/_internal/SurveyUiSchemaEdit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,4DAA4D,CAAC;AAC5G,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yDAAyD,CAAC;AAGtG,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;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AC,CAAC;yBACJ;qBACF;iBACF;aACF;YACD,mBAAmB;YACnB;gBACE,IAAI,EAAE,SAAS;gBACf,QAAQ,EAAE,GAAG,SAAS,0BAA0B;gBAChD,QAAQ,EAAE;oBACR;wBACE,KAAK,EAAE,sBAAsB;wBAC7B,IAAI,EAAE,SAAS;wBACf,OAAO,EAAE;4BACP,OAAO,EAAE,iCAAiC;4BAC1C,MAAM,EAAE,MAAM,iBAAiB,CAC7B,OAAO,CAAC,QAAQ,EAChB,OAAO,CAAC,iBAAiB,CAC1B;4BACD,OAAO,EAAE,MAAM,kBAAkB,CAC/B,OAAO,CAAC,EAAE,EACV,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,QAAQ,EAChB,OAAO,CAAC,MAAM,CAAC,IAAI,EACnB,OAAO,CAAC,iBAAiB,CAC1B;4BACD,2BAA2B,EAAE,CAAC;yBAC/B;qBACF;iBACF;aACF;SACF;KACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { UiSchemaRuleEffects } from "../../core/schemas/types";
|
|
2
|
-
/**
|
|
3
|
-
* @private
|
|
4
|
-
* settings uiSchema for Hub Survey - this
|
|
5
|
-
* defines how the schema properties should be
|
|
6
|
-
* rendered in the Survey settings experience
|
|
7
|
-
*/
|
|
8
|
-
export const buildUiSchema = async (i18nScope, options, context) => {
|
|
9
|
-
// We want to conver it over to a boolean as it can be undefined which doesn't play well
|
|
10
|
-
// with the rules in our schema system
|
|
11
|
-
const hasMapQuestion = !options.hasMapQuestion;
|
|
12
|
-
return {
|
|
13
|
-
type: "Layout",
|
|
14
|
-
elements: [
|
|
15
|
-
{
|
|
16
|
-
type: "Section",
|
|
17
|
-
labelKey: `${i18nScope}.sections.settings.label`,
|
|
18
|
-
elements: [
|
|
19
|
-
{
|
|
20
|
-
labelKey: `${i18nScope}.fields.displayMap.label`,
|
|
21
|
-
scope: "/properties/displayMap",
|
|
22
|
-
type: "Control",
|
|
23
|
-
rule: {
|
|
24
|
-
effect: UiSchemaRuleEffects.DISABLE,
|
|
25
|
-
condition: {
|
|
26
|
-
scope: "/properties/hasMapQuestion",
|
|
27
|
-
schema: { const: false },
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
options: {
|
|
31
|
-
control: "hub-field-input-tile-select",
|
|
32
|
-
type: "radio",
|
|
33
|
-
labels: [
|
|
34
|
-
`{{${i18nScope}.fields.displayMap.enabled.label:translate}}`,
|
|
35
|
-
`{{${i18nScope}.fields.displayMap.disabled.label:translate}}`,
|
|
36
|
-
],
|
|
37
|
-
descriptions: [
|
|
38
|
-
`{{${i18nScope}.fields.displayMap.enabled.description:translate}}`,
|
|
39
|
-
`{{${i18nScope}.fields.displayMap.disabled.description:translate}}`,
|
|
40
|
-
],
|
|
41
|
-
icons: ["sidecar", "form-elements"],
|
|
42
|
-
layout: "horizontal",
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
type: "Notice",
|
|
47
|
-
options: {
|
|
48
|
-
notice: {
|
|
49
|
-
configuration: {
|
|
50
|
-
id: "map-question-notice",
|
|
51
|
-
noticeType: "notice",
|
|
52
|
-
closable: false,
|
|
53
|
-
kind: "info",
|
|
54
|
-
scale: "m",
|
|
55
|
-
},
|
|
56
|
-
title: `{{${i18nScope}.fields.displayMap.notice.title:translate}}`,
|
|
57
|
-
body: `{{${i18nScope}.fields.displayMap.notice.message:translate}}`,
|
|
58
|
-
autoShow: true,
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
rules: [
|
|
62
|
-
{
|
|
63
|
-
effect: UiSchemaRuleEffects.SHOW,
|
|
64
|
-
conditions: [hasMapQuestion],
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
//# sourceMappingURL=SurveyUiSchemaSettings.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SurveyUiSchemaSettings.js","sourceRoot":"","sources":["../../../../src/surveys/_internal/SurveyUiSchemaSettings.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG1E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAChC,SAAiB,EACjB,OAA4B,EAC5B,OAAuB,EACH,EAAE;IACtB,wFAAwF;IACxF,sCAAsC;IACtC,MAAM,cAAc,GAAG,CAAE,OAAsB,CAAC,cAAc,CAAC;IAC/D,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,SAAS;gBACf,QAAQ,EAAE,GAAG,SAAS,0BAA0B;gBAChD,QAAQ,EAAE;oBACR;wBACE,QAAQ,EAAE,GAAG,SAAS,0BAA0B;wBAChD,KAAK,EAAE,wBAAwB;wBAC/B,IAAI,EAAE,SAAS;wBACf,IAAI,EAAE;4BACJ,MAAM,EAAE,mBAAmB,CAAC,OAAO;4BACnC,SAAS,EAAE;gCACT,KAAK,EAAE,4BAA4B;gCACnC,MAAM,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;6BACzB;yBACF;wBACD,OAAO,EAAE;4BACP,OAAO,EAAE,6BAA6B;4BACtC,IAAI,EAAE,OAAO;4BACb,MAAM,EAAE;gCACN,KAAK,SAAS,8CAA8C;gCAC5D,KAAK,SAAS,+CAA+C;6BAC9D;4BACD,YAAY,EAAE;gCACZ,KAAK,SAAS,oDAAoD;gCAClE,KAAK,SAAS,qDAAqD;6BACpE;4BACD,KAAK,EAAE,CAAC,SAAS,EAAE,eAAe,CAAC;4BACnC,MAAM,EAAE,YAAY;yBACrB;qBACF;oBACD;wBACE,IAAI,EAAE,QAAQ;wBACd,OAAO,EAAE;4BACP,MAAM,EAAE;gCACN,aAAa,EAAE;oCACb,EAAE,EAAE,qBAAqB;oCACzB,UAAU,EAAE,QAAQ;oCACpB,QAAQ,EAAE,KAAK;oCACf,IAAI,EAAE,MAAM;oCACZ,KAAK,EAAE,GAAG;iCACX;gCACD,KAAK,EAAE,KAAK,SAAS,6CAA6C;gCAClE,IAAI,EAAE,KAAK,SAAS,+CAA+C;gCACnE,QAAQ,EAAE,IAAI;6BACf;yBACF;wBACD,KAAK,EAAE;4BACL;gCACE,MAAM,EAAE,mBAAmB,CAAC,IAAI;gCAChC,UAAU,EAAE,CAAC,cAAc,CAAC;6BAC7B;yBACF;qBACF;iBACF;aACF;SACF;KACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { computeItemProps } from "../../core/_internal/computeItemProps";
|
|
2
|
-
import { getItemThumbnailUrl } from "../../resources/get-item-thumbnail-url";
|
|
3
|
-
import { hasMapQuestion } from "../utils/has-map-question";
|
|
4
|
-
import { shouldDisplayMap } from "../utils/should-display-map";
|
|
5
|
-
/**
|
|
6
|
-
* Given a model and a Survey object, set various computed properties that can't be directly mapped
|
|
7
|
-
* @private
|
|
8
|
-
* @param model
|
|
9
|
-
* @param survey
|
|
10
|
-
* @param requestOptions
|
|
11
|
-
* @returns an IHubSurvey object
|
|
12
|
-
*/
|
|
13
|
-
export function computeProps(model, survey, requestOptions) {
|
|
14
|
-
var _a;
|
|
15
|
-
let token;
|
|
16
|
-
if (requestOptions.authentication) {
|
|
17
|
-
const session = requestOptions.authentication;
|
|
18
|
-
token = session.token;
|
|
19
|
-
}
|
|
20
|
-
// compute base properties on survey object
|
|
21
|
-
survey = computeItemProps(model.item, survey);
|
|
22
|
-
// thumbnail url
|
|
23
|
-
survey.thumbnailUrl = getItemThumbnailUrl(model.item, requestOptions, token);
|
|
24
|
-
// map props
|
|
25
|
-
survey.hasMapQuestion = hasMapQuestion(((_a = model.formJSON) === null || _a === void 0 ? void 0 : _a.questions) || []);
|
|
26
|
-
survey.displayMap = shouldDisplayMap(model.item);
|
|
27
|
-
// cast b/c this takes a partial but returns a full object
|
|
28
|
-
return survey;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=computeProps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"computeProps.js","sourceRoot":"","sources":["../../../../src/surveys/_internal/computeProps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAGzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAa,EACb,MAA2B,EAC3B,cAA+B;;IAE/B,IAAI,KAAa,CAAC;IAClB,IAAI,cAAc,CAAC,cAAc,EAAE;QACjC,MAAM,OAAO,GACX,cAAc,CAAC,cAAuC,CAAC;QACzD,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;KACvB;IACD,2CAA2C;IAC3C,MAAM,GAAG,gBAAgB,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAE9C,gBAAgB;IAChB,MAAM,CAAC,YAAY,GAAG,mBAAmB,CAAC,KAAK,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,CAAC,CAAC;IAE7E,YAAY;IACZ,MAAM,CAAC,cAAc,GAAG,cAAc,CAAC,OAAA,KAAK,CAAC,QAAQ,0CAAE,SAAS,KAAI,EAAE,CAAC,CAAC;IACxE,MAAM,CAAC,UAAU,GAAG,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEjD,0DAA0D;IAC1D,OAAO,MAAoB,CAAC;AAC9B,CAAC"}
|