Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
compendium-v2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
compendium-v2
Commits
f0f2df4b
Commit
f0f2df4b
authored
2 years ago
by
Remco Tukker
Browse files
Options
Downloads
Patches
Plain Diff
if max1year is set on filter, ensure thats the case when opening a new page
parent
adb748e2
No related branches found
No related tags found
1 merge request
!25
Feature/comp 182 improved nren selection
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
webapp/src/components/graphing/Filter.tsx
+8
-0
8 additions, 0 deletions
webapp/src/components/graphing/Filter.tsx
webapp/src/pages/Policy.tsx
+9
-10
9 additions, 10 deletions
webapp/src/pages/Policy.tsx
with
17 additions
and
10 deletions
webapp/src/components/graphing/Filter.tsx
+
8
−
0
View file @
f0f2df4b
...
...
@@ -12,6 +12,14 @@ interface inputProps {
function
Filter
({
filterOptions
,
filterSelection
,
setFilterSelection
,
max1year
=
false
,
coloredYears
=
false
}:
inputProps
):
ReactElement
{
if
(
max1year
&&
filterSelection
.
selectedYears
.
length
>
1
)
{
const
maxYear
=
Math
.
max
(...
filterSelection
.
selectedYears
);
setFilterSelection
({
selectedYears
:
[
maxYear
],
selectedNrens
:
[...
filterSelection
.
selectedNrens
]
});
}
const
handleNrenClick
=
(
nren
:
string
)
=>
{
if
(
filterSelection
.
selectedNrens
.
includes
(
nren
))
{
setFilterSelection
({
...
...
This diff is collapsed.
Click to expand it.
webapp/src/pages/Policy.tsx
+
9
−
10
View file @
f0f2df4b
...
...
@@ -44,12 +44,11 @@ function getJSXFromMap(data: Map<string, Map<number, Policy>>) {
<
ul
>
{
policies
.
map
(([
key
,
text
])
=>
(
!!
policy
[
key
]
&&
(
<
li
key
=
{
key
}
>
<
a
href
=
{
policy
[
key
]
}
target
=
"_blank"
rel
=
"noopener noreferrer"
style
=
{
{
textDecoration
:
'
none
'
}
}
>
{
text
}
</
a
>
</
li
>
<
li
key
=
{
key
}
>
<
a
href
=
{
policy
[
key
]
}
target
=
"_blank"
rel
=
"noopener noreferrer"
style
=
{
{
textDecoration
:
'
none
'
}
}
>
{
text
}
</
a
>
</
li
>
)
))
}
</
ul
>
...
...
@@ -60,14 +59,14 @@ function getJSXFromMap(data: Map<string, Map<number, Policy>>) {
}
function
PolicyPage
({
filterSelection
,
setFilterSelection
}:
inputProps
)
{
const
[
policy
t
Data
,
setProjectData
]
=
useState
<
Policy
[]
>
();
const
[
policyData
,
setProjectData
]
=
useState
<
Policy
[]
>
();
const
{
years
,
nrens
}
=
useMemo
(
()
=>
getYearsAndNrens
(
policy
t
Data
||
[]),
[
policy
t
Data
]
()
=>
getYearsAndNrens
(
policyData
||
[]),
[
policyData
]
);
const
selectedData
=
(
policy
t
Data
||
[]).
filter
(
project
=>
const
selectedData
=
(
policyData
||
[]).
filter
(
project
=>
filterSelection
.
selectedYears
.
includes
(
project
.
year
)
&&
filterSelection
.
selectedNrens
.
includes
(
project
.
nren
)
);
const
policytDataByYear
=
createPolicyDataLookup
(
selectedData
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment