Skip to content

Commit

Permalink
Fix issue with 1/0 values in filterpanel not showing as 'Ja/Nei' #1522
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi749 committed May 2, 2024
1 parent 6068b37 commit 1f098bf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Sjekk ut [release notes](./releasenotes/1.9.0.md) for høydepunkter og mer detal
- Rettet et problem hvor "Ansvarlig"-feltet i administrering av tiltak ikke viste personen som er valgt i feltet [#1506](https://github.com/Puzzlepart/prosjektportalen365/issues/1506)
- Rettet et problem hvor det ikke var mulig å lagre tom verdi i valuta/tall felt fra redigeringspanel [#1510](https://github.com/Puzzlepart/prosjektportalen365/issues/1510)
- Rettet et problem hvor lenke til prosjektets tidslinje ikke lenket riktig for program [#1511](https://github.com/Puzzlepart/prosjektportalen365/issues/1511)
- Rettet et problem hvor Ja/nei kolonner ikke ble vist som 1/0 i filterpanel [#1522](https://github.com/Puzzlepart/prosjektportalen365/issues/1522)

### Forbedringer

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,18 @@ export function usePortfolioOverviewFilters(context: IPortfolioOverviewContext)
)
let items: IFilterItemProps[] = uniqueValues
.filter((value: string) => !stringIsNullOrEmpty(value))
.map((value: string) => ({ name: value, value }))
.map((value: string) => {
const name =
column.fieldName.includes('GtIsProgram') || column.fieldName.includes('GtIsParentProject')
? value === '1'
? 'Ja'
: value === '0'
? 'Nei'
: value
: value

return { name: name, value }
})
items = items.sort((a, b) => (a.value > b.value ? 1 : -1))
return { column, items }
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ export function useGroupRenderer() {
<div style={{ overflow: 'hidden', textOverflow: 'ellipsis' }}>
{group.type === TimelineGroupType.Project ? (
<Tooltip content={strings.TimelineGroupDescription} relationship='description' withArrow>
<Link
href={`${group.path}/SitePages/${page}.aspx`}
target='_blank'
title={group.title}
>
<Link href={`${group.path}/SitePages/${page}.aspx`} target='_blank' title={group.title}>
{group.title}
</Link>
</Tooltip>
Expand Down

0 comments on commit 1f098bf

Please sign in to comment.