From 0b0eddd62b314a5c0fc01adb9ce8fac90e0ddeb8 Mon Sep 17 00:00:00 2001 From: wandji20 Date: Fri, 15 Sep 2023 11:39:42 +0100 Subject: [PATCH 1/2] Add default columns to inventory item card [SCI-9151] --- app/assets/stylesheets/application.sass.scss | 1 + .../shared/repository_item_sidebar.scss | 45 ++ .../vue/components/RepositoryItemSidebar.vue | 528 +++++++++--------- app/views/layouts/application.html.erb | 2 +- config/locales/en.yml | 9 + 5 files changed, 308 insertions(+), 277 deletions(-) create mode 100644 app/assets/stylesheets/shared/repository_item_sidebar.scss diff --git a/app/assets/stylesheets/application.sass.scss b/app/assets/stylesheets/application.sass.scss index 34c9335f6..7b1ba75ab 100644 --- a/app/assets/stylesheets/application.sass.scss +++ b/app/assets/stylesheets/application.sass.scss @@ -77,6 +77,7 @@ @import "shared/assets"; @import "shared/avatar"; @import "shared/cards"; +@import "shared/repository_item_sidebar"; @import "shared/comments_sidebar"; @import "shared/comments"; @import "shared/content_pane"; diff --git a/app/assets/stylesheets/shared/repository_item_sidebar.scss b/app/assets/stylesheets/shared/repository_item_sidebar.scss new file mode 100644 index 000000000..1f5a66d80 --- /dev/null +++ b/app/assets/stylesheets/shared/repository_item_sidebar.scss @@ -0,0 +1,45 @@ +// scss-lint:disable IdSelector +// scss-lint:disable SelectorDepth +// scss-lint:disable NestingDepth + +.repository-item-sidebar { + font-size: 14px; + font-weight: 400; + line-height: 20px; + + .header { + border-bottom: 1px solid var(--sn-sleepy-grey); + height: var(--top-navigation-height); + + .item-name { + font-size: 20px; + line-height: 30px; + width: calc(100% - 2rem); + } + } + + .title { + font-size: 18px; + font-weight: 600; + line-height: 28px; + } + + #information { + width: 70%; + } + + .item-details { + div { + border-bottom: 1px solid var(--sn-sleepy-grey); + + span { + &.repository-name { + -webkit-box-orient: vertical; + display: -webkit-box; + -webkit-line-clamp: 3; + overflow: hidden; + } + } + } + } +} diff --git a/app/javascript/vue/components/RepositoryItemSidebar.vue b/app/javascript/vue/components/RepositoryItemSidebar.vue index d9e9a2d5b..3bc1ff860 100644 --- a/app/javascript/vue/components/RepositoryItemSidebar.vue +++ b/app/javascript/vue/components/RepositoryItemSidebar.vue @@ -1,284 +1,250 @@ \ No newline at end of file + diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 3b7dfbb0e..2a62a91a1 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -104,7 +104,7 @@
+ class='bg-white fixed top-0 right-0 h-screen w-[565px] overflow-auto gap-2.5 self-stretch z-[9999] rounded-tl-4 rounded-bl-4 transition-transform ease-in-out transform translate-x-full'>
diff --git a/config/locales/en.yml b/config/locales/en.yml index 1e1a73114..036976c10 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2106,6 +2106,15 @@ en: invalid_arguments: "Can't find %{key}" my_module_assigned_snapshot_service: invalid_arguments: "Can't find %{key}" + side_bar: + title: + information: "Information" + default: + repository_name: "Inventory" + id: "Item ID" + added_on: "Added on" + added_at: "Added at" + added_by: 'Added by' repository_stock_values: manage_modal: title: "Stock %{item}" From de4cb662a69a5ad18e4d30c2ad8cce46a844b330 Mon Sep 17 00:00:00 2001 From: wandji20 Date: Fri, 15 Sep 2023 12:30:02 +0100 Subject: [PATCH 2/2] Update translation name for item_card [SCI-9151] --- .../vue/components/RepositoryItemSidebar.vue | 10 +++++----- config/locales/en.yml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/javascript/vue/components/RepositoryItemSidebar.vue b/app/javascript/vue/components/RepositoryItemSidebar.vue index 3bc1ff860..1d0bee3d9 100644 --- a/app/javascript/vue/components/RepositoryItemSidebar.vue +++ b/app/javascript/vue/components/RepositoryItemSidebar.vue @@ -9,7 +9,7 @@
-

{{ i18n.t('repositories.side_bar.title.information') }}

+

{{ i18n.t('repositories.item_card.title.information') }}

{{ column.label }} @@ -314,10 +314,10 @@ computed: { defaultColumns() { return [ - { label: I18n.t('repositories.side_bar.default.repository_name'), value: this.repositoryRow.repository_name }, - { label: I18n.t('repositories.side_bar.default.id'), value: this.repositoryRow.code }, - { label: I18n.t('repositories.side_bar.default.added_on'), value: this.repositoryRow.added_on }, - { label: I18n.t('repositories.side_bar.default.added_by'), value: this.repositoryRow.added_by } + { label: I18n.t('repositories.item_card.default.repository_name'), value: this.repositoryRow.repository_name }, + { label: I18n.t('repositories.item_card.default.id'), value: this.repositoryRow.code }, + { label: I18n.t('repositories.item_card.default.added_on'), value: this.repositoryRow.added_on }, + { label: I18n.t('repositories.item_card.default.added_by'), value: this.repositoryRow.added_by } ] } }, diff --git a/config/locales/en.yml b/config/locales/en.yml index 036976c10..7e1af8151 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2106,7 +2106,7 @@ en: invalid_arguments: "Can't find %{key}" my_module_assigned_snapshot_service: invalid_arguments: "Can't find %{key}" - side_bar: + item_card: title: information: "Information" default: