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.
{
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/')
}]
}
}]
}
}
}
},
}
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.docIdisn't an option because when a new document is being created this will always have the value "new".