Adds several options to hide elements from primary menu #659.

This commit is contained in:
mateuswetah 2022-02-01 17:58:38 -03:00
parent a95fda7c84
commit df5d72fc8d
4 changed files with 55 additions and 16 deletions

View File

@ -15,7 +15,7 @@
:active-route="activeRoute" :active-route="activeRoute"
:is-menu-compressed="isMenuCompressed"/> :is-menu-compressed="isMenuCompressed"/>
<button <button
v-if="!$adminOptions.hideMenuCompressButton" v-if="!$adminOptions.hidePrimaryMenu && !$adminOptions.hidePrimaryMenuCompressButton"
class="is-hidden-mobile" class="is-hidden-mobile"
id="menu-compress-button" id="menu-compress-button"
@click="isMenuCompressed = !isMenuCompressed"> @click="isMenuCompressed = !isMenuCompressed">

View File

@ -114,6 +114,10 @@
:aria-label="$i18n.getFrom('items','edit_item')"> :aria-label="$i18n.getFrom('items','edit_item')">
<span <span
v-tooltip="{ v-tooltip="{
delay: {
show: 500,
hide: 100,
},
content: $i18n.get('edit'), content: $i18n.get('edit'),
autoHide: true, autoHide: true,
placement: 'auto' placement: 'auto'

View File

@ -8,7 +8,9 @@
<aside class="menu"> <aside class="menu">
<ul class="menu-list"> <ul class="menu-list">
<li class="repository-label"> <li
v-if="!$adminOptions.hidePrimaryMenuRepositoryButton"
class="repository-label">
<router-link <router-link
tag="a" tag="a"
:to="$routerHelper.getCollectionsPath()"> :to="$routerHelper.getCollectionsPath()">
@ -20,7 +22,7 @@
</span> </span>
</router-link> </router-link>
</li> </li>
<li> <li v-if="!$adminOptions.hidePrimaryMenuCollectionsButton">
<router-link <router-link
tag="a" tag="a"
:to="$routerHelper.getCollectionsPath()" :to="$routerHelper.getCollectionsPath()"
@ -31,7 +33,7 @@
<span class="menu-text">{{ $i18n.getFrom('collections', 'name') }}</span> <span class="menu-text">{{ $i18n.getFrom('collections', 'name') }}</span>
</router-link> </router-link>
</li> </li>
<li> <li v-if="!$adminOptions.hidePrimaryMenuItemsButton">
<router-link <router-link
tag="a" tag="a"
:to="$routerHelper.getItemsPath()" :to="$routerHelper.getItemsPath()"
@ -43,7 +45,7 @@
</router-link> </router-link>
</li> </li>
<li class="separator"/> <li class="separator"/>
<li v-if="$userCaps.hasCapability('tnc_rep_edit_metadata')"> <li v-if="$userCaps.hasCapability('tnc_rep_edit_metadata') && !$adminOptions.hidePrimaryMenuMetadataButton">
<router-link <router-link
tag="a" tag="a"
to="/metadata" to="/metadata"
@ -54,7 +56,7 @@
<span class="menu-text">{{ $i18n.get('metadata') }}</span> <span class="menu-text">{{ $i18n.get('metadata') }}</span>
</router-link> </router-link>
</li> </li>
<li v-if="$userCaps.hasCapability('tnc_rep_edit_filters')"> <li v-if="$userCaps.hasCapability('tnc_rep_edit_filters') && !$adminOptions.hidePrimaryMenuFiltersButton">
<router-link <router-link
tag="a" tag="a"
to="/filters" to="/filters"
@ -65,7 +67,7 @@
<span class="menu-text">{{ $i18n.getFrom('filters', 'name') }}</span> <span class="menu-text">{{ $i18n.getFrom('filters', 'name') }}</span>
</router-link> </router-link>
</li> </li>
<li> <li v-if="!$adminOptions.hidePrimaryMenuTaxonomiesButton">
<router-link <router-link
tag="a" tag="a"
to="/taxonomies" to="/taxonomies"
@ -76,7 +78,7 @@
<span class="menu-text">{{ $i18n.getFrom('taxonomies', 'name') }}</span> <span class="menu-text">{{ $i18n.getFrom('taxonomies', 'name') }}</span>
</router-link> </router-link>
</li> </li>
<li> <li v-if="!$adminOptions.hidePrimaryMenuActivitiesButton">
<router-link <router-link
tag="a" tag="a"
to="/activities" to="/activities"
@ -87,7 +89,7 @@
<span class="menu-text">{{ $i18n.get('activities') }}</span> <span class="menu-text">{{ $i18n.get('activities') }}</span>
</router-link> </router-link>
</li> </li>
<li v-if="$userCaps.hasCapability('tnc_rep_edit_users')"> <li v-if="$userCaps.hasCapability('tnc_rep_edit_users') && !$adminOptions.hidePrimaryMenuCapabilitiesButton">
<router-link <router-link
tag="a" tag="a"
:to="this.$routerHelper.getCapabilitiesPath()" :to="this.$routerHelper.getCapabilitiesPath()"
@ -98,7 +100,7 @@
<span class="menu-text">{{ $i18n.get('capabilities') }}</span> <span class="menu-text">{{ $i18n.get('capabilities') }}</span>
</router-link> </router-link>
</li> </li>
<li> <li v-if="!$adminOptions.hidePrimaryMenuImportersButton">
<router-link <router-link
tag="a" tag="a"
to="/importers" to="/importers"
@ -113,7 +115,7 @@
<span class="menu-text menu-text-import">{{ $i18n.get('importers') }}</span> <span class="menu-text menu-text-import">{{ $i18n.get('importers') }}</span>
</router-link> </router-link>
</li> </li>
<li> <li v-if="!$adminOptions.hidePrimaryMenuExportersButton">
<router-link <router-link
tag="a" tag="a"
to="/exporters" to="/exporters"

View File

@ -464,7 +464,6 @@ AdminOptionsHelperPlugin.install = function (Vue, options = {}) {
const adminSpecialModes = { const adminSpecialModes = {
itemsSingleSelectionMode: { itemsSingleSelectionMode: {
hideTainacanHeader: true, hideTainacanHeader: true,
hideMenuCompressButton: true,
hidePrimaryMenu: true, hidePrimaryMenu: true,
hideTainacanRepositorySubheader: true, hideTainacanRepositorySubheader: true,
hideTainacanCollectionSubheader: true, hideTainacanCollectionSubheader: true,
@ -484,7 +483,6 @@ AdminOptionsHelperPlugin.install = function (Vue, options = {}) {
}, },
itemsMultipleSelectionMode: { itemsMultipleSelectionMode: {
hideTainacanHeader: true, hideTainacanHeader: true,
hideMenuCompressButton: true,
hidePrimaryMenu: true, hidePrimaryMenu: true,
hideTainacanRepositorySubheader: true, hideTainacanRepositorySubheader: true,
hideTainacanCollectionSubheader: true, hideTainacanCollectionSubheader: true,
@ -504,7 +502,6 @@ AdminOptionsHelperPlugin.install = function (Vue, options = {}) {
}, },
itemsSearchSelectionMode: { itemsSearchSelectionMode: {
hideTainacanHeader: true, hideTainacanHeader: true,
hideMenuCompressButton: true,
hidePrimaryMenu: true, hidePrimaryMenu: true,
hideTainacanRepositorySubheader: true, hideTainacanRepositorySubheader: true,
hideTainacanCollectionSubheader: true, hideTainacanCollectionSubheader: true,
@ -521,7 +518,6 @@ AdminOptionsHelperPlugin.install = function (Vue, options = {}) {
}, },
itemEditionMode: { itemEditionMode: {
hideTainacanHeader: true, hideTainacanHeader: true,
hideMenuCompressButton: true,
hidePrimaryMenu: true, hidePrimaryMenu: true,
hideTainacanRepositorySubheader: true, hideTainacanRepositorySubheader: true,
hideTainacanCollectionSubheader: true, hideTainacanCollectionSubheader: true,
@ -529,7 +525,6 @@ AdminOptionsHelperPlugin.install = function (Vue, options = {}) {
}, },
mobileAppMode: { mobileAppMode: {
hideTainacanHeader: true, hideTainacanHeader: true,
hideMenuCompressButton: true,
hidePrimaryMenu: true, hidePrimaryMenu: true,
hideTainacanRepositorySubheader: true, hideTainacanRepositorySubheader: true,
hideTainacanCollectionSubheader: true, hideTainacanCollectionSubheader: true,
@ -551,4 +546,42 @@ AdminOptionsHelperPlugin.install = function (Vue, options = {}) {
} }
} }
/*
Possible Values:
* hideTainacanHeader
* hidePrimaryMenuCompressButton
* hidePrimaryMenu
* hidePrimaryMenuCompressButton
* hidePrimaryMenuRepositoryButton
* hidePrimaryMenuCollectionsButton
* hidePrimaryMenuItemsButton
* hidePrimaryMenuTaxonomiesButton
* hidePrimaryMenuMetadataButton
* hidePrimaryMenuFiltersButton
* hidePrimaryMenuImportersButton
* hidePrimaryMenuExportersButton
* hidePrimaryMenuActivitiesButton
* hidePrimaryMenuCapabilitiesButton
* hideTainacanRepositorySubheader
* hideTainacanCollectionSubheader
* hideMultipleItemSelection
* hideItemSelection
* hideBulkActionsDropdown
* hideContextMenu
* hideContextMenuOpenItemOption
* hideContextMenuOpenItemOnNewTabOption
* hideContextMenuEditItemOption
* hideContextMenuCopyItemOption
* hideContextMenuDeleteItemOption
* hideItemActionArea
* hideItemsListPageTitle
* hideItemCreationDropdown
* hideExposersButton
* hideItemsStatusStabs
* hideFilterCreationButton
* hideItemEditionPageBackButton
* hideItemEditionPageTitle
* hideBulkEditionPageTitle
* hideCollectionNameInItemPage
*/
}; };