Change error message wording and update logic [SCI-9506]

- Landing page is /repositories/:repository_id?landing_page=true&row_id=:repository_row_id
This commit is contained in:
sboursen-scinote 2024-04-16 11:51:04 +02:00
parent 8f9ea0e749
commit d3e5b66d67
7 changed files with 12 additions and 15 deletions

View file

@ -473,6 +473,7 @@ class RepositoriesController < ApplicationController
def load_repository_row
@repository_row = nil
@repository_row_landing_page = true if params[:landing_page].present?
return if params[:row_id].blank?
@repository_row = @repository.repository_rows.find_by(id: params[:row_id])

View file

@ -45,8 +45,6 @@ class RepositoryRowsController < ApplicationController
def show
respond_to do |format|
format.html do
return redirect_to repository_path(@repository, row_id: @repository_row.id) if params[:show_card].present?
redirect_to repository_path(@repository)
end

View file

@ -2,13 +2,11 @@
import PerfectScrollbar from 'vue3-perfect-scrollbar';
import { createApp } from 'vue/dist/vue.esm-bundler.js';
import { vOnClickOutside } from '@vueuse/components';
import { mountWithTurbolinks } from './helpers/turbolinks.js';
import RepositoryItemErrorSidebar from '../../vue/repository_item_sidebar/RepositoryItemErrorSidebar.vue';
const app = createApp({});
app.component('RepositoryItemErrorSidebar', RepositoryItemErrorSidebar);
app.use(PerfectScrollbar);
app.directive('click-outside', vOnClickOutside);
app.config.globalProperties.i18n = window.I18n;
mountWithTurbolinks(app, '#repositoryItemErrorSidebar');

View file

@ -13,11 +13,11 @@
<i id="close-icon" @click="close"
class="sn-icon sn-icon-close ml-auto cursor-pointer my-auto mx-0"></i>
</div>
<div id="divider" class="w-500 bg-sn-light-grey flex items-center self-stretch h-px mt-6 mr-6"></div>
<div id="divider" class="bg-sn-light-grey flex items-center self-stretch h-px mt-6 mr-6"></div>
</div>
<div class="flex flex-col flex-1 justify-center items-center gap-1">
<i class="sn-icon sn-icon-alert-warning text-sn-alert-passion"></i>
<span class="font-semibold leading-5">{{ i18n.t('repositories.item_card_errors.item_not_found') }}</span>
<h4 class="font-semibold text-lg">{{ i18n.t('repositories.item_card_errors.item_not_found') }}</h4>
</div>
</div>
</div>

View file

@ -22,7 +22,7 @@
<i id="close-icon" @click="toggleShowHideSidebar(null)"
class="sn-icon sn-icon-close ml-auto cursor-pointer my-auto mx-0"></i>
</div>
<div id="divider" class="w-500 bg-sn-light-grey flex items-center self-stretch h-px mt-6 mr-6"></div>
<div id="divider" class="bg-sn-light-grey flex items-center self-stretch h-px mt-6 mr-6"></div>
</div>
<div ref="bodyWrapper" id="body-wrapper" class="overflow-y-auto overflow-x-hidden h-[calc(100%-78px)] pt-6 ">
@ -122,7 +122,7 @@
</div>
</section>
<div id="divider" class="w-500 bg-sn-light-grey flex items-center self-stretch h-px "></div>
<div id="divider" class="bg-sn-light-grey flex items-center self-stretch h-px "></div>
<!-- CUSTOM COLUMNS, RELATIONSHIPS, ASSIGNED, QR CODE -->
<div id="custom-col-assigned-qr-wrapper" class="flex flex-col gap-6">
@ -138,7 +138,7 @@
:permissions="permissions" :updatePath="updatePath" :actions="actions" @update="update" />
</section>
<div id="divider" class="w-500 bg-sn-light-grey flex px-8 items-center self-stretch h-px"></div>
<div id="divider" class="bg-sn-light-grey flex px-8 items-center self-stretch h-px"></div>
<!-- RELATIONSHIPS -->
<section v-if="!repository?.is_snapshot" id="relationships-section" class="flex flex-col" ref="relationshipsSectionRef">
@ -241,7 +241,7 @@
</div>
</section>
<div v-if="!repository?.is_snapshot" id="divider" class="w-500 bg-sn-light-grey flex px-8 items-center self-stretch h-px"></div>
<div v-if="!repository?.is_snapshot" id="divider" class="bg-sn-light-grey flex px-8 items-center self-stretch h-px"></div>
<!-- ASSIGNED -->
<section v-if="!repository?.is_snapshot" id="assigned-section" class="flex flex-col" ref="assignedSectionRef">
@ -292,7 +292,7 @@
</div>
</section>
<div v-if="!repository?.is_snapshot" id="divider" class="w-500 bg-sn-light-grey flex px-8 items-center self-stretch h-px "></div>
<div v-if="!repository?.is_snapshot" id="divider" class="bg-sn-light-grey flex px-8 items-center self-stretch h-px "></div>
<!-- QR -->
<section id="qr-section" ref="QR-label">
@ -318,7 +318,7 @@
<!-- BOTTOM -->
<div id="bottom" v-show="!dataLoading && !loadingError" class="h-[100px] flex flex-col justify-end mt-4 mr-6"
:class="{ 'pb-6': customColumns?.length }">
<div id="divider" class="w-500 bg-sn-light-grey flex px-8 items-center self-stretch h-px mb-6"></div>
<div id="divider" class="bg-sn-light-grey flex px-8 items-center self-stretch h-px mb-6"></div>
<div id="bottom-button-wrapper" class="flex h-10 justify-end">
<button type="button" class="btn btn-primary print-label-button" data-e2e="e2e-BT-repoItemSB-print"
:data-rows="JSON.stringify([repositoryRowId])"

View file

@ -51,9 +51,9 @@
</div>
<!-- Inventory Item landing page link-->
<% if @repository_row %>
<% if @repository_row && @repository_row_landing_page %>
<a id="itemLandingPagelink" href="<%= repository_repository_row_path(@repository, @repository_row) %>" class="hidden record-info-link"></a>
<% else %>
<% elsif @repository_row_landing_page %>
<div id="repositoryItemErrorSidebar" data-behaviour="vue" class="fixed top-0 right-0 h-full z-[2039]">
<repository-item-error-sidebar />
</div>

View file

@ -2268,7 +2268,7 @@ en:
my_module_assigned_snapshot_service:
invalid_arguments: "Can't find %{key}"
item_card_errors:
item_not_found: "Inventory item you're looking for was deleted."
item_not_found: "Inventory item you're looking for doesn't exist."
item_card:
add_relationship_button_text: "Add"
repository_item_relationships_modal: