-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Because of how configuration for a component get's evaluated when provided as a function we don't currently have a good way to use the documents id.
For example in the below scenario using window.jms.util.docId isn't an option because when a new document is being created this will always have the value "new".
{
photo: {
label: 'USERS.FIELDS.PROFILE_PHOTO',
component: {
type: 'image',
configuration: () => {
const route = `/users/${window.jms.util.docId}`;
const minPath = window.jms.util.state.role !== 'admin' ? route : `/`;
return {
filePrefix: route + '/',
uploadMethods: [{
id: 'file-manager',
label: 'FILE_MANAGER.TITLE',
component: JSX(<jms-e-file-manager-select/>),
configuration: {
hidePath: false,
hideFolders: false,
allowUpload: true,
minPath,
route,
filters: [{
value: file => file.contentType.startsWith('image/')
}]
}
}]
}
}
}
},
}
Reactions are currently unavailable