From 743d0f57b7870ec392c96e0039381276f175a5fe Mon Sep 17 00:00:00 2001 From: Martin Artnik Date: Mon, 8 Apr 2024 11:35:41 +0200 Subject: [PATCH] (dev) Placeholder for new import modal [SCI-10494] --- app/assets/javascripts/repositories/show.js | 4 +--- .../packs/vue/design_system/modals.js | 20 ++++++++-------- app/javascript/vue/shared/info_component.vue | 16 ++++++------- app/javascript/vue/shared/info_modal.vue | 18 ++++++++++---- app/javascript/vue/shared/modal_mixin.js | 9 ++++++- app/views/design_elements/_modals.html.erb | 2 +- .../repositories/_toolbar_buttons.html.erb | 4 ++-- app/views/repositories/show.html.erb | 4 ++++ config/locales/en.yml | 24 +++++++++++++++++++ config/webpack/webpack.config.js | 1 + 10 files changed, 73 insertions(+), 29 deletions(-) diff --git a/app/assets/javascripts/repositories/show.js b/app/assets/javascripts/repositories/show.js index d07c061df..3567544e4 100644 --- a/app/assets/javascripts/repositories/show.js +++ b/app/assets/javascripts/repositories/show.js @@ -87,9 +87,7 @@ function initImportRecordsModal() { $('.repository-show').on('click', '#importRecordsButton', function() { - $('#modal-import-records').modal('show'); - $('#modal-import-records').find('#file').val(''); - initParseRecordsModal(); + window.importRepositoryModalComponent.open(); }); // Handling cancel click in #modal-import-records diff --git a/app/javascript/packs/vue/design_system/modals.js b/app/javascript/packs/vue/design_system/modals.js index 477dbc000..8baabddf7 100644 --- a/app/javascript/packs/vue/design_system/modals.js +++ b/app/javascript/packs/vue/design_system/modals.js @@ -28,19 +28,19 @@ const app = createApp({ steps: [ { id: 'step1', - icon: 'sn-icon sn-icon-open', + icon: 'sn-icon-open', label: 'Step 1', component: shallowRef(Step1) }, { id: 'step2', - icon: 'sn-icon sn-icon-edit', + icon: 'sn-icon-edit', label: 'Step 2', component: shallowRef(Step2) }, { id: 'step3', - icon: 'sn-icon sn-icon-inventory', + icon: 'sn-icon-inventory', label: 'Step 3', component: shallowRef(Step3) } @@ -53,37 +53,37 @@ const app = createApp({ // Info modal infoParams: { - componentTitle: 'Guide for updating the inventory', + title: 'Guide for updating the inventory', modalTitle: 'Update inventory', helpText: 'Help', - elements: [ + steps: [ { id: 'el1', - icon: 'sn-icon sn-icon-export', + icon: 'sn-icon-export', label: 'Export inventory', subtext: "Before making edits, we advise you to export the latest inventory information. If you're only adding new items, consider exporting empty inventory." }, { id: 'el2', - icon: 'sn-icon sn-icon-edit', + icon: 'sn-icon-edit', label: 'Edit your data', subtext: 'Make sure to include header names in first row, followed by item data.' }, { id: 'el3', - icon: 'sn-icon sn-icon-import', + icon: 'sn-icon-import', label: 'Import new or update items', subtext: 'Upload your data using .xlsx, .csv or .txt files.' }, { id: 'el4', - icon: 'sn-icon sn-icon-tables', + icon: 'sn-icon-tables', label: 'Merge your data', subtext: 'Complete the process by merging the columns you want to update.' }, { id: 'el5', - icon: 'sn-icon sn-icon-open', + icon: 'sn-icon-open', label: 'Learn more', linkTo: 'https://knowledgebase.scinote.net/en/knowledge/how-to-add-items-to-an-inventory' } diff --git a/app/javascript/vue/shared/info_component.vue b/app/javascript/vue/shared/info_component.vue index 8ff4bd3c7..771f63ff8 100644 --- a/app/javascript/vue/shared/info_component.vue +++ b/app/javascript/vue/shared/info_component.vue @@ -1,25 +1,25 @@