@esri/hub-common 14.32.0 → 14.32.1
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.
|
@@ -11,15 +11,22 @@ import { getItemThumbnailUrl } from "../../resources/get-item-thumbnail-url";
|
|
|
11
11
|
* @param requestOptions
|
|
12
12
|
*/
|
|
13
13
|
export function computeLinks(item, requestOptions) {
|
|
14
|
+
var _a;
|
|
14
15
|
let token;
|
|
15
16
|
if (requestOptions.authentication) {
|
|
16
17
|
const session = requestOptions.authentication;
|
|
17
18
|
token = session.token;
|
|
18
19
|
}
|
|
20
|
+
// If a solution template is deployed, we don't support
|
|
21
|
+
// managing it in the workspace, so we kick users to AGO
|
|
22
|
+
const isDeployed = (_a = item.typeKeywords) === null || _a === void 0 ? void 0 : _a.includes("Deployed");
|
|
23
|
+
const itemHomeUrl = getItemHomeUrl(item.id, requestOptions);
|
|
19
24
|
return {
|
|
20
|
-
self:
|
|
25
|
+
self: itemHomeUrl,
|
|
21
26
|
siteRelative: getHubRelativeUrl(item.type, getItemIdentifier(item), item.typeKeywords),
|
|
22
|
-
workspaceRelative:
|
|
27
|
+
workspaceRelative: isDeployed
|
|
28
|
+
? itemHomeUrl
|
|
29
|
+
: getRelativeWorkspaceUrl(item.type, getItemIdentifier(item)),
|
|
23
30
|
thumbnail: getItemThumbnailUrl(item, requestOptions, token),
|
|
24
31
|
};
|
|
25
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeLinks.js","sourceRoot":"","sources":["../../../../src/templates/_internal/computeLinks.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,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AACJ,CAAC"}
|
|
@@ -14,15 +14,22 @@ const get_item_thumbnail_url_1 = require("../../resources/get-item-thumbnail-url
|
|
|
14
14
|
* @param requestOptions
|
|
15
15
|
*/
|
|
16
16
|
function computeLinks(item, requestOptions) {
|
|
17
|
+
var _a;
|
|
17
18
|
let token;
|
|
18
19
|
if (requestOptions.authentication) {
|
|
19
20
|
const session = requestOptions.authentication;
|
|
20
21
|
token = session.token;
|
|
21
22
|
}
|
|
23
|
+
// If a solution template is deployed, we don't support
|
|
24
|
+
// managing it in the workspace, so we kick users to AGO
|
|
25
|
+
const isDeployed = (_a = item.typeKeywords) === null || _a === void 0 ? void 0 : _a.includes("Deployed");
|
|
26
|
+
const itemHomeUrl = urls_1.getItemHomeUrl(item.id, requestOptions);
|
|
22
27
|
return {
|
|
23
|
-
self:
|
|
28
|
+
self: itemHomeUrl,
|
|
24
29
|
siteRelative: internalContentUtils_1.getHubRelativeUrl(item.type, items_1.getItemIdentifier(item), item.typeKeywords),
|
|
25
|
-
workspaceRelative:
|
|
30
|
+
workspaceRelative: isDeployed
|
|
31
|
+
? itemHomeUrl
|
|
32
|
+
: getRelativeWorkspaceUrl_1.getRelativeWorkspaceUrl(item.type, items_1.getItemIdentifier(item)),
|
|
26
33
|
thumbnail: get_item_thumbnail_url_1.getItemThumbnailUrl(item, requestOptions, token),
|
|
27
34
|
};
|
|
28
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeLinks.js","sourceRoot":"","sources":["../../../../src/templates/_internal/computeLinks.ts"],"names":[],"mappings":";;;AAGA,qCAA4C;AAE5C,uCAAgD;AAChD,uFAAiF;AACjF,gFAA6E;AAC7E,mFAA6E;AAE7E;;;;;;GAMG;AACH,SAAgB,YAAY,CAC1B,IAAW,EACX,cAA+B
|
|
1
|
+
{"version":3,"file":"computeLinks.js","sourceRoot":"","sources":["../../../../src/templates/_internal/computeLinks.ts"],"names":[],"mappings":";;;AAGA,qCAA4C;AAE5C,uCAAgD;AAChD,uFAAiF;AACjF,gFAA6E;AAC7E,mFAA6E;AAE7E;;;;;;GAMG;AACH,SAAgB,YAAY,CAC1B,IAAW,EACX,cAA+B;;IAE/B,IAAI,KAAa,CAAC;IAClB,IAAI,cAAc,CAAC,cAAc,EAAE;QACjC,MAAM,OAAO,GAAgB,cAAc,CAAC,cAA6B,CAAC;QAC1E,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;KACvB;IAED,uDAAuD;IACvD,wDAAwD;IACxD,MAAM,UAAU,SAAG,IAAI,CAAC,YAAY,0CAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC3D,MAAM,WAAW,GAAG,qBAAc,CAAC,IAAI,CAAC,EAAE,EAAE,cAAc,CAAC,CAAC;IAC5D,OAAO;QACL,IAAI,EAAE,WAAW;QACjB,YAAY,EAAE,wCAAiB,CAC7B,IAAI,CAAC,IAAI,EACT,yBAAiB,CAAC,IAAI,CAAC,EACvB,IAAI,CAAC,YAAY,CAClB;QACD,iBAAiB,EAAE,UAAU;YAC3B,CAAC,CAAC,WAAW;YACb,CAAC,CAAC,iDAAuB,CAAC,IAAI,CAAC,IAAI,EAAE,yBAAiB,CAAC,IAAI,CAAC,CAAC;QAC/D,SAAS,EAAE,4CAAmB,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,CAAC;KAC5D,CAAC;AACJ,CAAC;AA1BD,oCA0BC"}
|