@esri/solutions-components 0.2.2 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. package/dist/assets/t9n/solution-config-modal/resources.json +22 -0
  2. package/dist/assets/t9n/solution-config-modal/resources_en.json +22 -0
  3. package/dist/cjs/calcite-action-menu_2.cjs.entry.js +18 -401
  4. package/dist/cjs/calcite-action-menu_2.cjs.entry.js.map +1 -1
  5. package/dist/cjs/calcite-action_2.cjs.entry.js +423 -71
  6. package/dist/cjs/calcite-action_2.cjs.entry.js.map +1 -1
  7. package/dist/cjs/calcite-loader.cjs.entry.js +97 -0
  8. package/dist/cjs/calcite-loader.cjs.entry.js.map +1 -0
  9. package/dist/cjs/{solution-configuration.cjs.entry.js → calcite-modal_2.cjs.entry.js} +451 -13
  10. package/dist/cjs/calcite-modal_2.cjs.entry.js.map +1 -0
  11. package/dist/cjs/{calcite-shell-panel_14.cjs.entry.js → calcite-panel_12.cjs.entry.js} +455 -709
  12. package/dist/cjs/calcite-panel_12.cjs.entry.js.map +1 -0
  13. package/dist/cjs/loader.cjs.js +1 -1
  14. package/dist/cjs/solution-config-modal.cjs.entry.js +131 -0
  15. package/dist/cjs/solution-config-modal.cjs.entry.js.map +1 -0
  16. package/dist/cjs/{solution-contents_3.cjs.entry.js → solution-contents_7.cjs.entry.js} +664 -5
  17. package/dist/cjs/solution-contents_7.cjs.entry.js.map +1 -0
  18. package/dist/cjs/{solution-store-893499a5.js → solution-store-09b3fc53.js} +4 -6
  19. package/dist/cjs/solution-store-09b3fc53.js.map +1 -0
  20. package/dist/cjs/solutions-components.cjs.js +1 -1
  21. package/dist/collection/collection-manifest.json +1 -0
  22. package/dist/collection/components/solution-config-modal/solution-config-modal.css +91 -0
  23. package/dist/collection/components/solution-config-modal/solution-config-modal.js +245 -0
  24. package/dist/collection/components/solution-config-modal/solution-config-modal.js.map +1 -0
  25. package/dist/collection/components/solution-configuration/solution-configuration.js +23 -17
  26. package/dist/collection/components/solution-configuration/solution-configuration.js.map +1 -1
  27. package/dist/collection/components/solution-item/solution-item.js +0 -2
  28. package/dist/collection/components/solution-item/solution-item.js.map +1 -1
  29. package/dist/collection/components/solution-item-details/solution-item-details.js +0 -13
  30. package/dist/collection/components/solution-item-details/solution-item-details.js.map +1 -1
  31. package/dist/collection/utils/solution-store.js +3 -5
  32. package/dist/collection/utils/solution-store.js.map +1 -1
  33. package/dist/collection/utils/solution-store.ts +3 -5
  34. package/dist/esm/buffer-tools_6.entry.js +2 -2
  35. package/dist/esm/calcite-action-bar_6.entry.js +2 -2
  36. package/dist/esm/calcite-action-menu_2.entry.js +20 -403
  37. package/dist/esm/calcite-action-menu_2.entry.js.map +1 -1
  38. package/dist/esm/calcite-action_2.entry.js +424 -72
  39. package/dist/esm/calcite-action_2.entry.js.map +1 -1
  40. package/dist/esm/calcite-combobox_3.entry.js +2 -2
  41. package/dist/esm/calcite-loader.entry.js +93 -0
  42. package/dist/esm/calcite-loader.entry.js.map +1 -0
  43. package/dist/esm/{solution-configuration.entry.js → calcite-modal_2.entry.js} +453 -16
  44. package/dist/esm/calcite-modal_2.entry.js.map +1 -0
  45. package/dist/esm/{calcite-shell-panel_14.entry.js → calcite-panel_12.entry.js} +454 -706
  46. package/dist/esm/calcite-panel_12.entry.js.map +1 -0
  47. package/dist/esm/config-layer-picker.entry.js +2 -2
  48. package/dist/esm/{interfaces-e2a2064d.js → interfaces-1bdfc3a8.js} +2 -2
  49. package/dist/esm/{interfaces-e2a2064d.js.map → interfaces-1bdfc3a8.js.map} +1 -1
  50. package/dist/esm/loader.js +1 -1
  51. package/dist/esm/{mapViewUtils-09f1e7bd.js → mapViewUtils-809947c8.js} +2 -2
  52. package/dist/esm/{mapViewUtils-09f1e7bd.js.map → mapViewUtils-809947c8.js.map} +1 -1
  53. package/dist/esm/public-notification.entry.js +2 -2
  54. package/dist/esm/solution-config-modal.entry.js +127 -0
  55. package/dist/esm/solution-config-modal.entry.js.map +1 -0
  56. package/dist/esm/{solution-contents_3.entry.js → solution-contents_7.entry.js} +661 -6
  57. package/dist/esm/solution-contents_7.entry.js.map +1 -0
  58. package/dist/esm/{solution-store-0c58c852.js → solution-store-d8519c64.js} +5 -7
  59. package/dist/esm/solution-store-d8519c64.js.map +1 -0
  60. package/dist/esm/solutions-components.js +1 -1
  61. package/dist/solutions-components/{p-be1ed982.entry.js → p-11068040.entry.js} +3 -3
  62. package/dist/solutions-components/{p-be1ed982.entry.js.map → p-11068040.entry.js.map} +0 -0
  63. package/dist/solutions-components/{p-659edb14.js → p-2910dd9e.js} +5 -7
  64. package/dist/{cjs/solution-store-893499a5.js.map → solutions-components/p-2910dd9e.js.map} +1 -1
  65. package/dist/solutions-components/{p-291fd295.entry.js → p-30810b45.entry.js} +3 -3
  66. package/dist/solutions-components/{p-291fd295.entry.js.map → p-30810b45.entry.js.map} +0 -0
  67. package/dist/solutions-components/p-38ddadf2.entry.js +342 -0
  68. package/dist/solutions-components/p-38ddadf2.entry.js.map +1 -0
  69. package/dist/solutions-components/{p-77c75f3a.entry.js → p-5b20090f.entry.js} +661 -6
  70. package/dist/solutions-components/p-5b20090f.entry.js.map +1 -0
  71. package/dist/solutions-components/{p-9393631c.entry.js → p-9ef1328a.entry.js} +3 -3
  72. package/dist/solutions-components/{p-9393631c.entry.js.map → p-9ef1328a.entry.js.map} +0 -0
  73. package/dist/solutions-components/{p-984cb687.entry.js → p-a1786d11.entry.js} +454 -706
  74. package/dist/solutions-components/p-a1786d11.entry.js.map +1 -0
  75. package/dist/solutions-components/{p-fe0fdd8b.js → p-c20bd963.js} +2 -2
  76. package/dist/solutions-components/{p-fe0fdd8b.js.map → p-c20bd963.js.map} +1 -1
  77. package/dist/solutions-components/p-c5721b0f.entry.js +127 -0
  78. package/dist/solutions-components/p-c5721b0f.entry.js.map +1 -0
  79. package/dist/solutions-components/{p-24d75151.entry.js → p-c818e661.entry.js} +3 -3
  80. package/dist/solutions-components/{p-24d75151.entry.js.map → p-c818e661.entry.js.map} +0 -0
  81. package/dist/solutions-components/{p-90629c1d.entry.js → p-cf59eb16.entry.js} +453 -16
  82. package/dist/solutions-components/p-cf59eb16.entry.js.map +1 -0
  83. package/dist/solutions-components/p-e405ebe8.entry.js +93 -0
  84. package/dist/solutions-components/p-e405ebe8.entry.js.map +1 -0
  85. package/dist/solutions-components/{p-77e6b03c.entry.js → p-e6fb9cde.entry.js} +3 -3
  86. package/dist/solutions-components/{p-77e6b03c.entry.js.map → p-e6fb9cde.entry.js.map} +0 -0
  87. package/dist/solutions-components/{p-97c4a268.entry.js → p-ef6f9e24.entry.js} +113 -229
  88. package/dist/solutions-components/p-ef6f9e24.entry.js.map +1 -0
  89. package/dist/solutions-components/{p-6b9dc092.js → p-f04fdb9a.js} +2 -2
  90. package/dist/solutions-components/{p-6b9dc092.js.map → p-f04fdb9a.js.map} +1 -1
  91. package/dist/solutions-components/solutions-components.esm.js +1 -1
  92. package/dist/solutions-components/utils/solution-store.ts +3 -5
  93. package/dist/solutions-components_commit.txt +8 -8
  94. package/dist/types/components/solution-config-modal/solution-config-modal.d.ts +69 -0
  95. package/dist/types/components/solution-configuration/solution-configuration.d.ts +4 -2
  96. package/dist/types/components/solution-item-details/solution-item-details.d.ts +0 -1
  97. package/dist/types/components.d.ts +43 -5
  98. package/dist/types/preact.d.ts +4 -0
  99. package/package.json +1 -1
  100. package/dist/cjs/calcite-modal.cjs.entry.js +0 -449
  101. package/dist/cjs/calcite-modal.cjs.entry.js.map +0 -1
  102. package/dist/cjs/calcite-panel_2.cjs.entry.js +0 -439
  103. package/dist/cjs/calcite-panel_2.cjs.entry.js.map +0 -1
  104. package/dist/cjs/calcite-scrim.cjs.entry.js +0 -64
  105. package/dist/cjs/calcite-scrim.cjs.entry.js.map +0 -1
  106. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js.map +0 -1
  107. package/dist/cjs/solution-configuration.cjs.entry.js.map +0 -1
  108. package/dist/cjs/solution-contents_3.cjs.entry.js.map +0 -1
  109. package/dist/esm/calcite-modal.entry.js +0 -445
  110. package/dist/esm/calcite-modal.entry.js.map +0 -1
  111. package/dist/esm/calcite-panel_2.entry.js +0 -434
  112. package/dist/esm/calcite-panel_2.entry.js.map +0 -1
  113. package/dist/esm/calcite-scrim.entry.js +0 -60
  114. package/dist/esm/calcite-scrim.entry.js.map +0 -1
  115. package/dist/esm/calcite-shell-panel_14.entry.js.map +0 -1
  116. package/dist/esm/solution-configuration.entry.js.map +0 -1
  117. package/dist/esm/solution-contents_3.entry.js.map +0 -1
  118. package/dist/esm/solution-store-0c58c852.js.map +0 -1
  119. package/dist/solutions-components/p-0fda7d9e.entry.js +0 -434
  120. package/dist/solutions-components/p-0fda7d9e.entry.js.map +0 -1
  121. package/dist/solutions-components/p-2ff754ce.entry.js +0 -257
  122. package/dist/solutions-components/p-2ff754ce.entry.js.map +0 -1
  123. package/dist/solutions-components/p-30a6199a.entry.js +0 -445
  124. package/dist/solutions-components/p-30a6199a.entry.js.map +0 -1
  125. package/dist/solutions-components/p-659edb14.js.map +0 -1
  126. package/dist/solutions-components/p-77c75f3a.entry.js.map +0 -1
  127. package/dist/solutions-components/p-90629c1d.entry.js.map +0 -1
  128. package/dist/solutions-components/p-97c4a268.entry.js.map +0 -1
  129. package/dist/solutions-components/p-984cb687.entry.js.map +0 -1
  130. package/dist/solutions-components/p-f5268b4f.entry.js +0 -60
  131. package/dist/solutions-components/p-f5268b4f.entry.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"solution-store.js","sourceRoot":"","sources":["../../src/utils/solution-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,WAAW,EAOZ,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,SAAS,EACT,6BAA6B,EAC7B,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,EACjB,OAAO,EACP,2BAA2B,EAM3B,mBAAmB,EACnB,sBAAsB,EACtB,aAAa,EACb,UAAU,EACV,sBAAsB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AAa,CAAC,EAAE,EAAE,0CAA0C,EAAE,IAAI,CAAC,CAAC;WACrE;SACF;MACH,CAAC,CACF,CAAC;MACF,OAAO,oBAAoB,CAAC,gBAAgB,CAAC;KAE9C;SAAM;MACL,uCAAuC;MACvC,4BAA4B,CAAC,OAAO,CAClC,CAAC,EAAE,EAAE,EAAE;QACL,MAAM,IAAI,GAAG,OAAO,CAAC,EAAE,EAAE,0CAA0C,CAAC,CAAC;QACrE,uCAAuC;QACvC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE;UACjD,aAAa,CAAC,EAAE,EAAE,0CAA0C,EAC1D,IAAI,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;SACzE;MACH,CAAC,CACF,CAAC;MACF,OAAO,SAAS,CAAC;KAClB;EACH,CAAC;EAED;;;;;;;;;KASG;EACO,cAAc,CACtB,QAAgB;IAEhB,MAAM,aAAa,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC1C,OAAO;MACL,MAAM,EAAE,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;MACzG,MAAM,EAAE,aAAa,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;KAChD,CAAC;EACJ,CAAC;CACF;AAED,eAAe,aAAa,CAAC,KAAK,CAAC","sourcesContent":["/** @license\r\n * Copyright 2022 Esri\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\nimport { createStore } from \"@stencil/store\";\r\nimport {\r\n EUpdateType,\r\n IFeatureServiceEnabledStatus,\r\n IItemShare,\r\n IItemTemplateEdit,\r\n IResourcePath,\r\n ISolutionTemplateEdits,\r\n ISolutionSpatialReferenceInfo\r\n} from './interfaces';\r\nimport {\r\n EFileType,\r\n SolutionTemplateFormatVersion,\r\n copyFilesToStorageItem,\r\n generateStorageFilePaths,\r\n getItemDataAsJson,\r\n getProp,\r\n getThumbnailFromStorageItem,\r\n IDeployFileCopyPath,\r\n IItemTemplate,\r\n IItemUpdate,\r\n ISolutionItemData,\r\n ISourceFile,\r\n isSupportedFileType,\r\n removeItemResourceFile,\r\n setCreateProp,\r\n updateItem,\r\n updateItemResourceFile,\r\n UserSession\r\n} from '@esri/solution-common';\r\n\r\n//--------------------------------------------------------------------------------------------------------------------//\r\n//\r\n// Loads a solution's definition and shares it as state across the solution configuration package components.\r\n//\r\n// Store contents:\r\n// * solutionItemId: [string] id of the current solution\r\n// * defaultWkid: [any] value of the solution's `params.wkid.default` data property, which may be undefined\r\n// * solutionData: [ISolutionItemData] the solution's data, which is modified in-place\r\n// * featureServices: [array] a list of Feature service enablement status for SR configuration\r\n// * spatialReferenceInfo: [object] the current spatial reference (if enabled) and the services that use it\r\n// * enabled: [boolean] use the spatial reference\r\n// * services: [object] services using this spatial reference organized by the service name\r\n// * spatialReference: [object] the spatial reference display\r\n//\r\n// Store singleton method:\r\n// * Store: Creates singleton instance when accessed; default export from module.\r\n// @example\r\n// import state from \"../solution-store\";\r\n// await state.loadSolution(...);\r\n//\r\n// Store instance methods:\r\n// * getItemInfo: Returns the stored information of an item.\r\n// * getStoreInfo: Returns a top-level store property: solutionItemId, defaultWkid, etc.\r\n// * loadSolution: Loads a Solution into the store from AGO.\r\n// * replaceItemThumbnail: Replaces the thumbnail associated with a template item in the store.\r\n// * saveSolution: Writes a Solution into AGO from the store.\r\n// * setItemInfo: Stores information for item.\r\n// * setStoreInfo: Sets a top-level store property: solutionItemId, defaultWkid, etc.\r\n//\r\n// Store events:\r\n// * solutionStoreHasChanges: Event for notifying if the store has changes or not.\r\n//\r\n//--------------------------------------------------------------------------------------------------------------------//\r\n\r\ninterface SolutionStoreData {\r\n solutionItemId: string,\r\n defaultWkid: string,\r\n solutionData: ISolutionItemData,\r\n templateEdits: ISolutionTemplateEdits,\r\n featureServices: IFeatureServiceEnabledStatus[],\r\n spatialReferenceInfo: ISolutionSpatialReferenceInfo\r\n}\r\n\r\nconst EmptySolutionStore: SolutionStoreData = {\r\n solutionItemId: \"\",\r\n defaultWkid: undefined,\r\n solutionData: { metadata: {}, templates: [] },\r\n templateEdits: {},\r\n featureServices: [],\r\n spatialReferenceInfo: {\r\n enabled: false,\r\n services: {},\r\n spatialReference: undefined\r\n }\r\n}\r\n\r\nclass SolutionStore\r\n{\r\n protected static _instance: SolutionStore;\r\n\r\n protected _store: any;\r\n\r\n protected _hasChanges = false;\r\n\r\n protected _authentication: UserSession;\r\n\r\n /**\r\n * Creates singleton instance when accessed; default export from module.\r\n *\r\n * @returns Static instance of the class\r\n */\r\n public static get Store(): SolutionStore {\r\n return this._instance || (this._instance = new this());\r\n }\r\n\r\n /**\r\n * Creates an empty store.\r\n *\r\n * @protected\r\n */\r\n protected constructor() {\r\n this._store = createStore({\r\n ...EmptySolutionStore\r\n });\r\n }\r\n\r\n /**\r\n * Returns the stored information of an item.\r\n *\r\n * @param itemId Id of item to fetch\r\n *\r\n * @returns Item information or `undefined` if not found\r\n */\r\n public getItemInfo(\r\n itemId: string\r\n ): IItemTemplateEdit {\r\n console.log(\"getItemInfo for \" + itemId);//???\r\n const templates = this._store.get(\"solutionData\").templates as IItemTemplateEdit[];\r\n\r\n let template: IItemTemplateEdit;\r\n templates.some((t: IItemTemplateEdit) => {\r\n if (itemId == t.itemId) {\r\n template = t;\r\n return true;\r\n }\r\n return false;\r\n });\r\n\r\n return template;\r\n }\r\n\r\n /**\r\n * Returns a top-level store property: solutionItemId, defaultWkid, etc.\r\n *\r\n * @param propName Name of property\r\n *\r\n * @returns Value of property\r\n */\r\n public getStoreInfo(\r\n propName: string\r\n ): any {\r\n return this._store.get(propName);\r\n }\r\n\r\n /**\r\n * Loads a Solution into the store from AGO.\r\n *\r\n * @param solutionItemId Id of the solution represented in the store\r\n * @param authentication Credentials for fetching information to be loaded into the store\r\n *\r\n * @returns Promise that resolves when task is done\r\n */\r\n public async loadSolution(\r\n solutionItemId: string,\r\n authentication: UserSession\r\n ): Promise<void> {\r\n this._authentication = authentication;\r\n console.log(\"load solution \" + solutionItemId);//???\r\n\r\n const solutionData = await getItemDataAsJson(solutionItemId, authentication);\r\n if (solutionData) {\r\n const defaultWkid: string | number = getProp(solutionData, \"params.wkid.default\");\r\n await this._prepareSolutionItemsForEditing(solutionItemId, solutionData.templates, authentication);\r\n const featureServices = this._getFeatureServices(solutionData.templates);\r\n const spatialReferenceInfo = this._getSpatialReferenceInfo(featureServices, defaultWkid);\r\n\r\n this._store.set(\"solutionItemId\", solutionItemId);\r\n this._store.set(\"defaultWkid\", defaultWkid);\r\n this._store.set(\"solutionData\", solutionData);\r\n this._store.set(\"featureServices\", featureServices);\r\n this._store.set(\"spatialReferenceInfo\", spatialReferenceInfo);\r\n }\r\n this._flagStoreHasChanges(false);\r\n }\r\n\r\n /**\r\n * Queues the replacement of the thumbnail associated with a template item in the store.\r\n *\r\n * @param itemEdit Details of the template to modify, containing the new thumbnail in the `thumbnail`\r\n * property\r\n */\r\n public replaceItemThumbnail(\r\n itemEdit: IItemTemplateEdit\r\n ): void {\r\n // Flag the current thumbnail and any replacements for removal\r\n itemEdit.resourceFilePaths.forEach((path: IResourcePath) => {\r\n if (path.type === EFileType.Thumbnail) {\r\n if (path.updateType === EUpdateType.None) {\r\n // Existing thumbnail not yet flagged for removal\r\n path.updateType = EUpdateType.Remove;\r\n } else if (path.updateType === EUpdateType.Add || path.updateType === EUpdateType.Update) {\r\n // An earlier replacement\r\n path.updateType = EUpdateType.Obsolete;\r\n }\r\n }\r\n });\r\n\r\n // Remove any replacements already queued\r\n itemEdit.resourceFilePaths =\r\n itemEdit.resourceFilePaths.filter((path: IResourcePath) => path.updateType != EUpdateType.Obsolete)\r\n\r\n // Add the new thumbnail to the store item\r\n itemEdit.resourceFilePaths.push({\r\n blob: itemEdit.thumbnail,\r\n filename: itemEdit.thumbnail.name,\r\n type: EFileType.Thumbnail,\r\n updateType: EUpdateType.Add\r\n } as IResourcePath);\r\n\r\n // Update the store\r\n this.setItemInfo(itemEdit);\r\n }\r\n\r\n /**\r\n * Writes a Solution into AGO from the store. Must use `loadSolution` to continue with solution.\r\n *\r\n * @returns Promise that resolves when task is done\r\n */\r\n public async saveSolution(\r\n ): Promise<void> {\r\n // Update the templates in the original solution item data\r\n const solutionItemId = this._store.get(\"solutionItemId\");\r\n const solutionData = this._store.get(\"solutionData\");\r\n const spatialReferenceInfo = this._store.get(\"spatialReferenceInfo\");\r\n\r\n await this._prepareSolutionItemsForStorage(solutionItemId, solutionData.templates, this._authentication);\r\n const updatedDefaultWkid = this._setSpatialReferenceInfo(spatialReferenceInfo, solutionData.templates);\r\n if (updatedDefaultWkid) {\r\n setCreateProp(solutionData, \"params.wkid\", {\r\n \"label\": \"Spatial Reference\",\r\n \"default\": updatedDefaultWkid,\r\n \"valueType\": \"spatialReference\",\r\n \"attributes\": {\r\n \"required\": \"true\"\r\n }\r\n });\r\n } else {\r\n setCreateProp(solutionData, \"params.wkid\", {});\r\n }\r\n\r\n const itemInfo: IItemUpdate = {\r\n id: solutionItemId,\r\n text: solutionData\r\n };\r\n await updateItem(itemInfo, this._authentication);\r\n }\r\n\r\n /**\r\n * Stores information for item.\r\n *\r\n * @param itemEdit Item information\r\n */\r\n public setItemInfo(\r\n itemEdit: IItemTemplateEdit\r\n ): void {\r\n const solutionData = this._store.get(\"solutionData\");\r\n const templates = solutionData.templates as IItemTemplateEdit[];\r\n\r\n templates.some((t: IItemTemplateEdit) => {\r\n if (itemEdit.itemId == t.itemId) {\r\n t = itemEdit;\r\n this._store.set(\"solutionData\", solutionData);\r\n this._flagStoreHasChanges(true);\r\n return true;\r\n }\r\n return false;\r\n });\r\n }\r\n\r\n /**\r\n * Sets a top-level store property: solutionItemId, defaultWkid, etc.\r\n *\r\n * @param propName Name of property\r\n * @param value Value of property\r\n */\r\n public setStoreInfo(\r\n propName: string,\r\n value: any\r\n ): void {\r\n this._store.set(propName, value);\r\n this._flagStoreHasChanges(true);\r\n}\r\n\r\n //------------------------------------------------------------------------------------------------------------------//\r\n\r\n /** Provides access to protected methods for unit testing.\r\n *\r\n * @param methodName Name of protected method to run\r\n * @param arg1 First argument to forward to method, e.g., for \"_prepareSolutionItemsForEditing\", `solutionItemId`\r\n * @param arg2 Second argument to forward to method, e.g., for \"_prepareSolutionItemsForEditing\", `templates`\r\n * @param arg3 Third argument to forward to method, e.g., for \"_prepareSolutionItemsForEditing\", `authentication`\r\n *\r\n * @returns\r\n */\r\n public _testAccess(\r\n methodName: string,\r\n arg1?: any,\r\n arg2?: any,\r\n arg3?: any\r\n ): any {\r\n switch (methodName) {\r\n case \"_emptyTheStore\":\r\n this._emptyTheStore();\r\n break;\r\n case \"_getFeatureServices\":\r\n return this._getFeatureServices(arg1);\r\n case \"_getItemsSharedWithThisGroup\":\r\n return this._getItemsSharedWithThisGroup(arg1, arg2);\r\n case \"_getResourceFilePaths\":\r\n return this._getResourceFilePaths(arg1, arg2, arg3);\r\n case \"_getResourceStorageName\":\r\n return this._getResourceStorageName(arg1, arg2);\r\n case \"_getSpatialReferenceInfo\":\r\n return this._getSpatialReferenceInfo(arg1, arg2);\r\n case \"_prepareSolutionItemsForEditing\":\r\n return this._prepareSolutionItemsForEditing(arg1, arg2, arg3);\r\n case \"_prepareSolutionItemsForStorage\":\r\n return this._prepareSolutionItemsForStorage(arg1, arg2, arg3);\r\n case \"_setSpatialReferenceInfo\":\r\n return this._setSpatialReferenceInfo(arg1, arg2);\r\n case \"_splitFilename\":\r\n return this._splitFilename(arg1);\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * Returns the store to the empty state.\r\n *\r\n * @protected\r\n */\r\n protected _emptyTheStore(): void {\r\n this._store.set(\"solutionItemId\", EmptySolutionStore.solutionItemId);\r\n this._store.set(\"defaultWkid\", EmptySolutionStore.defaultWkid);\r\n this._store.set(\"solutionData\", EmptySolutionStore.solutionData);\r\n this._store.set(\"templateEdits\", EmptySolutionStore.templateEdits);\r\n this._store.set(\"featureServices\", EmptySolutionStore.featureServices);\r\n this._store.set(\"spatialReferenceInfo\", EmptySolutionStore.spatialReferenceInfo);\r\n }\r\n\r\n /**\r\n * Sets the store's flag indicating if it has changes and dispatches an event when\r\n * the flag value changes.\r\n *\r\n * @param flagHasChanges Current state of change in the store; if it doesn't match the value saved in this\r\n * object, an event is dispatched with the new value and the saved value is updated\r\n *\r\n * @protected\r\n */\r\n protected _flagStoreHasChanges(flagHasChanges: boolean): void {\r\n // Event for notifying if the store has changes or not\r\n if (this._hasChanges !== flagHasChanges) {\r\n window.dispatchEvent(new CustomEvent(\"solutionStoreHasChanges\", {\r\n detail: flagHasChanges,\r\n bubbles: true,\r\n cancelable: false,\r\n composed: true\r\n }));\r\n }\r\n\r\n this._hasChanges = flagHasChanges;\r\n }\r\n\r\n /**\r\n * Gets a list of Feature Services that are not views.\r\n *\r\n * @param templates A list of item templates from the solution\r\n *\r\n * @returns a list of feature services\r\n *\r\n * @protected\r\n */\r\n protected _getCustomizableFeatureServices(\r\n templates: IItemTemplate[]\r\n ): IItemTemplate[] {\r\n return templates.reduce((prev, cur) => {\r\n if (cur.type === \"Feature Service\" && cur.item.typeKeywords.indexOf(\"View Service\") < 0) {\r\n prev.push(cur);\r\n }\r\n return prev;\r\n }, []);\r\n }\r\n\r\n /**\r\n * Gets a list of Feature Services that are not views along with an enabled property that indicates\r\n * if the service currently uses a spatial reference variable.\r\n *\r\n * @param templates A list of item templates from the solution\r\n *\r\n * @returns a list of feature service names and an enabled property to indicate\r\n * if they currently use a spatial reference variable.\r\n *\r\n * @protected\r\n */\r\n protected _getFeatureServices(\r\n templates: IItemTemplate[]\r\n ): IFeatureServiceEnabledStatus[] {\r\n const customizeableFeatureServices = this._getCustomizableFeatureServices(templates);\r\n return customizeableFeatureServices.map(\r\n (fs) => {\r\n const name: string = fs.item.title || fs.item.name;\r\n const wkid = getProp(fs, \"properties.service.spatialReference.wkid\");\r\n return { name, enabled: wkid.toString().startsWith(\"{{params.wkid||\") } as IFeatureServiceEnabledStatus;\r\n }\r\n );\r\n }\r\n\r\n /**\r\n * Capture the key item details for a given group template\r\n *\r\n * @param template one of the templates from the current solution\r\n * @param templates full list of templates\r\n *\r\n * @returns a list of IItemShare objects\r\n *\r\n * @protected\r\n */\r\n protected _getItemsSharedWithThisGroup(\r\n template: IItemTemplate,\r\n templates: IItemTemplate[]\r\n ): IItemShare[] {\r\n return templates.reduce((prev, cur) => {\r\n if (cur.itemId !== template.itemId && cur.type !== \"Group\") {\r\n prev.push({\r\n id: cur.itemId,\r\n title: cur.item.name || cur.item.title,\r\n isShared: (cur.groups || []).indexOf(template.itemId) > -1,\r\n shareItem: (cur.groups || []).indexOf(template.itemId) > -1,\r\n type: cur.type,\r\n typeKeywords: cur.item.typeKeywords\r\n });\r\n }\r\n return prev;\r\n }, []);\r\n }\r\n\r\n /**\r\n * Generate storage file paths from the solution template\r\n *\r\n * @param solutionId the id of the current solution\r\n * @param template the current template from the solution\r\n * @param portal Portal where file is to be found\r\n *\r\n * @returns a list of resource file infos\r\n *\r\n * @protected\r\n */\r\n protected _getResourceFilePaths(\r\n solutionId: string,\r\n template: any,\r\n portal: string\r\n ): IResourcePath[] {\r\n const resourceFilePaths: IDeployFileCopyPath[] = generateStorageFilePaths(\r\n portal,\r\n solutionId,\r\n template.resources,\r\n SolutionTemplateFormatVersion\r\n );\r\n return resourceFilePaths.map((fp: any) => {\r\n fp.updateType = EUpdateType.None;\r\n return fp;\r\n }) as IResourcePath[];\r\n }\r\n\r\n /**\r\n * Generates a resource name from a storage file path.\r\n *\r\n * @param templateItemId The id of the template item whose resource this is; used as a prefix in the resource name\r\n * @param resourcePath Resource file infos\r\n *\r\n * @returns The resource name to use when attaching a resource to the item.\r\n *\r\n * @protected\r\n */\r\n protected _getResourceStorageName(\r\n templateItemId: string,\r\n resourcePath: IResourcePath\r\n ): string {\r\n /* Converts\r\n {\r\n \"url\": \"https://myorg.maps.arcgis.com/sharing/rest/content/items/ca924c6db7d247b9a31fa30532fb5913/resources/79036430a6274e17ae915d0278b8569c_info_metadata/metadata.xml\",\r\n \"type\": 2,\r\n \"folder\": \"\",\r\n \"filename\": \"metadata.xml\",\r\n \"updateType\": 3\r\n }\r\n to\r\n ca924c6db7d247b9a31fa30532fb5913_info_metadata/metadata.xml\r\n */\r\n let prefix = templateItemId;\r\n switch (resourcePath.type) {\r\n case EFileType.Data:\r\n prefix = `${prefix}_info_data`;\r\n break;\r\n case EFileType.Info:\r\n prefix = `${prefix}_info`;\r\n break;\r\n case EFileType.Metadata:\r\n prefix = `${prefix}_info_metadata`;\r\n break;\r\n case EFileType.Resource:\r\n break;\r\n case EFileType.Thumbnail:\r\n prefix = `${prefix}_info_thumbnail`;\r\n break;\r\n }\r\n\r\n let filenameToUse = resourcePath.filename;\r\n if (resourcePath.type == EFileType.Data && filenameToUse && !isSupportedFileType(filenameToUse)) {\r\n filenameToUse = filenameToUse + \".zip\";\r\n prefix += \"z\";\r\n }\r\n\r\n const filename = resourcePath.folder ? resourcePath.folder + \"/\" + filenameToUse : filenameToUse;\r\n\r\n return prefix + \"/\" + filename;\r\n }\r\n\r\n /**\r\n * Extracts basic spatial reference information that is used to determine if a custom spatial reference parameter will\r\n * be exposed while deploying this solution and if so what feature services will support it and what will the default wkid be\r\n *\r\n * @param services a list of objects with service name and enabled property (indicates if they currently use a spatial reference var)\r\n * @param data the data object of a solution item\r\n *\r\n * @returns an object that stores if a custom spatial reference parameter is enabled/disabled,\r\n * a list of services and if they are enabled/disabled, and the default wkid\r\n *\r\n * @protected\r\n */\r\n protected _getSpatialReferenceInfo(\r\n services: any[],\r\n defaultWkid: string | number\r\n ): ISolutionSpatialReferenceInfo {\r\n const defaultServices: any = {};\r\n services.forEach(service => {\r\n defaultServices[service.name] = service.enabled;\r\n });\r\n\r\n return {\r\n enabled: defaultWkid !== undefined,\r\n services: defaultServices,\r\n spatialReference: defaultWkid ? defaultWkid : undefined\r\n }\r\n }\r\n\r\n /**\r\n * Create and store template items for the editor.\r\n *\r\n * @param solutionItemId Id of the solution represented in the store\r\n * @param templates A list of item templates from the solution\r\n * @param authentication Credentials for fetching information to be loaded into the store\r\n *\r\n * @returns a promise that resolves when the templates are ready\r\n *\r\n * @protected\r\n */\r\n protected async _prepareSolutionItemsForEditing(\r\n solutionItemId: string,\r\n templates: IItemTemplate[],\r\n authentication: UserSession\r\n ): Promise<void> {\r\n const thumbnailPromises = [];\r\n\r\n // Augment the template with paths to resources and group information, if relevant\r\n templates.forEach((t: IItemTemplateEdit) => {\r\n t.resourceFilePaths = this._getResourceFilePaths(\r\n solutionItemId,\r\n t,\r\n authentication.portal\r\n );\r\n thumbnailPromises.push(\r\n t.resourceFilePaths.length > 0 ?\r\n getThumbnailFromStorageItem(authentication, t.resourceFilePaths) :\r\n Promise.resolve()\r\n );\r\n\r\n t.groupDetails = t.type === \"Group\" ? this._getItemsSharedWithThisGroup(t, templates) : [];\r\n });\r\n\r\n // Augment the template with its thumbnail file\r\n const thumbnails = await Promise.all(thumbnailPromises);\r\n templates.forEach((t: IItemTemplateEdit, i: number) => {\r\n t.thumbnail = thumbnails[i] ? thumbnails[i] : undefined;\r\n });\r\n\r\n return Promise.resolve();\r\n }\r\n\r\n /**\r\n * Prepares template items for sending to AGO by updating the resources held by the solution item.\r\n *\r\n * @param solutionItemId Id of the solution represented in the store\r\n * @param templates A list of item templates from the solution\r\n * @param authentication Credentials for fetching information to be loaded into the store\r\n *\r\n * @returns a promise that resolves when the templates are ready\r\n *\r\n * @protected\r\n */\r\n protected async _prepareSolutionItemsForStorage(\r\n solutionItemId: string,\r\n templates: IItemTemplateEdit[],\r\n authentication: UserSession\r\n ): Promise<void> {\r\n const resourceAdds: ISourceFile[] = [];\r\n\r\n // Update the resources and remove the augmentation from a template\r\n const pendingTasks: Promise<void>[] = [];\r\n templates.forEach((t) => {\r\n\r\n // Run through the resourceFilePaths for the item seeking modifications to be made to the solution item's\r\n // collection of resources; queue them for batching\r\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\r\n t.resourceFilePaths.forEach(async (path: IResourcePath): Promise<void> => {\r\n const storageName = this._getResourceStorageName(t.itemId, path);\r\n\r\n switch (path.updateType) {\r\n\r\n case EUpdateType.Add:\r\n const {prefix, suffix } = this._splitFilename(storageName);\r\n t.resources.push(storageName);\r\n resourceAdds.push({\r\n itemId: t.itemId,\r\n file: path.blob,\r\n folder: prefix,\r\n filename: suffix\r\n } as ISourceFile);\r\n break;\r\n\r\n case EUpdateType.Update:\r\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\r\n pendingTasks.push(new Promise<void>(async (resolve): Promise<void> => {\r\n try {\r\n await updateItemResourceFile(solutionItemId, storageName, path.blob, authentication);\r\n } catch (err) {\r\n console.log(\"Unable to update \" + storageName + \" for item \" + t.itemId + \": \" + JSON.stringify(err));\r\n }\r\n resolve();\r\n }));\r\n break;\r\n\r\n case EUpdateType.Remove:\r\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\r\n pendingTasks.push(new Promise<void>(async (resolve): Promise<void> => {\r\n try {\r\n await removeItemResourceFile(solutionItemId, storageName, authentication);\r\n t.resources = t.resources.filter((path: string) => path !== storageName);\r\n } catch (err) {\r\n console.log(\"Unable to remove \" + storageName + \" for item \" + t.itemId + \": \" + JSON.stringify(err));\r\n }\r\n resolve();\r\n }));\r\n break;\r\n\r\n }\r\n return Promise.resolve();\r\n });\r\n\r\n delete t.resourceFilePaths;\r\n delete t.thumbnail;\r\n delete t.groupDetails;\r\n });\r\n\r\n // Update the resources\r\n return Promise.all(pendingTasks)\r\n .then(async () => {\r\n if (resourceAdds.length > 0) {\r\n await copyFilesToStorageItem(resourceAdds, solutionItemId, authentication);\r\n }\r\n return Promise.resolve();\r\n });\r\n }\r\n\r\n /**\r\n * Stores basic spatial reference information that is used to determine if a custom spatial reference parameter will\r\n * be exposed while deploying this solution and if so what feature services will support it and what will the default wkid be\r\n *\r\n * @param spatialReferenceInfo The configuration settings for a custom spatial reference\r\n * @param templates The templates in the current solution, which will be updated in place if\r\n * `spatialReferenceInfo.enabled` is true\r\n *\r\n * @returns The new default wkid\r\n *\r\n * @protected\r\n */\r\n protected _setSpatialReferenceInfo(\r\n spatialReferenceInfo: ISolutionSpatialReferenceInfo,\r\n templates: IItemTemplateEdit[]\r\n ): string | number {\r\n const customizingPrefix = \"{{params.wkid||\";\r\n const customizeableFeatureServices = this._getCustomizableFeatureServices(templates);\r\n\r\n if (spatialReferenceInfo.enabled) {\r\n // Enable or disable this feature in each service\r\n customizeableFeatureServices.forEach(\r\n (fs) => {\r\n const name: string = fs.item.title || fs.item.name;\r\n let wkid: any;\r\n if (spatialReferenceInfo.services[name] ) { // enabled\r\n wkid = `{{params.wkid||${spatialReferenceInfo.spatialReference}}}`;\r\n setCreateProp(fs, \"properties.service.spatialReference.wkid\", wkid);\r\n\r\n } else { // disabled\r\n wkid = getProp(fs, \"properties.service.spatialReference.wkid\");\r\n // Remove customizing prefix if present\r\n if (wkid.toString().startsWith(customizingPrefix)) {\r\n wkid = wkid.toString().substring(customizingPrefix.length, wkid.length - 2);\r\n setCreateProp(fs, \"properties.service.spatialReference.wkid\", wkid);\r\n }\r\n }\r\n }\r\n );\r\n return spatialReferenceInfo.spatialReference;\r\n\r\n } else {\r\n // Disable this feature in each service\r\n customizeableFeatureServices.forEach(\r\n (fs) => {\r\n const wkid = getProp(fs, \"properties.service.spatialReference.wkid\");\r\n // Remove customizing prefix if present\r\n if (wkid.toString().startsWith(customizingPrefix)) {\r\n setCreateProp(fs, \"properties.service.spatialReference.wkid\",\r\n wkid.toString().substring(customizingPrefix.length, wkid.length - 2));\r\n }\r\n }\r\n );\r\n return undefined;\r\n }\r\n }\r\n\r\n /**\r\n * Splits a pathed filename into a last term and a prefix; e.g., \"a/b/c\" returns \"c\" with a prefix of \"a/b\".\r\n *\r\n * @param filename Filename with optional path\r\n *\r\n * @returns An object consisting of a `prefix` (undefined if `filename` does not contain a path) and a `suffix`--the\r\n * filename at the end of a path\r\n *\r\n * @protected\r\n */\r\n protected _splitFilename(\r\n filename: string\r\n ): { prefix: string, suffix: string } {\r\n const filenameParts = filename.split(\"/\");\r\n return {\r\n prefix: filenameParts.length > 1 ? filenameParts.slice(0, filenameParts.length - 1).join(\"/\") : undefined,\r\n suffix: filenameParts[filenameParts.length - 1]\r\n };\r\n }\r\n}\r\n\r\nexport default SolutionStore.Store;\r\n"]}
