Skip to content

Commit

Permalink
fix: add km and MWK units in middle column AB#20153
Browse files Browse the repository at this point in the history
  • Loading branch information
jannisvisser committed Jul 17, 2023
1 parent 3c7c0d3 commit 4ec220a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
) | percent: '.0-0'
}}
</span>
{{ indicator.aggregateUnit }}
</ion-label>
</ion-item>
</ion-col>
Expand Down
17 changes: 17 additions & 0 deletions services/API-service/migration/1689575782230-aggregateUnit.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class aggregateUnit1689575782230 implements MigrationInterface {

Check failure on line 3 in services/API-service/migration/1689575782230-aggregateUnit.ts

View workflow job for this annotation

GitHub Actions / ibf-api-service (12.x)

Class 'aggregateUnit1689575782230' must be PascalCased
name = 'aggregateUnit1689575782230';

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "IBF-app"."indicator-metadata" ADD "aggregateUnit" character varying`,
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "IBF-app"."indicator-metadata" DROP COLUMN "aggregateUnit"`,
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ export class IndicatorMetadataEntity {
@Column({ nullable: true })
public unit: string;

@ApiProperty({ example: 'km' })
@Column({ nullable: true })
public aggregateUnit: string;

@ApiProperty()
@Column({ default: false })
public lazyLoad: boolean;
Expand Down
16 changes: 9 additions & 7 deletions services/API-service/src/scripts/json/indicator-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,8 @@
"order": 2,
"dynamic": true,
"lazyLoad": true,
"unit": "$"
"unit": "MWK",
"aggregateUnit": "MWK"
},
{
"countryCodes": "MWI",
Expand All @@ -1285,7 +1286,8 @@
"order": 2,
"dynamic": true,
"lazyLoad": true,
"unit": "nr. of roads"
"unit": "km",
"aggregateUnit": "km"
},
{
"countryCodes": "MWI",
Expand All @@ -1303,13 +1305,13 @@
"order": 2,
"dynamic": true,
"lazyLoad": true,
"unit": "nr. of schools"
"unit": "schools"
},
{
"countryCodes": "MWI",
"disasterTypes": ["flash-floods"],
"name": "nr_affected_clinics",
"label": "Affected clinics",
"label": "Affected health sites",
"icon": "Clinics_affected.svg",
"weightedAvg": false,
"active": "no",
Expand All @@ -1321,7 +1323,7 @@
"order": 2,
"dynamic": true,
"lazyLoad": true,
"unit": "nr. of clinics"
"unit": "health sites"
},
{
"countryCodes": "MWI",
Expand All @@ -1339,7 +1341,7 @@
"order": 2,
"dynamic": true,
"lazyLoad": true,
"unit": "nr. of waterpoints"
"unit": "waterpoints"
},
{
"countryCodes": "MWI",
Expand All @@ -1357,7 +1359,7 @@
"order": 2,
"dynamic": true,
"lazyLoad": true,
"unit": "nr. of buildings"
"unit": "buildings"
},
{
"countryCodes": "KEN",
Expand Down

0 comments on commit 4ec220a

Please sign in to comment.