Mesh provides invalid default UI config
- Dominant language
- Java
- Stars
- 593
- Forks
- 123
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 4
Description
## Gentics Mesh Version, operating system, or hardware.
- v1.4.1
## Problem
The `previewUrl` field should be an object mapping the project name to an array of preview URLs.
Instead, the default value is an array (taken from the [demo instance](https://demo.getmesh.io/mesh-ui/assets/config/mesh-ui-config.js)):
```js
previewUrls: [
{
/** display name to see within preview url selection in frontend */
label: 'Gentics Mesh Angular Demo',
/**
* Function to be called in frontend to get url
* @param nodeUuid unique Mesh node
*/
// adopt to angular demo
urlResolver: function (node) {
// custom route mapping
var segmentParent;
switch (node.schema.name) {
case 'category':
segmentParent = 'category';
break;
case 'vehicle':
segmentParent = 'product';
break;
default:
throw new Error('No existing app route preview mapping configured for node of schema: ' + node.schema.name);
}
// return app preview URL
return '/demo/' + segmentParent + '/' + node.uuid + '?preview=true';
}
}
]
```
You can see the expected structure here: https://github.com/gentics/mesh-ui/blob/develop/src/app/common/models/appconfig.model.ts
Contributor guide
Research direction
Compare the default UI configuration with the expected structure in mesh-ui's src/app/common/models/appconfig.model.ts and the demo configuration linked in the issue. Locate where Mesh supplies the default previewUrls value, change its shape to match the documented model, and verify that the default configuration is accepted by the UI.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100