1
+ {"version":3,"file":"solution-store.js","sourceRoot":"","sources":["../../src/utils/solution-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,WAAW,EAOZ,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,SAAS,EACT,6BAA6B,EAC7B,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,EACjB,OAAO,EACP,2BAA2B,EAM3B,mBAAmB,EACnB,sBAAsB,EACtB,aAAa,EACb,UAAU,EACV,sBAAsB,EAEvB,MAAM,uBAAuB,CAAC;AA6C/B,MAAM,kBAAkB,GAAsB;EAC5C,cAAc,EAAE,EAAE;EAClB,WAAW,EAAE,SAAS;EACtB,YAAY,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;EAC7C,aAAa,EAAE,EAAE;EACjB,eAAe,EAAE,EAAE;EACnB,oBAAoB,EAAE;IACp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AAM,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;SACzE;MACH,CAAC,CACF,CAAC;MACF,OAAO,SAAS,CAAC;KAClB;EACH,CAAC;EAED;;;;;;;;;KASG;EACO,cAAc,CACtB,QAAgB;IAEhB,MAAM,aAAa,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC1C,OAAO;MACL,MAAM,EAAE,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;MACzG,MAAM,EAAE,aAAa,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;KAChD,CAAC;EACJ,CAAC;CACF;AAED,eAAe,aAAa,CAAC,KAAK,CAAC","sourcesContent":["/** @license\r\n * Copyright 2022 Esri\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\nimport { createStore } from \"@stencil/store\";\r\nimport {\r\n EUpdateType,\r\n IFeatureServiceEnabledStatus,\r\n IItemShare,\r\n IItemTemplateEdit,\r\n IResourcePath,\r\n ISolutionTemplateEdits,\r\n ISolutionSpatialReferenceInfo\r\n} from './interfaces';\r\nimport {\r\n EFileType,\r\n SolutionTemplateFormatVersion,\r\n copyFilesToStorageItem,\r\n generateStorageFilePaths,\r\n getItemDataAsJson,\r\n getProp,\r\n getThumbnailFromStorageItem,\r\n IDeployFileCopyPath,\r\n IItemTemplate,\r\n IItemUpdate,\r\n ISolutionItemData,\r\n ISourceFile,\r\n isSupportedFileType,\r\n removeItemResourceFile,\r\n setCreateProp,\r\n updateItem,\r\n updateItemResourceFile,\r\n UserSession\r\n} from '@esri/solution-common';\r\n\r\n//--------------------------------------------------------------------------------------------------------------------//\r\n//\r\n// Loads a solution's definition and shares it as state across the solution configuration package components.\r\n//\r\n// Store contents:\r\n// * solutionItemId: [string] id of the current solution\r\n// * defaultWkid: [any] value of the solution's `params.wkid.default` data property, which may be undefined\r\n// * solutionData: [ISolutionItemData] the solution's data, which is modified in-place\r\n// * featureServices: [array] a list of Feature service enablement status for SR configuration\r\n// * spatialReferenceInfo: [object] the current spatial reference (if enabled) and the services that use it\r\n// * enabled: [boolean] use the spatial reference\r\n// * services: [object] services using this spatial reference organized by the service name\r\n// * spatialReference: [object] the spatial reference display\r\n//\r\n// Store singleton method:\r\n// * Store: Creates singleton instance when accessed; default export from module.\r\n// @example\r\n// import state from \"../solution-store\";\r\n// await state.loadSolution(...);\r\n//\r\n// Store instance methods:\r\n// * getItemInfo: Returns the stored information of an item.\r\n// * getStoreInfo: Returns a top-level store property: solutionItemId, defaultWkid, etc.\r\n// * loadSolution: Loads a Solution into the store from AGO.\r\n// * replaceItemThumbnail: Replaces the thumbnail associated with a template item in the store.\r\n// * saveSolution: Writes a Solution into AGO from the store.\r\n// * setItemInfo: Stores information for item.\r\n// * setStoreInfo: Sets a top-level store property: solutionItemId, defaultWkid, etc.\r\n//\r\n// Store events:\r\n// * solutionStoreHasChanges: Event for notifying if the store has changes or not.\r\n//\r\n//--------------------------------------------------------------------------------------------------------------------//\r\n\r\ninterface SolutionStoreData {\r\n solutionItemId: string,\r\n defaultWkid: string,\r\n solutionData: ISolutionItemData,\r\n templateEdits: ISolutionTemplateEdits,\r\n featureServices: IFeatureServiceEnabledStatus[],\r\n spatialReferenceInfo: ISolutionSpatialReferenceInfo\r\n}\r\n\r\nconst EmptySolutionStore: SolutionStoreData = {\r\n solutionItemId: \"\",\r\n defaultWkid: undefined,\r\n solutionData: { metadata: {}, templates: [] },\r\n templateEdits: {},\r\n featureServices: [],\r\n spatialReferenceInfo: {\r\n enabled: false,\r\n services: {},\r\n spatialReference: undefined\r\n }\r\n}\r\n\r\nclass SolutionStore\r\n{\r\n protected static _instance: SolutionStore;\r\n\r\n protected _store: any;\r\n\r\n protected _hasChanges = false;\r\n\r\n protected _authentication: UserSession;\r\n\r\n /**\r\n * Creates singleton instance when accessed; default export from module.\r\n *\r\n * @returns Static instance of the class\r\n */\r\n public static get Store(): SolutionStore {\r\n return this._instance || (this._instance = new this());\r\n }\r\n\r\n /**\r\n * Creates an empty store.\r\n *\r\n * @protected\r\n */\r\n protected constructor() {\r\n this._store = createStore({\r\n ...EmptySolutionStore\r\n });\r\n }\r\n\r\n /**\r\n * Returns the stored information of an item.\r\n *\r\n * @param itemId Id of item to fetch\r\n *\r\n * @returns Item information or `undefined` if not found\r\n */\r\n public getItemInfo(\r\n itemId: string\r\n ): IItemTemplateEdit {\r\n const templates = this._store.get(\"solutionData\").templates as IItemTemplateEdit[];\r\n\r\n let template: IItemTemplateEdit;\r\n templates.some((t: IItemTemplateEdit) => {\r\n if (itemId == t.itemId) {\r\n template = t;\r\n return true;\r\n }\r\n return false;\r\n });\r\n\r\n return template;\r\n }\r\n\r\n /**\r\n * Returns a top-level store property: solutionItemId, defaultWkid, etc.\r\n *\r\n * @param propName Name of property\r\n *\r\n * @returns Value of property\r\n */\r\n public getStoreInfo(\r\n propName: string\r\n ): any {\r\n return this._store.get(propName);\r\n }\r\n\r\n /**\r\n * Loads a Solution into the store from AGO.\r\n *\r\n * @param solutionItemId Id of the solution represented in the store\r\n * @param authentication Credentials for fetching information to be loaded into the store\r\n *\r\n * @returns Promise that resolves when task is done\r\n */\r\n public async loadSolution(\r\n solutionItemId: string,\r\n authentication: UserSession\r\n ): Promise<void> {\r\n this._authentication = authentication;\r\n\r\n const solutionData = await getItemDataAsJson(solutionItemId, authentication);\r\n if (solutionData) {\r\n const defaultWkid: string | number = getProp(solutionData, \"params.wkid.default\");\r\n await this._prepareSolutionItemsForEditing(solutionItemId, solutionData.templates, authentication);\r\n const featureServices = this._getFeatureServices(solutionData.templates);\r\n const spatialReferenceInfo = this._getSpatialReferenceInfo(featureServices, defaultWkid);\r\n\r\n this._store.set(\"solutionItemId\", solutionItemId);\r\n this._store.set(\"defaultWkid\", defaultWkid);\r\n this._store.set(\"solutionData\", solutionData);\r\n this._store.set(\"featureServices\", featureServices);\r\n this._store.set(\"spatialReferenceInfo\", spatialReferenceInfo);\r\n }\r\n this._flagStoreHasChanges(false);\r\n }\r\n\r\n /**\r\n * Queues the replacement of the thumbnail associated with a template item in the store.\r\n *\r\n * @param itemEdit Details of the template to modify, containing the new thumbnail in the `thumbnail`\r\n * property\r\n */\r\n public replaceItemThumbnail(\r\n itemEdit: IItemTemplateEdit\r\n ): void {\r\n // Flag the current thumbnail and any replacements for removal\r\n itemEdit.resourceFilePaths.forEach((path: IResourcePath) => {\r\n if (path.type === EFileType.Thumbnail) {\r\n if (path.updateType === EUpdateType.None) {\r\n // Existing thumbnail not yet flagged for removal\r\n path.updateType = EUpdateType.Remove;\r\n } else if (path.updateType === EUpdateType.Add || path.updateType === EUpdateType.Update) {\r\n // An earlier replacement\r\n path.updateType = EUpdateType.Obsolete;\r\n }\r\n }\r\n });\r\n\r\n // Remove any replacements already queued\r\n itemEdit.resourceFilePaths =\r\n itemEdit.resourceFilePaths.filter((path: IResourcePath) => path.updateType != EUpdateType.Obsolete)\r\n\r\n // Add the new thumbnail to the store item\r\n itemEdit.resourceFilePaths.push({\r\n blob: itemEdit.thumbnail,\r\n filename: itemEdit.thumbnail.name,\r\n type: EFileType.Thumbnail,\r\n updateType: EUpdateType.Add\r\n } as IResourcePath);\r\n\r\n // Update the store\r\n this.setItemInfo(itemEdit);\r\n }\r\n\r\n /**\r\n * Writes a Solution into AGO from the store. Must use `loadSolution` to continue with solution.\r\n *\r\n * @returns Promise that resolves when task is done\r\n */\r\n public async saveSolution(\r\n ): Promise<void> {\r\n // Update the templates in the original solution item data\r\n const solutionItemId = this._store.get(\"solutionItemId\");\r\n const solutionData = this._store.get(\"solutionData\");\r\n const spatialReferenceInfo = this._store.get(\"spatialReferenceInfo\");\r\n\r\n await this._prepareSolutionItemsForStorage(solutionItemId, solutionData.templates, this._authentication);\r\n const updatedDefaultWkid = this._setSpatialReferenceInfo(spatialReferenceInfo, solutionData.templates);\r\n if (updatedDefaultWkid) {\r\n setCreateProp(solutionData, \"params.wkid\", {\r\n \"label\": \"Spatial Reference\",\r\n \"default\": updatedDefaultWkid,\r\n \"valueType\": \"spatialReference\",\r\n \"attributes\": {\r\n \"required\": \"true\"\r\n }\r\n });\r\n } else {\r\n setCreateProp(solutionData, \"params.wkid\", {});\r\n }\r\n\r\n const itemInfo: IItemUpdate = {\r\n id: solutionItemId,\r\n text: solutionData\r\n };\r\n await updateItem(itemInfo, this._authentication);\r\n }\r\n\r\n /**\r\n * Stores information for item.\r\n *\r\n * @param itemEdit Item information\r\n */\r\n public setItemInfo(\r\n itemEdit: IItemTemplateEdit\r\n ): void {\r\n const solutionData = this._store.get(\"solutionData\");\r\n const templates = solutionData.templates as IItemTemplateEdit[];\r\n\r\n templates.some((t: IItemTemplateEdit) => {\r\n if (itemEdit.itemId == t.itemId) {\r\n t = itemEdit;\r\n this._store.set(\"solutionData\", solutionData);\r\n this._flagStoreHasChanges(true);\r\n return true;\r\n }\r\n return false;\r\n });\r\n }\r\n\r\n /**\r\n * Sets a top-level store property: solutionItemId, defaultWkid, etc.\r\n *\r\n * @param propName Name of property\r\n * @param value Value of property\r\n */\r\n public setStoreInfo(\r\n propName: string,\r\n value: any\r\n ): void {\r\n this._store.set(propName, value);\r\n this._flagStoreHasChanges(true);\r\n}\r\n\r\n //------------------------------------------------------------------------------------------------------------------//\r\n\r\n /** Provides access to protected methods for unit testing.\r\n *\r\n * @param methodName Name of protected method to run\r\n * @param arg1 First argument to forward to method, e.g., for \"_prepareSolutionItemsForEditing\", `solutionItemId`\r\n * @param arg2 Second argument to forward to method, e.g., for \"_prepareSolutionItemsForEditing\", `templates`\r\n * @param arg3 Third argument to forward to method, e.g., for \"_prepareSolutionItemsForEditing\", `authentication`\r\n *\r\n * @returns\r\n */\r\n public _testAccess(\r\n methodName: string,\r\n arg1?: any,\r\n arg2?: any,\r\n arg3?: any\r\n ): any {\r\n switch (methodName) {\r\n case \"_emptyTheStore\":\r\n this._emptyTheStore();\r\n break;\r\n case \"_getFeatureServices\":\r\n return this._getFeatureServices(arg1);\r\n case \"_getItemsSharedWithThisGroup\":\r\n return this._getItemsSharedWithThisGroup(arg1, arg2);\r\n case \"_getResourceFilePaths\":\r\n return this._getResourceFilePaths(arg1, arg2, arg3);\r\n case \"_getResourceStorageName\":\r\n return this._getResourceStorageName(arg1, arg2);\r\n case \"_getSpatialReferenceInfo\":\r\n return this._getSpatialReferenceInfo(arg1, arg2);\r\n case \"_prepareSolutionItemsForEditing\":\r\n return this._prepareSolutionItemsForEditing(arg1, arg2, arg3);\r\n case \"_prepareSolutionItemsForStorage\":\r\n return this._prepareSolutionItemsForStorage(arg1, arg2, arg3);\r\n case \"_setSpatialReferenceInfo\":\r\n return this._setSpatialReferenceInfo(arg1, arg2);\r\n case \"_splitFilename\":\r\n return this._splitFilename(arg1);\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * Returns the store to the empty state.\r\n *\r\n * @protected\r\n */\r\n protected _emptyTheStore(): void {\r\n this._store.set(\"solutionItemId\", EmptySolutionStore.solutionItemId);\r\n this._store.set(\"defaultWkid\", EmptySolutionStore.defaultWkid);\r\n this._store.set(\"solutionData\", EmptySolutionStore.solutionData);\r\n this._store.set(\"templateEdits\", EmptySolutionStore.templateEdits);\r\n this._store.set(\"featureServices\", EmptySolutionStore.featureServices);\r\n this._store.set(\"spatialReferenceInfo\", EmptySolutionStore.spatialReferenceInfo);\r\n }\r\n\r\n /**\r\n * Sets the store's flag indicating if it has changes and dispatches an event when\r\n * the flag value changes.\r\n *\r\n * @param flagHasChanges Current state of change in the store; if it doesn't match the value saved in this\r\n * object, an event is dispatched with the new value and the saved value is updated\r\n *\r\n * @protected\r\n */\r\n protected _flagStoreHasChanges(flagHasChanges: boolean): void {\r\n // Event for notifying if the store has changes or not\r\n if (this._hasChanges !== flagHasChanges) {\r\n window.dispatchEvent(new CustomEvent(\"solutionStoreHasChanges\", {\r\n detail: flagHasChanges,\r\n bubbles: true,\r\n cancelable: false,\r\n composed: true\r\n }));\r\n }\r\n\r\n this._hasChanges = flagHasChanges;\r\n }\r\n\r\n /**\r\n * Gets a list of Feature Services that are not views.\r\n *\r\n * @param templates A list of item templates from the solution\r\n *\r\n * @returns a list of feature services\r\n *\r\n * @protected\r\n */\r\n protected _getCustomizableFeatureServices(\r\n templates: IItemTemplate[]\r\n ): IItemTemplate[] {\r\n return templates.reduce((prev, cur) => {\r\n if (cur.type === \"Feature Service\" && cur.item.typeKeywords.indexOf(\"View Service\") < 0) {\r\n prev.push(cur);\r\n }\r\n return prev;\r\n }, []);\r\n }\r\n\r\n /**\r\n * Gets a list of Feature Services that are not views along with an enabled property that indicates\r\n * if the service currently uses a spatial reference variable.\r\n *\r\n * @param templates A list of item templates from the solution\r\n *\r\n * @returns a list of feature service names and an enabled property to indicate\r\n * if they currently use a spatial reference variable.\r\n *\r\n * @protected\r\n */\r\n protected _getFeatureServices(\r\n templates: IItemTemplate[]\r\n ): IFeatureServiceEnabledStatus[] {\r\n const customizeableFeatureServices = this._getCustomizableFeatureServices(templates);\r\n return customizeableFeatureServices.map(\r\n (fs) => {\r\n const name: string = fs.item.title || fs.item.name;\r\n const wkid = getProp(fs, \"properties.service.spatialReference.wkid\");\r\n return { name, enabled: wkid.toString().startsWith(\"{{params.wkid||\") } as IFeatureServiceEnabledStatus;\r\n }\r\n );\r\n }\r\n\r\n /**\r\n * Capture the key item details for a given group template\r\n *\r\n * @param template one of the templates from the current solution\r\n * @param templates full list of templates\r\n *\r\n * @returns a list of IItemShare objects\r\n *\r\n * @protected\r\n */\r\n protected _getItemsSharedWithThisGroup(\r\n template: IItemTemplate,\r\n templates: IItemTemplate[]\r\n ): IItemShare[] {\r\n return templates.reduce((prev, cur) => {\r\n if (cur.itemId !== template.itemId && cur.type !== \"Group\") {\r\n prev.push({\r\n id: cur.itemId,\r\n title: cur.item.name || cur.item.title,\r\n isShared: (cur.groups || []).indexOf(template.itemId) > -1,\r\n shareItem: (cur.groups || []).indexOf(template.itemId) > -1,\r\n type: cur.type,\r\n typeKeywords: cur.item.typeKeywords\r\n });\r\n }\r\n return prev;\r\n }, []);\r\n }\r\n\r\n /**\r\n * Generate storage file paths from the solution template\r\n *\r\n * @param solutionId the id of the current solution\r\n * @param template the current template from the solution\r\n * @param portal Portal where file is to be found\r\n *\r\n * @returns a list of resource file infos\r\n *\r\n * @protected\r\n */\r\n protected _getResourceFilePaths(\r\n solutionId: string,\r\n template: any,\r\n portal: string\r\n ): IResourcePath[] {\r\n const resourceFilePaths: IDeployFileCopyPath[] = generateStorageFilePaths(\r\n portal,\r\n solutionId,\r\n template.resources,\r\n SolutionTemplateFormatVersion\r\n );\r\n return resourceFilePaths.map((fp: any) => {\r\n fp.updateType = EUpdateType.None;\r\n return fp;\r\n }) as IResourcePath[];\r\n }\r\n\r\n /**\r\n * Generates a resource name from a storage file path.\r\n *\r\n * @param templateItemId The id of the template item whose resource this is; used as a prefix in the resource name\r\n * @param resourcePath Resource file infos\r\n *\r\n * @returns The resource name to use when attaching a resource to the item.\r\n *\r\n * @protected\r\n */\r\n protected _getResourceStorageName(\r\n templateItemId: string,\r\n resourcePath: IResourcePath\r\n ): string {\r\n /* Converts\r\n {\r\n \"url\": \"https://myorg.maps.arcgis.com/sharing/rest/content/items/ca924c6db7d247b9a31fa30532fb5913/resources/79036430a6274e17ae915d0278b8569c_info_metadata/metadata.xml\",\r\n \"type\": 2,\r\n \"folder\": \"\",\r\n \"filename\": \"metadata.xml\",\r\n \"updateType\": 3\r\n }\r\n to\r\n ca924c6db7d247b9a31fa30532fb5913_info_metadata/metadata.xml\r\n */\r\n let prefix = templateItemId;\r\n switch (resourcePath.type) {\r\n case EFileType.Data:\r\n prefix = `${prefix}_info_data`;\r\n break;\r\n case EFileType.Info:\r\n prefix = `${prefix}_info`;\r\n break;\r\n case EFileType.Metadata:\r\n prefix = `${prefix}_info_metadata`;\r\n break;\r\n case EFileType.Resource:\r\n break;\r\n case EFileType.Thumbnail:\r\n prefix = `${prefix}_info_thumbnail`;\r\n break;\r\n }\r\n\r\n let filenameToUse = resourcePath.filename;\r\n if (resourcePath.type == EFileType.Data && filenameToUse && !isSupportedFileType(filenameToUse)) {\r\n filenameToUse = filenameToUse + \".zip\";\r\n prefix += \"z\";\r\n }\r\n\r\n const filename = resourcePath.folder ? resourcePath.folder + \"/\" + filenameToUse : filenameToUse;\r\n\r\n return prefix + \"/\" + filename;\r\n }\r\n\r\n /**\r\n * Extracts basic spatial reference information that is used to determine if a custom spatial reference parameter will\r\n * be exposed while deploying this solution and if so what feature services will support it and what will the default wkid be\r\n *\r\n * @param services a list of objects with service name and enabled property (indicates if they currently use a spatial reference var)\r\n * @param data the data object of a solution item\r\n *\r\n * @returns an object that stores if a custom spatial reference parameter is enabled/disabled,\r\n * a list of services and if they are enabled/disabled, and the default wkid\r\n *\r\n * @protected\r\n */\r\n protected _getSpatialReferenceInfo(\r\n services: any[],\r\n defaultWkid: string | number\r\n ): ISolutionSpatialReferenceInfo {\r\n const defaultServices: any = {};\r\n services.forEach(service => {\r\n defaultServices[service.name] = service.enabled;\r\n });\r\n\r\n return {\r\n enabled: defaultWkid !== undefined,\r\n services: defaultServices,\r\n spatialReference: defaultWkid ? defaultWkid : undefined\r\n }\r\n }\r\n\r\n /**\r\n * Create and store template items for the editor.\r\n *\r\n * @param solutionItemId Id of the solution represented in the store\r\n * @param templates A list of item templates from the solution\r\n * @param authentication Credentials for fetching information to be loaded into the store\r\n *\r\n * @returns a promise that resolves when the templates are ready\r\n *\r\n * @protected\r\n */\r\n protected async _prepareSolutionItemsForEditing(\r\n solutionItemId: string,\r\n templates: IItemTemplate[],\r\n authentication: UserSession\r\n ): Promise<void> {\r\n const thumbnailPromises = [];\r\n\r\n // Augment the template with paths to resources and group information, if relevant\r\n templates.forEach((t: IItemTemplateEdit) => {\r\n t.resourceFilePaths = this._getResourceFilePaths(\r\n solutionItemId,\r\n t,\r\n authentication.portal\r\n );\r\n thumbnailPromises.push(\r\n t.resourceFilePaths.length > 0 ?\r\n getThumbnailFromStorageItem(authentication, t.resourceFilePaths) :\r\n Promise.resolve()\r\n );\r\n\r\n t.groupDetails = t.type === \"Group\" ? this._getItemsSharedWithThisGroup(t, templates) : [];\r\n });\r\n\r\n // Augment the template with its thumbnail file\r\n const thumbnails = await Promise.all(thumbnailPromises);\r\n templates.forEach((t: IItemTemplateEdit, i: number) => {\r\n t.thumbnail = thumbnails[i] ? thumbnails[i] : undefined;\r\n });\r\n\r\n return Promise.resolve();\r\n }\r\n\r\n /**\r\n * Prepares template items for sending to AGO by updating the resources held by the solution item.\r\n *\r\n * @param solutionItemId Id of the solution represented in the store\r\n * @param templates A list of item templates from the solution\r\n * @param authentication Credentials for fetching information to be loaded into the store\r\n *\r\n * @returns a promise that resolves when the templates are ready\r\n *\r\n * @protected\r\n */\r\n protected async _prepareSolutionItemsForStorage(\r\n solutionItemId: string,\r\n templates: IItemTemplateEdit[],\r\n authentication: UserSession\r\n ): Promise<void> {\r\n const resourceAdds: ISourceFile[] = [];\r\n\r\n // Update the resources and remove the augmentation from a template\r\n const pendingTasks: Promise<void>[] = [];\r\n templates.forEach((t) => {\r\n\r\n // Run through the resourceFilePaths for the item seeking modifications to be made to the solution item's\r\n // collection of resources; queue them for batching\r\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\r\n t.resourceFilePaths.forEach(async (path: IResourcePath): Promise<void> => {\r\n const storageName = this._getResourceStorageName(t.itemId, path);\r\n\r\n switch (path.updateType) {\r\n\r\n case EUpdateType.Add:\r\n const {prefix, suffix } = this._splitFilename(storageName);\r\n t.resources.push(storageName);\r\n resourceAdds.push({\r\n itemId: t.itemId,\r\n file: path.blob,\r\n folder: prefix,\r\n filename: suffix\r\n } as ISourceFile);\r\n break;\r\n\r\n case EUpdateType.Update:\r\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\r\n pendingTasks.push(new Promise<void>(async (resolve): Promise<void> => {\r\n try {\r\n await updateItemResourceFile(solutionItemId, storageName, path.blob, authentication);\r\n } catch (err) {\r\n console.log(\"Unable to update \" + storageName + \" for item \" + t.itemId + \": \" + JSON.stringify(err));\r\n }\r\n resolve();\r\n }));\r\n break;\r\n\r\n case EUpdateType.Remove:\r\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\r\n pendingTasks.push(new Promise<void>(async (resolve): Promise<void> => {\r\n try {\r\n await removeItemResourceFile(solutionItemId, storageName, authentication);\r\n t.resources = t.resources.filter((path: string) => path !== storageName);\r\n } catch (err) {\r\n console.log(\"Unable to remove \" + storageName + \" for item \" + t.itemId + \": \" + JSON.stringify(err));\r\n }\r\n resolve();\r\n }));\r\n break;\r\n\r\n }\r\n return Promise.resolve();\r\n });\r\n\r\n //???delete t.resourceFilePaths;\r\n //???delete t.thumbnail;\r\n //???delete t.groupDetails;\r\n });\r\n\r\n // Update the resources\r\n return Promise.all(pendingTasks)\r\n .then(async () => {\r\n if (resourceAdds.length > 0) {\r\n await copyFilesToStorageItem(resourceAdds, solutionItemId, authentication);\r\n }\r\n return Promise.resolve();\r\n });\r\n }\r\n\r\n /**\r\n * Stores basic spatial reference information that is used to determine if a custom spatial reference parameter will\r\n * be exposed while deploying this solution and if so what feature services will support it and what will the default wkid be\r\n *\r\n * @param spatialReferenceInfo The configuration settings for a custom spatial reference\r\n * @param templates The templates in the current solution, which will be updated in place if\r\n * `spatialReferenceInfo.enabled` is true\r\n *\r\n * @returns The new default wkid\r\n *\r\n * @protected\r\n */\r\n protected _setSpatialReferenceInfo(\r\n spatialReferenceInfo: ISolutionSpatialReferenceInfo,\r\n templates: IItemTemplateEdit[]\r\n ): string | number {\r\n const customizingPrefix = \"{{params.wkid||\";\r\n const customizeableFeatureServices = this._getCustomizableFeatureServices(templates);\r\n\r\n if (spatialReferenceInfo.enabled) {\r\n // Enable or disable this feature in each service\r\n customizeableFeatureServices.forEach(\r\n (fs) => {\r\n const name: string = fs.item.title || fs.item.name;\r\n let wkid: any;\r\n if (spatialReferenceInfo.services[name] ) { // enabled\r\n wkid = `{{params.wkid||${spatialReferenceInfo.spatialReference}}}`;\r\n setCreateProp(fs, \"properties.service.spatialReference.wkid\", wkid);\r\n\r\n } else { // disabled\r\n wkid = getProp(fs, \"properties.service.spatialReference.wkid\");\r\n // Remove customizing prefix if present\r\n if (wkid.toString().startsWith(customizingPrefix)) {\r\n wkid = wkid.toString().substring(customizingPrefix.length, wkid.length - 2);\r\n setCreateProp(fs, \"properties.service.spatialReference.wkid\", wkid);\r\n }\r\n }\r\n }\r\n );\r\n return spatialReferenceInfo.spatialReference;\r\n\r\n } else {\r\n // Disable this feature in each service\r\n customizeableFeatureServices.forEach(\r\n (fs) => {\r\n const wkid = getProp(fs, \"properties.service.spatialReference.wkid\");\r\n // Remove customizing prefix if present\r\n if (wkid.toString().startsWith(customizingPrefix)) {\r\n setCreateProp(fs, \"properties.service.spatialReference.wkid\",\r\n wkid.toString().substring(customizingPrefix.length, wkid.length - 2));\r\n }\r\n }\r\n );\r\n return undefined;\r\n }\r\n }\r\n\r\n /**\r\n * Splits a pathed filename into a last term and a prefix; e.g., \"a/b/c\" returns \"c\" with a prefix of \"a/b\".\r\n *\r\n * @param filename Filename with optional path\r\n *\r\n * @returns An object consisting of a `prefix` (undefined if `filename` does not contain a path) and a `suffix`--the\r\n * filename at the end of a path\r\n *\r\n * @protected\r\n */\r\n protected _splitFilename(\r\n filename: string\r\n ): { prefix: string, suffix: string } {\r\n const filenameParts = filename.split(\"/\");\r\n return {\r\n prefix: filenameParts.length > 1 ? filenameParts.slice(0, filenameParts.length - 1).join(\"/\") : undefined,\r\n suffix: filenameParts[filenameParts.length - 1]\r\n };\r\n }\r\n}\r\n\r\nexport default SolutionStore.Store;\r\n"]}
@@ -141,7 +141,6 @@ class SolutionStore
141
141
  public getItemInfo(
142
142
  itemId: string
143
143
  ): IItemTemplateEdit {
144
- console.log("getItemInfo for " + itemId);//???
145
144
  const templates = this._store.get("solutionData").templates as IItemTemplateEdit[];
146
145
 
147
146
  let template: IItemTemplateEdit;
@@ -182,7 +181,6 @@ class SolutionStore
182
181
  authentication: UserSession
183
182
  ): Promise<void> {
184
183
  this._authentication = authentication;
185
- console.log("load solution " + solutionItemId);//???
186
184
 
187
185
  const solutionData = await getItemDataAsJson(solutionItemId, authentication);
188
186
  if (solutionData) {
@@ -684,9 +682,9 @@ class SolutionStore
684
682
  return Promise.resolve();
685
683
  });
686
684
 
687
- delete t.resourceFilePaths;
688
- delete t.thumbnail;
689
- delete t.groupDetails;
685
+ //???delete t.resourceFilePaths;
686
+ //???delete t.thumbnail;
687
+ //???delete t.groupDetails;
690
688
  });
