Skip to content

Commit

Permalink
fix: show themes instead of regulatory areas in dashboard list
Browse files Browse the repository at this point in the history
  • Loading branch information
maximeperrault authored and maximeperraultdev committed Jan 27, 2025
1 parent ed5979a commit 7c9a8f7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ context('Side Window > Dashboard List > Filter Bar', () => {
return
}

cy.wrap(row).should('contain', 'Interdiction VNM Molene')
cy.wrap(row).should('contain', 'Mixte')
})

cy.clickButton('Réinitialiser les filtres')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const Columns = (
accessorFn: row => row.regulatoryAreaIds,
cell: info => (isFetching ? <StyledSkeletonRow /> : <RegulatoryAreasThemesCell themeIds={info.getValue()} />),
enableSorting: true,
header: () => 'Thématiques',
header: () => 'Thématiques reg. des zones sélectionnées',
id: 'regulatoryAreaIds',
size: 365 + legacyFirefoxOffset,
sortingFn: (rowA: Row<Dashboard.Dashboard>, rowB: Row<Dashboard.Dashboard>, columnId: string) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useGetRegulatoryLayersQuery } from '@api/regulatoryLayersAPI'
import { getTitle } from 'domain/entities/layers/utils'
import { uniq } from 'lodash'

export function RegulatoryAreasThemesCell({ themeIds }: { themeIds: number[] }) {
Expand All @@ -12,9 +11,9 @@ export function RegulatoryAreasThemesCell({ themeIds }: { themeIds: number[] })
return '-'
}

const regulatoryAreasThemes = uniq(
themeIds.map(themeId => getTitle(regulatoryAreas.entities[themeId]?.layer_name))
).join(', ')
const regulatoryAreasThemes = uniq(themeIds.map(themeId => regulatoryAreas.entities[themeId]?.thematique))
.filter(Boolean)
.join(', ')

return <span title={regulatoryAreasThemes}>{regulatoryAreasThemes}</span>
}

0 comments on commit 7c9a8f7

Please sign in to comment.