archesproject / arches

Arches is a web platform for creating, managing, & visualizing geospatial data. Arches was inspired by the needs of the Cultural Heritage community, particularly the widespread need of organizations to build & manage cultural heritage inventories
GNU Affero General Public License v3.0
211 stars 142 forks source link

Changing card types results in corrupted interface #11227

Open tris-ots opened 1 month ago

tris-ots commented 1 month ago

I've found an issue where changing the card type to one which the node doesn't support, such as map cards for a string or date datatype, results in a persistently garbled or corrupted user interface. This issue was discovered in Arches 7.5.2b0 with the CIDOC 6.2 ontology loaded, and seems to be more common with Resource Models that have more than a couple of nodes. In most cases, the card type choice widget is not affected, and I was able to change the card type back to Default or another appropriate value and this fixed the issue, but if I didn't change the card type, the interface remained corrupted even after I rebooted the server.

This is a fairly minor issue, basically a problem of missing guardrails to prevent the user from making an incorrect choice.

Steps to reproduce:

  1. Navigate to the Arches designer.
  2. Select the Cards tab and choose a card that does not contain a geojson-feature-collection node.
  3. Select a node and change the Card Type to Related Resources Map Card or Map Card.

arches-related-resource-map-card-corrupted-display

jacobtylerwalls commented 1 month ago

Thanks for the report. Reproduced with two string nodes. Error happened when performing the same action (select map card) on the second string node.

trace:

Error: The argument passed when initializing an observable array must be an array, or null, or undefined.
    at a.Ia (knockout-latest.js:48:381)
    at viewModel (map.js:97:30)
    at viewModel (map-editor.js:241:27)
    at new viewModel (map.js:143:24)
    at Object.eval [as createViewModel] (knockout-latest.js:92:380)
    at c (knockout-latest.js:98:333)
    at eval (knockout-latest.js:99:294)
    at eval (knockout-latest.js:91:377)
    at b (knockout-latest.js:38:98)
    at MutationObserver.c (knockout-latest.js:38:136)

Does not appear to be a duplicate of #10401 or #10413

chiatt commented 1 month ago

I suspect we don't clear the configs when switching between components. When the card is switched the configs used in the first card are passed to the second and can gum things up depending on the params of the card. This is at least true for reports.