datalad / datalad-catalog

Create a user-friendly data catalog from structured metadata
https://datalad-catalog.netlify.app
MIT License
14 stars 12 forks source link

Set minimum required fields based on default config in javascript #412

Closed jsheunis closed 5 months ago

jsheunis commented 5 months ago

The issue reported here: https://github.com/datalad/datalad-catalog/issues/410#issuecomment-1893711843

This occurs because the tutorial's toy config does not contain all fields that the javascript and html code expect. Specifically, social_links is excluded and so the javascript-loaded config object does not contain that field, and then v-if="social_links['about']" fails with error message: [Vue warn]: Error in render: "TypeError: Cannot read properties of undefined (reading 'about')"

We should add code in javascript to check if a loaded config object contains the minimum required fields as given in the default config, and if not the missing fields should be set from default config.