EsriPS / arcgis-assistant-feedback

A Swiss Army Knife for ArcGIS.
https://assistant.esri-ps.com
29 stars 2 forks source link

After copying hosted app, incorrect URL in the new app's description JSON #25

Closed jevandusen closed 3 years ago

jevandusen commented 3 years ago

Describe the bug After using the "Copy Items" tool in the ArcGIS Assistant to copy a hosted app (e.g., a story map, Instant App, or Web AppBuilder app), the URL property of the new app still uses the URL of the original app. This incorrect URL can be seen in the app's description JSON and in the URL field of the ArcGIS Online item page. The effect is that clicking the "View" button on the app's ArcGIS Online item page causes the original app to be opened.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://assistant.esri-ps.com/content, select an app (e.g., an app with the item ID "641dde9146d54476ada92e88a585badc"), click "Copy Items" in the toolbar, and continue with the copying workflow as prompted. You can copy the app to the same account, to a different user account in the same organization, or to a user account in a different organization -- the same issue occurs in any case.
  2. In the panel that appears after the copy operation finishes, note that a new item ID is provided for the app, as expected, but the URL for the new app still contains the item ID of the original app at the end. For example, the new item ID may be "35dddcf5131346e3a8ab7cd8dee463c7", but the URL is "https://edu.maps.arcgis.com/apps/webappviewer/index.html?id=641dde9146d54476ada92e88a585badc" (note that this item ID is the same as in step 1 above).
  3. Open the JSON for the item, and in the Description JSON, note that the "id" value in the JSON is different from the item ID in the "url" value further down in the JSON. Editing the "url" value manually to use the new item ID resolves the issue.

Expected behavior The new app's URL property should contain the new item ID, rather than the item ID for the old app.

Additional context I have been able to reproduce this issue for apps created using the classic Story Maps templates, the new StoryMaps builder, the Web AppBuilder, and the Instant Apps templates. I suspect that it is an issue with copying hosted apps in general.

jpeterson commented 3 years ago

Hey @jevandusen! @thollingshead is actually working on a fix for this as we speak 😄

@thollingshead if I recall, there was at least one other facet to this issue. Can you comment on what all the fix will entail?

thollingshead commented 3 years ago

Yes, a fix is underway. It will address updating both the item ID as described above, as well as the Organization/Enterprise base URL to cover scenarios of copying the apps between Portals. This change will cover all the applicable application item types.

jevandusen commented 3 years ago

Perfect, thanks @jpeterson and @thollingshead! Apart from this, the copying seemed to work well -- really useful.

jpeterson commented 3 years ago

@jevandusen – @thollingshead's fix should now be live in today's release!

Here's the rest of the changelog: https://guide.assistant.esri-ps.com/docs/changelog#1-november-2021

jevandusen commented 3 years ago

Thanks @jpeterson and @thollingshead! Just tested it out and it seems like it's working as expected now.