mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 21:21:50 +08:00
Disable toolbar state button only for archived inventories [SCI-10531]
This commit is contained in:
parent
ffbf36e1e8
commit
67ba0c1c85
2 changed files with 4 additions and 2 deletions
|
@ -20,14 +20,15 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
viewMode: { type: String, required: true },
|
viewMode: { type: String, required: true },
|
||||||
activeUrl: { type: String, required: true },
|
activeUrl: { type: String, required: true },
|
||||||
archivedUrl: { type: String, required: true }
|
archivedUrl: { type: String, required: true },
|
||||||
|
disabled: { type: String, default: 'false' }
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
delete window.initRepositoryStateMenu;
|
delete window.initRepositoryStateMenu;
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
disabled() {
|
disabled() {
|
||||||
return this.viewMode === 'archived' ? ' disabled' : '';
|
return this.disabled === 'true' ? ' disabled' : '';
|
||||||
},
|
},
|
||||||
btnText() {
|
btnText() {
|
||||||
return I18n.t(`toolbar.${this.viewMode}_state`);
|
return I18n.t(`toolbar.${this.viewMode}_state`);
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
<div id='repositoryStateMenu' data-behaviour="vue">
|
<div id='repositoryStateMenu' data-behaviour="vue">
|
||||||
<repository-state-menu
|
<repository-state-menu
|
||||||
view-mode="<%= view_mode %>"
|
view-mode="<%= view_mode %>"
|
||||||
|
disabled="<%= @repository.archived? %>"
|
||||||
active-url="<%= repository_url(@repository) %>"
|
active-url="<%= repository_url(@repository) %>"
|
||||||
archived-url="<%= repository_url(@repository, params: { archived: true }) %>">
|
archived-url="<%= repository_url(@repository, params: { archived: true }) %>">
|
||||||
</repository-state-menu>
|
</repository-state-menu>
|
||||||
|
|
Loading…
Reference in a new issue