From 3fccaf5840d45cd6e3b11907573ff76c7b3aedc8 Mon Sep 17 00:00:00 2001 From: Csaky Date: Tue, 17 Oct 2023 17:25:23 -0700 Subject: [PATCH] Filter S3 Metadata or Tags from COMS data --- .github/environments/values.prod.yaml | 9 +++++++ app/config/custom-environment-variables.json | 3 ++- charts/bcbox/Chart.yaml | 4 +-- charts/bcbox/values.yaml | 1 + .../src/components/object/ObjectFilters.vue | 4 +-- .../src/components/object/ObjectMetadata.vue | 5 +++- .../object/ObjectMetadataTagForm.vue | 3 +-- .../src/components/object/ObjectSidebar.vue | 3 --- frontend/src/services/objectService.ts | 26 +++++++++++++++---- frontend/src/services/versionService.ts | 13 ++++++++-- frontend/src/utils/utils.ts | 23 ++++++++++++++++ 11 files changed, 75 insertions(+), 19 deletions(-) diff --git a/.github/environments/values.prod.yaml b/.github/environments/values.prod.yaml index 54043e25..05e96294 100644 --- a/.github/environments/values.prod.yaml +++ b/.github/environments/values.prod.yaml @@ -6,6 +6,15 @@ config: FRONTEND_COMS_APIPATH: https://coms.api.gov.bc.ca/api/v1 FRONTEND_OIDC_AUTHORITY: https://loginproxy.gov.bc.ca/auth/realms/standard FRONTEND_OIDC_CLIENTID: bc-box-4555 + FRONTEND_S3METATAG_EXCLUDE: + metadata: + - geodrive.common.encoding + - geodrive.windows.attr + - geodrive.windows.secdesc + - s3b-last-modified + - sha256 + tagset: + - coms-id SERVER_APIPATH: /api/v1 SERVER_BODYLIMIT: 30mb # SERVER_LOGFILE: ~ diff --git a/app/config/custom-environment-variables.json b/app/config/custom-environment-variables.json index c4832211..d50f44c1 100644 --- a/app/config/custom-environment-variables.json +++ b/app/config/custom-environment-variables.json @@ -8,7 +8,8 @@ "oidc": { "authority": "FRONTEND_OIDC_AUTHORITY", "clientId": "FRONTEND_OIDC_CLIENTID" - } + }, + "s3MetaTagExclude": "FRONTEND_S3METATAG_EXCLUDE" }, "server": { "apiPath": "SERVER_APIPATH", diff --git a/charts/bcbox/Chart.yaml b/charts/bcbox/Chart.yaml index cac25818..326bccef 100644 --- a/charts/bcbox/Chart.yaml +++ b/charts/bcbox/Chart.yaml @@ -3,7 +3,7 @@ name: bcbox # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.0.9 +version: 0.0.10 kubeVersion: ">= 1.13.0" description: A frontend UI for managing access control to S3 Objects # A chart can be either an 'application' or a 'library' chart. @@ -37,6 +37,6 @@ maintainers: # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.4.0" +appVersion: "0.5.0" deprecated: false annotations: {} diff --git a/charts/bcbox/values.yaml b/charts/bcbox/values.yaml index 8b793356..d4995dda 100644 --- a/charts/bcbox/values.yaml +++ b/charts/bcbox/values.yaml @@ -122,3 +122,4 @@ config: # SERVER_LOGFILE: ~ SERVER_LOGLEVEL: "http" SERVER_PORT: "8080" + # FRONTEND_S3METATAG_EXCLUDE: ~ diff --git a/frontend/src/components/object/ObjectFilters.vue b/frontend/src/components/object/ObjectFilters.vue index 0743202d..efded0fe 100644 --- a/frontend/src/components/object/ObjectFilters.vue +++ b/frontend/src/components/object/ObjectFilters.vue @@ -86,8 +86,6 @@ const tagsetValues = computed(() => { .flatMap((obj) => obj.tagset) // Add a display property to each tag to be used by the multiselect .map((val) => ({ ...val, display: `${val.key}=${val.value}` })) - // coms-id not allowed as a tag to filter on by COMS - .filter((val) => val.key !== 'coms-id') // Unique by display property .filter( (val, index, self) => @@ -116,7 +114,7 @@ const selectedMetadataChanged = (event: MultiSelectChangeEvent) => { }; const selectedTagsChanged = (event: MultiSelectChangeEvent) => { // Unselect any other tags that have the same tag key - // e.g. if 'coms-id=1234' is selected, unselect any other tags that have 'coms-id' as the key + // e.g. if 'colour=red' is selected, unselect any other tags that have 'colour' as the key uncheckOther(event, selectedTags); selectedFilterValuesChanged(); }; diff --git a/frontend/src/components/object/ObjectMetadata.vue b/frontend/src/components/object/ObjectMetadata.vue index dc8fc8fc..829d7aa1 100644 --- a/frontend/src/components/object/ObjectMetadata.vue +++ b/frontend/src/components/object/ObjectMetadata.vue @@ -97,7 +97,10 @@ watch([props, tsGetMetadata,vsGetMetadata] , () => {