From 34d5d47627907e39a26b135b7b87462c4afc25c2 Mon Sep 17 00:00:00 2001 From: hegeaal Date: Thu, 16 Jan 2025 12:27:13 +0100 Subject: [PATCH] fix: only title for nb showing --- .github/workflows/deploy-prod&demo.yaml | 1 - .github/workflows/deploy-staging.yaml | 5 --- package-lock.json | 50 +++++++++++---------- src/context/table-context/reducer.ts | 3 +- src/pages/datasets-page/populated-table.tsx | 3 +- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/.github/workflows/deploy-prod&demo.yaml b/.github/workflows/deploy-prod&demo.yaml index 706c9d1a6..436f84d35 100644 --- a/.github/workflows/deploy-prod&demo.yaml +++ b/.github/workflows/deploy-prod&demo.yaml @@ -16,7 +16,6 @@ jobs: cluster: digdir-fdk-prod secrets: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GCP_SA_DIGDIR_FDK_GCR_KEY: ${{ secrets.GCP_SA_DIGDIR_FDK_GCR_KEY }} DIGDIR_FDK_AUTODEPLOY: ${{ secrets.DIGDIR_FDK_PROD_AUTODEPLOY }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/deploy-staging.yaml b/.github/workflows/deploy-staging.yaml index a586a6e78..8733dad28 100644 --- a/.github/workflows/deploy-staging.yaml +++ b/.github/workflows/deploy-staging.yaml @@ -17,7 +17,6 @@ jobs: cluster: digdir-fdk-dev secrets: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GCP_SA_DIGDIR_FDK_GCR_KEY: ${{ secrets.GCP_SA_DIGDIR_FDK_GCR_KEY }} DIGDIR_FDK_AUTODEPLOY: ${{ secrets.DIGDIR_FDK_DEV_AUTODEPLOY }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} @@ -25,8 +24,6 @@ jobs: name: Build image on PR from dependabot if: ${{ github.actor == 'dependabot[bot]' }} uses: Informasjonsforvaltning/workflows/.github/workflows/build.yaml@main - secrets: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} dependabot-build-dev-image: name: Build dev image on PR from dependabot @@ -34,5 +31,3 @@ jobs: uses: Informasjonsforvaltning/workflows/.github/workflows/build.yaml@main with: dockerfile: dev.Dockerfile - secrets: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package-lock.json b/package-lock.json index 01c569bdf..4835d1b4d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12246,9 +12246,9 @@ "dev": true }, "node_modules/cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", "dev": true, "engines": { "node": ">= 0.6" @@ -12546,9 +12546,9 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "dependencies": { "path-key": "^3.1.0", @@ -13256,9 +13256,9 @@ "dev": true }, "node_modules/elliptic": { - "version": "6.5.7", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.7.tgz", - "integrity": "sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==", + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz", + "integrity": "sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==", "dev": true, "dependencies": { "bn.js": "^4.11.9", @@ -13900,9 +13900,9 @@ "dev": true }, "node_modules/express": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", - "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", "dev": true, "dependencies": { "accepts": "~1.3.8", @@ -13910,7 +13910,7 @@ "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.6.0", + "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", @@ -13924,7 +13924,7 @@ "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.10", + "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", "qs": "6.13.0", "range-parser": "~1.2.1", @@ -13939,6 +13939,10 @@ }, "engines": { "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/express/node_modules/debug": { @@ -15449,9 +15453,9 @@ } }, "node_modules/http-proxy-middleware": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz", - "integrity": "sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz", + "integrity": "sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA==", "dev": true, "dependencies": { "@types/http-proxy": "^1.17.8", @@ -17415,9 +17419,9 @@ "optional": true }, "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", "dev": true, "funding": [ { @@ -18242,9 +18246,9 @@ } }, "node_modules/path-to-regexp": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", - "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", "dev": true }, "node_modules/path-type": { diff --git a/src/context/table-context/reducer.ts b/src/context/table-context/reducer.ts index b6627e01f..a83e1337d 100644 --- a/src/context/table-context/reducer.ts +++ b/src/context/table-context/reducer.ts @@ -7,6 +7,7 @@ import { Props as RowProps } from '../../components/table/table-row'; import { CellType } from '../../components/table/table-header'; import { RegistrationStatus } from '../../utils/types/enums'; +import { getTranslateText } from '../../utils/language/translateText'; type SORT_ORDER = 'ascending' | 'descending' | 'unsorted'; type FILTER_TYPE = { type: 'status'; value: RegistrationStatus } | { type: 'search' | 'status'; value: string }; @@ -53,7 +54,7 @@ const getFilteredDatasets = (state: STATE): Dataset[] => { switch (state.filter?.type) { case 'search': return state.datasets.filter(dataset => !state.filter?.value || - dataset.title?.nb?.toLowerCase().includes(state.filter?.value.toString().toLocaleLowerCase()) + getTranslateText(dataset?.title).toLowerCase().includes(state.filter?.value.toString().toLocaleLowerCase()) ); case 'status': return state.datasets.filter(dataset => !state.filter?.value || diff --git a/src/pages/datasets-page/populated-table.tsx b/src/pages/datasets-page/populated-table.tsx index 057bcb581..c6224215f 100644 --- a/src/pages/datasets-page/populated-table.tsx +++ b/src/pages/datasets-page/populated-table.tsx @@ -14,6 +14,7 @@ import { Props as RowProps } from '../../components/table/table-row'; import { SORT_BY_TYPE, SORT_TYPE } from '../../context/table-context/reducer'; import env from '../../utils/constants/env'; import { useDatasetsContext } from '../../context/datasets-context'; +import { getTranslateText } from '../../utils/language/translateText'; const { FDK_REGISTRATION_BASE_URI } = env; @@ -99,7 +100,7 @@ const getRows = (datasets: Dataset[], catalogId: string): RowProps[ icon: , width: colWidths.col_4, }, - { text: dataset.title?.nb ?? 'Mangler tittel', width: colWidths.col_1 }, + { text: dataset?.title ? getTranslateText(dataset.title) : 'Mangler tittel', width: colWidths.col_1 }, { text: dataset?._lastModified && getDate(dataset?._lastModified), width: colWidths.col_2 }, { tag: getTag(dataset?.registrationStatus), width: colWidths.col_3 }, ],