From b852c042feff417c745e2166c26f84b22456b14a Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Wed, 18 Sep 2024 15:56:19 +0000 Subject: [PATCH] Bug 37856: Add service_platform field The change from this patch itself should be self-explanatory. Testing for this requires credentials to a specific provider. But the parameter is only added to the URL if defined. Test plan, ktd, apply patch, run: $ yarn js:build $ yarn api:bundle $ koha-plack --restart kohadev 1) Enable ERMModule 2) Create a new provider, visit: /cgi-bin/koha/erm/eusage/usage_data_providers/add 3) Ensure 'Service platform' now shows. Create the provider and put something in this field. 4) View the provider, ensure the field is shown, visit: /cgi-bin/koha/erm/eusage/usage_data_providers/1 Ensure all tests are still passing: $ cypress run --spec t/cypress/integration/ERM/DataProviders_spec.ts $ prove t/db_dependent/api/v1/erm_usage_* Signed-off-by: David Nind Signed-off-by: Katrin Fischer --- api/v1/swagger/definitions/erm_usage_data_provider.yaml | 5 +++++ installer/data/mysql/kohastructure.sql | 1 + .../ERM/UsageStatisticsDataProviderDetails.vue | 6 ++++++ .../ERM/UsageStatisticsDataProvidersFormAdd.vue | 9 +++++++++ 4 files changed, 21 insertions(+) diff --git a/api/v1/swagger/definitions/erm_usage_data_provider.yaml b/api/v1/swagger/definitions/erm_usage_data_provider.yaml index baa6c5d092..ed6bdfe570 100644 --- a/api/v1/swagger/definitions/erm_usage_data_provider.yaml +++ b/api/v1/swagger/definitions/erm_usage_data_provider.yaml @@ -73,6 +73,11 @@ properties: type: - string - "null" + service_platform: + description: service platform of the harvester + type: + - string + - "null" metric_type: description: metric type of the harvester when reporting type: diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 2b2175fe2f..31f0828a24 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3215,6 +3215,7 @@ CREATE TABLE `erm_usage_data_providers` ( `requestor_name` varchar(80) DEFAULT NULL COMMENT 'requestor name', `requestor_email` varchar(80) DEFAULT NULL COMMENT 'requestor email', `report_types` varchar(255) DEFAULT NULL COMMENT 'report types provided by the harvester', + `service_platform` varchar(80) DEFAULT NULL COMMENT 'platform if provider requires it', PRIMARY KEY (`erm_usage_data_provider_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProviderDetails.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProviderDetails.vue index 9190f5834a..3032b8d668 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProviderDetails.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProviderDetails.vue @@ -32,6 +32,12 @@ {{ usage_data_provider.report_types }} +
  • + + + {{ usage_data_provider.service_platform }} + +
  • {{ $__("SUSHI credentials") }} diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFormAdd.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFormAdd.vue index ab042e8f62..b0c35107f5 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFormAdd.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFormAdd.vue @@ -118,6 +118,15 @@ :disabled="!selected_provider && !manual_form" /> +
  • + + +