From c36e2277fa9471c13474ac492f644a0654565151 Mon Sep 17 00:00:00 2001 From: sboursen-scinote Date: Thu, 18 Apr 2024 16:19:18 +0200 Subject: [PATCH] Fix various issues with archived labels in reporsitories [SCI-10531] --- app/controllers/repositories_controller.rb | 4 ++-- app/javascript/vue/repositories/table.vue | 2 +- app/javascript/vue/repository/state_menu.vue | 5 ++++- app/views/repositories/index.html.erb | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 2f28cb65e..16b73b83e 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -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 }) diff --git a/app/javascript/vue/repositories/table.vue b/app/javascript/vue/repositories/table.vue index 58f38de38..ed3fe33f8 100644 --- a/app/javascript/vue/repositories/table.vue +++ b/app/javascript/vue/repositories/table.vue @@ -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', diff --git a/app/javascript/vue/repository/state_menu.vue b/app/javascript/vue/repository/state_menu.vue index 53d8ad620..7e798ccdb 100644 --- a/app/javascript/vue/repository/state_menu.vue +++ b/app/javascript/vue/repository/state_menu.vue @@ -1,7 +1,7 @@