From 3622f65e33b5ec4284a62db29069560b54a07159 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Mon, 27 Nov 2023 10:47:05 +0000 Subject: [PATCH] Bug 35392: Move usage-reports store into erm store This is all ERM, no need to have it be separate store files --- .../intranet-tmpl/prog/js/vue/modules/erm.ts | 2 +- .../intranet-tmpl/prog/js/vue/stores/erm.js | 137 +++++++++++++++++ .../prog/js/vue/stores/usage-reports.js | 138 ------------------ 3 files changed, 138 insertions(+), 139 deletions(-) delete mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/stores/usage-reports.js diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts b/koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts index 0a39c70d56..42e26712cd 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/modules/erm.ts @@ -24,7 +24,7 @@ import { useVendorStore } from "../stores/vendors"; import { useAVStore } from "../stores/authorised-values"; import { useERMStore } from "../stores/erm"; import { useNavigationStore } from "../stores/navigation"; -import { useReportsStore } from "../stores/usage-reports"; +import { useReportsStore } from "../stores/erm"; import i18n from "../i18n"; const pinia = createPinia(); diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/erm.js b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/erm.js index 3570499ead..157cf5b676 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/erm.js +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/erm.js @@ -10,3 +10,140 @@ export const useERMStore = defineStore("erm", { }, }), }); + +export const useReportsStore = defineStore("reports", { + state: () => ({ + months_data: [ + { short: "Jan", description: "January", value: 1, active: true }, + { short: "Feb", description: "February", value: 2, active: true }, + { short: "Mar", description: "March", value: 3, active: true }, + { short: "Apr", description: "April", value: 4, active: true }, + { short: "May", description: "May", value: 5, active: true }, + { short: "Jun", description: "June", value: 6, active: true }, + { short: "Jul", description: "July", value: 7, active: true }, + { short: "Aug", description: "August", value: 8, active: true }, + { short: "Sep", description: "September", value: 9, active: true }, + { short: "Oct", description: "October", value: 10, active: true }, + { short: "Nov", description: "November", value: 11, active: true }, + { short: "Dec", description: "December", value: 12, active: true }, + ], + query: null, + title_property_column_options: { + 1: { + id: 1, + name: "Provider name", + active: true, + used_by: ["title", "item", "database", "platform"], + column: { + title: __("Data provider"), + data: "provider_name", + searchable: true, + orderable: true, + }, + }, + 2: { + id: 2, + name: "Publisher", + active: false, + used_by: ["title", "item", "database"], + column: { + title: __("Publisher"), + data: "publisher", + searchable: true, + orderable: true, + }, + }, + 3: { + id: 3, + name: "Platform", + active: false, + used_by: ["item", "database", "platform"], + column: { + title: __("Platform"), + data: "platform", + searchable: true, + orderable: true, + }, + }, + 4: { + id: 4, + name: "Publisher ID", + active: false, + used_by: ["title", "database"], + column: { + title: __("Publisher ID"), + data: "publisher_id", + searchable: true, + orderable: true, + }, + }, + 5: { + id: 5, + name: "Online ISSN", + active: false, + used_by: ["title"], + column: { + title: __("Online ISSN"), + data: "online_issn", + searchable: true, + orderable: true, + }, + }, + 6: { + id: 6, + name: "Print ISSN", + active: false, + used_by: ["title"], + column: { + title: __("Print ISSN"), + data: "print_issn", + searchable: true, + orderable: true, + }, + }, + 7: { + id: 7, + name: "DOI", + active: false, + used_by: ["title"], + column: { + title: __("DOI"), + data: "title_doi", + searchable: true, + orderable: true, + }, + }, + 8: { + id: 8, + name: "URI", + active: false, + used_by: ["title"], + column: { + title: __("URI"), + data: "title_uri", + searchable: true, + orderable: true, + }, + }, + }, + report_type_map: { + TR_B1: ["YOP", "ISBN"], + TR_B2: ["YOP", "ISBN"], + TR_B3: ["YOP", "Access_Type", "ISBN"], + TR_J3: ["Access_Type"], + TR_J4: ["YOP"], + }, + }), + actions: { + getMonthsData() { + return this.months_data; + }, + getColumnOptions() { + return this.title_property_column_options; + }, + checkReportColumns(report_type, column) { + if (!this.report_type_map.hasOwnProperty(report_type)) return false; + return this.report_type_map[report_type].includes(column); + }, + }, +}); diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/usage-reports.js b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/usage-reports.js deleted file mode 100644 index ff3028ec5f..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/usage-reports.js +++ /dev/null @@ -1,138 +0,0 @@ -import { defineStore } from "pinia"; - -export const useReportsStore = defineStore("reports", { - state: () => ({ - months_data: [ - { short: "Jan", description: "January", value: 1, active: true }, - { short: "Feb", description: "February", value: 2, active: true }, - { short: "Mar", description: "March", value: 3, active: true }, - { short: "Apr", description: "April", value: 4, active: true }, - { short: "May", description: "May", value: 5, active: true }, - { short: "Jun", description: "June", value: 6, active: true }, - { short: "Jul", description: "July", value: 7, active: true }, - { short: "Aug", description: "August", value: 8, active: true }, - { short: "Sep", description: "September", value: 9, active: true }, - { short: "Oct", description: "October", value: 10, active: true }, - { short: "Nov", description: "November", value: 11, active: true }, - { short: "Dec", description: "December", value: 12, active: true }, - ], - query: null, - title_property_column_options: { - 1: { - id: 1, - name: "Provider name", - active: true, - used_by: ["title", "item", "database", "platform"], - column: { - title: __("Data provider"), - data: "provider_name", - searchable: true, - orderable: true, - }, - }, - 2: { - id: 2, - name: "Publisher", - active: false, - used_by: ["title", "item", "database"], - column: { - title: __("Publisher"), - data: "publisher", - searchable: true, - orderable: true, - }, - }, - 3: { - id: 3, - name: "Platform", - active: false, - used_by: ["item", "database", "platform"], - column: { - title: __("Platform"), - data: "platform", - searchable: true, - orderable: true, - }, - }, - 4: { - id: 4, - name: "Publisher ID", - active: false, - used_by: ["title", "database"], - column: { - title: __("Publisher ID"), - data: "publisher_id", - searchable: true, - orderable: true, - }, - }, - 5: { - id: 5, - name: "Online ISSN", - active: false, - used_by: ["title"], - column: { - title: __("Online ISSN"), - data: "online_issn", - searchable: true, - orderable: true, - }, - }, - 6: { - id: 6, - name: "Print ISSN", - active: false, - used_by: ["title"], - column: { - title: __("Print ISSN"), - data: "print_issn", - searchable: true, - orderable: true, - }, - }, - 7: { - id: 7, - name: "DOI", - active: false, - used_by: ["title"], - column: { - title: __("DOI"), - data: "title_doi", - searchable: true, - orderable: true, - }, - }, - 8: { - id: 8, - name: "URI", - active: false, - used_by: ["title"], - column: { - title: __("URI"), - data: "title_uri", - searchable: true, - orderable: true, - }, - }, - }, - report_type_map: { - TR_B1: ["YOP", "ISBN"], - TR_B2: ["YOP", "ISBN"], - TR_B3: ["YOP", "Access_Type", "ISBN"], - TR_J3: ["Access_Type"], - TR_J4: ["YOP"], - }, - }), - actions: { - getMonthsData() { - return this.months_data; - }, - getColumnOptions() { - return this.title_property_column_options; - }, - checkReportColumns(report_type, column) { - if (!this.report_type_map.hasOwnProperty(report_type)) return false; - return this.report_type_map[report_type].includes(column); - }, - }, -}); -- 2.30.2