@arcgis/portal-components 5.2.0-next.60 → 5.2.0-next.62
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/2YI5PHJ6.js +2 -0
- package/dist/cdn/{25BWGJFT.js → 332KSPIN.js} +1 -1
- package/dist/cdn/5KADGOPQ.js +2 -0
- package/dist/cdn/6RLJVPF6.js +2 -0
- package/dist/cdn/CG4WYBHN.js +2 -0
- package/dist/cdn/{NMAP3FYP.js → DML7662F.js} +1 -1
- package/dist/cdn/{UL2NWFFH.js → EEELQMTE.js} +1 -1
- package/dist/cdn/{IXATTQKO.js → G2KWSRCG.js} +1 -1
- package/dist/cdn/JZTBGLFH.js +2 -0
- package/dist/cdn/{R2CAXYXG.js → KZVNGOD4.js} +99 -83
- package/dist/cdn/{5DE3XVTY.js → L2BME3WC.js} +1 -1
- package/dist/cdn/{UDTQ7U6L.js → LUT4IGPP.js} +1 -1
- package/dist/cdn/{IZOGASBD.js → PGCNY5GO.js} +1 -1
- package/dist/cdn/QCJQXOSH.js +2 -0
- package/dist/cdn/SOJU4OFZ.js +2 -0
- package/dist/cdn/{6LMJGR6F.js → WEJQVIN4.js} +1 -1
- package/dist/cdn/XW42SAEJ.js +2 -0
- package/dist/cdn/{THRK2DGY.js → ZK2VXTNX.js} +1 -1
- package/dist/cdn/{5VMPZXL3.js → ZXIRKL4X.js} +1 -1
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/portal-navigation/apps/notebook.avif +0 -0
- package/dist/cdn/assets/portal-navigation/t9n/messages.en.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/portal-browser.js +0 -3
- package/dist/components/arcgis-portal-account-switcher/customElement.d.ts +3 -2
- package/dist/components/arcgis-portal-account-switcher/customElement.js +98 -92
- package/dist/components/arcgis-portal-ai-assistant/agents/types.d.ts +52 -16
- package/dist/components/arcgis-portal-ai-assistant/customElement.d.ts +28 -2
- package/dist/components/arcgis-portal-ai-assistant/customElement.js +1206 -673
- package/dist/components/arcgis-portal-browser/customElement.js +2 -5
- package/dist/components/arcgis-portal-browser/utils/store.d.ts +7 -3
- package/dist/components/arcgis-portal-classification-config/customElement.js +6 -6
- package/dist/components/arcgis-portal-group-browser/customElement.d.ts +174 -0
- package/dist/components/arcgis-portal-group-browser/customElement.js +66 -68
- package/dist/components/arcgis-portal-group-browser/types.d.ts +3 -3
- package/dist/components/arcgis-portal-navigation/customElement.d.ts +7 -0
- package/dist/components/arcgis-portal-navigation/customElement.js +422 -417
- package/dist/components/arcgis-portal-navigation/index.js +0 -2
- package/dist/components/portal-browser/components/portal-browser-filter/customElement.js +14 -0
- package/dist/components/{arcgis-portal-browser-filter → portal-browser/components/portal-browser-filter}/index.js +0 -1
- package/dist/components/portal-browser/components/portal-browser-filter-date/customElement.js +59 -0
- package/dist/components/{arcgis-portal-browser-filter-date → portal-browser/components/portal-browser-filter-date}/index.js +1 -2
- package/dist/components/portal-browser/components/portal-browser-filter-date/portal-browser-filter-date.d.ts +122 -0
- package/dist/components/portal-browser/components/portal-browser-filters/customElement.js +11 -0
- package/dist/components/portal-group-browser-filters/customElement.js +113 -86
- package/dist/components/portal-group-browser-filters/index.js +0 -3
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.css-custom-data.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 +0 -24
- package/dist/loader.js +3 -6
- package/dist/types/lumina.d.ts +3 -19
- package/dist/types/preact.d.ts +3 -22
- package/dist/types/react.d.ts +3 -25
- package/dist/types/stencil.d.ts +3 -19
- package/package.json +4 -4
- package/dist/cdn/2YEGKG66.js +0 -2
- package/dist/cdn/3527GI5O.js +0 -2
- package/dist/cdn/3Y33UPZ6.js +0 -2
- package/dist/cdn/744FUP4K.js +0 -2
- package/dist/cdn/FGJNEKPQ.js +0 -2
- package/dist/cdn/HEA66RTI.js +0 -2
- package/dist/cdn/IQFYKVRG.js +0 -2
- package/dist/cdn/JPHGWARN.js +0 -2
- package/dist/cdn/JUNNQTQU.js +0 -2
- package/dist/cdn/MNU537SB.js +0 -2
- package/dist/cdn/XMUR4HRH.js +0 -2
- package/dist/cdn/XX4U6IRN.js +0 -2
- package/dist/cdn/Y3RUZTB3.js +0 -2
- package/dist/cdn/YIU7GBUN.js +0 -2
- package/dist/cdn/ZOEF7HBV.js +0 -2
- package/dist/components/arcgis-portal-browser-filter/customElement.d.ts +0 -226
- package/dist/components/arcgis-portal-browser-filter/customElement.js +0 -32
- package/dist/components/arcgis-portal-browser-filter/index.d.ts +0 -1
- package/dist/components/arcgis-portal-browser-filter-date/customElement.d.ts +0 -233
- package/dist/components/arcgis-portal-browser-filter-date/customElement.js +0 -118
- package/dist/components/arcgis-portal-browser-filter-date/index.d.ts +0 -1
- package/dist/components/arcgis-portal-browser-filters/customElement.d.ts +0 -7
- package/dist/components/arcgis-portal-browser-filters/customElement.js +0 -29
- package/dist/components/arcgis-portal-browser-filters/index.d.ts +0 -1
- /package/dist/cdn/{F3PB42AG.js → 4E65YWCP.js} +0 -0
- /package/dist/components/{arcgis-portal-browser-filters → portal-browser/components/portal-browser-filters}/index.js +0 -0
|
@@ -1,171 +1,175 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { LitElement as
|
|
4
|
-
import { html as
|
|
2
|
+
import { c as S } from "../../chunks/runtime.js";
|
|
3
|
+
import { LitElement as b, createEvent as $, nothing as L } from "@arcgis/lumina";
|
|
4
|
+
import { html as h, svg as _ } from "lit";
|
|
5
5
|
import { s as O } from "../../chunks/portal-account-switcher.js";
|
|
6
|
-
import { g as x, a as
|
|
6
|
+
import { g as x, a as C, l as I, u as v } from "../../chunks/user.js";
|
|
7
7
|
import p from "@arcgis/core/identity/IdentityManager.js";
|
|
8
8
|
import { t as E } from "../../chunks/functionalities.js";
|
|
9
9
|
import { u as M } from "../../chunks/useT9n.js";
|
|
10
10
|
import { m as T } from "../../chunks/icons.js";
|
|
11
11
|
import { substitute as g } from "@arcgis/core/intl.js";
|
|
12
|
-
function
|
|
13
|
-
const
|
|
14
|
-
return
|
|
12
|
+
function A(n, t = "_blank", e = 582, s = 670) {
|
|
13
|
+
const i = window.screenLeft ?? 0, r = window.screenTop ?? 0, o = window.innerWidth || document.documentElement.clientWidth || window.screen.width, a = window.innerHeight || document.documentElement.clientHeight || window.screen.height, c = o / 2 - e / 2 + i, l = a / 2 - s / 2 + r, d = window.open(n, t, `scrollbars=no, width=${e}, height=${s}, top=${l}, left=${c}`);
|
|
14
|
+
return d?.focus(), d;
|
|
15
15
|
}
|
|
16
|
-
function K(
|
|
17
|
-
const e = (
|
|
16
|
+
function K(n) {
|
|
17
|
+
const e = (n || window.location.origin).split(".")[1].replace("maps", "");
|
|
18
18
|
return `https://${e ? `${e}${e === "qa" ? "ext" : ""}.` : ""}arcgis.com/sharing/rest/`;
|
|
19
19
|
}
|
|
20
|
-
function P(
|
|
21
|
-
const e = p.findOAuthInfo(
|
|
20
|
+
function P(n, t) {
|
|
21
|
+
const e = p.findOAuthInfo(n.url), {
|
|
22
22
|
/* appId = "arcgisonline", */
|
|
23
23
|
locale: s = "en",
|
|
24
|
-
expiration:
|
|
25
|
-
} = e, r = new URLSearchParams({
|
|
24
|
+
expiration: i = 3600 * 1e3
|
|
25
|
+
} = e ?? {}, r = new URLSearchParams({
|
|
26
26
|
locale: s,
|
|
27
27
|
client_id: "arcgisonline",
|
|
28
28
|
//appId!,
|
|
29
29
|
response_type: "token",
|
|
30
|
-
expiration: `${
|
|
30
|
+
expiration: `${i}`,
|
|
31
31
|
linkUserRequest: "true",
|
|
32
32
|
showSocialLogins: "true",
|
|
33
33
|
hideEnterpriseLogins: "false",
|
|
34
34
|
force_login: "true",
|
|
35
35
|
parent: window.location.origin,
|
|
36
|
-
redirect_uri: `https://${
|
|
36
|
+
redirect_uri: `https://${n.portalHostname}/home/link_account_callback.html`,
|
|
37
37
|
state: JSON.stringify({ useMessage: !0 })
|
|
38
38
|
}), o = `${K(t)}oauth2/authorize?${r.toString()}`;
|
|
39
|
-
|
|
39
|
+
A(o);
|
|
40
40
|
}
|
|
41
|
-
function W(
|
|
41
|
+
function W(n) {
|
|
42
42
|
const {
|
|
43
43
|
config: t,
|
|
44
44
|
credential: e,
|
|
45
45
|
clientId: s = "arcgisonline",
|
|
46
|
-
redirectToClientUri:
|
|
46
|
+
redirectToClientUri: i = !1,
|
|
47
47
|
displaySignoutComplete: r = !1
|
|
48
|
-
} =
|
|
48
|
+
} = n, o = new URLSearchParams({
|
|
49
49
|
display: "iframe",
|
|
50
50
|
client_id: s,
|
|
51
51
|
...e.token && { token: e.token },
|
|
52
52
|
parent: window.location.origin,
|
|
53
|
-
redirect_uri: `${t.baseUrl}
|
|
53
|
+
redirect_uri: `${t.baseUrl}signout_callback.html`,
|
|
54
54
|
state: JSON.stringify({
|
|
55
55
|
signout: !0,
|
|
56
56
|
origin: window.location.origin,
|
|
57
|
-
redirectToClientUri:
|
|
57
|
+
redirectToClientUri: i,
|
|
58
58
|
displaySignoutComplete: r
|
|
59
59
|
})
|
|
60
60
|
}), a = `${t.restBaseUrl}oauth2/signout?${o.toString()}`, c = document.createElement("iframe");
|
|
61
61
|
c.src = a, c.style.display = "none", document.body.appendChild(c);
|
|
62
62
|
}
|
|
63
|
-
function N(
|
|
64
|
-
const e =
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
function N(n, t) {
|
|
64
|
+
const e = u(n.orgUrlKey, t), s = p.findOAuthInfo(e), {
|
|
65
|
+
/* appId = "arcgisonline", */
|
|
66
|
+
locale: i = "en",
|
|
67
|
+
expiration: r = 3600 * 1e3
|
|
68
|
+
} = s ?? {}, o = k(n.provider), a = new URLSearchParams({
|
|
69
|
+
locale: i,
|
|
69
70
|
client_id: "arcgisonline",
|
|
70
71
|
//appId,
|
|
71
72
|
response_type: "token",
|
|
72
|
-
expiration: `${
|
|
73
|
+
expiration: `${r}`,
|
|
73
74
|
parent: window.location.origin,
|
|
74
|
-
...
|
|
75
|
-
...
|
|
75
|
+
...o === "social" && { socialLoginProviderName: n.provider },
|
|
76
|
+
...o === "default" && { prepopulatedusername: n.username },
|
|
76
77
|
force_login: "true",
|
|
77
|
-
redirect_uri: `${e}/home/
|
|
78
|
+
redirect_uri: `${e}/home/sign_in_callback.html`,
|
|
78
79
|
state: JSON.stringify({
|
|
79
|
-
user:
|
|
80
|
+
user: n.username,
|
|
80
81
|
server: e,
|
|
81
82
|
portalUrl: e,
|
|
82
83
|
origin: window.location.origin
|
|
83
84
|
})
|
|
84
|
-
}),
|
|
85
|
-
|
|
85
|
+
}), c = `${w(n, t)}?${a.toString()}`;
|
|
86
|
+
A(c);
|
|
86
87
|
}
|
|
87
88
|
function R({
|
|
88
|
-
account:
|
|
89
|
+
account: n,
|
|
89
90
|
credential: t,
|
|
90
91
|
//client_id,
|
|
91
92
|
portal: e
|
|
92
93
|
}) {
|
|
93
|
-
const s = k(
|
|
94
|
+
const s = k(n.provider), i = w(n, e), r = U(n, e), o = new URLSearchParams({
|
|
94
95
|
client_id: "arcgisonline",
|
|
95
96
|
redirect_uri: r,
|
|
96
97
|
parent: window.location.origin,
|
|
97
98
|
response_type: "token",
|
|
98
99
|
prepopulatedusername: t.userId,
|
|
99
100
|
force_login: "false",
|
|
100
|
-
...s === "social" && { socialLoginProviderName:
|
|
101
|
+
...s === "social" && { socialLoginProviderName: n.provider },
|
|
101
102
|
expiration: `${(t?.expires ?? Date.now() + 60 * 1e3) - Date.now()}`
|
|
102
103
|
});
|
|
103
|
-
return `${
|
|
104
|
+
return `${i}?${o.toString()}`;
|
|
104
105
|
}
|
|
105
|
-
function k(
|
|
106
|
-
return B(
|
|
106
|
+
function k(n) {
|
|
107
|
+
return B(n) ? "social" : n === "enterprise" ? "enterprise" : n.includes("oidc") ? "oidc" : "default";
|
|
107
108
|
}
|
|
108
|
-
function B(
|
|
109
|
-
return ["apple", "facebook", "github", "google"].includes(
|
|
109
|
+
function B(n) {
|
|
110
|
+
return ["apple", "facebook", "github", "google"].includes(n);
|
|
110
111
|
}
|
|
111
|
-
function w(
|
|
112
|
-
const e =
|
|
113
|
-
let
|
|
112
|
+
function w(n, t) {
|
|
113
|
+
const e = u(n.orgUrlKey, t).toLowerCase(), s = k(n.provider);
|
|
114
|
+
let i = "";
|
|
114
115
|
switch (s) {
|
|
115
116
|
case "social":
|
|
116
|
-
|
|
117
|
+
i = "social/";
|
|
117
118
|
break;
|
|
118
119
|
case "enterprise":
|
|
119
|
-
|
|
120
|
+
i = "saml/";
|
|
120
121
|
break;
|
|
121
122
|
case "oidc":
|
|
122
|
-
|
|
123
|
+
i = `oidc/${n.provider.split("_")[1]}/`;
|
|
123
124
|
break;
|
|
124
125
|
}
|
|
125
|
-
return `${e}/sharing/rest/oauth2/${
|
|
126
|
+
return `${e}/sharing/rest/oauth2/${i}authorize`;
|
|
126
127
|
}
|
|
127
|
-
function
|
|
128
|
-
return
|
|
128
|
+
function u(n, t) {
|
|
129
|
+
return n?.startsWith("https://") ? n : n && t.customBaseUrl ? `https://${n}.${t.customBaseUrl}` : `https://${t.portalHostname}`;
|
|
129
130
|
}
|
|
130
|
-
function
|
|
131
|
-
return `${
|
|
131
|
+
function U(n, t) {
|
|
132
|
+
return `${u(n.orgUrlKey, t)}/home/accountswitcher-callback.html`;
|
|
132
133
|
}
|
|
133
134
|
function H({
|
|
134
|
-
origin:
|
|
135
|
+
origin: n,
|
|
135
136
|
redirectToClientUri: t,
|
|
136
137
|
displaySignoutComplete: e
|
|
137
138
|
}) {
|
|
138
|
-
console.log("Signout complete",
|
|
139
|
+
console.log("Signout complete", n, t, e);
|
|
139
140
|
}
|
|
140
|
-
function J(
|
|
141
|
-
return p.findCredential(
|
|
141
|
+
function J(n, t) {
|
|
142
|
+
return p.findCredential(u(n.orgUrlKey, t), n.username);
|
|
142
143
|
}
|
|
143
|
-
function
|
|
144
|
-
const e = J(
|
|
144
|
+
function D(n, t) {
|
|
145
|
+
const e = J(n, t);
|
|
145
146
|
if (e)
|
|
146
147
|
return e;
|
|
147
|
-
const s =
|
|
148
|
+
const s = u(n.orgUrlKey, t), i = `${s}/home/check_sign_in_status.html#state=${JSON.stringify({
|
|
148
149
|
origin: window.location.origin,
|
|
149
150
|
server: s,
|
|
150
151
|
orgKey: s
|
|
151
152
|
})}`;
|
|
152
|
-
|
|
153
|
+
q(i, `iframe__for-${s}`);
|
|
153
154
|
}
|
|
154
|
-
function
|
|
155
|
+
function q(n, t) {
|
|
155
156
|
const e = document.createElement("iframe");
|
|
156
|
-
e.src =
|
|
157
|
+
e.src = n, e.id = t, e.style.display = "none", document.body.appendChild(e);
|
|
157
158
|
}
|
|
158
159
|
const f = 100;
|
|
159
|
-
class z extends
|
|
160
|
+
class z extends b {
|
|
160
161
|
constructor() {
|
|
161
|
-
super(), this.messages = M({ blocking: !0 }), this.clientId = "arcgisonline", this.targetUser = "", this.linkedAccounts = [], this.loading = !1, this.signedInStatus = {}, this.showAssociatedAccountsWarning = !1, this.
|
|
162
|
+
super(), this.messages = M({ blocking: !0 }), this.clientId = "arcgisonline", this.targetUser = "", this.baseUrl = "", this.linkedAccounts = [], this.loading = !1, this.signedInStatus = {}, this.showAssociatedAccountsWarning = !1, this.arcgisAccountSwitch = $(), this.arcgisClose = $(), this.listenOn(window, "message", this.handleMessageEvent);
|
|
162
163
|
}
|
|
163
164
|
static {
|
|
164
|
-
this.properties = { linkedAccounts: 16, userAccounts: 16, user: 16, credential: 16, alertOptions: 16, loading: 16, signedInStatus: 16, showAssociatedAccountsWarning: 16, portal: 0
|
|
165
|
+
this.properties = { linkedAccounts: 16, userAccounts: 16, user: 16, credential: 16, alertOptions: 16, loading: 16, signedInStatus: 16, showAssociatedAccountsWarning: 16, portal: 0 };
|
|
165
166
|
}
|
|
166
167
|
static {
|
|
167
168
|
this.styles = O;
|
|
168
169
|
}
|
|
170
|
+
connectedCallback() {
|
|
171
|
+
super.connectedCallback(), this.baseUrl = u(this.portal?.urlKey ?? "", this.portal);
|
|
172
|
+
}
|
|
169
173
|
willUpdate(t) {
|
|
170
174
|
t.has("portal") && (this.user = this.portal?.user), (t.has("portal") || t.has("user")) && this.portal && this.user && this.findLinkedUsers();
|
|
171
175
|
}
|
|
@@ -198,20 +202,20 @@ class z extends S {
|
|
|
198
202
|
}
|
|
199
203
|
}
|
|
200
204
|
handleSignoutMessage(t) {
|
|
201
|
-
const { error: e, signout: s, accountOrigin:
|
|
205
|
+
const { error: e, signout: s, accountOrigin: i, redirectToClientUri: r, displaySignoutComplete: o } = t.data;
|
|
202
206
|
if (e && e !== "unknown") {
|
|
203
207
|
console.error(e), reportError(this.messages.errors.signout);
|
|
204
208
|
return;
|
|
205
209
|
}
|
|
206
|
-
s && (this.user = void 0, this.credential = void 0, H({ origin:
|
|
210
|
+
s && (this.user = void 0, this.credential = void 0, H({ origin: i, redirectToClientUri: r, displaySignoutComplete: o }));
|
|
207
211
|
}
|
|
208
212
|
handleSigninMessage(t) {
|
|
209
|
-
const { messages: e } = this, { error: s, status:
|
|
213
|
+
const { messages: e } = this, { error: s, status: i, credential: r } = t.data;
|
|
210
214
|
if (s) {
|
|
211
215
|
console.error(s), reportError(e.errors.signin);
|
|
212
216
|
return;
|
|
213
217
|
}
|
|
214
|
-
if (
|
|
218
|
+
if (i === "success") {
|
|
215
219
|
const {
|
|
216
220
|
portal: o,
|
|
217
221
|
user: a
|
|
@@ -228,11 +232,11 @@ class z extends S {
|
|
|
228
232
|
}
|
|
229
233
|
}
|
|
230
234
|
handleCheckSignInStatusMessage(t) {
|
|
231
|
-
const { success: e, orgKey: s, server:
|
|
232
|
-
s &&
|
|
235
|
+
const { success: e, orgKey: s, server: i, userId: r, token: o, expires: a, ssl: c } = t.data;
|
|
236
|
+
s && i && e && r && o && a && c !== void 0 && (this.signedInStatus[r] = { token: o, expires: a, ssl: c });
|
|
233
237
|
}
|
|
234
238
|
async handleLinkUserMessage(t) {
|
|
235
|
-
const { error: e, username: s, access_token:
|
|
239
|
+
const { error: e, username: s, access_token: i } = t.data, { portal: r, user: o, linkedAccounts: a, messages: c } = this;
|
|
236
240
|
if (e) {
|
|
237
241
|
if (e.toString().toLowerCase().includes("user denied your request"))
|
|
238
242
|
return;
|
|
@@ -243,16 +247,16 @@ class z extends S {
|
|
|
243
247
|
reportError(c.errors.selfLink);
|
|
244
248
|
return;
|
|
245
249
|
}
|
|
246
|
-
if (a.find((
|
|
250
|
+
if (a.find((d) => d.username === s)) {
|
|
247
251
|
reportError(g(c.errors.alreadyLinked, { username: s }));
|
|
248
252
|
return;
|
|
249
253
|
}
|
|
250
|
-
const l = await x(r, s,
|
|
254
|
+
const l = await x(r, s, i);
|
|
251
255
|
if (l?.length) {
|
|
252
256
|
this.userAccounts = l, this.targetUser = s ?? "", this.showAssociatedAccountsWarning = !0;
|
|
253
257
|
return;
|
|
254
258
|
}
|
|
255
|
-
this.linkAccount(s,
|
|
259
|
+
this.linkAccount(s, i);
|
|
256
260
|
}
|
|
257
261
|
handleExchangeTokenMessage(t) {
|
|
258
262
|
const e = typeof t.data == "string" ? JSON.parse(t.data) : t.data;
|
|
@@ -260,10 +264,10 @@ class z extends S {
|
|
|
260
264
|
if (e.error)
|
|
261
265
|
console.error(e);
|
|
262
266
|
else if (e.status === "success" && this.targetUser) {
|
|
263
|
-
const { portal: s, linkedAccounts:
|
|
267
|
+
const { portal: s, linkedAccounts: i, targetUser: r, clientId: o } = this, a = i.find((y) => y.username === r);
|
|
264
268
|
if (!a)
|
|
265
269
|
return;
|
|
266
|
-
const c =
|
|
270
|
+
const c = U(a, s), l = u(a.orgUrlKey, s), d = new URLSearchParams({
|
|
267
271
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
268
272
|
response_type: "token",
|
|
269
273
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
@@ -271,7 +275,7 @@ class z extends S {
|
|
|
271
275
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
272
276
|
redirect_uri: c,
|
|
273
277
|
state: JSON.stringify({ user: a.username, portalUrl: l })
|
|
274
|
-
}), m = `${w(a, s)}?${
|
|
278
|
+
}), m = `${w(a, s)}?${d.toString()}`;
|
|
275
279
|
window.opener ? (window.opener.location.href = m, window.close()) : window.location.href = m;
|
|
276
280
|
}
|
|
277
281
|
}
|
|
@@ -281,13 +285,13 @@ class z extends S {
|
|
|
281
285
|
this.linkedAccounts = [];
|
|
282
286
|
return;
|
|
283
287
|
}
|
|
284
|
-
this.loading = !0, this.linkedAccounts = await
|
|
288
|
+
this.loading = !0, this.linkedAccounts = await C(this.portal, this.user), this.linkedAccounts.length && (this.signedInStatus = this.linkedAccounts.filter((t) => t.orgUrlKey !== this.portal.urlKey).reduce((t, e) => (t[e.username] = D(e, this.portal) ?? null, t), {})), this.loading = !1;
|
|
285
289
|
}
|
|
286
290
|
async linkAccount(t, e) {
|
|
287
|
-
const { portal: s, user:
|
|
288
|
-
if (!s || !
|
|
291
|
+
const { portal: s, user: i } = this;
|
|
292
|
+
if (!s || !i)
|
|
289
293
|
return;
|
|
290
|
-
const r = await
|
|
294
|
+
const r = await I({ portal: s, user: i, targetUser: t, targetToken: e }), { messages: o } = this;
|
|
291
295
|
if (r.error) {
|
|
292
296
|
this.reportError(g(o.errors.linkAccount, { username: t })), this.targetUser = "", this.userAccounts = [];
|
|
293
297
|
return;
|
|
@@ -298,18 +302,18 @@ class z extends S {
|
|
|
298
302
|
async unlinkAccount(t) {
|
|
299
303
|
if (!this.portal || !this.user)
|
|
300
304
|
return;
|
|
301
|
-
const { messages: e, portal: s, user:
|
|
305
|
+
const { messages: e, portal: s, user: i } = this, { success: r } = await v({ portal: s, user: i, linkedUsername: t.username });
|
|
302
306
|
r ? this.reportSuccess(g(e.success.unlinkAccount, { username: t.username })) : this.reportError(g(e.errors.unlinkAccount, { username: t.username })), await this.findLinkedUsers();
|
|
303
307
|
}
|
|
304
308
|
startAccountLink() {
|
|
305
309
|
P(this.portal, this.baseUrl);
|
|
306
310
|
}
|
|
307
311
|
switchAccount(t) {
|
|
308
|
-
const { portal: e, user: s, clientId:
|
|
312
|
+
const { portal: e, user: s, clientId: i } = this;
|
|
309
313
|
if (!e || !s || !t)
|
|
310
314
|
return;
|
|
311
|
-
const r =
|
|
312
|
-
o && W({ config: { baseUrl: r, restBaseUrl: `${r}/sharing/rest` }, credential: o, clientId:
|
|
315
|
+
const r = u(s.sourceJSON.orgUrlKey ?? "", e), o = p.findCredential(r, s.id || s.username);
|
|
316
|
+
o && W({ config: { baseUrl: r, restBaseUrl: `${r}/sharing/rest` }, credential: o, clientId: i }), N(t, e);
|
|
313
317
|
}
|
|
314
318
|
reportError(t, e, s = !1) {
|
|
315
319
|
this.alertOptions = {
|
|
@@ -344,21 +348,23 @@ class z extends S {
|
|
|
344
348
|
};
|
|
345
349
|
}
|
|
346
350
|
render() {
|
|
347
|
-
const { linkedAccounts: t, user: e, portal: s, messages:
|
|
348
|
-
return !s || !e ? null :
|
|
351
|
+
const { linkedAccounts: t, user: e, portal: s, messages: i } = this;
|
|
352
|
+
return !s || !e ? null : h`<calcite-dialog .heading=${i.switchAccounts} scale=m width=s open modal .loading=${this.loading} outside-close-disabled @calciteDialogClose=${() => {
|
|
353
|
+
this.arcgisClose.emit();
|
|
354
|
+
}}><calcite-block .heading=${i.currentAccount} expanded class="current-account-block"><calcite-list .label=${g(i.currentAccountLabel, { username: e.username })} interaction-mode=static selection-mode=none class="current-account-list"><calcite-list-item><arcgis-portal-user-avatar .user=${e} .portal=${s} show-name .heading=${e.username} .description=${s.name || ""} slot=content-start></arcgis-portal-user-avatar></calcite-list-item></calcite-list></calcite-block>${t.length > 0 ? h`<calcite-block .heading=${i.chooseAccount} expanded class="linked-accounts-block"><calcite-button slot=content-end icon-start=plus class="link-account-button" @click=${() => this.startAccountLink()} .disabled=${t.length >= f}>${i.linkAccount}</calcite-button><arcgis-portal-account-switcher-list .portal=${s} .linkedAccounts=${t} .signedInUsers=${Object.keys(this.signedInStatus).filter((r) => this.signedInStatus[r] !== null)} .label=${i.usersList} interactive @arcgisAccountSwitch=${(r) => {
|
|
349
355
|
this.switchAccount(r.detail.account);
|
|
350
356
|
}} @arcgisAccountUnlink=${(r) => {
|
|
351
357
|
this.showUnlinkConfirmation(r.detail.account);
|
|
352
|
-
}}></arcgis-portal-account-switcher-list></calcite-block>` :
|
|
358
|
+
}}></arcgis-portal-account-switcher-list></calcite-block>` : h`<calcite-block .heading=${i.chooseAccount} expanded class="empty-accounts-block"><div class="empty-accounts-info"><svg class="empty-accounts-icon" width=48 height=48 viewBox="0 0 48 48" fill=none xmlns=http://www.w3.org/2000/svg>${_`<path d=${T.couple ?? L} fill=currentColor />`}</svg><h4>${i.emptyListTitle}</h4><p>${i.emptyList}</p><calcite-button icon-start=plus class="link-account-button" @click=${() => this.startAccountLink()} .disabled=${t.length >= f}>${i.linkAccount}</calcite-button></div></calcite-block>`}<calcite-notice kind=info .open=${t.length >= f}><div slot=message>${i.maxAccounts}</div></calcite-notice><calcite-alert .label=${i.alertLabel} slot=alerts .autoClose=${this.alertOptions?.kind !== "danger"} auto-close-duration=fast placement=bottom .kind=${this.alertOptions?.kind} .icon=${this.alertOptions?.icon} .open=${!!this.alertOptions} @calciteAlertClose=${() => {
|
|
353
359
|
this.alertOptions = void 0;
|
|
354
|
-
}}>${this.alertOptions?.title &&
|
|
360
|
+
}}>${this.alertOptions?.title && h`<h4 slot=title class="alert-title">${this.alertOptions.title}</h4>` || ""}${this.alertOptions?.message && h`<p slot=message class="alert-message">${this.alertOptions.message}</p>` || ""}${this.alertOptions?.actions?.map((r) => h`<calcite-button slot=actions-end .kind=${r.kind} .appearance=${r.appearance} @click=${r.clickHandler}>${r.text}</calcite-button>`)}</calcite-alert></calcite-dialog>${this.showAssociatedAccountsWarning && h`<arcgis-portal-account-switcher-accounts .portal=${s} .targetUser=${this.targetUser} .accounts=${this.userAccounts ?? []} @arcgisLinkAll=${() => {
|
|
355
361
|
this.linkAccount(this.targetUser, "");
|
|
356
362
|
}} @arcgisCloseDialog=${() => {
|
|
357
363
|
this.showAssociatedAccountsWarning = !1;
|
|
358
364
|
}}></arcgis-portal-account-switcher-accounts>` || ""}`;
|
|
359
365
|
}
|
|
360
366
|
}
|
|
361
|
-
|
|
367
|
+
S("arcgis-portal-account-switcher", z);
|
|
362
368
|
export {
|
|
363
369
|
z as ArcgisPortalAccountSwitcher
|
|
364
370
|
};
|
|
@@ -1,28 +1,64 @@
|
|
|
1
|
-
|
|
1
|
+
/** A host-resolved Portal destination with an optional localized action label. */
|
|
2
|
+
export type PortalNavigationTarget = PortalNavigationDestination
|
|
3
|
+
& {
|
|
4
|
+
t9nKey?: string;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export type PartialPortalNavigationTargetMap = Partial<PortalNavigationTargetMap>;
|
|
8
|
+
|
|
9
|
+
export type PortalNavigationDestination = {
|
|
10
|
+
destinationType: "portal-content";
|
|
11
|
+
hash?: PortalContentNavigationHash;
|
|
12
|
+
} | { destinationType: "portal-gallery" | "portal-map-viewer" | "portal-notebooks" | "portal-scene-viewer"; } | {
|
|
2
13
|
destinationType: "portal-group";
|
|
3
14
|
groupId: string;
|
|
4
|
-
} | {
|
|
15
|
+
} | {
|
|
16
|
+
destinationType: "portal-groups";
|
|
17
|
+
hash?: PortalGroupsNavigationHash;
|
|
18
|
+
} | {
|
|
5
19
|
destinationType: "portal-item";
|
|
6
20
|
itemId: string;
|
|
7
|
-
} | {
|
|
8
|
-
|
|
9
|
-
|
|
21
|
+
} | {
|
|
22
|
+
destinationType: "portal-org";
|
|
23
|
+
hash?: PortalOrgNavigationHash;
|
|
24
|
+
};
|
|
10
25
|
|
|
11
26
|
export interface PortalNavigationTargetMap {
|
|
12
|
-
"portal-content": string;
|
|
13
|
-
"portal-content-favorites": string;
|
|
14
|
-
"portal-content-group": string;
|
|
15
|
-
"portal-content-living-atlas": string;
|
|
16
|
-
"portal-content-organization": string;
|
|
27
|
+
"portal-content": (hash?: PortalContentNavigationHash) => string;
|
|
17
28
|
"portal-gallery": string;
|
|
18
|
-
"portal-groups": string;
|
|
19
|
-
"portal-groups-featured": string;
|
|
20
|
-
"portal-groups-my": string;
|
|
21
|
-
"portal-groups-organization": string;
|
|
29
|
+
"portal-groups": (hash?: PortalGroupsNavigationHash) => string;
|
|
22
30
|
"portal-item": (itemId: string) => string;
|
|
23
31
|
"portal-group": (groupId: string) => string;
|
|
24
32
|
"portal-map-viewer": string;
|
|
25
33
|
"portal-notebooks": string;
|
|
34
|
+
"portal-org": (hash?: PortalOrgNavigationHash) => string;
|
|
26
35
|
"portal-scene-viewer": string;
|
|
27
|
-
|
|
28
|
-
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type PortalContentNavigationHash = (typeof portalContentNavigationHashes)[number];
|
|
39
|
+
|
|
40
|
+
export type PortalGroupsNavigationHash = (typeof portalGroupsNavigationHashes)[number];
|
|
41
|
+
|
|
42
|
+
export type PortalOrgNavigationHash = (typeof portalOrgNavigationHashes)[number];
|
|
43
|
+
|
|
44
|
+
export const portalContentNavigationHashes: readonly [
|
|
45
|
+
"favorites",
|
|
46
|
+
"group",
|
|
47
|
+
"living-atlas",
|
|
48
|
+
"org"
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
export const portalGroupsNavigationHashes: readonly [
|
|
52
|
+
"featured",
|
|
53
|
+
"my",
|
|
54
|
+
"organization"
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
export const portalOrgNavigationHashes: readonly [
|
|
58
|
+
"licenses",
|
|
59
|
+
"members",
|
|
60
|
+
"overview",
|
|
61
|
+
"reports",
|
|
62
|
+
"settings",
|
|
63
|
+
"status"
|
|
64
|
+
];
|
|
@@ -13,6 +13,12 @@ export abstract class ArcgisPortalAiAssistant extends LitElement {
|
|
|
13
13
|
accessor config: Config;
|
|
14
14
|
/** @default false */
|
|
15
15
|
accessor defaultClosed: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Enables Portal navigation suggestions from the assistant.
|
|
18
|
+
*
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
accessor navigationAgentEnabled: boolean;
|
|
16
22
|
/** Optional map of navigation target overrides for generating navigation hrefs from portal navigation suggestions. */
|
|
17
23
|
accessor navigationTargetMap: PartialPortalNavigationTargetMap | undefined;
|
|
18
24
|
accessor portal: Portal;
|
|
@@ -58,7 +64,17 @@ export abstract class ArcgisPortalAiAssistant extends LitElement {
|
|
|
58
64
|
openNotebooks: string;
|
|
59
65
|
openSceneViewer: string;
|
|
60
66
|
openGroup: string;
|
|
61
|
-
|
|
67
|
+
openOrgSettings: string;
|
|
68
|
+
};
|
|
69
|
+
navigationTargets: {
|
|
70
|
+
myContent: string;
|
|
71
|
+
createFeatureLayer: string;
|
|
72
|
+
createFolder: string;
|
|
73
|
+
myGroups: string;
|
|
74
|
+
createGroup: string;
|
|
75
|
+
featuredGroups: string;
|
|
76
|
+
organizationGroups: string;
|
|
77
|
+
configureMultifactorAuthentication: string;
|
|
62
78
|
};
|
|
63
79
|
openPanel: string;
|
|
64
80
|
status: {
|
|
@@ -117,7 +133,17 @@ export abstract class ArcgisPortalAiAssistant extends LitElement {
|
|
|
117
133
|
openNotebooks: string;
|
|
118
134
|
openSceneViewer: string;
|
|
119
135
|
openGroup: string;
|
|
120
|
-
|
|
136
|
+
openOrgSettings: string;
|
|
137
|
+
};
|
|
138
|
+
navigationTargets: {
|
|
139
|
+
myContent: string;
|
|
140
|
+
createFeatureLayer: string;
|
|
141
|
+
createFolder: string;
|
|
142
|
+
myGroups: string;
|
|
143
|
+
createGroup: string;
|
|
144
|
+
featuredGroups: string;
|
|
145
|
+
organizationGroups: string;
|
|
146
|
+
configureMultifactorAuthentication: string;
|
|
121
147
|
};
|
|
122
148
|
openPanel: string;
|
|
123
149
|
status: {
|