Bug 34587: Vue router, api client and authorised values

Signed-off-by: Jessica Zairo <jzairo@bywatersolutions.com>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Matt Blenkinsop 2023-04-27 10:52:14 +00:00 committed by Tomas Cohen Arazi
parent 7a33ba395e
commit 383f42b6ef
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
3 changed files with 150 additions and 1 deletions

View file

@ -250,6 +250,80 @@ export class ERMAPIClient extends HttpClient {
}),
};
}
get usage_data_providers() {
return {
get: (id) =>
this.get({
endpoint: "usage_data_providers/" + id,
}),
getAll: (query) =>
this.get({
endpoint: "usage_data_providers",
query
}),
delete: (id) =>
this.delete({
endpoint: "usage_data_providers/" + id,
}),
create: (usage_data_provider) =>
this.post({
endpoint: "usage_data_providers",
body: usage_data_provider,
}),
update: (usage_data_provider, id) =>
this.put({
endpoint: "usage_data_providers/" + id,
body: usage_data_provider,
}),
//count: () => this.count("usage_data_providers"), //TODO: Implement count method
};
}
get titles() {
return {
get: (id) =>
this.get({
endpoint: "usage_titles/" + id,
headers: {
"x-koha-embed":
"usage_mus",
},
}),
getAll: (query) =>
this.get({
endpoint: "usage_titles",
query
}),
getReport: (query, embed) =>
this.get({
endpoint: "usage_titles/report",
query,
headers: {
"x-koha-embed":
`${embed}`,
},
}),
};
}
get counter_files() {
return {
getAll: (query) =>
this.get({
endpoint: "counter_files",
query,
headers: {
"x-koha-embed":
"counter_logs",
}
}),
delete: (id) =>
this.delete({
endpoint: "counter_files/" + id,
}),
};
}
}
export default ERMAPIClient;

View file

@ -20,6 +20,12 @@ import EHoldingsEBSCOTitlesShow from "../components/ERM/EHoldingsEBSCOTitlesShow
import LicensesList from "../components/ERM/LicensesList.vue";
import LicensesShow from "../components/ERM/LicensesShow.vue";
import LicensesFormAdd from "../components/ERM/LicensesFormAdd.vue";
import UsageStatisticsDataProvidersList from "../components/ERM/UsageStatisticsDataProvidersList.vue";
import UsageStatisticsDataProvidersSummary from "../components/ERM/UsageStatisticsDataProvidersSummary.vue";
import UsageStatisticsDataProvidersFormAdd from "../components/ERM/UsageStatisticsDataProvidersFormAdd.vue";
import UsageStatisticsDataProvidersShow from "../components/ERM/UsageStatisticsDataProvidersShow.vue";
import UsageStatisticsReportsHome from "../components/ERM/UsageStatisticsReportsHome.vue";
import UsageStatisticsReportsViewer from "../components/ERM/UsageStatisticsReportsViewer.vue";
import { $__ } from "../i18n";
@ -280,6 +286,70 @@ export const routes = [
},
],
},
{
path: "/cgi-bin/koha/erm/eusage",
title: $__("eUsage"),
icon: "fa fa-tasks",
disabled: true,
children: [
{
path: "usage_data_providers",
title: $__("Data providers"),
icon: "fa fa-exchange",
is_end_node: true,
children: [
{
path: "",
name: "UsageStatisticsDataProvidersList",
component: markRaw(UsageStatisticsDataProvidersList),
},
{
path: ":usage_data_provider_id",
name: "UsageStatisticsDataProvidersShow",
component: markRaw(UsageStatisticsDataProvidersShow),
title: $__("Show provider")
},
{
path: "add",
name: "UsageStatisticsDataProvidersFormAdd",
component: markRaw(UsageStatisticsDataProvidersFormAdd),
title: $__("Add data provider")
},
{
path: "edit/:usage_data_provider_id",
name: "UsageStatisticsDataProvidersFormAddEdit",
component: markRaw(UsageStatisticsDataProvidersFormAdd),
title: $__("Edit data provider")
},
{
path: "summary",
name: "UsageStatisticsDataProvidersSummary",
component: markRaw(UsageStatisticsDataProvidersSummary),
title: $__("Data providers summary")
},
]
},
{
path: "reports",
title: "Reports",
icon: "fa fa-bar-chart",
is_end_node: true,
children: [
{
path: "",
name: "UsageStatisticsReportsHome",
component: markRaw(UsageStatisticsReportsHome),
},
{
path: "viewer",
name: "UsageStatisticsReportsViewer",
component: markRaw(UsageStatisticsReportsViewer),
title: $__("View report")
}
]
}
]
}
],
},
];
];

View file

@ -37,6 +37,11 @@ export const useAVStore = defineStore("authorised_values", {
av_package_content_types: [],
av_title_publication_types: [],
av_notforloan: [],
av_report_types: [],
av_platform_reports_metrics: [],
av_database_reports_metrics: [],
av_title_reports_metrics: [],
av_item_reports_metrics: [],
}),
actions: {
get_lib_from_av(arr_name, av) {