terriajs icon indicating copy to clipboard operation
terriajs copied to clipboard

Carto API v3 (Map Table + Query) support

Open nf-s opened this issue 1 year ago • 2 comments

Carto API v3 (Map Table + Query) support

Fixes https://github.com/terriajs/terriajs/issues/6323

Todo

  • [x] Handle error messages from Carto API

Test me

See https://github.com/TerriaJS/terriajs/issues/6323#issuecomment-1247866595 for example configs and test links

Checklist

  • [x] There are unit tests to verify my changes are correct or unit tests aren't applicable (if so, write quick reason why unit tests don't exist)
  • [ ] I've updated relevant documentation in doc/.
  • [x] I've updated CHANGES.md with what I changed.
  • [x] I've provided instructions in the PR description on how to test this PR.

nf-s avatar Sep 14 '22 12:09 nf-s

I managed to get an error clicking around with both of the example datasets loaded from #6323 (comment)

Uncaught Error: [mobx] Computed values are not allowed to cause side effects by changing observables that are already being observed. Tried to modify: [email protected]
    at invariant (mobx.module.js?daf9:29:1)
    at fail (mobx.module.js?daf9:24:1)
    at checkIfStateModificationsAreAllowed (mobx.module.js?daf9:763:1)
    at ObservableValue.prepareNewValue (mobx.module.js?daf9:1085:1)
    at ObservableObjectAdministration.write (mobx.module.js?daf9:4163:1)
    at FeatureInfoSection.set [as featureChangedCounter] (mobx.module.js?daf9:4327:1)
    at eval (FeatureInfoSection.tsx?490b:131:1)
    at executeAction (mobx.module.js?daf9:951:1)
    at runInAction (mobx.module.js?daf9:2086:1)
    at FeatureInfoSection.eval (FeatureInfoSection.tsx?490b:130:1)

To replicate, load both the table and query item with this sharelink: http://ci.terria.io/carto-v3/#clean&https://gist.githubusercontent.com/nf-s/c2485b3d2f05cbededdaa50e85a64db9/raw/87f132a401682098599ee911383d0c82543cbd19/carto-v3.json&share=s-pG3vSJFltAEvdLB0WiZIlNdjJFX

Click on a feature to get FeatureInfo to show up, then toggle the visibility of that layer to off in the workbench. Application crashes. Occurs for either table or query layer. Dont have to have both loaded for crashes to occur.

image

Good find @staffordsmith83 - this issue relates to all GeoJSON isn't cause by this PR so I have created a separate issue - https://github.com/TerriaJS/terriajs/issues/6576

nf-s avatar Sep 29 '22 07:09 nf-s

OK @nf-s Ill review this as is!

staffordsmith83 avatar Sep 29 '22 07:09 staffordsmith83

How is the documentation generated

At the moment documentation is generated from Traits using the generateDocs.ts.

I have added a description to both carto v1 and v3 - https://github.com/TerriaJS/terriajs/commit/dfaeed3fa2daaea8bd66a796712a4a46464b69f7

nf-s avatar Oct 04 '22 04:10 nf-s

Thank you @nf-s !! Great work.

imakihi avatar Oct 06 '22 07:10 imakihi