Skip to content

Commit 6bd4882

Browse files
committed
replace tags and keywords
replace tags and keywords
1 parent dc4aa4c commit 6bd4882

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

demos/recreateSolution/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<head>
55
<meta charset="utf-8" />
6-
<title>createSolution example</title>
6+
<title>recreate Solution example</title>
77
<!--
88
| Copyright 2023 Esri
99
|

packages/creator/src/creator.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ export async function createSolution(
108108
itemBase?.typeKeywords.includes("Deployed")
109109
) {
110110
_updateCreateOptionForReDeployedTemplate(sourceId, srcAuthentication, createOptions, itemBase).then(
111-
(updatedCreateOptions) => {
112-
resolve(_applySourceToCreateOptions(updatedCreateOptions, itemBase, srcAuthentication, false));
111+
(modifiedCreateOptions) => {
112+
resolve(_applySourceToCreateOptions(modifiedCreateOptions, itemBase, srcAuthentication, false));
113113
},
114114
reject,
115115
);
@@ -425,6 +425,15 @@ export async function _updateCreateOptionForReDeployedTemplate(
425425
// Handle any errors
426426
console.error("An error occurred during the search:", error);
427427
}
428+
429+
//switch thhe Deployed keyword to Template
430+
const deployedIndex = itemBase.typeKeywords.indexOf("Deployed");
431+
if (deployedIndex !== -1) {
432+
itemBase.typeKeywords[deployedIndex] = "Template";
433+
}
434+
435+
//remove any tags with group. since it's now a new solution.
436+
itemBase.tags = itemBase.tags.filter((tag) => !tag.includes("group."));
428437
} catch (error) {
429438
console.error("An error occurred during get item data:", error);
430439
}

0 commit comments

Comments
 (0)