mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 21:21:50 +08:00
Merge pull request #7493 from sboursen-scinote/sb_SCI-10531
Fix various issues with archived labels in repositories [SCI-10531]
This commit is contained in:
commit
ffbf36e1e8
4 changed files with 8 additions and 5 deletions
|
@ -563,11 +563,11 @@ class RepositoriesController < ApplicationController
|
|||
|
||||
def set_breadcrumbs_items
|
||||
@breadcrumbs_items = []
|
||||
archived_branch = @repository&.archived? || (!@repository && params[:archived] == 'true')
|
||||
archived_branch = @repository&.archived? || (!@repository && params[:view_mode] == 'archived')
|
||||
|
||||
@breadcrumbs_items.push({
|
||||
label: t('breadcrumbs.inventories'),
|
||||
url: archived_branch ? repositories_path(archived: true) : repositories_path,
|
||||
url: archived_branch ? repositories_path(view_mode: 'archived') : repositories_path,
|
||||
archived: archived_branch
|
||||
})
|
||||
|
||||
|
|
|
@ -175,7 +175,7 @@ export default {
|
|||
},
|
||||
toolbarActions() {
|
||||
const left = [];
|
||||
if (this.createUrl) {
|
||||
if (this.createUrl && this.currentViewMode !== 'archived') {
|
||||
left.push({
|
||||
name: 'create',
|
||||
icon: 'sn-icon sn-icon-new-task',
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<MenuDropdown
|
||||
:listItems="viewModesMenu"
|
||||
:btnClasses="'btn btn-secondary !border-sn-light-grey px-3'"
|
||||
:btnClasses="'btn btn-secondary !border-sn-light-grey px-3 prevent-shrink' + disabled"
|
||||
:btnText="btnText"
|
||||
:caret="true"
|
||||
position='right'>
|
||||
|
@ -26,6 +26,9 @@ export default {
|
|||
delete window.initRepositoryStateMenu;
|
||||
},
|
||||
computed: {
|
||||
disabled() {
|
||||
return this.viewMode === 'archived' ? ' disabled' : '';
|
||||
},
|
||||
btnText() {
|
||||
return I18n.t(`toolbar.${this.viewMode}_state`);
|
||||
},
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
<% if current_team %>
|
||||
<% provide(:sidebar_url, sidebar_repositories_path) %>
|
||||
<div class="content-pane flexible <%= params[:archived] ? :archived : :active %> repositories-index">
|
||||
<div class="content-pane flexible <%= params[:view_mode] ? :archived : :active %> repositories-index">
|
||||
<div class="content-header">
|
||||
<div class="title-row">
|
||||
<h1 data-view-mode="active"><%= t('libraries.index.head_title') %></h1>
|
||||
|
|
Loading…
Reference in a new issue