@esri/solutions-components 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/calcite-input-text_5.cjs.entry.js +36 -36
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +1 -1
- package/dist/cjs/solution-configuration.cjs.entry.js +1 -1
- package/dist/cjs/solution-contents_3.cjs.entry.js +1 -1
- package/dist/cjs/{solution-store-70002b57.js → solution-store-ca4639d5.js} +3 -3
- package/dist/collection/components/add-record-modal/test/add-record-modal.e2e.js +24 -0
- package/dist/collection/components/add-record-modal/test/add-record-modal.spec.js +32 -0
- package/dist/collection/components/buffer-tools/test/buffer-tools.e2e.js +24 -0
- package/dist/collection/components/buffer-tools/test/buffer-tools.spec.js +157 -0
- package/dist/collection/components/card-manager/test/card-manager.e2e.js +24 -0
- package/dist/collection/components/card-manager/test/card-manager.spec.js +32 -0
- package/dist/collection/components/comment-card/test/comment-card.e2e.js +24 -0
- package/dist/collection/components/comment-card/test/comment-card.spec.js +32 -0
- package/dist/collection/components/crowdsource-manager/test/crowdsource-manager.e2e.js +24 -0
- package/dist/collection/components/crowdsource-manager/test/crowdsource-manager.spec.js +32 -0
- package/dist/collection/components/crowdsource-reporter/test/crowdsource-reporter.e2e.js +24 -0
- package/dist/collection/components/crowdsource-reporter/test/crowdsource-reporter.spec.js +32 -0
- package/dist/collection/components/deduct-calculator/test/deduct-calculator.e2e.js +24 -0
- package/dist/collection/components/deduct-calculator/test/deduct-calculator.spec.js +32 -0
- package/dist/collection/components/edit-record-modal/test/edit-record-modal.e2e.js +24 -0
- package/dist/collection/components/edit-record-modal/test/edit-record-modal.spec.js +32 -0
- package/dist/collection/components/info-card/test/info-card.e2e.js +24 -0
- package/dist/collection/components/info-card/test/info-card.spec.js +32 -0
- package/dist/collection/components/json-editor/test/json-editor.e2e.js +31 -0
- package/dist/collection/components/json-editor/test/json-editor.spec.js +60 -0
- package/dist/collection/components/layer-table/test/layer-table.e2e.js +24 -0
- package/dist/collection/components/layer-table/test/layer-table.spec.js +32 -0
- package/dist/collection/components/list-item/test/list-item.e2e.js +24 -0
- package/dist/collection/components/list-item/test/list-item.spec.js +32 -0
- package/dist/collection/components/map-card/test/map-card.e2e.js +24 -0
- package/dist/collection/components/map-card/test/map-card.spec.js +32 -0
- package/dist/collection/components/map-draw-tools/test/map-draw-tools.e2e.js +24 -0
- package/dist/collection/components/map-draw-tools/test/map-draw-tools.spec.js +32 -0
- package/dist/collection/components/map-layer-picker/test/map-layer-picker.e2e.js +24 -0
- package/dist/collection/components/map-layer-picker/test/map-layer-picker.spec.js +109 -0
- package/dist/collection/components/map-search/test/map-search.e2e.js +24 -0
- package/dist/collection/components/map-search/test/map-search.spec.js +53 -0
- package/dist/collection/components/map-select-tools/map-select-tools.js +36 -36
- package/dist/collection/components/map-select-tools/test/map-select-tools.e2e.js +24 -0
- package/dist/collection/components/map-select-tools/test/map-select-tools.spec.js +349 -0
- package/dist/collection/components/media-card/test/media-card.e2e.js +24 -0
- package/dist/collection/components/media-card/test/media-card.spec.js +32 -0
- package/dist/collection/components/pci-calculator/test/pci-calculator.e2e.js +24 -0
- package/dist/collection/components/pci-calculator/test/pci-calculator.spec.js +32 -0
- package/dist/collection/components/pdf-download/test/pdf-download.e2e.js +71 -0
- package/dist/collection/components/pdf-download/test/pdf-download.spec.js +104 -0
- package/dist/collection/components/public-notification/test/public-notification.e2e.js +95 -0
- package/dist/collection/components/public-notification/test/public-notification.spec.js +149 -0
- package/dist/collection/components/refine-selection/refine-selection.css +85 -85
- package/dist/collection/components/solution-configuration/test/solution-configuration.e2e.js +31 -0
- package/dist/collection/components/solution-configuration/test/solution-configuration.spec.js +114 -0
- package/dist/collection/components/solution-contents/test/solution-contents.e2e.js +89 -0
- package/dist/collection/components/solution-contents/test/solution-contents.spec.js +138 -0
- package/dist/collection/components/solution-item/test/solution-item.e2e.js +31 -0
- package/dist/collection/components/solution-item/test/solution-item.spec.js +72 -0
- package/dist/collection/components/solution-item-details/test/solution-item-details.e2e.js +31 -0
- package/dist/collection/components/solution-item-details/test/solution-item-details.spec.js +137 -0
- package/dist/collection/components/solution-item-icon/test/solution-item-icon.e2e.js +24 -0
- package/dist/collection/components/solution-item-icon/test/solution-item-icon.spec.js +34 -0
- package/dist/collection/components/solution-item-sharing/test/solution-item-sharing.e2e.js +31 -0
- package/dist/collection/components/solution-item-sharing/test/solution-item-sharing.spec.js +49 -0
- package/dist/collection/components/solution-organization-variables/test/solution-organization-variables.e2e.js +31 -0
- package/dist/collection/components/solution-organization-variables/test/solution-organization-variables.spec.js +60 -0
- package/dist/collection/components/solution-resource-item/test/solution-resource-item.e2e.js +31 -0
- package/dist/collection/components/solution-resource-item/test/solution-resource-item.spec.js +50 -0
- package/dist/collection/components/solution-spatial-ref/test/solution-spatial-ref.e2e.js +31 -0
- package/dist/collection/components/solution-spatial-ref/test/solution-spatial-ref.spec.js +170 -0
- package/dist/collection/components/solution-template-data/test/solution-template-data.e2e.js +31 -0
- package/dist/collection/components/solution-template-data/test/solution-template-data.spec.js +55 -0
- package/dist/collection/components/solution-variables/test/solution-variables.e2e.js +31 -0
- package/dist/collection/components/solution-variables/test/solution-variables.spec.js +126 -0
- package/dist/collection/utils/publicNotificationUtils.js +45 -0
- package/dist/collection/utils/templates.e2e.js +25 -0
- package/dist/collection/utils/test/csvUtils.spec.js +46 -0
- package/dist/collection/utils/test/downloadUtils.spec.js +102 -0
- package/dist/collection/utils/test/pciUtils.spec.js +297 -0
- package/dist/collection/utils/test/solution-store.spec.js +439 -0
- package/dist/components/map-select-tools2.js +36 -36
- package/dist/components/solution-store.js +3 -3
- package/dist/esm/calcite-input-text_5.entry.js +36 -36
- package/dist/esm/calcite-shell-panel_14.entry.js +1 -1
- package/dist/esm/solution-configuration.entry.js +1 -1
- package/dist/esm/solution-contents_3.entry.js +1 -1
- package/dist/esm/{solution-store-5d068b07.js → solution-store-70f874f8.js} +3 -3
- package/dist/solutions-components/{p-41802f6b.entry.js → p-16dfb254.entry.js} +1 -1
- package/dist/solutions-components/{p-4769a2a5.entry.js → p-5ed755a2.entry.js} +1 -1
- package/dist/solutions-components/{p-826a814d.js → p-78719506.js} +2 -2
- package/dist/solutions-components/{p-9f620303.entry.js → p-b4b19fd3.entry.js} +1 -1
- package/dist/solutions-components/{p-24fe6e1c.entry.js → p-d5d5942d.entry.js} +1 -1
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/common.js +291 -0
- package/dist/solutions-components/utils/csvDownload.js +36 -0
- package/dist/solutions-components/utils/csvUtils.js +32 -0
- package/dist/solutions-components/utils/downloadUtils.js +386 -0
- package/dist/solutions-components/utils/interfaces.js +56 -0
- package/dist/solutions-components/utils/languageUtil.js +85 -0
- package/dist/solutions-components/utils/loadModules.js +20 -0
- package/dist/solutions-components/utils/locale.js +56 -0
- package/dist/solutions-components/utils/mapViewUtils.js +140 -0
- package/dist/solutions-components/utils/pciUtils.js +837 -0
- package/dist/solutions-components/utils/pdfUtils.js +62 -0
- package/dist/solutions-components/utils/publicNotificationStore.js +38 -0
- package/dist/solutions-components/utils/publicNotificationUtils.js +45 -0
- package/dist/solutions-components/utils/queryUtils.js +148 -0
- package/dist/solutions-components/utils/solution-store.js +579 -0
- package/dist/solutions-components/utils/templates.e2e.js +25 -0
- package/dist/solutions-components/utils/templates.js +341 -0
- package/dist/solutions-components/utils/test/csvUtils.spec.js +46 -0
- package/dist/solutions-components/utils/test/downloadUtils.spec.js +102 -0
- package/dist/solutions-components/utils/test/mocks/jsApi.js +74 -0
- package/dist/solutions-components/utils/test/pciUtils.spec.js +297 -0
- package/dist/solutions-components/utils/test/solution-store.spec.js +439 -0
- package/dist/solutions-components/utils/test/testUtils.js +135 -0
- package/dist/solutions-components/utils/types.js +14 -0
- package/dist/solutions-components_commit.txt +7 -0
- package/package.json +7 -7
@@ -0,0 +1,114 @@
|
|
1
|
+
/** @license
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import { newSpecPage } from '@stencil/core/testing';
|
17
|
+
import { SolutionConfiguration } from '../solution-configuration';
|
18
|
+
import { h } from '@stencil/core';
|
19
|
+
import state from "../../../utils/solution-store";
|
20
|
+
// Mock MutationObserver because Jest environment doesn't have it
|
21
|
+
const mutationObserverMock = jest.fn(function MutationObserver() {
|
22
|
+
this.observe = jest.fn();
|
23
|
+
});
|
24
|
+
global.MutationObserver = mutationObserverMock;
|
25
|
+
xdescribe('solution-configuration', () => {
|
26
|
+
// has to be a better way..
|
27
|
+
global.MutationObserver = class {
|
28
|
+
constructor() { }
|
29
|
+
disconnect() { }
|
30
|
+
observe() { }
|
31
|
+
takeRecords() { return []; }
|
32
|
+
};
|
33
|
+
beforeEach(() => {
|
34
|
+
state._testAccess("_emptyTheStore");
|
35
|
+
});
|
36
|
+
it('renders', async () => {
|
37
|
+
state.setStoreInfo("featureServices", [
|
38
|
+
"Feature Service 1",
|
39
|
+
"Feature Service 2"
|
40
|
+
]);
|
41
|
+
const page = await newSpecPage({
|
42
|
+
components: [SolutionConfiguration],
|
43
|
+
supportsShadowDom: false,
|
44
|
+
template: () => (h("solution-configuration", null))
|
45
|
+
});
|
46
|
+
expect(page.root).toEqualHtml(`
|
47
|
+
<solution-configuration itemid="">
|
48
|
+
<div class="configuration-container">
|
49
|
+
<div class="configuration">
|
50
|
+
<calcite-tabs class="config-tabs">
|
51
|
+
<calcite-tab-nav slot="tab-nav">
|
52
|
+
<calcite-tab-title>Definition</calcite-tab-title>
|
53
|
+
<calcite-tab-title>Spatial Reference</calcite-tab-title>
|
54
|
+
</calcite-tab-nav>
|
55
|
+
|
56
|
+
<calcite-tab class="config-tab" active>
|
57
|
+
<div class="config-solution">
|
58
|
+
|
59
|
+
<div class="config-inventory">
|
60
|
+
<solution-contents id="configInventory"></solution-contents>
|
61
|
+
</div>
|
62
|
+
<calcite-button appearance="transparent" class="collapse-btn" icon-start="chevrons-left" id="collapse-vars" scale="s" title="Cancel Edits"></calcite-button>
|
63
|
+
<div class="config-item">
|
64
|
+
<solution-item></solution-item>
|
65
|
+
</div>
|
66
|
+
|
67
|
+
</div>
|
68
|
+
</calcite-tab>
|
69
|
+
<calcite-tab class="config-tab">
|
70
|
+
<div class="config-solution">
|
71
|
+
<solution-spatial-ref id="configure-solution-spatial-ref" locked=""></solution-spatial-ref>
|
72
|
+
</div>
|
73
|
+
</calcite-tab>
|
74
|
+
</calcite-tabs>
|
75
|
+
</div>
|
76
|
+
</div>
|
77
|
+
</solution-configuration>
|
78
|
+
`);
|
79
|
+
});
|
80
|
+
it('does not render spatial ref tab when no services are found', async () => {
|
81
|
+
const page = await newSpecPage({
|
82
|
+
components: [SolutionConfiguration],
|
83
|
+
supportsShadowDom: false,
|
84
|
+
template: () => (h("solution-configuration", null))
|
85
|
+
});
|
86
|
+
expect(page.root).toEqualHtml(`
|
87
|
+
<solution-configuration itemid="">
|
88
|
+
<div class="configuration-container">
|
89
|
+
<div class="configuration">
|
90
|
+
<calcite-tabs class="config-tabs">
|
91
|
+
<calcite-tab-nav slot="tab-nav">
|
92
|
+
<calcite-tab-title>Definition</calcite-tab-title>
|
93
|
+
</calcite-tab-nav>
|
94
|
+
|
95
|
+
<calcite-tab class="config-tab" active>
|
96
|
+
<div class="config-solution">
|
97
|
+
|
98
|
+
<div class="config-inventory">
|
99
|
+
<solution-contents id="configInventory"></solution-contents>
|
100
|
+
</div>
|
101
|
+
<calcite-button appearance="transparent" class="collapse-btn" icon-start="chevrons-left" id="collapse-vars" scale="s" title="Cancel Edits"></calcite-button>
|
102
|
+
<div class="config-item">
|
103
|
+
<solution-item></solution-item>
|
104
|
+
</div>
|
105
|
+
|
106
|
+
</div>
|
107
|
+
</calcite-tab>
|
108
|
+
</calcite-tabs>
|
109
|
+
</div>
|
110
|
+
</div>
|
111
|
+
</solution-configuration>
|
112
|
+
`);
|
113
|
+
});
|
114
|
+
});
|
@@ -0,0 +1,89 @@
|
|
1
|
+
/** @license
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
//import { newE2EPage } from '@stencil/core/testing';
|
17
|
+
describe('solution-contents', () => {
|
18
|
+
it('renders without a solution', async () => {
|
19
|
+
//TEST commented out for now.
|
20
|
+
// need to work out how we pass translations
|
21
|
+
// e2e tests don't seem to support a similar apporach to the unit tests where we can use template to load JSX
|
22
|
+
// could flatten the translations further so it would contain no sub groups
|
23
|
+
// could set default translations for each file
|
24
|
+
// and could still have a test to compare the default with the actual as a way to verify
|
25
|
+
expect("a").toEqual("a");
|
26
|
+
// const page = await newE2EPage();
|
27
|
+
// await page.setContent('<solution-contents></solution-contents>');
|
28
|
+
// const element = await page.find('solution-contents');
|
29
|
+
// expect(element).toHaveClass('hydrated');
|
30
|
+
});
|
31
|
+
// it('renders with a solution', async () => {
|
32
|
+
// const page = await newE2EPage();
|
33
|
+
// await page.setContent('<solution-contents></solution-contents>');
|
34
|
+
// const element = await page.find('solution-contents');
|
35
|
+
// element.setProperty("value",
|
36
|
+
// [{
|
37
|
+
// "id": "1",
|
38
|
+
// "title": "Dashboard 1"
|
39
|
+
// }, {
|
40
|
+
// "id": "2",
|
41
|
+
// "title": "Dashboard 2",
|
42
|
+
// "dependencies": [{
|
43
|
+
// "id": "3",
|
44
|
+
// "title": "Map 1",
|
45
|
+
// "dependencies": [{
|
46
|
+
// "id": "4",
|
47
|
+
// "title": "View 1",
|
48
|
+
// "dependencies": [{
|
49
|
+
// "id": "5",
|
50
|
+
// "title": "Feature Service 1"
|
51
|
+
// }]
|
52
|
+
// }]
|
53
|
+
// }]
|
54
|
+
// }, {
|
55
|
+
// "id": "6",
|
56
|
+
// "title": "Application 1",
|
57
|
+
// "dependencies": [{
|
58
|
+
// "id": "7",
|
59
|
+
// "title": "Group 1",
|
60
|
+
// "dependencies": [{
|
61
|
+
// "id": "8",
|
62
|
+
// "title": "Map 2",
|
63
|
+
// "dependencies": [{
|
64
|
+
// "id": "9",
|
65
|
+
// "title": "Feature Service 2"
|
66
|
+
// }, {
|
67
|
+
// "id": "10",
|
68
|
+
// "title": "Feature Service 3"
|
69
|
+
// }, {
|
70
|
+
// "id": "11",
|
71
|
+
// "title": "Map 3",
|
72
|
+
// "dependencies": [{
|
73
|
+
// "id": "12",
|
74
|
+
// "title": "Feature Service 4"
|
75
|
+
// }]
|
76
|
+
// }]
|
77
|
+
// }]
|
78
|
+
// }]
|
79
|
+
// }, {
|
80
|
+
// "id": "13",
|
81
|
+
// "title": "Notebook 1"
|
82
|
+
// }, {
|
83
|
+
// "id": "14",
|
84
|
+
// "title": "Survey 1"
|
85
|
+
// }]
|
86
|
+
// );
|
87
|
+
// await page.waitForChanges();
|
88
|
+
// });
|
89
|
+
});
|
@@ -0,0 +1,138 @@
|
|
1
|
+
/** @license
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import { newSpecPage } from '@stencil/core/testing';
|
17
|
+
import { SolutionContents } from '../solution-contents';
|
18
|
+
import { value } from '../../../demos/data/solution-contents-data.json';
|
19
|
+
import { h } from '@stencil/core';
|
20
|
+
xdescribe('solution-contents', () => {
|
21
|
+
it('renders', async () => {
|
22
|
+
const page = await newSpecPage({
|
23
|
+
components: [SolutionContents],
|
24
|
+
supportsShadowDom: false,
|
25
|
+
template: () => (h("solution-contents", { "template-hierarchy": value }))
|
26
|
+
});
|
27
|
+
expect(page.root).toEqualHtml(`
|
28
|
+
<solution-contents>
|
29
|
+
<calcite-tree>
|
30
|
+
|
31
|
+
<calcite-tree-item>
|
32
|
+
<solution-item-icon type="Dashboard"></solution-item-icon>
|
33
|
+
<span class="icon-text" title="Dashboard 1">
|
34
|
+
Dashboard 1
|
35
|
+
</span>
|
36
|
+
</calcite-tree-item>
|
37
|
+
|
38
|
+
<calcite-tree-item>
|
39
|
+
<solution-item-icon type="Dashboard"></solution-item-icon>
|
40
|
+
<span class="icon-text" title="Dashboard 2">
|
41
|
+
Dashboard 2
|
42
|
+
</span>
|
43
|
+
<calcite-tree slot="children">
|
44
|
+
<calcite-tree-item>
|
45
|
+
<solution-item-icon type="Web Map"></solution-item-icon>
|
46
|
+
<span class="icon-text" title="Map 1">
|
47
|
+
Map 1
|
48
|
+
</span>
|
49
|
+
<calcite-tree slot="children">
|
50
|
+
<calcite-tree-item>
|
51
|
+
<solution-item-icon type="Feature Service"></solution-item-icon>
|
52
|
+
<span class="icon-text" title="View 1">
|
53
|
+
View 1
|
54
|
+
</span>
|
55
|
+
<calcite-tree slot="children">
|
56
|
+
<calcite-tree-item>
|
57
|
+
<solution-item-icon type="Feature Service"></solution-item-icon>
|
58
|
+
<span class="icon-text" title="Feature Service 1">
|
59
|
+
Feature Service 1
|
60
|
+
</span>
|
61
|
+
</calcite-tree-item>
|
62
|
+
</calcite-tree>
|
63
|
+
</calcite-tree-item>
|
64
|
+
</calcite-tree>
|
65
|
+
</calcite-tree-item>
|
66
|
+
</calcite-tree>
|
67
|
+
</calcite-tree-item>
|
68
|
+
|
69
|
+
<calcite-tree-item>
|
70
|
+
<solution-item-icon type="QuickCapture Project"></solution-item-icon>
|
71
|
+
<span class="icon-text" title="Application 1">
|
72
|
+
Application 1
|
73
|
+
</span>
|
74
|
+
<calcite-tree slot="children">
|
75
|
+
<calcite-tree-item>
|
76
|
+
<solution-item-icon type="Group"></solution-item-icon>
|
77
|
+
<span class="icon-text" title="Group 1">
|
78
|
+
Group 1
|
79
|
+
</span>
|
80
|
+
<calcite-tree slot="children">
|
81
|
+
<calcite-tree-item>
|
82
|
+
<solution-item-icon type="Web Map"></solution-item-icon>
|
83
|
+
<span class="icon-text" title="Map 2">
|
84
|
+
Map 2
|
85
|
+
</span>
|
86
|
+
<calcite-tree slot="children">
|
87
|
+
<calcite-tree-item>
|
88
|
+
<solution-item-icon type="Feature Service"></solution-item-icon>
|
89
|
+
<span class="icon-text" title="Feature Service 2">
|
90
|
+
Feature Service 2
|
91
|
+
</span>
|
92
|
+
</calcite-tree-item>
|
93
|
+
<calcite-tree-item>
|
94
|
+
<solution-item-icon type="Feature Service"></solution-item-icon>
|
95
|
+
<span class="icon-text" title="Feature Service 3">
|
96
|
+
Feature Service 3
|
97
|
+
</span>
|
98
|
+
</calcite-tree-item>
|
99
|
+
<calcite-tree-item>
|
100
|
+
<solution-item-icon type="Web Map"></solution-item-icon>
|
101
|
+
<span class="icon-text" title="Map 3">
|
102
|
+
Map 3
|
103
|
+
</span>
|
104
|
+
<calcite-tree slot="children">
|
105
|
+
<calcite-tree-item>
|
106
|
+
<solution-item-icon type="Feature Service"></solution-item-icon>
|
107
|
+
<span class="icon-text" title="Feature Service 4">
|
108
|
+
Feature Service 4
|
109
|
+
</span>
|
110
|
+
</calcite-tree-item>
|
111
|
+
</calcite-tree>
|
112
|
+
</calcite-tree-item>
|
113
|
+
</calcite-tree>
|
114
|
+
</calcite-tree-item>
|
115
|
+
</calcite-tree>
|
116
|
+
</calcite-tree-item>
|
117
|
+
</calcite-tree>
|
118
|
+
</calcite-tree-item>
|
119
|
+
|
120
|
+
<calcite-tree-item>
|
121
|
+
<solution-item-icon type="Notebook"></solution-item-icon>
|
122
|
+
<span class="icon-text" title="Notebook 1">
|
123
|
+
Notebook 1
|
124
|
+
</span>
|
125
|
+
</calcite-tree-item>
|
126
|
+
|
127
|
+
<calcite-tree-item>
|
128
|
+
<solution-item-icon type="Form"></solution-item-icon>
|
129
|
+
<span class="icon-text" title="Survey 1">
|
130
|
+
Survey 1
|
131
|
+
</span>
|
132
|
+
</calcite-tree-item>
|
133
|
+
|
134
|
+
</calcite-tree>
|
135
|
+
</solution-contents>
|
136
|
+
`);
|
137
|
+
});
|
138
|
+
});
|
@@ -0,0 +1,31 @@
|
|
1
|
+
/** @license
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
// import { newE2EPage } from '@stencil/core/testing';
|
17
|
+
describe('solution-item', () => {
|
18
|
+
it('renders', async () => {
|
19
|
+
//TEST commented out for now.
|
20
|
+
// need to work out how we pass translations
|
21
|
+
// e2e tests don't seem to support a similar apporach to the unit tests where we can use template to load JSX
|
22
|
+
// could flatten the translations further so it would contain no sub groups
|
23
|
+
// could set default translations for each file
|
24
|
+
// and could still have a test to compare the default with the actual as a way to verify
|
25
|
+
expect("a").toEqual("a");
|
26
|
+
// const page = await newE2EPage();
|
27
|
+
// await page.setContent('<solution-item></solution-item>');
|
28
|
+
// const element = await page.find('solution-item');
|
29
|
+
// expect(element).toHaveClass('hydrated');
|
30
|
+
});
|
31
|
+
});
|
@@ -0,0 +1,72 @@
|
|
1
|
+
/** @license
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import { newSpecPage } from '@stencil/core/testing';
|
17
|
+
import { SolutionItem } from '../solution-item';
|
18
|
+
import { h } from '@stencil/core';
|
19
|
+
xdescribe('solution-item', () => {
|
20
|
+
it('renders', async () => {
|
21
|
+
const page = await newSpecPage({
|
22
|
+
components: [SolutionItem],
|
23
|
+
supportsShadowDom: false,
|
24
|
+
template: () => (h("solution-item", null))
|
25
|
+
});
|
26
|
+
expect(page.root).toEqualHtml(`
|
27
|
+
<solution-item>
|
28
|
+
<div class="configuration-container">
|
29
|
+
<div class="configuration">
|
30
|
+
<calcite-tabs class="config-tabs" style="display: none;">
|
31
|
+
<calcite-tab-nav slot="tab-nav">
|
32
|
+
<calcite-tab-title>
|
33
|
+
Group Details
|
34
|
+
</calcite-tab-title>
|
35
|
+
<calcite-tab-title>
|
36
|
+
Sharing
|
37
|
+
</calcite-tab-title>
|
38
|
+
</calcite-tab-nav>
|
39
|
+
<calcite-tab active="" class="config-tab" id="group-tab">
|
40
|
+
<solution-item-details type=""></solution-item-details>
|
41
|
+
</calcite-tab>
|
42
|
+
<calcite-tab class="config-tab" id="share-tab">
|
43
|
+
<solution-item-sharing groupid=""></solution-item-sharing>
|
44
|
+
</calcite-tab>
|
45
|
+
</calcite-tabs>
|
46
|
+
<calcite-tabs class="config-tabs" style="display: inherit;">
|
47
|
+
<calcite-tab-nav slot="tab-nav">
|
48
|
+
<calcite-tab-title>Item Details</calcite-tab-title>
|
49
|
+
<calcite-tab-title>Data</calcite-tab-title>
|
50
|
+
<calcite-tab-title>Properties</calcite-tab-title>
|
51
|
+
<calcite-tab-title>Resources</calcite-tab-title>
|
52
|
+
</calcite-tab-nav>
|
53
|
+
|
54
|
+
<calcite-tab class="config-tab" active>
|
55
|
+
<solution-item-details type=""></solution-item-details>
|
56
|
+
</calcite-tab>
|
57
|
+
<calcite-tab class="config-tab" id="data-tab">
|
58
|
+
<solution-template-data instanceid="data" itemid=""></solution-template-data>
|
59
|
+
</calcite-tab>
|
60
|
+
<calcite-tab class="config-tab" id="props-tab">
|
61
|
+
<solution-template-data instanceid="props" itemid=""></solution-template-data>
|
62
|
+
</calcite-tab>
|
63
|
+
<calcite-tab class="config-tab" id="resources-tab">
|
64
|
+
<solution-resource-item class="solutions-resource-container" itemid=""></solution-resource-item>
|
65
|
+
</calcite-tab>
|
66
|
+
</calcite-tabs>
|
67
|
+
</div>
|
68
|
+
</div>
|
69
|
+
</solution-item>
|
70
|
+
`);
|
71
|
+
});
|
72
|
+
});
|
@@ -0,0 +1,31 @@
|
|
1
|
+
/** @license
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
// import { newE2EPage } from '@stencil/core/testing';
|
17
|
+
describe('solution-item-details', () => {
|
18
|
+
it('renders', async () => {
|
19
|
+
//TEST commented out for now.
|
20
|
+
// need to work out how we pass translations
|
21
|
+
// e2e tests don't seem to support a similar apporach to the unit tests where we can use template to load JSX
|
22
|
+
// could flatten the translations further so it would contain no sub groups
|
23
|
+
// could set default translations for each file
|
24
|
+
// and could still have a test to compare the default with the actual as a way to verify
|
25
|
+
expect("a").toEqual("a");
|
26
|
+
// const page = await newE2EPage();
|
27
|
+
// await page.setContent('<solution-item-details></solution-item-details>');
|
28
|
+
// const element = await page.find('solution-item-details');
|
29
|
+
// expect(element).toHaveClass('hydrated');
|
30
|
+
});
|
31
|
+
});
|
@@ -0,0 +1,137 @@
|
|
1
|
+
/** @license
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import { newSpecPage } from '@stencil/core/testing';
|
17
|
+
import { SolutionItemDetails } from '../solution-item-details';
|
18
|
+
import { value } from '../../../demos/data/solution-item-details-data.json';
|
19
|
+
//import * as groupData from '../../../demos/data/solution-group-details-data.json';
|
20
|
+
import { h } from '@stencil/core';
|
21
|
+
xdescribe('solution-item-details', () => {
|
22
|
+
it('renders', async () => {
|
23
|
+
const page = await newSpecPage({
|
24
|
+
components: [SolutionItemDetails],
|
25
|
+
supportsShadowDom: false,
|
26
|
+
template: () => (h("solution-item-details", { "item-id": value }))
|
27
|
+
});
|
28
|
+
expect(page.root).toEqualHtml(`
|
29
|
+
<solution-item-details type="">
|
30
|
+
<div class="parent-container">
|
31
|
+
<div class="inputBottomSeparation">
|
32
|
+
<calcite-input id="item-title" value="ElectionGeography_public"></calcite-input>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div class="inputBottomSeparation">
|
36
|
+
|
37
|
+
<input class="display-none" type="file" accept=".jpg,.gif,.png,image/jpg,image/gif,image/png" />
|
38
|
+
|
39
|
+
<button class="btn-link font-size--3 inline-block trailer-quarter">
|
40
|
+
<svg viewBox="0 0 16 16" width="16" height="16" class="icon-inline icon-inline--on-left">
|
41
|
+
<path d="M14.792 2.666l-1.414-1.413a.965.965 0 0 0-1.385-.03l-1.444 1.444-8.763 8.72L.03 15.481a.371.371 0 0 0 .488.488l4.096-1.756 8.763-8.72-.001-.001.002.002 1.443-1.444a.965.965 0 0 0-.03-1.385zM1.569 14.431l.554-1.293.74.739zm2.338-.924l-1.414-1.414 7.963-7.92 1.414 1.415zm8.67-8.626l-1.413-1.414 1.29-1.29a.306.306 0 0 1 .433 0l.981.98a.306.306 0 0 1 0 .433z"></path>
|
42
|
+
</svg> Edit Thumbnail
|
43
|
+
</button>
|
44
|
+
|
45
|
+
<div class="flex">
|
46
|
+
<div class="img-container">
|
47
|
+
<img class="scale-down" width="200" height="133" />
|
48
|
+
</div>
|
49
|
+
<div class="snippet-count-container">
|
50
|
+
<calcite-input id="item-snippet" maxlength="250" type="textarea" value="A public feature layer view used by election staff to share information about election geography with the public."></calcite-input>
|
51
|
+
<label id="item-snippet-count" class="font-size--3"></label>
|
52
|
+
</div>
|
53
|
+
</div>
|
54
|
+
</div>
|
55
|
+
|
56
|
+
<calcite-label>Description
|
57
|
+
<label id="item-description-label">
|
58
|
+
<calcite-input id="item-description" type="textarea" value="A public feature layer view used by election staff to share information about election geography with the public."></calcite-input>
|
59
|
+
</label>
|
60
|
+
</calcite-label>
|
61
|
+
|
62
|
+
<calcite-label>Tags
|
63
|
+
<label id="item-tags-label">
|
64
|
+
<calcite-input id="item-tags" value="Precincts,Polling Places,Voting,Early Voting,Ballots,Voting Centers,Elected Officials,Secretary of State,Elections,Election Day,Election Officials,Clerks"></calcite-input>
|
65
|
+
</label>
|
66
|
+
</calcite-label>
|
67
|
+
|
68
|
+
<calcite-label>Credits
|
69
|
+
<label id="item-credits-label">
|
70
|
+
<calcite-input id="item-credits" value="Esri"></calcite-input>
|
71
|
+
</label>
|
72
|
+
</calcite-label>
|
73
|
+
|
74
|
+
<calcite-label>
|
75
|
+
<label id="item-terms-label">Terms of Use
|
76
|
+
<calcite-input id="item-terms" type="textarea"></calcite-input>
|
77
|
+
</label>
|
78
|
+
</calcite-label>
|
79
|
+
</div>
|
80
|
+
</solution-item-details>
|
81
|
+
`);
|
82
|
+
});
|
83
|
+
/*
|
84
|
+
it('renders group details', async () => {
|
85
|
+
const page = await newSpecPage({
|
86
|
+
components: [SolutionItemDetails],
|
87
|
+
supportsShadowDom: false,
|
88
|
+
template: () => (
|
89
|
+
<solution-item-details type="Group" value={groupData.value}></solution-item-details>
|
90
|
+
)
|
91
|
+
});
|
92
|
+
expect(page.root).toEqualHtml(`
|
93
|
+
<solution-item-details type="Group">
|
94
|
+
<div class="parent-container">
|
95
|
+
<div class="inputBottomSeparation">
|
96
|
+
<calcite-input id="item-title" value="Election"></calcite-input>
|
97
|
+
</div>
|
98
|
+
|
99
|
+
<div class="inputBottomSeparation">
|
100
|
+
|
101
|
+
<input class="display-none" type="file" accept=".jpg,.gif,.png,image/jpg,image/gif,image/png" />
|
102
|
+
|
103
|
+
<button class="btn-link font-size--3 inline-block trailer-quarter">
|
104
|
+
<svg viewBox="0 0 16 16" width="16" height="16" class="icon-inline icon-inline--on-left">
|
105
|
+
<path d="M14.792 2.666l-1.414-1.413a.965.965 0 0 0-1.385-.03l-1.444 1.444-8.763 8.72L.03 15.481a.371.371 0 0 0 .488.488l4.096-1.756 8.763-8.72-.001-.001.002.002 1.443-1.444a.965.965 0 0 0-.03-1.385zM1.569 14.431l.554-1.293.74.739zm2.338-.924l-1.414-1.414 7.963-7.92 1.414 1.415zm8.67-8.626l-1.413-1.414 1.29-1.29a.306.306 0 0 1 .433 0l.981.98a.306.306 0 0 1 0 .433z"></path>
|
106
|
+
</svg> Edit Thumbnail
|
107
|
+
</button>
|
108
|
+
|
109
|
+
<div class="flex">
|
110
|
+
<div class="img-container">
|
111
|
+
<img class="scale-down" width="200" height="133" />
|
112
|
+
</div>
|
113
|
+
<div class="snippet-count-container">
|
114
|
+
<calcite-input id="item-snippet" maxlength="250" type="textarea" value="A public group used by election staff to share information about election items."></calcite-input>
|
115
|
+
<label id="item-snippet-count" class="font-size--3"></label>
|
116
|
+
</div>
|
117
|
+
</div>
|
118
|
+
</div>
|
119
|
+
|
120
|
+
<calcite-label>Description
|
121
|
+
<label id="item-description-label">
|
122
|
+
<calcite-input id="item-description" type="textarea" value="A public group used by election staff to share information about election items."></calcite-input>
|
123
|
+
</label>
|
124
|
+
</calcite-label>
|
125
|
+
|
126
|
+
<calcite-label>Tags
|
127
|
+
<label id="item-tags-label">
|
128
|
+
<calcite-input id="item-tags" value="Elections,Election Day"></calcite-input>
|
129
|
+
</label>
|
130
|
+
</calcite-label>
|
131
|
+
|
132
|
+
</div>
|
133
|
+
</solution-item-details>
|
134
|
+
`);
|
135
|
+
});
|
136
|
+
*/
|
137
|
+
});
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/** @license
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
describe('solution-item-icon', () => {
|
17
|
+
it('renders', async () => {
|
18
|
+
// const page = await newE2EPage();
|
19
|
+
// await page.setContent('<solution-item-icon></solution-item-icon>');
|
20
|
+
// const element = await page.find('solution-item-icon');
|
21
|
+
// expect(element).toHaveClass('hydrated');
|
22
|
+
expect("a").toEqual("a");
|
23
|
+
});
|
24
|
+
});
|