Skip to content

Commit

Permalink
Merge pull request #2036 from tf/hide-extended-rights
Browse files Browse the repository at this point in the history
Hide license and source url meta data if not supported by entry type
  • Loading branch information
tf authored Dec 12, 2023
2 parents 56d398d + 43ff231 commit 9ccbf63
Showing 1 changed file with 24 additions and 17 deletions.
41 changes: 24 additions & 17 deletions package/src/editor/initializers/setupFileTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,32 @@ app.addInitializer(function(options) {
valueViewOptions: {
settingsDialogTabLink: 'general'
}
},
{
name: 'source_url',
valueView: TextFileMetaDataItemValueView,
valueViewOptions: {
fromConfiguration: true,
settingsDialogTabLink: 'general'
}
},
{
name: 'license',
valueView: TextFileMetaDataItemValueView,
valueViewOptions: {
fromConfiguration: true,
formatValue: value => I18n.t(`pageflow.file_licenses.${value}.name`),
settingsDialogTabLink: 'general'
}
}
];

if (editor.entryType.supportsExtendedFileRights) {
editor.fileTypes.commonMetaDataAttributes = [
...editor.fileTypes.commonMetaDataAttributes,
{
name: 'source_url',
valueView: TextFileMetaDataItemValueView,
valueViewOptions: {
fromConfiguration: true,
settingsDialogTabLink: 'general'
}
},
{
name: 'license',
valueView: TextFileMetaDataItemValueView,
valueViewOptions: {
fromConfiguration: true,
formatValue: value => I18n.t(`pageflow.file_licenses.${value}.name`),
settingsDialogTabLink: 'general'
}
}
];
}

editor.fileTypes.commonSettingsDialogTabs = [
{
name: 'general',
Expand Down

0 comments on commit 9ccbf63

Please sign in to comment.