Esri / solution.js

TypeScript wrappers running in Node.js and modern browsers for transferring ArcGIS Online items from one organization to another.
https://esri.github.io/solution.js/
Apache License 2.0
39 stars 12 forks source link

Support circular dependencies #47

Closed MikeTschudi closed 4 years ago

MikeTschudi commented 5 years ago

Current design cancels templatization. Can cut loops instead.

chris-fox commented 5 years ago

Examples Wildlife Resource Locator + Recreation License Locator

MikeTschudi commented 5 years ago

Also workforce projects and their groups

jmhauck commented 4 years ago

@MikeTschudi I went through workforce projects a bit more and all seems well with the exception of needing this. No more planned changes for workforce at the moment.

chris-fox commented 4 years ago

@MikeTschudi, I created a sample Template using the R3 locator solutions. It is called R3 Locator in the deploy solutions app:

https://localdeployment.maps.arcgis.com/home/item.html?id=4ee28fce27e64c75a4c44a217f62b7d2

It has 3 Web Applications (WAB), Each apps web map references (via the pop-up) another 1 of the apps and in one case a web map references the other 2 apps. This is a good test case to validate deployment of apps with circular dependencies works properly.

chris-fox commented 4 years ago

@jmhauck, I updated the R3 template so that the three web maps now have their corresponding circular dependencies lists in a circularDependency property. You can use this to validate this work.

shoe913 commented 4 years ago

Verified; app and layer ids switch as expected.

Though the layer id's and apps switched, the link created by the switch did not work. This is because the app tested (Adopt-A-Catch Basin Dashboard linking to Adopt-A-Catch Basin Manager) needs to pass an organization url instead of a generic "maps.arcgis.com".

This solution requires the connected app not be shared publicly and as such the full org url "myorg.maps.arcgis.com" is required. This is hardcoded in the pop up like the app/layer ids.

The url in the current deployment item is pointed to the Try It Live experience so it can meet current deployment patterns. Can we add the TIL url and the "deployed from" url to the list of items to swizzle?

This will ensure that the items can deploy in both the current SDT and with the solution item.

@chris-fox @jmhauck @MikeTschudi

chris-fox commented 4 years ago

@shoe913, I think we should just update the json of the Solution template to point to the Deployment app rather than the TIL app. I think this is a simpler story than trying to mix 2 different urls.

The key to remember is the long term plan is to not provide a pro add-in to deploy solutions, everything will be deployed via this new Deployment app. So we don't need to worry about the way we use to do it. For example, I think in these cases we should even consider removing the arcade expressions with the comments "Replace X here" and "Don't modify below here" and just reference the app in the html because the deployment will handle the swizzling for the user. There should be no need to modify and the arcade actually makes it more complicated than it needs to be.

Actually I think if you look I didn't even use the arcade expressions in the pop-ups, I just updated the html directly in the template i.e:

Need a Fishing License? <br /> Get one <a href='{{portalBaseUrl}}/apps/webappviewer/index.html?id={{6ae0e9a6ac3f4216a0d7da228838b00a.itemId}}'>Here</a>!

shoe913 commented 4 years ago

@chris-fox, Switching the Arcade is a much more elegant solution. I totally forgot we could hijack the html in this way before deployment.

Since we can do that on the solution item, and keep the current solution "as is" for the SDT until we are 100% online, everything is working correctly. I'll slide this over to complete.