@esri/hub-common 12.13.1 → 12.15.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/schemas/getEntityEditorSchemas.js +52 -0
- package/dist/esm/core/schemas/getEntityEditorSchemas.js.map +1 -0
- package/dist/esm/core/schemas/index.js +1 -1
- package/dist/esm/core/schemas/index.js.map +1 -1
- package/dist/esm/core/schemas/shared/index.js +2 -0
- package/dist/esm/core/schemas/shared/index.js.map +1 -0
- package/dist/esm/core/schemas/shared/subschemas.js +20 -0
- package/dist/esm/core/schemas/shared/subschemas.js.map +1 -0
- package/dist/esm/core/types/IHubProject.js.map +1 -1
- package/dist/esm/initiatives/HubInitiative.js +12 -12
- package/dist/esm/initiatives/HubInitiative.js.map +1 -1
- package/dist/esm/initiatives/_internal/InitiativeSchema.js +13 -0
- package/dist/esm/initiatives/_internal/InitiativeSchema.js.map +1 -0
- package/dist/esm/initiatives/_internal/InitiativeUiSchemaEdit.js +20 -0
- package/dist/esm/initiatives/_internal/InitiativeUiSchemaEdit.js.map +1 -0
- package/dist/esm/projects/HubProject.js +7 -7
- package/dist/esm/projects/HubProject.js.map +1 -1
- package/dist/esm/projects/_internal/ProjectSchema.js +52 -0
- package/dist/esm/projects/_internal/ProjectSchema.js.map +1 -0
- package/dist/esm/projects/_internal/ProjectUiSchemaCreate.js +128 -0
- package/dist/esm/projects/_internal/ProjectUiSchemaCreate.js.map +1 -0
- package/dist/esm/projects/_internal/ProjectUiSchemaEdit.js +130 -0
- package/dist/esm/projects/_internal/ProjectUiSchemaEdit.js.map +1 -0
- package/dist/esm/projects/edit.js +11 -32
- package/dist/esm/projects/edit.js.map +1 -1
- package/dist/esm/search/_internal/commonHelpers/getTopLevelPredicate.js +45 -0
- package/dist/esm/search/_internal/commonHelpers/getTopLevelPredicate.js.map +1 -0
- package/dist/esm/search/_internal/expandPredicate.js +1 -0
- package/dist/esm/search/_internal/expandPredicate.js.map +1 -1
- package/dist/esm/search/_internal/hubSearchItemsHelpers/getQQueryParam.js +3 -28
- package/dist/esm/search/_internal/hubSearchItemsHelpers/getQQueryParam.js.map +1 -1
- package/dist/esm/search/serializeQueryForPortal.js +6 -0
- package/dist/esm/search/serializeQueryForPortal.js.map +1 -1
- package/dist/node/core/schemas/getEntityEditorSchemas.js +55 -0
- package/dist/node/core/schemas/getEntityEditorSchemas.js.map +1 -0
- package/dist/node/core/schemas/index.js +1 -1
- package/dist/node/core/schemas/index.js.map +1 -1
- package/dist/node/core/schemas/shared/index.js +5 -0
- package/dist/node/core/schemas/shared/index.js.map +1 -0
- package/dist/node/core/schemas/shared/subschemas.js +23 -0
- package/dist/node/core/schemas/shared/subschemas.js.map +1 -0
- package/dist/node/core/types/IHubProject.js.map +1 -1
- package/dist/node/initiatives/HubInitiative.js +12 -12
- package/dist/node/initiatives/HubInitiative.js.map +1 -1
- package/dist/node/initiatives/_internal/InitiativeSchema.js +16 -0
- package/dist/node/initiatives/_internal/InitiativeSchema.js.map +1 -0
- package/dist/node/initiatives/_internal/InitiativeUiSchemaEdit.js +23 -0
- package/dist/node/initiatives/_internal/InitiativeUiSchemaEdit.js.map +1 -0
- package/dist/node/projects/HubProject.js +7 -7
- package/dist/node/projects/HubProject.js.map +1 -1
- package/dist/node/projects/_internal/ProjectSchema.js +55 -0
- package/dist/node/projects/_internal/ProjectSchema.js.map +1 -0
- package/dist/node/projects/_internal/ProjectUiSchemaCreate.js +131 -0
- package/dist/node/projects/_internal/ProjectUiSchemaCreate.js.map +1 -0
- package/dist/node/projects/_internal/ProjectUiSchemaEdit.js +133 -0
- package/dist/node/projects/_internal/ProjectUiSchemaEdit.js.map +1 -0
- package/dist/node/projects/edit.js +11 -32
- package/dist/node/projects/edit.js.map +1 -1
- package/dist/node/search/_internal/commonHelpers/getTopLevelPredicate.js +49 -0
- package/dist/node/search/_internal/commonHelpers/getTopLevelPredicate.js.map +1 -0
- package/dist/node/search/_internal/expandPredicate.js +1 -0
- package/dist/node/search/_internal/expandPredicate.js.map +1 -1
- package/dist/node/search/_internal/hubSearchItemsHelpers/getQQueryParam.js +5 -31
- package/dist/node/search/_internal/hubSearchItemsHelpers/getQQueryParam.js.map +1 -1
- package/dist/node/search/serializeQueryForPortal.js +6 -0
- package/dist/node/search/serializeQueryForPortal.js.map +1 -1
- package/dist/types/core/behaviors/IWithEditorBehavior.d.ts +7 -2
- package/dist/types/core/schemas/getEntityEditorSchemas.d.ts +19 -0
- package/dist/types/core/schemas/index.d.ts +1 -1
- package/dist/types/core/schemas/shared/index.d.ts +1 -0
- package/dist/types/core/schemas/shared/subschemas.d.ts +29 -0
- package/dist/types/core/types/IHubProject.d.ts +0 -8
- package/dist/types/initiatives/HubInitiative.d.ts +11 -5
- package/dist/types/initiatives/_internal/InitiativeSchema.d.ts +7 -0
- package/dist/types/initiatives/_internal/InitiativeUiSchemaEdit.d.ts +5 -0
- package/dist/types/projects/HubProject.d.ts +8 -6
- package/dist/types/projects/_internal/ProjectSchema.d.ts +7 -0
- package/dist/types/projects/_internal/ProjectUiSchemaCreate.d.ts +7 -0
- package/dist/types/projects/_internal/ProjectUiSchemaEdit.d.ts +7 -0
- package/dist/types/projects/edit.d.ts +7 -4
- package/dist/types/search/_internal/commonHelpers/getTopLevelPredicate.d.ts +20 -0
- package/dist/types/search/_internal/hubSearchItemsHelpers/getQQueryParam.d.ts +1 -2
- package/package.json +1 -1
- package/dist/esm/core/schemas/hubproject.js +0 -300
- package/dist/esm/core/schemas/hubproject.js.map +0 -1
- package/dist/node/core/schemas/hubproject.js +0 -303
- package/dist/node/core/schemas/hubproject.js.map +0 -1
- package/dist/types/core/schemas/hubproject.d.ts +0 -10
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uiSchema = void 0;
|
|
4
|
+
const core_1 = require("../../core");
|
|
5
|
+
/**
|
|
6
|
+
* minimal create uiSchema for Hub Projects - this defines
|
|
7
|
+
* how the schema properties should be rendered in the
|
|
8
|
+
* project creation experience
|
|
9
|
+
*/
|
|
10
|
+
exports.uiSchema = {
|
|
11
|
+
type: "Layout",
|
|
12
|
+
elements: [
|
|
13
|
+
{
|
|
14
|
+
type: "Section",
|
|
15
|
+
options: { section: "stepper", scale: "l" },
|
|
16
|
+
elements: [
|
|
17
|
+
{
|
|
18
|
+
type: "Step",
|
|
19
|
+
labelKey: "{{i18nScope}}.sections.details.label",
|
|
20
|
+
elements: [
|
|
21
|
+
{
|
|
22
|
+
type: "Section",
|
|
23
|
+
labelKey: "{{i18nScope}}.sections.basicInfo.label",
|
|
24
|
+
elements: [
|
|
25
|
+
{
|
|
26
|
+
labelKey: "{{i18nScope}}.fields.name.label",
|
|
27
|
+
scope: "/properties/name",
|
|
28
|
+
type: "Control",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
labelKey: "{{i18nScope}}.fields.summary.label",
|
|
32
|
+
scope: "/properties/summary",
|
|
33
|
+
type: "Control",
|
|
34
|
+
options: {
|
|
35
|
+
control: "hub-field-input-input",
|
|
36
|
+
type: "textarea",
|
|
37
|
+
helperText: {
|
|
38
|
+
labelKey: "{{i18nScope}}.fields.summary.helperText",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
labelKey: "{{i18nScope}}.fields.description.label",
|
|
44
|
+
scope: "/properties/description",
|
|
45
|
+
type: "Control",
|
|
46
|
+
options: {
|
|
47
|
+
control: "hub-field-input-input",
|
|
48
|
+
type: "textarea",
|
|
49
|
+
helperText: {
|
|
50
|
+
labelKey: "{{i18nScope}}.fields.description.helperText",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
type: "Step",
|
|
60
|
+
labelKey: "{{i18nScope}}.sections.location.label",
|
|
61
|
+
rule: {
|
|
62
|
+
effect: core_1.UiSchemaRuleEffects.DISABLE,
|
|
63
|
+
condition: {
|
|
64
|
+
scope: "/properties/name",
|
|
65
|
+
schema: { const: "" },
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
elements: [
|
|
69
|
+
{
|
|
70
|
+
type: "Section",
|
|
71
|
+
labelKey: "{{i18nScope}}.sections.location.label",
|
|
72
|
+
elements: [
|
|
73
|
+
{
|
|
74
|
+
scope: "/properties/extent",
|
|
75
|
+
type: "Control",
|
|
76
|
+
options: {
|
|
77
|
+
control: "hub-field-input-boundary-picker",
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
type: "Step",
|
|
86
|
+
labelKey: "{{i18nScope}}.sections.statusAndTimeline.label",
|
|
87
|
+
rule: {
|
|
88
|
+
effect: core_1.UiSchemaRuleEffects.DISABLE,
|
|
89
|
+
condition: {
|
|
90
|
+
scope: "/properties/name",
|
|
91
|
+
schema: { const: "" },
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
elements: [
|
|
95
|
+
{
|
|
96
|
+
type: "Section",
|
|
97
|
+
labelKey: "{{i18nScope}}.sections.status.label",
|
|
98
|
+
elements: [
|
|
99
|
+
{
|
|
100
|
+
labelKey: "{{i18nScope}}.fields.status.label",
|
|
101
|
+
scope: "/properties/status",
|
|
102
|
+
type: "Control",
|
|
103
|
+
options: {
|
|
104
|
+
control: "hub-field-input-select",
|
|
105
|
+
enum: {
|
|
106
|
+
i18nScope: "{{i18nScope}}.fields.status.enum",
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
type: "Section",
|
|
114
|
+
labelKey: "{{i18nScope}}.sections.timeline.label",
|
|
115
|
+
elements: [
|
|
116
|
+
{
|
|
117
|
+
scope: "/properties/view/properties/timeline",
|
|
118
|
+
type: "Control",
|
|
119
|
+
options: {
|
|
120
|
+
control: "arcgis-hub-timeline-editor",
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
};
|
|
131
|
+
//# sourceMappingURL=ProjectUiSchemaCreate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProjectUiSchemaCreate.js","sourceRoot":"","sources":["../../../../src/projects/_internal/ProjectUiSchemaCreate.ts"],"names":[],"mappings":";;;AAAA,qCAA4D;AAE5D;;;;GAIG;AACU,QAAA,QAAQ,GAAc;IACjC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR;YACE,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;YAC3C,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAM;oBACZ,QAAQ,EAAE,sCAAsC;oBAChD,QAAQ,EAAE;wBACR;4BACE,IAAI,EAAE,SAAS;4BACf,QAAQ,EAAE,wCAAwC;4BAClD,QAAQ,EAAE;gCACR;oCACE,QAAQ,EAAE,iCAAiC;oCAC3C,KAAK,EAAE,kBAAkB;oCACzB,IAAI,EAAE,SAAS;iCAChB;gCACD;oCACE,QAAQ,EAAE,oCAAoC;oCAC9C,KAAK,EAAE,qBAAqB;oCAC5B,IAAI,EAAE,SAAS;oCACf,OAAO,EAAE;wCACP,OAAO,EAAE,uBAAuB;wCAChC,IAAI,EAAE,UAAU;wCAChB,UAAU,EAAE;4CACV,QAAQ,EAAE,yCAAyC;yCACpD;qCACF;iCACF;gCACD;oCACE,QAAQ,EAAE,wCAAwC;oCAClD,KAAK,EAAE,yBAAyB;oCAChC,IAAI,EAAE,SAAS;oCACf,OAAO,EAAE;wCACP,OAAO,EAAE,uBAAuB;wCAChC,IAAI,E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AAE,SAAS;oCACf,OAAO,EAAE;wCACP,OAAO,EAAE,4BAA4B;qCACtC;iCACF;6BACF;yBACF;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uiSchema = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* complete edit uiSchema for Hub Projects - this defines
|
|
6
|
+
* how the schema properties should be rendered in the
|
|
7
|
+
* project editing experience
|
|
8
|
+
*/
|
|
9
|
+
exports.uiSchema = {
|
|
10
|
+
type: "Layout",
|
|
11
|
+
elements: [
|
|
12
|
+
{
|
|
13
|
+
type: "Section",
|
|
14
|
+
labelKey: "{{i18nScope}}.sections.basicInfo.label",
|
|
15
|
+
elements: [
|
|
16
|
+
{
|
|
17
|
+
labelKey: "{{i18nScope}}.fields.name.label",
|
|
18
|
+
scope: "/properties/name",
|
|
19
|
+
type: "Control",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
labelKey: "{{i18nScope}}.fields.summary.label",
|
|
23
|
+
scope: "/properties/summary",
|
|
24
|
+
type: "Control",
|
|
25
|
+
options: {
|
|
26
|
+
control: "hub-field-input-input",
|
|
27
|
+
type: "textarea",
|
|
28
|
+
helperText: {
|
|
29
|
+
labelKey: "{{i18nScope}}.fields.summary.helperText",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
labelKey: "{{i18nScope}}.fields.description.label",
|
|
35
|
+
scope: "/properties/description",
|
|
36
|
+
type: "Control",
|
|
37
|
+
options: {
|
|
38
|
+
control: "hub-field-input-input",
|
|
39
|
+
type: "textarea",
|
|
40
|
+
helperText: {
|
|
41
|
+
labelKey: "{{i18nScope}}.fields.description.helperText",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
labelKey: "{{i18nScope}}.fields.featuredImage.label",
|
|
47
|
+
scope: "/properties/view/properties/featuredImage",
|
|
48
|
+
type: "Control",
|
|
49
|
+
options: {
|
|
50
|
+
control: "hub-field-input-image-picker",
|
|
51
|
+
maxWidth: 727,
|
|
52
|
+
maxHeight: 484,
|
|
53
|
+
aspectRatio: 1.5,
|
|
54
|
+
helperText: {
|
|
55
|
+
labelKey: "{{i18nScope}}.fields.featuredImage.helperText",
|
|
56
|
+
},
|
|
57
|
+
sizeDescription: {
|
|
58
|
+
labelKey: "{{i18nScope}}.fields.featuredImage.sizeDescription",
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
type: "Section",
|
|
66
|
+
labelKey: "{{i18nScope}}.sections.location.label",
|
|
67
|
+
elements: [
|
|
68
|
+
{
|
|
69
|
+
scope: "/properties/extent",
|
|
70
|
+
type: "Control",
|
|
71
|
+
options: {
|
|
72
|
+
control: "hub-field-input-boundary-picker",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
labelKey: "{{i18nScope}}.fields.showMap.label",
|
|
77
|
+
scope: "/properties/view/properties/showMap",
|
|
78
|
+
type: "Control",
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
type: "Section",
|
|
84
|
+
labelKey: "{{i18nScope}}.sections.status.label",
|
|
85
|
+
elements: [
|
|
86
|
+
{
|
|
87
|
+
scope: "/properties/status",
|
|
88
|
+
type: "Control",
|
|
89
|
+
labelKey: "{{i18nScope}}.fields.status.label",
|
|
90
|
+
options: {
|
|
91
|
+
control: "hub-field-input-select",
|
|
92
|
+
enum: {
|
|
93
|
+
i18nScope: "{{i18nScope}}.fields.status.enum",
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
type: "Section",
|
|
101
|
+
labelKey: "{{i18nScope}}.sections.timeline.label",
|
|
102
|
+
elements: [
|
|
103
|
+
{
|
|
104
|
+
scope: "/properties/view/properties/timeline",
|
|
105
|
+
type: "Control",
|
|
106
|
+
options: {
|
|
107
|
+
control: "arcgis-hub-timeline-editor",
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
type: "Section",
|
|
114
|
+
labelKey: "{{i18nScope}}.sections.featuredContent.label",
|
|
115
|
+
options: {
|
|
116
|
+
helperText: {
|
|
117
|
+
labelKey: "{{i18nScope}}.sections.featuredContent.helperText",
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
elements: [
|
|
121
|
+
{
|
|
122
|
+
scope: "/properties/view/properties/featuredContentIds",
|
|
123
|
+
type: "Control",
|
|
124
|
+
options: {
|
|
125
|
+
control: "hub-field-input-gallery-picker",
|
|
126
|
+
targetEntity: "item",
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
};
|
|
133
|
+
//# sourceMappingURL=ProjectUiSchemaEdit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProjectUiSchemaEdit.js","sourceRoot":"","sources":["../../../../src/projects/_internal/ProjectUiSchemaEdit.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACU,QAAA,QAAQ,GAAc;IACjC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR;YACE,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,wCAAwC;YAClD,QAAQ,EAAE;gBACR;oBACE,QAAQ,EAAE,iCAAiC;oBAC3C,KAAK,EAAE,kBAAkB;oBACzB,IAAI,EAAE,SAAS;iBAChB;gBACD;oBACE,QAAQ,EAAE,oCAAoC;oBAC9C,KAAK,EAAE,qBAAqB;oBAC5B,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACP,OAAO,EAAE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;aACF;SACF;QACD;YACE,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,uCAAuC;YACjD,QAAQ,EAAE;gBACR;oBACE,KAAK,EAAE,sCAAsC;oBAC7C,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACP,OAAO,EAAE,4BAA4B;qBACtC;iBACF;aACF;SACF;QACD;YACE,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,8CAA8C;YACxD,OAAO,EAAE;gBACP,UAAU,EAAE;oBACV,QAAQ,EAAE,mDAAmD;iBAC9D;aACF;YACD,QAAQ,EAAE;gBACR;oBACE,KAAK,EAAE,gDAAgD;oBACvD,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACP,OAAO,EAAE,gCAAgC;wBACzC,YAAY,EAAE,MAAM;qBACrB;iBACF;aACF;SACF;KACF;CACF,CAAC"}
|
|
@@ -8,14 +8,11 @@ const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
|
|
|
8
8
|
const PropertyMapper_1 = require("../core/_internal/PropertyMapper");
|
|
9
9
|
const types_1 = require("../core/types");
|
|
10
10
|
const defaults_1 = require("./defaults");
|
|
11
|
-
const schemas_1 = require("../core/schemas");
|
|
12
|
-
const internal_1 = require("../core/schemas/internal");
|
|
13
|
-
const applyUiSchemaElementOptions_1 = require("../core/schemas/internal/applyUiSchemaElementOptions");
|
|
14
11
|
const computeProps_1 = require("./_internal/computeProps");
|
|
15
12
|
const getPropertyMap_1 = require("./_internal/getPropertyMap");
|
|
16
13
|
const util_1 = require("../util");
|
|
17
|
-
const interpolate_1 = require("../items/interpolate");
|
|
18
14
|
const configureBaseResources_1 = require("../core/_internal/configureBaseResources");
|
|
15
|
+
const schemas_1 = require("../core/schemas");
|
|
19
16
|
/**
|
|
20
17
|
* @private
|
|
21
18
|
* Create a new Hub Project item
|
|
@@ -110,37 +107,19 @@ async function deleteProject(id, requestOptions) {
|
|
|
110
107
|
}
|
|
111
108
|
exports.deleteProject = deleteProject;
|
|
112
109
|
/**
|
|
110
|
+
* DEPRECATED: the following will be removed at next breaking version
|
|
111
|
+
* use the getEntityEditorSchemas function instead (which this function
|
|
112
|
+
* has already been refactored to consume)
|
|
113
|
+
*
|
|
113
114
|
* Get the editor config for for the HubProject entity.
|
|
114
|
-
* @param i18nScope
|
|
115
|
-
* @param type
|
|
116
|
-
* @param options
|
|
117
|
-
* @returns
|
|
115
|
+
* @param i18nScope translation scope to be interpolated into the uiSchema
|
|
116
|
+
* @param type editor type - corresonds to the returned uiSchema
|
|
117
|
+
* @param options optional hash of dynamic uiSchema element options
|
|
118
118
|
*/
|
|
119
|
+
/* istanbul ignore next deprecated */
|
|
119
120
|
async function getHubProjectEditorConfig(i18nScope, type, options = []) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
// uiSchema is the complete (edit) schema, unless otherwise specified
|
|
123
|
-
let uiSchema = util_1.cloneObject(schemas_1.HubProjectEditUiSchema);
|
|
124
|
-
// by default we don't need to filter the schema b/c it's the entire schema
|
|
125
|
-
let filterSchema = false;
|
|
126
|
-
// if another schema is requested, we need to use that UI schema
|
|
127
|
-
// and the subset the overall schema down to just the properties
|
|
128
|
-
// used in the UI schema
|
|
129
|
-
switch (type) {
|
|
130
|
-
case "create":
|
|
131
|
-
uiSchema = util_1.cloneObject(schemas_1.HubProjectCreateUiSchema);
|
|
132
|
-
filterSchema = true;
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
|
-
if (filterSchema) {
|
|
136
|
-
// filter out properties not used in the UI schema
|
|
137
|
-
schema = internal_1.filterSchemaToUiSchema(schema, uiSchema);
|
|
138
|
-
}
|
|
139
|
-
// apply the options
|
|
140
|
-
uiSchema = applyUiSchemaElementOptions_1.applyUiSchemaElementOptions(uiSchema, options);
|
|
141
|
-
// interpolate the i18n scope into the uiSchema
|
|
142
|
-
uiSchema = interpolate_1.interpolate(uiSchema, { i18nScope });
|
|
143
|
-
return Promise.resolve({ schema, uiSchema });
|
|
121
|
+
const editorType = `hub:project:${type}`;
|
|
122
|
+
return schemas_1.getEntityEditorSchemas(i18nScope, editorType, options);
|
|
144
123
|
}
|
|
145
124
|
exports.getHubProjectEditorConfig = getHubProjectEditorConfig;
|
|
146
125
|
//# sourceMappingURL=edit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../../src/projects/edit.ts"],"names":[],"mappings":";;;AAEA,4EAA4E;AAC5E,sCAKmB;AACnB,0CAA8E;
|
|
1
|
+
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../../src/projects/edit.ts"],"names":[],"mappings":";;;AAEA,4EAA4E;AAC5E,sCAKmB;AACnB,0CAA8E;AAC9E,iEAAwE;AACxE,qEAAkE;AAClE,yCAA+D;AAC/D,yCAAoE;AACpE,2DAAwD;AACxD,+DAA4D;AAE5D,kCAAsC;AACtC,qFAAkF;AAClF,6CAGyB;AAMzB;;;;;;;;GAQG;AACI,KAAK,UAAU,aAAa,CACjC,cAAoC,EACpC,cAAmC;IAEnC,IAAI,SAAS,CAAC;IACd,kCAAkC;IAClC,2CAA2C;IAC3C,MAAM,OAAO,mCAAQ,0BAAe,GAAK,cAAc,CAAE,CAAC;IAE1D,uDAAuD;IACvD,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;QACjB,OAAO,CAAC,IAAI,GAAG,qBAAa,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;KAC/D;IACD,yBAAyB;IACzB,OAAO,CAAC,IAAI,GAAG,MAAM,qBAAa,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,cAAc,CAAC,CAAC;IAC3E,uBAAuB;IACvB,OAAO,CAAC,YAAY,GAAG,sBAAc,CAAC,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1E,kDAAkD;IAClD,MAAM,MAAM,GAAG,IAAI,+BAAc,CAAuB,+BAAc,EAAE,CAAC,CAAC;IAC1E,wEA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|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTopLevelPredicate = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Searches through a list of filters and finds a specific predicate that should be appended at the top level of a search
|
|
6
|
+
* (i.e., has special requirements for combining with other predicates). Also verifies that the predicate is not combined in any invalid ways.
|
|
7
|
+
*
|
|
8
|
+
* Combination Requirements:
|
|
9
|
+
* - Only ONE filter can have a predicate with the target field
|
|
10
|
+
* - Only ONE predicate with the target field can exist
|
|
11
|
+
* - The predicate can only be ANDed to other predicates
|
|
12
|
+
* - The predicate's field value MUST be a string (not string[] or IMatchOptions)
|
|
13
|
+
*
|
|
14
|
+
* Example: Portal's bbox field cannot be conditionally searched. Any value provided will always be applied as a top-level filter.
|
|
15
|
+
* - Valid: `?bbox=1,2,3,4&filter=type:CSV`
|
|
16
|
+
* - Invalid: `?filter=type:CSV OR (type:PDF AND bbox=1,2,3,4)
|
|
17
|
+
*
|
|
18
|
+
* @param field the field of the desired predicate
|
|
19
|
+
* @param filters filters to be searched / validated
|
|
20
|
+
* @returns the predicate (if present and all requirements are met)
|
|
21
|
+
*/
|
|
22
|
+
function getTopLevelPredicate(field, filters) {
|
|
23
|
+
let result = null;
|
|
24
|
+
const matchingFilters = filters.filter((f) => {
|
|
25
|
+
return f.predicates.find((p) => !!p[field]);
|
|
26
|
+
});
|
|
27
|
+
if (matchingFilters.length > 1) {
|
|
28
|
+
throw new Error(`Only 1 IFilter can have a '${field}' predicate but ${matchingFilters.length} were detected`);
|
|
29
|
+
}
|
|
30
|
+
if (matchingFilters.length) {
|
|
31
|
+
const matchingFilter = matchingFilters[0];
|
|
32
|
+
const matchingPredicates = matchingFilter.predicates.filter((p) => !!p[field]);
|
|
33
|
+
if (matchingPredicates.length > 1) {
|
|
34
|
+
throw new Error(`Only 1 '${field}' predicate is allowed but ${matchingPredicates.length} were detected`);
|
|
35
|
+
}
|
|
36
|
+
if (matchingFilter.operation !== "AND" &&
|
|
37
|
+
matchingFilter.predicates.length > 1) {
|
|
38
|
+
throw new Error(`'${field}' predicates cannot be OR'd to other predicates`);
|
|
39
|
+
}
|
|
40
|
+
const topLevelPredicate = matchingPredicates[0];
|
|
41
|
+
if (typeof topLevelPredicate[field] !== "string") {
|
|
42
|
+
throw new Error(`'${field}' predicate must have a string value, string[] and IMatchOptions are not allowed.`);
|
|
43
|
+
}
|
|
44
|
+
result = topLevelPredicate;
|
|
45
|
+
}
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
exports.getTopLevelPredicate = getTopLevelPredicate;
|
|
49
|
+
//# sourceMappingURL=getTopLevelPredicate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTopLevelPredicate.js","sourceRoot":"","sources":["../../../../../src/search/_internal/commonHelpers/getTopLevelPredicate.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,oBAAoB,CAClC,KAAa,EACb,OAAkB;IAElB,IAAI,MAAM,GAAG,IAAI,CAAC;IAElB,MAAM,eAAe,GAAc,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;QACtD,OAAO,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE;QAC9B,MAAM,IAAI,KAAK,CACb,8BAA8B,KAAK,mBAAmB,eAAe,CAAC,MAAM,gBAAgB,CAC7F,CAAC;KACH;IAED,IAAI,eAAe,CAAC,MAAM,EAAE;QAC1B,MAAM,cAAc,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;QAC1C,MAAM,kBAAkB,GAAG,cAAc,CAAC,UAAU,CAAC,MAAM,CACzD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAClB,CAAC;QAEF,IAAI,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE;YACjC,MAAM,IAAI,KAAK,CACb,WAAW,KAAK,8BAA8B,kBAAkB,CAAC,MAAM,gBAAgB,CACxF,CAAC;SACH;QAED,IACE,cAAc,CAAC,SAAS,KAAK,KAAK;YAClC,cAAc,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EACpC;YACA,MAAM,IAAI,KAAK,CACb,IAAI,KAAK,iDAAiD,CAC3D,CAAC;SACH;QAED,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC;QAChD,IAAI,OAAO,iBAAiB,CAAC,KAAK,CAAC,KAAK,QAAQ,EAAE;YAChD,MAAM,IAAI,KAAK,CACb,IAAI,KAAK,mFAAmF,CAC7F,CAAC;SACH;QACD,MAAM,GAAG,iBAAiB,CAAC;KAC5B;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AA/CD,oDA+CC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expandPredicate.js","sourceRoot":"","sources":["../../../../src/search/_internal/expandPredicate.ts"],"names":[],"mappings":";;;AAAA,2CAAiD;AACjD,qCAAyC;AAEzC,oCAAwE;AAExE;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,SAAqB;IACnD,MAAM,MAAM,GAAe,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;IACvD,MAAM,SAAS,GAAG;QAChB,YAAY;QACZ,mBAAmB;QACnB,gBAAgB;QAChB,MAAM;QACN,kBAAkB;QAClB,YAAY;QACZ,gBAAgB;
|
|
1
|
+
{"version":3,"file":"expandPredicate.js","sourceRoot":"","sources":["../../../../src/search/_internal/expandPredicate.ts"],"names":[],"mappings":";;;AAAA,2CAAiD;AACjD,qCAAyC;AAEzC,oCAAwE;AAExE;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,SAAqB;IACnD,M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M,CAAC;AAChB,CAAC;AAnCD,0CAmCC"}
|
|
@@ -1,40 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getQQueryParam = void 0;
|
|
4
|
+
const getTopLevelPredicate_1 = require("../commonHelpers/getTopLevelPredicate");
|
|
2
5
|
// TODO: the 'q' query param logic is only here because the
|
|
3
6
|
// OGC API currently has a bug where 'q' cannot be included
|
|
4
7
|
// in the 'filter' string. Once that bug is resolved, rip this
|
|
5
|
-
// logic out and let predicates with 'term' to be processed
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.getQPredicate = exports.getQQueryParam = void 0;
|
|
8
|
-
// normally
|
|
8
|
+
// logic out and let predicates with 'term' to be processed normally
|
|
9
9
|
function getQQueryParam(query) {
|
|
10
|
-
const
|
|
11
|
-
return f.predicates.find((p) => !!p.term);
|
|
12
|
-
});
|
|
13
|
-
const qPredicate = getQPredicate(qFilters);
|
|
10
|
+
const qPredicate = getTopLevelPredicate_1.getTopLevelPredicate("term", query.filters);
|
|
14
11
|
return qPredicate === null || qPredicate === void 0 ? void 0 : qPredicate.term;
|
|
15
12
|
}
|
|
16
13
|
exports.getQQueryParam = getQQueryParam;
|
|
17
|
-
function getQPredicate(filters) {
|
|
18
|
-
let result;
|
|
19
|
-
if (filters.length > 1) {
|
|
20
|
-
throw new Error(`IQuery can only have 1 IFilter with a 'term' predicate but ${filters.length} were detected`);
|
|
21
|
-
}
|
|
22
|
-
if (filters.length) {
|
|
23
|
-
const filter = filters[0];
|
|
24
|
-
const qPredicates = filter.predicates.filter((p) => !!p.term);
|
|
25
|
-
if (qPredicates.length > 1) {
|
|
26
|
-
throw new Error(`IQuery can only have 1 'term' predicate but ${qPredicates.length} were detected`);
|
|
27
|
-
}
|
|
28
|
-
if (filter.operation !== "AND" && filter.predicates.length > 1) {
|
|
29
|
-
throw new Error(`'term' predicates cannot be OR'd to other predicates`);
|
|
30
|
-
}
|
|
31
|
-
const qPredicate = qPredicates[0];
|
|
32
|
-
if (typeof qPredicate.term !== "string") {
|
|
33
|
-
throw new Error(`'term' predicate must have a string value, string[] and IMatchOptions are not allowed.`);
|
|
34
|
-
}
|
|
35
|
-
result = qPredicate;
|
|
36
|
-
}
|
|
37
|
-
return result;
|
|
38
|
-
}
|
|
39
|
-
exports.getQPredicate = getQPredicate;
|
|
40
14
|
//# sourceMappingURL=getQQueryParam.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getQQueryParam.js","sourceRoot":"","sources":["../../../../../src/search/_internal/hubSearchItemsHelpers/getQQueryParam.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"getQQueryParam.js","sourceRoot":"","sources":["../../../../../src/search/_internal/hubSearchItemsHelpers/getQQueryParam.ts"],"names":[],"mappings":";;;AACA,gFAA6E;AAE7E,2DAA2D;AAC3D,2DAA2D;AAC3D,8DAA8D;AAC9D,oEAAoE;AAEpE,SAAgB,cAAc,CAAC,KAAa;IAC1C,MAAM,UAAU,GAAG,2CAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAC/D,OAAO,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,CAAC;AAC1B,CAAC;AAHD,wCAGC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.serializeQueryForPortal = void 0;
|
|
4
|
+
const getTopLevelPredicate_1 = require("./_internal/commonHelpers/getTopLevelPredicate");
|
|
4
5
|
const expandPredicate_1 = require("./_internal/expandPredicate");
|
|
5
6
|
/**
|
|
6
7
|
* Serialize IQuery into ISearchOptions for ArcGIS Portal
|
|
@@ -12,6 +13,10 @@ function serializeQueryForPortal(query) {
|
|
|
12
13
|
// remove any empty entries
|
|
13
14
|
const nonEmptyOptions = filterSearchOptions.filter(removeEmptyEntries);
|
|
14
15
|
const result = mergeSearchOptions(nonEmptyOptions, "AND");
|
|
16
|
+
const bboxPredicate = getTopLevelPredicate_1.getTopLevelPredicate("bbox", query.filters);
|
|
17
|
+
if (bboxPredicate) {
|
|
18
|
+
result.params = { bbox: bboxPredicate.bbox };
|
|
19
|
+
}
|
|
15
20
|
return result;
|
|
16
21
|
}
|
|
17
22
|
exports.serializeQueryForPortal = serializeQueryForPortal;
|
|
@@ -75,6 +80,7 @@ function serializePredicate(predicate) {
|
|
|
75
80
|
"searchUserName",
|
|
76
81
|
"categoriesAsParam",
|
|
77
82
|
"categoryFilter",
|
|
83
|
+
"bbox",
|
|
78
84
|
];
|
|
79
85
|
const specialProps = [
|
|
80
86
|
"filterType",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializeQueryForPortal.js","sourceRoot":"","sources":["../../../src/search/serializeQueryForPortal.ts"],"names":[],"mappings":";;;AAQA,iEAA8D;AAE9D;;;;GAIG;AACH,SAAgB,uBAAuB,CAAC,KAAa;IACnD,MAAM,mBAAmB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAC/D,2BAA2B;IAC3B,MAAM,eAAe,GAAG,mBAAmB,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;IACvE,MAAM,MAAM,GAAG,kBAAkB,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IAE1D,OAAO,MAAM,CAAC;AAChB,CAAC;
|
|
1
|
+
{"version":3,"file":"serializeQueryForPortal.js","sourceRoot":"","sources":["../../../src/search/serializeQueryForPortal.ts"],"names":[],"mappings":";;;AAQA,yFAAsF;AACtF,iEAA8D;AAE9D;;;;GAIG;AACH,SAAgB,uBAAuB,CAAC,KAAa;IACnD,MAAM,mBAAmB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAC/D,2BAA2B;IAC3B,MAAM,eAAe,GAAG,mBAAmB,CAAC,MAAM,CAA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sBAAsB,CAC7B,IAAkB,EAClB,GAAW,EACX,KAAwB;IAExB,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,CAAC,GAAG,GAAG,GAAG,KAAK,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC;QACnD,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;YACpB,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC;SACd;KACF;SAAM;QACL,CAAC,GAAG,GAAG,GAAG,KAAK,KAAK,GAAG,CAAC;KACzB;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import { IConfigurationSchema, IUiSchema, UiSchemaElementOptions } from "../schemas";
|
|
1
|
+
import { IConfigurationSchema, IUiSchema, UiSchemaElementOptions, EditorType } from "../schemas";
|
|
2
|
+
/**
|
|
3
|
+
* DEPRECATED: the following will be removed at next breaking version
|
|
4
|
+
* we will be shifting towards the EditorType defined in the schemas
|
|
5
|
+
* directory
|
|
6
|
+
*/
|
|
2
7
|
export declare type EditorConfigType = "create" | "edit";
|
|
3
8
|
export interface IEditorConfig {
|
|
4
9
|
schema: IConfigurationSchema;
|
|
@@ -8,5 +13,5 @@ export interface IEditorConfig {
|
|
|
8
13
|
*
|
|
9
14
|
*/
|
|
10
15
|
export interface IWithEditorBehavior {
|
|
11
|
-
getEditorConfig(i18nScope: string, type:
|
|
16
|
+
getEditorConfig(i18nScope: string, type: EditorType, options: UiSchemaElementOptions[]): Promise<IEditorConfig>;
|
|
12
17
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IEditorConfig } from "../behaviors";
|
|
2
|
+
import { UiSchemaElementOptions } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* defines the possible editor type values - these correspond
|
|
5
|
+
* to the supported/defined uiSchema configurations
|
|
6
|
+
*/
|
|
7
|
+
export declare type EditorType = (typeof validEditorTypes)[number];
|
|
8
|
+
export declare const validEditorTypes: readonly ["hub:project:create", "hub:project:edit", "hub:initiative:edit"];
|
|
9
|
+
/**
|
|
10
|
+
* get the editor schema and uiSchema defined for an entity.
|
|
11
|
+
* The schema and uiSchema that are returned can be used to
|
|
12
|
+
* render a form UI (using the configuration editor)
|
|
13
|
+
*
|
|
14
|
+
* @param i18nScope translation scope to be interpolated into the uiSchema
|
|
15
|
+
* @param type editor type - corresonds to the returned uiSchema
|
|
16
|
+
* @param options optional hash of dynamic uiSchema element options
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
export declare const getEntityEditorSchemas: (i18nScope: string, type: EditorType, options?: UiSchemaElementOptions[]) => Promise<IEditorConfig>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./types";
|
|
2
|
-
export * from "./
|
|
2
|
+
export * from "./getEntityEditorSchemas";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./subschemas";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* For consistency and validation purposes, leverage these commonly
|
|
3
|
+
* re-used subschemas in your schema definitions
|
|
4
|
+
*/
|
|
5
|
+
export declare const ENTITY_NAME_SCHEMA: {
|
|
6
|
+
type: string;
|
|
7
|
+
minLength: number;
|
|
8
|
+
maxLength: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const ENTITY_EXTENT_SCHEMA: {
|
|
11
|
+
type: string;
|
|
12
|
+
properties: {
|
|
13
|
+
spatialReference: {
|
|
14
|
+
type: string;
|
|
15
|
+
};
|
|
16
|
+
xmax: {
|
|
17
|
+
type: string[];
|
|
18
|
+
};
|
|
19
|
+
xmin: {
|
|
20
|
+
type: string[];
|
|
21
|
+
};
|
|
22
|
+
ymax: {
|
|
23
|
+
type: string[];
|
|
24
|
+
};
|
|
25
|
+
ymin: {
|
|
26
|
+
type: string[];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import { IWithLayout, IWithPermissions, IWithSlug, IWithCatalog } from "../traits/index";
|
|
2
2
|
import { IHubItemEntity } from "./IHubItemEntity";
|
|
3
|
-
import { IHubTimeline } from "./IHubTimeline";
|
|
4
3
|
/**
|
|
5
4
|
* Defines the properties of a Hub Project object
|
|
6
5
|
*/
|
|
7
6
|
export interface IHubProject extends IHubItemEntity, IWithSlug, IWithCatalog, IWithLayout, IWithPermissions {
|
|
8
|
-
/**
|
|
9
|
-
* Timeline for the project
|
|
10
|
-
*/
|
|
11
|
-
timeline?: IHubTimeline;
|
|
12
|
-
/**
|
|
13
|
-
* Project Status
|
|
14
|
-
*/
|
|
15
7
|
status: PROJECT_STATUSES;
|
|
16
8
|
}
|
|
17
9
|
export declare enum PROJECT_STATUSES {
|