691
689
 
692
690
  // Update the resources
@@ -15,8 +15,8 @@ import { d as decimalPlaces, c as clamp } from './math-552c5420.js';
15
15
  import { i as isActivationKey } from './key-acb660e7.js';
16
16
  import { n as numberStringFormatter, c as connectLocalized, d as disconnectLocalized } from './locale-0b490b02.js';
17
17
  import { s as state } from './publicNotificationStore-060c59c8.js';
18
- import { f as ESelectionType, e as ERefineMode, d as ESelectionMode } from './interfaces-e2a2064d.js';
19
- import { b as getMapLayerView, f as queryFeaturesByGeometry, h as highlightFeatures } from './mapViewUtils-09f1e7bd.js';
18
+ import { f as ESelectionType, d as ERefineMode, c as ESelectionMode } from './interfaces-1bdfc3a8.js';
19
+ import { b as getMapLayerView, f as queryFeaturesByGeometry, h as highlightFeatures } from './mapViewUtils-809947c8.js';
20
20
  import './_commonjsHelpers-8fd39c50.js';
21
21
  import './resources-436ae282.js';
22
22
  import './observers-31601001.js';
@@ -11,8 +11,8 @@ import { c as connectConditionalSlotComponent, d as disconnectConditionalSlotCom
11
11
  import { d as debounce } from './debounce-4c884e5c.js';
12
12
  import { S as StatusIcons } from './interfaces-4ae145eb.js';
13
13
  import { l as loadModules } from './loadModules-d3b50f95.js';
14
- import { a as goToSelection, h as highlightFeatures, q as queryObjectIds, d as getQueryGeoms, e as queryFeaturesByID } from './mapViewUtils-09f1e7bd.js';
15
- import { E as EWorkflowType, d as ESelectionMode, e as ERefineMode } from './interfaces-e2a2064d.js';
14
+ import { a as goToSelection, h as highlightFeatures, q as queryObjectIds, d as getQueryGeoms, e as queryFeaturesByID } from './mapViewUtils-809947c8.js';
15
+ import { E as EWorkflowType, c as ESelectionMode, d as ERefineMode } from './interfaces-1bdfc3a8.js';
16
16
  import { s as state } from './publicNotificationStore-060c59c8.js';
17
17
  import { g as getLocaleComponentStrings } from './locale-0e10d7e5.js';
18
18
  import { p as pdfUtils } from './labelFormats-b37958c3.js';