Skip to content

Commit

Permalink
Add approvalDate based filtering without aggregations to funding sear…
Browse files Browse the repository at this point in the history
…ch. Edit links in funding-call and funding document views.
  • Loading branch information
ommann committed May 28, 2024
1 parent 128e17c commit 237e577
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ <h2 i18n>Rahoitushaun vaihe</h2>
<div style='display: flex; border-bottom: 1rem'>
<div style='min-width: 100px'>{{ row.phase }}</div>
<div style='min-width: 100px'>{{ row.approvalDate | date }}</div>
<a [routerLink]='["/results/fundings"]' [queryParams]='{decisionMaker: "LT", callId: call.id}' i18n>Näytä myönnöt</a>
<a [routerLink]='["/results/fundings"]' [queryParams]='{decisionMaker: "LT", callId: call.id, approvalDate: row.approvalDate}' i18n>Näytä myönnöt</a>
</div>
</div>

Expand All @@ -410,7 +410,7 @@ <h2 i18n>Rahoitushaun vaihe</h2>
<div style='display: flex; border-bottom: 1rem'>
<div style='min-width: 100px'>{{ row.phase }}</div>
<div style='min-width: 100px'>{{ row.approvalDate | date }}</div>
<a [routerLink]='["/results/fundings"]' [queryParams]='{decisionMaker: "BTY", callId: call.id}' i18n>Näytä myönnöt</a>
<a [routerLink]='["/results/fundings"]' [queryParams]='{decisionMaker: "BTY", callId: call.id, approvalDate: row.approvalDate}' i18n>Näytä myönnöt</a>
</div>
</div>

Expand All @@ -425,7 +425,7 @@ <h2 i18n>Rahoitushaun vaihe</h2>
<div style='display: flex; border-bottom: 1rem'>
<div style='min-width: 100px'>{{ row.phase }}</div>
<div style='min-width: 100px'>{{ row.approvalDate | date }}</div>
<a [routerLink]='["/results/fundings"]' [queryParams]='{decisionMaker: "KY", callId: call.id}' i18n>Näytä myönnöt</a>
<a [routerLink]='["/results/fundings"]' [queryParams]='{decisionMaker: "KY", callId: call.id, approvalDate: row.approvalDate}' i18n>Näytä myönnöt</a>
</div>
</div>

Expand All @@ -440,7 +440,7 @@ <h2 i18n>Rahoitushaun vaihe</h2>
<div style='display: flex; border-bottom: 1rem'>
<div style='min-width: 100px'>{{ row.phase }}</div>
<div style='min-width: 100px'>{{ row.approvalDate | date }}</div>
<a [routerLink]='["/results/fundings"]' [queryParams]='{decisionMaker: "TIK", callId: call.id}' i18n>Näytä myönnöt</a>
<a [routerLink]='["/results/fundings"]' [queryParams]='{decisionMaker: "TIK", callId: call.id, approvalDate: row.approvalDate}' i18n>Näytä myönnöt</a>
</div>
</div>

Expand All @@ -455,7 +455,7 @@ <h2 i18n>Rahoitushaun vaihe</h2>
<div style='display: flex; border-bottom: 1rem'>
<div style='min-width: 100px'>{{ row.phase }}</div>
<div style='min-width: 100px'>{{ row.approvalDate | date }}</div>
<a [routerLink]='["/results/fundings"]' [queryParams]='{decisionMaker: "STN", callId: call.id}' i18n>Näytä myönnöt</a>
<a [routerLink]='["/results/fundings"]' [queryParams]='{decisionMaker: "STN", callId: call.id, approvalDate: row.approvalDate}' i18n>Näytä myönnöt</a>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ <h2 class="col-12 col-sm-4 col-lg-3 th">
<!-- Normal funding -->
<ng-container *ngIf="!item.euFunding; else euCallProgramme">
<div class="col-12 col-sm-8 col-lg-9 td">
{{ item.funder.callProgrammeName }}
<a [routerLink]="'/results/funding-calls/' + item.funder.callProgrammeName">{{ item.funder.callProgrammeName }}</a>
</div>
</ng-container>

Expand Down
1 change: 1 addition & 0 deletions src/app/portal/services/filters/filter.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ describe('FilterService', () => {
approvalYear: [],
decisionMaker: [],
callId: [],
approvalDate: [],
};
let tabChangeService: TabChangeService;

Expand Down
9 changes: 9 additions & 0 deletions src/app/portal/services/filters/filter.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export type Filters = {
approvalYear: string[];
decisionMaker: string[];
callId: string[];
approvalDate: string[];
};

@Injectable({
Expand Down Expand Up @@ -98,6 +99,7 @@ export class FilterService {
approvalYearFilter: string[];
decisionMakerFilter: string[];
callIdFilter: string[];
approvalDateFilter: string[];

private filterSource = new BehaviorSubject({
toYear: [],
Expand Down Expand Up @@ -200,6 +202,7 @@ export class FilterService {
topic: mapFilter(source.topic),

callId: mapFilter(source.callId),
approvalDate: mapFilter(source.approvalDate),

// Datasets
dataSource: mapFilter(source.dataSource),
Expand Down Expand Up @@ -335,6 +338,11 @@ export class FilterService {
filter.callId,
'callProgrammeId'
);

this.approvalDateFilter = this.basicFilter(
filter.approvalDate,
'council.approvalDate'
);
}

// Regular terms filter
Expand Down Expand Up @@ -958,6 +966,7 @@ export class FilterService {
...basicFilter('funding', this.approvalYearFilter),
...basicFilter('funding', this.decisionMakerFilter),
...basicFilter('funding', this.callIdFilter),
...basicFilter('funding', this.approvalDateFilter),

// Datasets
...basicFilter('dataset', this.dataSourceFilter),
Expand Down

0 comments on commit 237e577

Please sign in to comment.