Improved files to distinguish subtypes (allows multiple different files tabs at a entity)
Attachments via the improved files Block thumbnails at mosaico templates as a separate files tab Some fixes All not tested yet
This commit is contained in:
parent
ade0fc87f2
commit
32cad03f4f
32 changed files with 683 additions and 346 deletions
|
@ -80,7 +80,7 @@ export default class List extends Component {
|
|||
});
|
||||
}
|
||||
|
||||
if (perms.includes('manageFiles')) {
|
||||
if (perms.includes('viewFiles')) {
|
||||
actions.push({
|
||||
label: <Icon icon="hdd" title={t('Files')}/>,
|
||||
link: `/templates/${data[0]}/files`
|
||||
|
|
|
@ -323,8 +323,6 @@ export function getEditForm(owner, typeKey, prefix = '') {
|
|||
}
|
||||
|
||||
export function getTypeForm(owner, typeKey, isEdit) {
|
||||
return <div>
|
||||
{owner.templateTypes[typeKey].getTypeForm(owner, isEdit)}
|
||||
</div>;
|
||||
return owner.templateTypes[typeKey].getTypeForm(owner, isEdit);
|
||||
}
|
||||
|
||||
|
|
|
@ -64,6 +64,20 @@ export default class List extends Component {
|
|||
});
|
||||
}
|
||||
|
||||
if (perms.includes('viewFiles')) {
|
||||
actions.push({
|
||||
label: <Icon icon="hdd" title={t('Files')}/>,
|
||||
link: `/templates/mosaico/${data[0]}/files`
|
||||
});
|
||||
}
|
||||
|
||||
if (perms.includes('viewFiles')) {
|
||||
actions.push({
|
||||
label: <Icon icon="th-large" title={t('Block thumbnails')}/>,
|
||||
link: `/templates/mosaico/${data[0]}/blocks`
|
||||
});
|
||||
}
|
||||
|
||||
if (perms.includes('share')) {
|
||||
actions.push({
|
||||
label: <Icon icon="share-alt" title={t('Share')}/>,
|
||||
|
|
|
@ -33,8 +33,8 @@ function getMenus(t) {
|
|||
files: {
|
||||
title: t('Files'),
|
||||
link: params => `/templates/${params.templateId}/files`,
|
||||
visible: resolved => resolved.template.permissions.includes('edit'),
|
||||
panelRender: props => <Files title={t('Files')} entity={props.resolved.template} entityTypeId="template" />
|
||||
visible: resolved => resolved.template.permissions.includes('viewFiles'),
|
||||
panelRender: props => <Files title={t('Files')} entity={props.resolved.template} entityTypeId="template" entitySubTypeId="file" managePermission="manageFiles"/>
|
||||
},
|
||||
share: {
|
||||
title: t('Share'),
|
||||
|
@ -69,8 +69,14 @@ function getMenus(t) {
|
|||
files: {
|
||||
title: t('Files'),
|
||||
link: params => `/templates/mosaico/${params.mosaiceTemplateId}/files`,
|
||||
visible: resolved => resolved.mosaicoTemplate.permissions.includes('edit'),
|
||||
panelRender: props => <Files title={t('Files')} entity={props.resolved.mosaicoTemplate} entityTypeId="mosaicoTemplate" />
|
||||
visible: resolved => resolved.mosaicoTemplate.permissions.includes('viewFiles'),
|
||||
panelRender: props => <Files title={t('Files')} entity={props.resolved.mosaicoTemplate} entityTypeId="mosaicoTemplate" entitySubTypeId="file" managePermission="manageFiles" />
|
||||
},
|
||||
blocks: {
|
||||
title: t('Block thumbnails'),
|
||||
link: params => `/templates/mosaico/${params.mosaiceTemplateId}/blocks`,
|
||||
visible: resolved => resolved.mosaicoTemplate.permissions.includes('viewFiles'),
|
||||
panelRender: props => <Files title={t('Block thumbnails')} entity={props.resolved.mosaicoTemplate} entityTypeId="mosaicoTemplate" entitySubTypeId="block" managePermission="manageFiles" />
|
||||
},
|
||||
share: {
|
||||
title: t('Share'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue