Skip to content

Commit

Permalink
Add links to funding search from funding calls
Browse files Browse the repository at this point in the history
  • Loading branch information
ommann committed May 23, 2024
1 parent 9f7042e commit 6b82767
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,11 @@ <h2>Rahoitushaun vaihe</h2>
<div style='font-weight: bold'>Luonnontieteiden ja tekniikan tutkimuksen toimikunta</div>

<div *ngFor="let row of grouped.LT; let i = index">
<div style='border-bottom: 1rem'>{{ row.phase }} {{row.approvalDate | date}}</div>
<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}'>Näytä päätökset</a>
</div>
</div>

<div style='margin-bottom: 1rem'></div>
Expand All @@ -401,7 +405,13 @@ <h2>Rahoitushaun vaihe</h2>
<div style='font-weight: bold'>Biotieteiden, terveyden ja ympäristön tutkimuksen toimikunta</div>

<div *ngFor="let row of grouped.BTY; let i = index">
<div style='border-bottom: 1rem'>{{ row.phase }} {{row.approvalDate | date}}</div>
<!--<div style='border-bottom: 1rem'>{{ row.phase }} {{row.approvalDate | date}}</div>-->

<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}'>Näytä päätökset</a>
</div>
</div>

<div style='margin-bottom: 1rem'></div>
Expand All @@ -412,7 +422,11 @@ <h2>Rahoitushaun vaihe</h2>
<div style='font-weight: bold'>Kulttuurin ja yhteiskunnan tutkimuksen toimikunta</div>

<div *ngFor="let row of grouped.KY; let i = index">
<div style='border-bottom: 1rem'>{{ row.phase }} {{row.approvalDate | date}}</div>
<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}'>Näytä päätökset</a>
</div>
</div>

<div style='margin-bottom: 1rem'></div>
Expand All @@ -423,7 +437,11 @@ <h2>Rahoitushaun vaihe</h2>
<div style='font-weight: bold'>Tutkimusinfrastruktuurikomitea</div>

<div *ngFor="let row of grouped.TIK; let i = index">
<div style='border-bottom: 1rem'>{{ row.phase }} {{row.approvalDate | date}}</div>
<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}'>Näytä päätökset</a>
</div>
</div>

<div style='margin-bottom: 1rem'></div>
Expand All @@ -434,7 +452,11 @@ <h2>Rahoitushaun vaihe</h2>
<div style='font-weight: bold'>Strategisen tutkimuksen neuvosto</div>

<div *ngFor="let row of grouped.STN; let i = index">
<div style='border-bottom: 1rem'>{{ row.phase }} {{row.approvalDate | date}}</div>
<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}'>Näytä päätökset</a>
</div>
</div>

<div style='margin-bottom: 1rem'></div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/portal/models/funding-call.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class FundingCall {
}[],
public daysLeft: number,
public typeOfFundingId: string,
public council: any,
public council: any
) {}
}

Expand Down
15 changes: 14 additions & 1 deletion src/app/portal/services/filters/filter.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export type Filters = {
typeOfFundingId: string[];
approvalYear: string[];
decisionMaker: string[];
callId: string[];
};

@Injectable({
Expand Down Expand Up @@ -96,6 +97,7 @@ export class FilterService {
typeOfFundingIdFilter: string[];
approvalYearFilter: string[];
decisionMakerFilter: string[];
callIdFilter: string[];

private filterSource = new BehaviorSubject({
toYear: [],
Expand Down Expand Up @@ -196,6 +198,9 @@ export class FilterService {
fundingStatus: mapFilter(source.fundingStatus),
fundingAmount: mapFilter(source.fundingAmount),
topic: mapFilter(source.topic),

callId: mapFilter(source.callId),

// Datasets
dataSource: mapFilter(source.dataSource),
accessType: mapFilter(source.accessType),
Expand All @@ -205,14 +210,15 @@ export class FilterService {
date: mapFilter(source.date),
status: mapFilter(source.status),
typeOfFundingId: mapFilter(source.typeOfFundingId),

approvalYear: mapFilter(source.approvalYear),
decisionMaker: mapFilter(source.decisionMaker),
};
}

// Filters
createFilters(filter: Filters) {
console.log("createFilters, filter.callId", filter.callId);

// Global
this.yearFilter = this.filterByYear(filter.year);
this.organizationFilter = this.filterByOrganization(filter.organization);
Expand Down Expand Up @@ -282,6 +288,7 @@ export class FilterService {
filter.topic,
'keywords.keyword.keyword'
);

// Datasets
this.dataSourceFilter = this.basicFilter(
filter.dataSource,
Expand Down Expand Up @@ -325,6 +332,11 @@ export class FilterService {
filter.decisionMaker,
'council.decisionMakerId.keyword'
);

this.callIdFilter = this.basicFilter(
filter.callId,
'callProgrammeId'
);
}

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

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

0 comments on commit 6b82767

Please sign in to comment.