@arcgis/portal-components 6.0.0-next.37 → 6.0.0-next.39
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/cdn/2574FNAZ.js +2 -0
- package/dist/cdn/3DOZPC3W.js +2 -0
- package/dist/cdn/{R5LNWMD4.js → 3HZI6MKD.js} +1 -1
- package/dist/cdn/{ASLKTYLX.js → 3KGSWW6B.js} +1 -1
- package/dist/cdn/{VWV2LCNA.js → 3OL7A2UC.js} +1 -1
- package/dist/cdn/3Q7UJKKN.js +2 -0
- package/dist/cdn/43A74S72.js +2 -0
- package/dist/cdn/46HNNQAD.js +2 -0
- package/dist/cdn/46MYBPSS.js +2 -0
- package/dist/cdn/{H25PBZPU.js → 47DKAGRV.js} +1 -1
- package/dist/cdn/{5VFGR7LA.js → 4CBRO7JP.js} +1 -1
- package/dist/cdn/{NLFBHNSX.js → 5M25PCH2.js} +1 -1
- package/dist/cdn/5MLBK66O.js +2 -0
- package/dist/cdn/5RBH3LGK.js +2 -0
- package/dist/cdn/5ZHNRQOW.js +2 -0
- package/dist/cdn/62TL6V4N.js +2 -0
- package/dist/cdn/{IWQ5I2DD.js → 66VV7NHO.js} +1 -1
- package/dist/cdn/{US37IXWO.js → 6AHPTR2E.js} +1 -1
- package/dist/cdn/{ZQ6SGKLT.js → 6APPSZ7E.js} +1 -1
- package/dist/cdn/{XH6RD5BO.js → 6CUXEL27.js} +1 -1
- package/dist/cdn/{6HNKQNS5.js → 6QI7DAS2.js} +1 -1
- package/dist/cdn/{324F5URQ.js → 6ZJNZZPC.js} +1 -1
- package/dist/cdn/{5CEFJTG4.js → 75CT6IMW.js} +1 -1
- package/dist/cdn/{CJ4S56BE.js → 7J22VLBO.js} +1 -1
- package/dist/cdn/7VPB6Q55.js +63 -0
- package/dist/cdn/7ZU43BL6.js +2 -0
- package/dist/cdn/A5QLPZ57.js +2 -0
- package/dist/cdn/AZTAWZI5.js +2 -0
- package/dist/cdn/{WIUFH5SJ.js → BNWJUQDF.js} +1 -1
- package/dist/cdn/{UBPCKCW2.js → BUYOYUA2.js} +1 -1
- package/dist/cdn/BX7Q3V2Y.js +43 -0
- package/dist/cdn/BXPNB7VJ.js +2 -0
- package/dist/cdn/{4Y73LE7P.js → BZEKNJUA.js} +1 -1
- package/dist/cdn/{WCZJXBW3.js → C6RUWLEJ.js} +1 -1
- package/dist/cdn/C7SNE6YG.js +2 -0
- package/dist/cdn/DENQY4OE.js +2 -0
- package/dist/cdn/DT4HGMLS.js +2 -0
- package/dist/cdn/{NYBLHT3F.js → DTGPLVZF.js} +1 -1
- package/dist/cdn/DU2R3VC4.js +2 -0
- package/dist/cdn/{RJRTGF33.js → E5HCHRAI.js} +1 -1
- package/dist/cdn/{IX4WEZZ2.js → EBL7YSRM.js} +1 -1
- package/dist/cdn/EDGE3T36.js +2 -0
- package/dist/cdn/{HBO7XTIL.js → EFMYI4L2.js} +1 -1
- package/dist/cdn/{XOM3GLYF.js → FFL2L4X5.js} +1 -1
- package/dist/cdn/{PST62OKJ.js → FIAEPK5L.js} +1 -1
- package/dist/cdn/{L25GEXL6.js → FTKSVLDI.js} +1 -1
- package/dist/cdn/{QMIVFHQE.js → G272JPUS.js} +1 -1
- package/dist/cdn/{D52TYBRX.js → GFUKRB6D.js} +1 -1
- package/dist/cdn/{ZGSAH7Z7.js → GG6U75ZA.js} +1 -1
- package/dist/cdn/{O4YFPGD5.js → GZ4ONSFV.js} +1 -1
- package/dist/cdn/{YP7T6NKR.js → HOIZXTOD.js} +1 -1
- package/dist/cdn/{DV57AOBF.js → IAMPUXPT.js} +1 -1
- package/dist/cdn/{AUM2QTBQ.js → IAWL475A.js} +1 -1
- package/dist/cdn/IGLODZPX.js +2 -0
- package/dist/cdn/{KTWSNYYZ.js → IOF72CDU.js} +1 -1
- package/dist/cdn/ITRJGXFV.js +93 -0
- package/dist/cdn/{EDQSL2P3.js → ITWLFQI4.js} +1 -1
- package/dist/cdn/{B343BOVA.js → IYICIRGI.js} +1 -1
- package/dist/cdn/{OVAOMUO3.js → JFGXTJY4.js} +1 -1
- package/dist/cdn/{5E4EL6TF.js → JIU6MBGB.js} +1 -1
- package/dist/cdn/{5Y32T5IJ.js → JTA223NH.js} +1 -1
- package/dist/cdn/KA2MXQTR.js +2 -0
- package/dist/cdn/KAK6CNI7.js +2 -0
- package/dist/cdn/{5S4JV6IY.js → KPZGBBDG.js} +1 -1
- package/dist/cdn/{M664QA6J.js → KRO5XRZ7.js} +1 -1
- package/dist/cdn/KWL2D56D.js +3 -0
- package/dist/cdn/{BRWHEYLW.js → KXVXQYIB.js} +1 -1
- package/dist/cdn/L3YOPSRB.js +135 -0
- package/dist/cdn/{QF626JXP.js → LEESUFWE.js} +1 -1
- package/dist/cdn/{CMNTOT5D.js → LGKI24ZT.js} +1 -1
- package/dist/cdn/LTD5KLLE.js +2 -0
- package/dist/cdn/{VFECPSKA.js → MB32XRI5.js} +1 -1
- package/dist/cdn/{3T3QBPC3.js → MSL36HAR.js} +1 -1
- package/dist/cdn/{ARAHDT2O.js → N3WRMPM6.js} +1 -1
- package/dist/cdn/N47MW5HI.js +9 -0
- package/dist/cdn/{G7DJPREL.js → N7XYFVOI.js} +1 -1
- package/dist/cdn/{WZFGZEQI.js → NU4K2AV3.js} +1 -1
- package/dist/cdn/{ESKKH4DE.js → ONRTCGLU.js} +1 -1
- package/dist/cdn/{WSQLSDQY.js → OPI4P6VO.js} +1 -1
- package/dist/cdn/{YYKKXL62.js → OPMM7QH5.js} +1 -1
- package/dist/cdn/{PRBP4AP6.js → OXF2WDSW.js} +1 -1
- package/dist/cdn/P3FFM322.js +2 -0
- package/dist/cdn/QAXFE5DD.js +2 -0
- package/dist/cdn/{6EMK2BU6.js → QKRLO5CJ.js} +1 -1
- package/dist/cdn/{FVHP6PFG.js → R26RBXQW.js} +1 -1
- package/dist/cdn/R6KJVAX3.js +99 -0
- package/dist/cdn/RA2NMLMP.js +2 -0
- package/dist/cdn/{365ICWHN.js → RJXIU4GH.js} +1 -1
- package/dist/cdn/{6FFYU4NI.js → RKHNP3KL.js} +1 -1
- package/dist/cdn/RR56BOTV.js +2 -0
- package/dist/cdn/RTZ2TKM5.js +2 -0
- package/dist/cdn/RX64JXHI.js +170 -0
- package/dist/cdn/{26KZUWNM.js → RXMM6CFK.js} +1 -1
- package/dist/cdn/{JA3GGSJJ.js → S4N5QMSN.js} +1 -1
- package/dist/cdn/{3CXU5CCM.js → SCLYGIHM.js} +1 -1
- package/dist/cdn/{PJZZIITX.js → SLK7PV62.js} +1 -1
- package/dist/cdn/{SUA7ZZUH.js → SUN4MBT3.js} +1 -1
- package/dist/cdn/SYXCSFIA.js +2 -0
- package/dist/cdn/{3QWNGHAK.js → TBSNDRRE.js} +1 -1
- package/dist/cdn/TP7V25GT.js +2 -0
- package/dist/cdn/{FGDSHTJ5.js → UBMZBXT7.js} +1 -1
- package/dist/cdn/UIK6LPA7.js +2 -0
- package/dist/cdn/{7DAB2CEU.js → VQRMXBPQ.js} +1 -1
- package/dist/cdn/{AM3UTQWH.js → VWOBCSD6.js} +1 -1
- package/dist/cdn/{C3F24ZOM.js → W3JJBZYX.js} +1 -1
- package/dist/cdn/W6WVMRGQ.js +2 -0
- package/dist/cdn/{TO666HVV.js → WNXDXB3M.js} +1 -1
- package/dist/cdn/{XEVOU7SJ.js → WOSWA2VI.js} +1 -1
- package/dist/cdn/{DMS3R2W5.js → WTKLB3R6.js} +1 -1
- package/dist/cdn/{LR33CLTB.js → X7W4VJO7.js} +1 -1
- package/dist/cdn/{CIRCDM5E.js → XCOP6QHA.js} +1 -1
- package/dist/cdn/{C4GK263H.js → XVV75AX3.js} +1 -1
- package/dist/cdn/XYHIVGUK.js +2 -0
- package/dist/cdn/{2GZVUHL5.js → Y4JOEFBJ.js} +1 -1
- package/dist/cdn/{CNEJPW3I.js → Y7ZCEONL.js} +1 -1
- package/dist/cdn/YELHAJB3.js +2 -0
- package/dist/cdn/YH2OFXPU.js +2 -0
- package/dist/cdn/{HVQ7FKJ5.js → YYVLFAFT.js} +1 -1
- package/dist/cdn/{BX2LXI3N.js → ZDH4KVAV.js} +1 -1
- package/dist/cdn/{SO3IBFEU.js → ZECUXVTO.js} +1 -1
- package/dist/cdn/ZG7OW456.js +2 -0
- package/dist/cdn/{7BFTXD5J.js → ZLNBCJE4.js} +1 -1
- package/dist/cdn/{GC4BV7IZ.js → ZNNEU5QW.js} +1 -1
- package/dist/cdn/assets/portal-item-status-card/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/portal-review-layer-sharing/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/constants.js +7 -0
- package/dist/chunks/contextUsage.js +208 -0
- package/dist/chunks/createPortalTool.js +8 -8
- package/dist/chunks/fieldAddDelete.js +1 -1
- package/dist/chunks/groups2.js +1 -1
- package/dist/chunks/help.js +22 -0
- package/dist/chunks/item.js +29 -25
- package/dist/chunks/item2.js +66 -30
- package/dist/chunks/itemThumbnail.js +1 -1
- package/dist/chunks/items.js +11 -11
- package/dist/chunks/layers.js +1 -1
- package/dist/chunks/portal-item-preview-sublayer.js +1 -1
- package/dist/chunks/portal-item-status-card.js +81 -0
- package/dist/chunks/portal.js +2 -2
- package/dist/chunks/portal2.js +1 -1
- package/dist/chunks/previewSessionController.js +33 -0
- package/dist/chunks/request.js +9 -9
- package/dist/chunks/services.js +1 -1
- package/dist/chunks/user.js +2 -2
- package/dist/chunks/utils2.js +4 -4
- package/dist/components/arcgis-portal-ai-assistant/customElement.js +241 -219
- package/dist/components/arcgis-portal-ai-assistant/index.js +1 -0
- package/dist/components/arcgis-portal-ai-assistant-diagnostics/contextUsage.d.ts +46 -0
- package/dist/components/arcgis-portal-ai-assistant-diagnostics/customElement.d.ts +26 -0
- package/dist/components/arcgis-portal-ai-assistant-diagnostics/customElement.js +46 -0
- package/dist/components/arcgis-portal-ai-assistant-diagnostics/index.d.ts +1 -0
- package/dist/components/arcgis-portal-ai-assistant-diagnostics/index.js +10 -0
- package/dist/components/arcgis-portal-delete-items/customElement.js +95 -110
- package/dist/components/arcgis-portal-entity-picker/customElement.js +1 -1
- package/dist/components/arcgis-portal-field-delete/customElement.js +1 -1
- package/dist/components/arcgis-portal-group-browser/customElement.js +62 -90
- package/dist/components/arcgis-portal-group-thumbnail/customElement.js +1 -1
- package/dist/components/arcgis-portal-item-share-summary/customElement.js +1 -1
- package/dist/components/arcgis-portal-item-status-card/customElement.d.ts +82 -0
- package/dist/components/arcgis-portal-item-status-card/customElement.js +12 -0
- package/dist/components/arcgis-portal-item-status-card/index.d.ts +1 -0
- package/dist/components/arcgis-portal-item-status-card/index.js +4 -0
- package/dist/components/arcgis-portal-navigation/customElement.js +1 -1
- package/dist/components/arcgis-portal-navigation/index.js +4 -4
- package/dist/components/arcgis-portal-review-layer-sharing/customElement.d.ts +139 -0
- package/dist/components/arcgis-portal-review-layer-sharing/customElement.js +593 -0
- package/dist/components/arcgis-portal-review-layer-sharing/index.d.ts +1 -0
- package/dist/components/arcgis-portal-review-layer-sharing/index.js +10 -0
- package/dist/components/arcgis-portal-review-layer-sharing/types.d.ts +27 -0
- package/dist/components/arcgis-portal-user-popup/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.d.ts +24 -0
- package/dist/index.js +1 -1
- package/dist/loader.js +3 -0
- package/dist/types/item.d.ts +2 -0
- package/dist/types/lumina.d.ts +18 -0
- package/dist/types/preact.d.ts +21 -0
- package/dist/types/react.d.ts +24 -0
- package/dist/types/stencil.d.ts +18 -0
- package/package.json +10 -10
- package/dist/cdn/234TH32X.js +0 -106
- package/dist/cdn/25K5D5HL.js +0 -2
- package/dist/cdn/4KTRAA2J.js +0 -2
- package/dist/cdn/4X4EYM3Q.js +0 -2
- package/dist/cdn/4YJGTINX.js +0 -2
- package/dist/cdn/A3OUZJ44.js +0 -2
- package/dist/cdn/ASID6YW7.js +0 -135
- package/dist/cdn/AYESDOK5.js +0 -2
- package/dist/cdn/BOEGDK4D.js +0 -2
- package/dist/cdn/CBFFZMX4.js +0 -2
- package/dist/cdn/FACH2JTF.js +0 -2
- package/dist/cdn/FGRMURKX.js +0 -2
- package/dist/cdn/GBG25IJ2.js +0 -2
- package/dist/cdn/H6MGSC3Y.js +0 -2
- package/dist/cdn/IKRGN33H.js +0 -93
- package/dist/cdn/K3GAZFRI.js +0 -63
- package/dist/cdn/LBW47BJG.js +0 -2
- package/dist/cdn/LRL2RJID.js +0 -2
- package/dist/cdn/MHQ5BATZ.js +0 -2
- package/dist/cdn/NJB24AIV.js +0 -2
- package/dist/cdn/NQ2IAQKL.js +0 -41
- package/dist/cdn/OEG4XCKY.js +0 -2
- package/dist/cdn/OHAQPQAP.js +0 -2
- package/dist/cdn/OYTK2VF2.js +0 -2
- package/dist/cdn/QPBWKASC.js +0 -2
- package/dist/cdn/RJ3SU3EV.js +0 -2
- package/dist/cdn/U2HTYOBB.js +0 -150
- package/dist/cdn/VLD3MVSG.js +0 -2
- package/dist/cdn/WMKG3CBK.js +0 -2
- package/dist/cdn/X4R2NVDQ.js +0 -2
- package/dist/cdn/X7C4PAJY.js +0 -2
- package/dist/cdn/YGZICQBT.js +0 -2
- package/dist/cdn/YNGFN7AY.js +0 -2
|
@@ -0,0 +1,593 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
import { c as A } from "../../chunks/runtime.js";
|
|
3
|
+
import { repeat as F } from "lit/directives/repeat.js";
|
|
4
|
+
import O from "@arcgis/core/portal/PortalItem.js";
|
|
5
|
+
import { LitElement as _, createEvent as E, safeClassMap as N } from "@arcgis/lumina";
|
|
6
|
+
import { css as W, html as g } from "lit";
|
|
7
|
+
import { createRef as H, ref as j } from "lit/directives/ref.js";
|
|
8
|
+
import { Task as J } from "@lit/task";
|
|
9
|
+
import { log as $ } from "@arcgis/toolkit/log";
|
|
10
|
+
import { u as k } from "../../chunks/useT9n.js";
|
|
11
|
+
import { i as V, a as z, b as w } from "../../chunks/item2.js";
|
|
12
|
+
import { g as Q } from "../../chunks/help.js";
|
|
13
|
+
import { c as X, a as Y, g as Z } from "../../chunks/portal.js";
|
|
14
|
+
import { g as L } from "../../chunks/portal-item-status-card.js";
|
|
15
|
+
import "../arcgis-portal-item-preview/customElement.js";
|
|
16
|
+
import "../arcgis-portal-preview-panel/customElement.js";
|
|
17
|
+
import { c as ee } from "../../chunks/previewSessionController.js";
|
|
18
|
+
import { r as y, f as te, c as re } from "../../chunks/request.js";
|
|
19
|
+
import { s as se } from "../../chunks/item.js";
|
|
20
|
+
import { i as b } from "../../chunks/functionalities.js";
|
|
21
|
+
import { d as ie } from "../../chunks/groups.js";
|
|
22
|
+
import { substitute as P } from "@arcgis/core/intl.js";
|
|
23
|
+
const ae = W`:host{display:block}calcite-dialog{--calcite-dialog-content-space: 0;--calcite-dialog-content-top-space: 0;--calcite-dialog-content-bottom-space: 0;--calcite-dialog-size-x: 1080px;--calcite-dialog-size-y: min(922px, 75vh)}.header{font:var(--calcite-font-weight-medium) var(--calcite-font-size-0) / 1.25rem var(--calcite-sans-family);color:var(--calcite-color-text-1);margin-block-end:.5rem}.status{font:var(--calcite-font-weight-normal) var(--calcite-font-size--1) / 1.125rem var(--calcite-sans-family);color:var(--calcite-color-text-2)}.status--error{color:var(--calcite-color-status-danger)}.content{display:grid;gap:.75rem;flex:1;min-block-size:0;position:relative}.scrim--overlay{z-index:1}.content>.status{padding:.75rem}.top-bar{color:var(--calcite-color-text-2);font:var(--calcite-font-weight-normal) var(--calcite-font-size--1) / 1.25rem var(--calcite-sans-family);margin-block-end:.25rem;padding-block-end:.75rem;border-block-end:1px solid var(--calcite-color-border-3)}.result-list,.result-sections{display:grid;gap:1rem}.results{display:grid;grid-template-columns:minmax(0,1fr);min-inline-size:0;min-block-size:0}.content--preview .results{grid-template-columns:300px minmax(0,1fr)}.review-content{box-sizing:border-box;min-inline-size:0;min-block-size:0;padding:.75rem}.content--preview .review-content{overflow:auto}.preview{min-inline-size:0;min-block-size:0}.preview arcgis-portal-preview-panel{--arcgis-portal-preview-panel-width: 100%;position:relative;display:block;block-size:100%}.preview arcgis-portal-item-preview{--calcite-panel-header-content-space: initial}@media(max-width:51rem){.content--preview .results{grid-template-columns:minmax(0,1fr);gap:.75rem;block-size:auto}.preview{inline-size:100%;block-size:min(34rem,50vh)}}.result-section{display:grid;gap:1rem;padding-block-start:.75rem}.result-section__title{color:var(--calcite-color-text-1);font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium)}`;
|
|
24
|
+
async function ne({
|
|
25
|
+
itemId: r,
|
|
26
|
+
portal: e,
|
|
27
|
+
relationship: t,
|
|
28
|
+
includeRecycleBin: s,
|
|
29
|
+
num: a,
|
|
30
|
+
nextkey: i
|
|
31
|
+
}) {
|
|
32
|
+
const { relationshipRules: l, direction: o } = t, d = `${e.restUrl}/content/items/${r}/relatedItems`, u = {
|
|
33
|
+
f: "json",
|
|
34
|
+
includeRecycleBin: s,
|
|
35
|
+
includeSystemManaged: "true",
|
|
36
|
+
excludedFlags: "legacy,exclude",
|
|
37
|
+
num: a,
|
|
38
|
+
direction: o,
|
|
39
|
+
...l?.length ? { relationshipRules: l.join(",") } : {},
|
|
40
|
+
...i != null ? { nextkey: i } : {}
|
|
41
|
+
};
|
|
42
|
+
try {
|
|
43
|
+
return {
|
|
44
|
+
result: await y({
|
|
45
|
+
url: d,
|
|
46
|
+
portal: e,
|
|
47
|
+
params: u
|
|
48
|
+
})
|
|
49
|
+
};
|
|
50
|
+
} catch (n) {
|
|
51
|
+
return console.error(n), { error: { code: "unhandledError" } };
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async function oe(r) {
|
|
55
|
+
const e = [];
|
|
56
|
+
let t = 0, s;
|
|
57
|
+
do {
|
|
58
|
+
const a = await r(s);
|
|
59
|
+
if (a.error || !a.result)
|
|
60
|
+
return { error: { code: "unhandledError" } };
|
|
61
|
+
e.push(...a.result.relatedItems), t = a.result.aggregations?.total?.count ?? t, s = a.result.nextKey;
|
|
62
|
+
} while (s != null);
|
|
63
|
+
return {
|
|
64
|
+
result: {
|
|
65
|
+
relatedItems: e,
|
|
66
|
+
countOfAccessibleItem: e.length,
|
|
67
|
+
totalCountOfRelatedItems: t
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
async function le({
|
|
72
|
+
itemId: r,
|
|
73
|
+
portal: e,
|
|
74
|
+
relationship: t,
|
|
75
|
+
includeRecycleBin: s,
|
|
76
|
+
num: a
|
|
77
|
+
}) {
|
|
78
|
+
return await oe(
|
|
79
|
+
async (i) => await ne({
|
|
80
|
+
itemId: r,
|
|
81
|
+
portal: e,
|
|
82
|
+
relationship: t,
|
|
83
|
+
includeRecycleBin: s,
|
|
84
|
+
num: a,
|
|
85
|
+
...i != null ? { nextkey: i } : {}
|
|
86
|
+
})
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
const T = {
|
|
90
|
+
needsGroupUpdate: !1,
|
|
91
|
+
needsShareLevelUpdate: !1,
|
|
92
|
+
canEditShareLevel: !0,
|
|
93
|
+
premium: !1
|
|
94
|
+
}, U = {
|
|
95
|
+
private: 0,
|
|
96
|
+
shared: 1,
|
|
97
|
+
org: 2,
|
|
98
|
+
public: 3
|
|
99
|
+
}, ce = [
|
|
100
|
+
"Location Tracking Service",
|
|
101
|
+
"Location Tracking View",
|
|
102
|
+
"IoTFeed",
|
|
103
|
+
"IoTFeatureLayer",
|
|
104
|
+
"IoTMapImageLayer",
|
|
105
|
+
"IoTStreamLayer",
|
|
106
|
+
"Administrative Report",
|
|
107
|
+
"EditExtensionIndoorsSpaces",
|
|
108
|
+
"ArcgisWorkflowJobLocation",
|
|
109
|
+
"Integration Info",
|
|
110
|
+
"Analysis Model Web Tool"
|
|
111
|
+
], de = ["Data Store", "Knowledge Graph", "Pro Project", "Workflow"], ue = [
|
|
112
|
+
"Vector Tile Service",
|
|
113
|
+
"Map Service",
|
|
114
|
+
"Scene Service",
|
|
115
|
+
"Feature Service"
|
|
116
|
+
];
|
|
117
|
+
function pe(r, e) {
|
|
118
|
+
const t = ce.some((o) => r.typeKeywords?.includes(o)), s = r.type === "Image Service" && r.url?.includes("://iservices") && r.url.includes("arcgis.com"), a = r.type === "Geoprocessing Service" && r.typeKeywords?.includes("Notebook Web Tool"), i = b(de, r.type), l = r.type === "Parquet Feature Layer" && e.isPortal;
|
|
119
|
+
return t || s || a || i || l;
|
|
120
|
+
}
|
|
121
|
+
function he(r) {
|
|
122
|
+
return r.typeKeywords?.includes("Hosted Service") && b(ue, r.type);
|
|
123
|
+
}
|
|
124
|
+
const me = ["Trial Developer", "Developer", "Developer Subscription"], ge = [
|
|
125
|
+
"needEditableLayers",
|
|
126
|
+
"needsShareLevelUpdateLayers"
|
|
127
|
+
], fe = [
|
|
128
|
+
"needPubliclyEditableLayers",
|
|
129
|
+
"needDataCollectionLayers",
|
|
130
|
+
"premiumLayers",
|
|
131
|
+
"notEditableLayers",
|
|
132
|
+
"needAuthentication"
|
|
133
|
+
];
|
|
134
|
+
async function ve({
|
|
135
|
+
sharingDetailResult: r,
|
|
136
|
+
mainAccess: e,
|
|
137
|
+
developerPortal: t,
|
|
138
|
+
portal: s
|
|
139
|
+
}) {
|
|
140
|
+
const { sourceItem: a, detail: i } = r, { canEditShareLevel: l, needsGroupUpdate: o, needsShareLevelUpdate: d, premium: u } = i;
|
|
141
|
+
return !o && !d && !u ? null : !l && !u ? "notEditableLayers" : e === "public" ? u ? "premiumLayers" : a.access !== "public" && t && he(a) ? "notEditableLayers" : a.access !== "public" && await V(a, s) ? a.typeKeywords.includes("Public Data Collection") ? "needEditableLayers" : "needDataCollectionLayers" : "needsShareLevelUpdateLayers" : u ? null : "needsShareLevelUpdateLayers";
|
|
142
|
+
}
|
|
143
|
+
function ye(r) {
|
|
144
|
+
return !!(r && b(me, r));
|
|
145
|
+
}
|
|
146
|
+
function R(r, e) {
|
|
147
|
+
if (!r)
|
|
148
|
+
return [];
|
|
149
|
+
const t = e === "updatable" ? ge : fe, s = /* @__PURE__ */ new Map();
|
|
150
|
+
return t.forEach((a) => {
|
|
151
|
+
r[a].forEach((i) => {
|
|
152
|
+
s.has(i.sourceItem.id) || s.set(i.sourceItem.id, {
|
|
153
|
+
itemResult: i,
|
|
154
|
+
state: a
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
}), Array.from(s.values());
|
|
158
|
+
}
|
|
159
|
+
function we({
|
|
160
|
+
mainAccess: r,
|
|
161
|
+
sourceItem: e,
|
|
162
|
+
sourceGroups: t,
|
|
163
|
+
mainGroupIds: s,
|
|
164
|
+
isMainItemSharedWithCollabGroups: a,
|
|
165
|
+
sourceHasSameOwningSystem: i,
|
|
166
|
+
portalIsPortal: l
|
|
167
|
+
}) {
|
|
168
|
+
const o = { ...T }, d = new Set((t ?? []).map((c) => c.id)), u = r === "public";
|
|
169
|
+
if (u && pe(e, { isPortal: l }))
|
|
170
|
+
return { ...o, needsShareLevelUpdate: !0, canEditShareLevel: !1 };
|
|
171
|
+
const n = e.access;
|
|
172
|
+
return n !== "public" ? (o.canEditShareLevel = be(e.itemControl), o.needsShareLevelUpdate = Se(r, n), o.needsGroupUpdate = (!u || a) && x(s, d), o) : (o.premium = Ee(e), o.needsGroupUpdate = Ie({
|
|
173
|
+
sourceItem: e,
|
|
174
|
+
isMainItemSharedToPublic: u,
|
|
175
|
+
isMainItemSharedWithCollabGroups: a,
|
|
176
|
+
mainGroupIds: s,
|
|
177
|
+
sourceGroupIds: d,
|
|
178
|
+
sourceHasSameOwningSystem: i
|
|
179
|
+
}), o);
|
|
180
|
+
}
|
|
181
|
+
function be(r) {
|
|
182
|
+
return r === "admin" || r === "update";
|
|
183
|
+
}
|
|
184
|
+
function Se(r, e) {
|
|
185
|
+
return !(e === "private" && r === "shared") && U[r] > U[e];
|
|
186
|
+
}
|
|
187
|
+
function Ie({
|
|
188
|
+
sourceItem: r,
|
|
189
|
+
isMainItemSharedToPublic: e,
|
|
190
|
+
isMainItemSharedWithCollabGroups: t,
|
|
191
|
+
mainGroupIds: s,
|
|
192
|
+
sourceGroupIds: a,
|
|
193
|
+
sourceHasSameOwningSystem: i
|
|
194
|
+
}) {
|
|
195
|
+
return !e || !t || r.owner === "esri_apps" || !i ? !1 : x(s, a);
|
|
196
|
+
}
|
|
197
|
+
function x(r, e) {
|
|
198
|
+
for (const t of r)
|
|
199
|
+
if (!e.has(t))
|
|
200
|
+
return !0;
|
|
201
|
+
return !1;
|
|
202
|
+
}
|
|
203
|
+
function Ee(r) {
|
|
204
|
+
const e = r.owner?.toLowerCase() ?? "", t = r.typeKeywords ?? [];
|
|
205
|
+
return e.includes("esri") && (t.includes("Requires Credits") || t.includes("Requires Subscription"));
|
|
206
|
+
}
|
|
207
|
+
async function $e(r) {
|
|
208
|
+
const e = await B(r);
|
|
209
|
+
return e.error || !e.result ? { error: e.error ?? { code: "unhandledError" } } : { result: e.result.buckets };
|
|
210
|
+
}
|
|
211
|
+
async function B({
|
|
212
|
+
portal: r,
|
|
213
|
+
mainItems: e
|
|
214
|
+
}) {
|
|
215
|
+
try {
|
|
216
|
+
const t = await ke(r, e);
|
|
217
|
+
if (t.error || !t.result)
|
|
218
|
+
return { error: t.error ?? { code: "unhandledError" } };
|
|
219
|
+
const s = await Le({ portal: r, mainItems: t.result });
|
|
220
|
+
return s.error || !s.result ? { error: s.error ?? { code: "unhandledError" } } : { result: { mainItems: t.result, buckets: s.result } };
|
|
221
|
+
} catch (t) {
|
|
222
|
+
return console.error(t), { error: { code: "unhandledError" } };
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
async function ke(r, e) {
|
|
226
|
+
const t = [];
|
|
227
|
+
for (const { id: i } of e) {
|
|
228
|
+
if (!i)
|
|
229
|
+
return console.error("Main items must have an ID to refresh sharing metadata."), { error: { code: "unhandledError" } };
|
|
230
|
+
t.push(i);
|
|
231
|
+
}
|
|
232
|
+
const s = await Promise.all(t.map(async (i) => await z(r, i))), a = [];
|
|
233
|
+
for (const i of s) {
|
|
234
|
+
if (i.error || !i.result)
|
|
235
|
+
return console.error("Unable to load current main item sharing metadata.", i.error), { error: i.error ?? { code: "unhandledError" } };
|
|
236
|
+
a.push(i.result);
|
|
237
|
+
}
|
|
238
|
+
return { result: a };
|
|
239
|
+
}
|
|
240
|
+
async function Le({
|
|
241
|
+
portal: r,
|
|
242
|
+
mainItems: e
|
|
243
|
+
}) {
|
|
244
|
+
if (!e.length)
|
|
245
|
+
return { error: { code: "unhandledError", message: "At least one main item is required." } };
|
|
246
|
+
const t = e.filter((n) => n.access !== "private");
|
|
247
|
+
if (!t.length)
|
|
248
|
+
return { result: C() };
|
|
249
|
+
const s = C(), a = X(r), i = ye(a.subscriptionInfo?.type);
|
|
250
|
+
for (const n of t) {
|
|
251
|
+
if (!se(n))
|
|
252
|
+
continue;
|
|
253
|
+
const c = {
|
|
254
|
+
mainItemId: n.id,
|
|
255
|
+
sourceItem: n,
|
|
256
|
+
detail: { ...T }
|
|
257
|
+
};
|
|
258
|
+
s.needAuthentication.push(c), s.allRelatedItems.push(c);
|
|
259
|
+
}
|
|
260
|
+
const l = /* @__PURE__ */ new Map();
|
|
261
|
+
for (const n of t) {
|
|
262
|
+
const { result: c, error: p } = await Pe(r, n.id);
|
|
263
|
+
if (p || !c)
|
|
264
|
+
return { error: p ?? { code: "unhandledError" } };
|
|
265
|
+
l.set(n.id, c);
|
|
266
|
+
}
|
|
267
|
+
const o = /* @__PURE__ */ new Map();
|
|
268
|
+
for (const n of t)
|
|
269
|
+
l.get(n.id)?.length && o.set(n.id, await w(r, n.id));
|
|
270
|
+
const u = t.some(
|
|
271
|
+
(n) => n.access === "public" && o.get(n.id)?.some((c) => c.capabilities?.includes("distributed")) && l.get(n.id)?.some((c) => c.access === "public" && c.owner !== "esri_apps" && c.url)
|
|
272
|
+
) ? await D(r, r.restUrl) : void 0;
|
|
273
|
+
for (const n of t) {
|
|
274
|
+
const c = l.get(n.id) ?? [];
|
|
275
|
+
if (!c.length)
|
|
276
|
+
continue;
|
|
277
|
+
const p = o.get(n.id) ?? [], h = new Set(p.map((m) => m.id)), S = p.some(
|
|
278
|
+
(m) => m.capabilities?.includes("distributed")
|
|
279
|
+
), q = await Promise.all(
|
|
280
|
+
c.map(async (m) => {
|
|
281
|
+
const f = await w(r, m.id);
|
|
282
|
+
let I = !1;
|
|
283
|
+
if (n.access === "public" && m.access === "public" && S && m.owner !== "esri_apps" && m.url && [...h].some((v) => !f.some((K) => K.id === v))) {
|
|
284
|
+
const v = await D(r, m.url);
|
|
285
|
+
I = !!(v && u && v === u);
|
|
286
|
+
}
|
|
287
|
+
const G = we({
|
|
288
|
+
mainAccess: n.access,
|
|
289
|
+
sourceItem: m,
|
|
290
|
+
sourceGroups: f,
|
|
291
|
+
mainGroupIds: h,
|
|
292
|
+
isMainItemSharedWithCollabGroups: S,
|
|
293
|
+
sourceHasSameOwningSystem: I,
|
|
294
|
+
portalIsPortal: r.isPortal
|
|
295
|
+
});
|
|
296
|
+
return { mainItemId: n.id, sourceItem: m, detail: G };
|
|
297
|
+
})
|
|
298
|
+
);
|
|
299
|
+
(await Promise.all(
|
|
300
|
+
q.map(async (m) => ({
|
|
301
|
+
itemResult: m,
|
|
302
|
+
bucket: await ve({
|
|
303
|
+
sharingDetailResult: m,
|
|
304
|
+
mainAccess: n.access,
|
|
305
|
+
developerPortal: i,
|
|
306
|
+
portal: r
|
|
307
|
+
})
|
|
308
|
+
}))
|
|
309
|
+
)).forEach(({ itemResult: m, bucket: f }) => {
|
|
310
|
+
s.allRelatedItems.push(m), f && s[f].push(m);
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
return { result: s };
|
|
314
|
+
}
|
|
315
|
+
async function D(r, e) {
|
|
316
|
+
const t = new URL(e), s = t.pathname.match(/^.*?\/rest(?:\/|$)/iu)?.[0];
|
|
317
|
+
t.pathname = `${(s ?? t.pathname).replace(/\/$/u, "")}/info`, t.search = "", t.hash = "";
|
|
318
|
+
const a = t.href;
|
|
319
|
+
try {
|
|
320
|
+
return (await te({
|
|
321
|
+
key: "portalInfo",
|
|
322
|
+
id: a,
|
|
323
|
+
requester: async () => await y({
|
|
324
|
+
url: a,
|
|
325
|
+
portal: r,
|
|
326
|
+
options: { addTokenManually: !1, disableIdentityLookup: !0 }
|
|
327
|
+
})
|
|
328
|
+
})).owningSystemUrl;
|
|
329
|
+
} catch (i) {
|
|
330
|
+
throw re("portalInfo", a), i;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
async function Pe(r, e) {
|
|
334
|
+
const t = /* @__PURE__ */ new Map(), { error: s, result: a } = await le({
|
|
335
|
+
itemId: e,
|
|
336
|
+
portal: r,
|
|
337
|
+
relationship: { direction: "reverse" }
|
|
338
|
+
});
|
|
339
|
+
if (s || !a)
|
|
340
|
+
return { error: s ?? { code: "unhandledError" } };
|
|
341
|
+
for (const i of a.relatedItems)
|
|
342
|
+
i.id !== e && t.set(i.id, i);
|
|
343
|
+
return { result: Array.from(t.values()) };
|
|
344
|
+
}
|
|
345
|
+
const C = () => ({
|
|
346
|
+
allRelatedItems: [],
|
|
347
|
+
needEditableLayers: [],
|
|
348
|
+
needPubliclyEditableLayers: [],
|
|
349
|
+
needDataCollectionLayers: [],
|
|
350
|
+
needsShareLevelUpdateLayers: [],
|
|
351
|
+
premiumLayers: [],
|
|
352
|
+
notEditableLayers: [],
|
|
353
|
+
needAuthentication: []
|
|
354
|
+
});
|
|
355
|
+
async function Ue({
|
|
356
|
+
portal: r,
|
|
357
|
+
mainItems: e,
|
|
358
|
+
sourceItems: t,
|
|
359
|
+
shareLevel: s,
|
|
360
|
+
updateGroups: a
|
|
361
|
+
}) {
|
|
362
|
+
if (!t.length)
|
|
363
|
+
return { result: [] };
|
|
364
|
+
try {
|
|
365
|
+
const i = a ? await Re(
|
|
366
|
+
r,
|
|
367
|
+
e,
|
|
368
|
+
s === "public" || e.every(({ access: p }) => p === "public")
|
|
369
|
+
) : [], l = {
|
|
370
|
+
confirmItemControl: !0,
|
|
371
|
+
...i.length ? { groups: i.join(",") } : {},
|
|
372
|
+
...s ? De(s) : {}
|
|
373
|
+
}, o = Y(r), d = r.user;
|
|
374
|
+
if (d && t.every(({ owner: p }) => p === d.username)) {
|
|
375
|
+
const { results: p } = await y({
|
|
376
|
+
url: `${o}content/users/${d.username}/shareItems`,
|
|
377
|
+
portal: r,
|
|
378
|
+
params: { ...l, items: t.map(({ id: h }) => h).join(",") },
|
|
379
|
+
method: "post"
|
|
380
|
+
});
|
|
381
|
+
return M(p, t);
|
|
382
|
+
}
|
|
383
|
+
const u = await Promise.allSettled(
|
|
384
|
+
t.map(async ({ id: p }) => {
|
|
385
|
+
const h = await y({
|
|
386
|
+
url: `${o}content/items/${p}/share`,
|
|
387
|
+
portal: r,
|
|
388
|
+
params: l,
|
|
389
|
+
method: "post"
|
|
390
|
+
});
|
|
391
|
+
return { ...h, success: !h.error && !h.notSharedWith?.length };
|
|
392
|
+
})
|
|
393
|
+
), n = [];
|
|
394
|
+
let c = !1;
|
|
395
|
+
return u.forEach((p) => {
|
|
396
|
+
p.status === "fulfilled" ? n.push(p.value) : (c = !0, console.error("Unable to update related item sharing", p.reason));
|
|
397
|
+
}), c ? { result: n, error: { code: "unhandledError" } } : M(n, t);
|
|
398
|
+
} catch (i) {
|
|
399
|
+
return console.error("Unable to update related item sharing", i), { error: { code: "unhandledError" } };
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
async function Re(r, e, t) {
|
|
403
|
+
if (!e.length)
|
|
404
|
+
throw new Error("Main items are required to update group sharing.");
|
|
405
|
+
const s = await Promise.all(e.map(async ({ id: l }) => await w(r, l))), a = s.slice(1).map((l) => new Set(l.map(({ id: o }) => o))), i = /* @__PURE__ */ new Set();
|
|
406
|
+
return s[0].filter((l) => {
|
|
407
|
+
const { id: o } = l;
|
|
408
|
+
return i.has(o) || !a.every((d) => d.has(o)) || t && !ie(l) ? !1 : (i.add(o), !0);
|
|
409
|
+
}).map(({ id: l }) => l);
|
|
410
|
+
}
|
|
411
|
+
function De(r) {
|
|
412
|
+
return {
|
|
413
|
+
org: r === "org",
|
|
414
|
+
everyone: r === "public"
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
function M(r, e) {
|
|
418
|
+
const t = r.filter(
|
|
419
|
+
({ success: a, error: i, notSharedWith: l }) => !a || i || l?.length
|
|
420
|
+
), s = new Set(r.map(({ itemId: a }) => a));
|
|
421
|
+
return r.length !== e.length || s.size !== e.length || e.some(({ id: a }) => !s.has(a)) || t.length ? (console.error("Some related items were not successfully shared.", r), { result: r, error: { code: "unhandledError" } }) : { result: r };
|
|
422
|
+
}
|
|
423
|
+
class Ce extends _ {
|
|
424
|
+
constructor() {
|
|
425
|
+
super(...arguments), this.messages = k({ blocking: !0 }), this.analysisRequestId = 0, this.statusMessages = k({ name: "portal-item-status-card", blocking: !0 }), this.previewElement = H(), this.displayItemsById = /* @__PURE__ */ new Map(), this.previewSession = ee({
|
|
426
|
+
onOpen: ({ preview: e }) => {
|
|
427
|
+
const { updatable: t, nonUpdatable: s } = this.displayItems;
|
|
428
|
+
this.previewItem = [...t, ...s].find(({ itemResult: a }) => a.sourceItem.id === e.id);
|
|
429
|
+
},
|
|
430
|
+
onClose: () => {
|
|
431
|
+
this.previewItem = void 0;
|
|
432
|
+
}
|
|
433
|
+
}), this.previewTask = new J(this, {
|
|
434
|
+
args: () => [this.previewItem, this.portal],
|
|
435
|
+
task: async ([e, t]) => {
|
|
436
|
+
if (!e)
|
|
437
|
+
return;
|
|
438
|
+
const s = await z(t, e.itemResult.sourceItem.id);
|
|
439
|
+
if (s.error || !s.result)
|
|
440
|
+
return $("error", this, "Unable to load review item preview.", { detail: { error: s.error } }), { error: !0 };
|
|
441
|
+
const a = L(e.state), i = a?.i18nKey === "pdc" ? "120004130" : a?.i18nKey === "premium" ? "120001307" : void 0, l = i ? await Q(t, this.messages._lang) : void 0, o = i ? l?.[i] : void 0, d = this.createDisplayItem(s.result, t);
|
|
442
|
+
return await d.load(), {
|
|
443
|
+
item: d,
|
|
444
|
+
helpUrl: o ? `${Z(t)}${o}` : void 0
|
|
445
|
+
};
|
|
446
|
+
},
|
|
447
|
+
onComplete: () => {
|
|
448
|
+
this.focusPreview();
|
|
449
|
+
},
|
|
450
|
+
onError: (e) => {
|
|
451
|
+
$("error", this, "Unable to load review item preview.", { detail: { error: e } });
|
|
452
|
+
}
|
|
453
|
+
}), this.loading = !1, this.updatingSharing = !1, this.open = !1, this.arcgisClose = E(), this.arcgisComplete = E();
|
|
454
|
+
}
|
|
455
|
+
static {
|
|
456
|
+
this.properties = { loading: 16, buckets: 16, errorMessage: 16, updatingSharing: 16, updateError: 16, previewItem: 16, portal: 0, items: 0, open: 5 };
|
|
457
|
+
}
|
|
458
|
+
static {
|
|
459
|
+
this.styles = ae;
|
|
460
|
+
}
|
|
461
|
+
willUpdate(e) {
|
|
462
|
+
if (e.has("open") || e.has("items") || e.has("portal")) {
|
|
463
|
+
this.updateError = void 0, this.previewItem = void 0, this.displayItemsById.clear();
|
|
464
|
+
const t = ++this.analysisRequestId;
|
|
465
|
+
this.open && this.analyzeLayerSharing(t);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
async analyzeLayerSharing(e) {
|
|
469
|
+
this.loading = !0, this.buckets = void 0, this.errorMessage = void 0;
|
|
470
|
+
const t = await $e({
|
|
471
|
+
portal: this.portal,
|
|
472
|
+
mainItems: this.items
|
|
473
|
+
});
|
|
474
|
+
if (!(e !== this.analysisRequestId || !this.open)) {
|
|
475
|
+
if (this.loading = !1, t.error || !t.result) {
|
|
476
|
+
this.errorMessage = this.messages.analysisError;
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
this.buckets = t.result;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
closeDialog() {
|
|
483
|
+
!this.open || this.updatingSharing || (this.open = !1, this.arcgisClose.emit());
|
|
484
|
+
}
|
|
485
|
+
get displayItems() {
|
|
486
|
+
return {
|
|
487
|
+
nonUpdatable: R(this.buckets, "nonUpdatable"),
|
|
488
|
+
updatable: R(this.buckets, "updatable")
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
getDisplayItem(e) {
|
|
492
|
+
let t = this.displayItemsById.get(e.id);
|
|
493
|
+
return t || (t = this.createDisplayItem(e), this.displayItemsById.set(e.id, t)), t;
|
|
494
|
+
}
|
|
495
|
+
createDisplayItem(e, t = this.portal) {
|
|
496
|
+
return new O({
|
|
497
|
+
id: e.id,
|
|
498
|
+
title: e.title,
|
|
499
|
+
owner: e.owner,
|
|
500
|
+
access: e.access,
|
|
501
|
+
type: e.type,
|
|
502
|
+
typeKeywords: e.typeKeywords,
|
|
503
|
+
snippet: e.snippet,
|
|
504
|
+
url: e.url,
|
|
505
|
+
modified: new Date(e.modified),
|
|
506
|
+
sourceJSON: e,
|
|
507
|
+
portal: t
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
async updateSharing() {
|
|
511
|
+
if (this.updatingSharing || !this.buckets || !this.displayItems.updatable.length)
|
|
512
|
+
return;
|
|
513
|
+
const e = this.buckets, t = this.analysisRequestId, s = this.portal;
|
|
514
|
+
this.updatingSharing = !0, this.updateError = void 0;
|
|
515
|
+
const a = await B({ portal: s, mainItems: this.items });
|
|
516
|
+
if (t !== this.analysisRequestId || !this.open) {
|
|
517
|
+
this.updatingSharing = !1;
|
|
518
|
+
return;
|
|
519
|
+
}
|
|
520
|
+
if (a.error || !a.result) {
|
|
521
|
+
this.updatingSharing = !1, this.updateError = this.messages.updateError;
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
524
|
+
const { mainItems: i, buckets: l } = a.result;
|
|
525
|
+
this.buckets = l, this.previewItem = void 0, this.displayItemsById.clear();
|
|
526
|
+
const o = [...l.needEditableLayers, ...l.needsShareLevelUpdateLayers];
|
|
527
|
+
if (!o.length) {
|
|
528
|
+
this.updatingSharing = !1;
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
531
|
+
const d = Array.from(new Map(o.map(({ sourceItem: h }) => [h.id, h])).values()), u = o.some(({ detail: h }) => h.needsShareLevelUpdate), n = o.some(({ detail: h }) => h.needsGroupUpdate), c = i[0]?.access;
|
|
532
|
+
if (u && (!c || i.some((h) => h.access !== c))) {
|
|
533
|
+
this.updatingSharing = !1, this.updateError = this.messages.updateError;
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
const p = await Ue({
|
|
537
|
+
portal: s,
|
|
538
|
+
mainItems: i,
|
|
539
|
+
sourceItems: d,
|
|
540
|
+
shareLevel: u ? c : void 0,
|
|
541
|
+
updateGroups: n
|
|
542
|
+
});
|
|
543
|
+
if (this.updatingSharing = !1, !(t !== this.analysisRequestId || !this.open)) {
|
|
544
|
+
if (p.error) {
|
|
545
|
+
this.updateError = this.messages.updateError;
|
|
546
|
+
const h = ++this.analysisRequestId;
|
|
547
|
+
this.analyzeLayerSharing(h);
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
this.open = !1, this.arcgisComplete.emit({ updatedSourceItems: d, oldSharingDetail: e });
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
async focusPreview() {
|
|
554
|
+
await this.updateComplete, await this.previewElement.value?.setFocus();
|
|
555
|
+
}
|
|
556
|
+
async closePreview() {
|
|
557
|
+
this.previewItem = void 0, await this.updateComplete, await this.previewSession.closePreview({ restoreFocus: !0 });
|
|
558
|
+
}
|
|
559
|
+
renderResultSection(e, t) {
|
|
560
|
+
return t.length ? g`<section class="result-section"><div class="result-section__title">${e}</div><div class="result-list">${F(t, ({ itemResult: s, state: a }) => `${a}-${s.mainItemId}-${s.sourceItem.id}`, ({ itemResult: s, state: a }) => g`<arcgis-portal-item-status-card .item=${this.getDisplayItem(s.sourceItem)} .portal=${this.portal} .previewed=${this.previewItem?.itemResult.sourceItem.id === s.sourceItem.id} @arcgisItemBrowserCardPreview=${(i) => {
|
|
561
|
+
i.stopPropagation(), !i.detail || this.previewItem?.itemResult.sourceItem.id === i.detail.id ? this.closePreview() : this.previewSession.handlePreview(i.detail, i.composedPath()[0]);
|
|
562
|
+
}} .state=${a}></arcgis-portal-item-status-card>`)}</div></section>` : null;
|
|
563
|
+
}
|
|
564
|
+
renderPreview() {
|
|
565
|
+
if (!this.previewItem)
|
|
566
|
+
return null;
|
|
567
|
+
const e = L(this.previewItem.state);
|
|
568
|
+
return g`<aside class="preview"><arcgis-portal-preview-panel open @arcgisOpen=${() => {
|
|
569
|
+
this.focusPreview();
|
|
570
|
+
}} @arcgisClose=${(t) => {
|
|
571
|
+
t.stopPropagation(), this.closePreview();
|
|
572
|
+
}}>${this.previewTask.render({
|
|
573
|
+
error: () => this.renderPreviewError(),
|
|
574
|
+
complete: (t) => t && "item" in t ? g`<arcgis-portal-item-preview .item=${t.item} .portal=${this.portal} @arcgisClose=${(s) => {
|
|
575
|
+
s.stopPropagation(), this.closePreview();
|
|
576
|
+
}} ${j(this.previewElement)}>${e && g`<calcite-notice slot=summary-top open .kind=${e.kind}><div slot=message>${this.statusMessages.status[e.i18nKey].panel}</div>${t.helpUrl && (e.i18nKey === "pdc" || e.i18nKey === "premium") && g`<calcite-link slot=link .href=${t.helpUrl} target=_blank rel=noopener icon-end=launch>${this.statusMessages.status[e.i18nKey].learnMore}</calcite-link>` || ""}</calcite-notice>` || ""}</arcgis-portal-item-preview>` : this.renderPreviewError()
|
|
577
|
+
})}</arcgis-portal-preview-panel></aside>`;
|
|
578
|
+
}
|
|
579
|
+
renderPreviewError() {
|
|
580
|
+
return g`<div class="status status--error" role=alert>${this.messages.previewError}</div>`;
|
|
581
|
+
}
|
|
582
|
+
render() {
|
|
583
|
+
const { messages: e, displayItems: t, errorMessage: s, buckets: a, loading: i, open: l, portal: o, updatingSharing: d, updateError: u } = this;
|
|
584
|
+
if (!e._lang)
|
|
585
|
+
return;
|
|
586
|
+
const { nonUpdatable: n, updatable: c } = t, p = c.length > 0 || n.length > 0;
|
|
587
|
+
return g`<calcite-dialog .heading=${e.heading} modal .open=${l} outside-close-disabled escape-disabled overlay-positioning=fixed placement=center scale=l @calciteDialogClose=${this.closeDialog}><div class=${N({ content: !0, "content--preview": !!this.previewItem })}>${d && g`<calcite-scrim class="scrim--overlay" role=status><calcite-loader .label=${e.updatingSharing}></calcite-loader></calcite-scrim>` || ""}${i && g`<div class="status">${e.loadingSourceItems}</div>` || ""}${s && g`<div class="status status--error">${s}</div>` || ""}${u && g`<div class="status status--error" role=alert>${u}</div>` || ""}${!i && !s && a ? g`<div class="results">${this.renderPreview()}<div class="review-content"><div class="top-bar" .innerHTML=${e[o.isPortal ? "noticeEnterprise" : "notice"] ?? ""}></div>${p ? g`<div class="result-sections">${this.renderResultSection(P(e.updatableSectionTitle, { count: c.length }), c)}${this.renderResultSection(P(e.nonUpdatableSectionTitle, { count: n.length }), n)}</div>` : g`<div class="status">${e.noIssues}</div>`}</div></div>` : null}</div><calcite-button slot=footer-end appearance=outline .disabled=${d} @click=${this.closeDialog}>${e.close}</calcite-button>${c.length > 0 && g`<calcite-button slot=footer-end .disabled=${d} @click=${this.updateSharing}>${e.updateSharing}</calcite-button>` || ""}</calcite-dialog>`;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
A("arcgis-portal-review-layer-sharing", Ce);
|
|
591
|
+
export {
|
|
592
|
+
Ce as ArcgisPortalReviewLayerSharing
|
|
593
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./customElement.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "../arcgis-portal-item-status-card/index.js";
|
|
2
|
+
import "../arcgis-portal-preview-panel/index.js";
|
|
3
|
+
import "../arcgis-portal-item-preview/index.js";
|
|
4
|
+
import "@esri/calcite-components/components/calcite-notice";
|
|
5
|
+
import "@esri/calcite-components/components/calcite-link";
|
|
6
|
+
import "@esri/calcite-components/components/calcite-dialog";
|
|
7
|
+
import "@esri/calcite-components/components/calcite-scrim";
|
|
8
|
+
import "@esri/calcite-components/components/calcite-loader";
|
|
9
|
+
import "@esri/calcite-components/components/calcite-button";
|
|
10
|
+
export * from "./customElement.js";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ItemSourceJSON } from "../../types/item.js";
|
|
2
|
+
|
|
3
|
+
export type ReviewLayerSharingBuckets = {
|
|
4
|
+
allRelatedItems: ReviewLayerSharingItemResult[];
|
|
5
|
+
needEditableLayers: ReviewLayerSharingItemResult[];
|
|
6
|
+
needPubliclyEditableLayers: ReviewLayerSharingItemResult[];
|
|
7
|
+
needDataCollectionLayers: ReviewLayerSharingItemResult[];
|
|
8
|
+
needsShareLevelUpdateLayers: ReviewLayerSharingItemResult[];
|
|
9
|
+
premiumLayers: ReviewLayerSharingItemResult[];
|
|
10
|
+
notEditableLayers: ReviewLayerSharingItemResult[];
|
|
11
|
+
needAuthentication: ReviewLayerSharingItemResult[];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type ReviewLayerSharingIssueState = Exclude<keyof ReviewLayerSharingBuckets, "allRelatedItems">;
|
|
15
|
+
|
|
16
|
+
export type ReviewLayerSharingItemResult = {
|
|
17
|
+
mainItemId: string;
|
|
18
|
+
sourceItem: ItemSourceJSON;
|
|
19
|
+
detail: ReviewLayerSharingDetail;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export interface ReviewLayerSharingDetail {
|
|
23
|
+
needsGroupUpdate: boolean;
|
|
24
|
+
needsShareLevelUpdate: boolean;
|
|
25
|
+
canEditShareLevel: boolean;
|
|
26
|
+
premium: boolean;
|
|
27
|
+
}
|
|
@@ -16,7 +16,7 @@ import { d as M, g as F } from "../../chunks/string.js";
|
|
|
16
16
|
import { g as G } from "../../chunks/user2.js";
|
|
17
17
|
import { g as S } from "../../chunks/url.js";
|
|
18
18
|
import { f as x, r as P } from "../../chunks/request.js";
|
|
19
|
-
import {
|
|
19
|
+
import { a as A } from "../../chunks/portal.js";
|
|
20
20
|
async function D(l, e, r, o) {
|
|
21
21
|
const t = l.owner ?? "";
|
|
22
22
|
if (U(l) === "public_authoritative") {
|