Skip to content

Commit

Permalink
fix: only title for nb showing
Browse files Browse the repository at this point in the history
  • Loading branch information
hegeaal committed Jan 16, 2025
1 parent 2af1c08 commit 34d5d47
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 31 deletions.
1 change: 0 additions & 1 deletion .github/workflows/deploy-prod&demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/deploy-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,17 @@ 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 }}

dependabot-build:
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
if: ${{ github.actor == 'dependabot[bot]' }}
uses: Informasjonsforvaltning/workflows/.github/workflows/build.yaml@main
with:
dockerfile: dev.Dockerfile
secrets:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50 changes: 27 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/context/table-context/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down Expand Up @@ -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 ||
Expand Down
3 changes: 2 additions & 1 deletion src/pages/datasets-page/populated-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -99,7 +100,7 @@ const getRows = (datasets: Dataset[], catalogId: string): RowProps<ColumnProps>[
icon: <Icon name={dataset.specializedType === 'SERIES' ? 'squareThreeStroke' : 'squareTextStroke'} />,
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 },
],
Expand Down

0 comments on commit 34d5d47

Please sign in to comment.