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:
ajugo 2024-04-19 10:09:49 +02:00 committed by GitHub
commit ffbf36e1e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 8 additions and 5 deletions

View file

@ -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
})

View file

@ -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',

View file

@ -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`);
},

View file

@ -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>