-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from EyeSeeTea/development
Development
- Loading branch information
Showing
22 changed files
with
301 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,3 +38,4 @@ cypress/videos/ | |
|
||
# Custom | ||
bak | ||
NOTES* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { OrgUnitPath, OrgUnit, getOrgUnitIdsFromPaths } from "../domain/entities/OrgUnit"; | ||
import { OrgUnitsRepository } from "../domain/repositories/OrgUnitsRepository"; | ||
import { D2Api } from "../types/d2-api"; | ||
|
||
export class Dhis2OrgUnitsRepository implements OrgUnitsRepository { | ||
constructor(private api: D2Api) {} | ||
|
||
async getFromPaths(paths: OrgUnitPath[]): Promise<OrgUnit[]> { | ||
const ids = getOrgUnitIdsFromPaths(paths); | ||
|
||
const { organisationUnits } = await this.api.metadata | ||
.get({ | ||
organisationUnits: { | ||
filter: { id: { in: ids } }, | ||
fields: { id: true, path: true, name: true, level: true }, | ||
}, | ||
}) | ||
.getData(); | ||
|
||
return organisationUnits; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { OrgUnit, OrgUnitPath } from "../entities/OrgUnit"; | ||
|
||
export interface OrgUnitsRepository { | ||
getFromPaths(paths: OrgUnitPath[]): Promise<OrgUnit[]>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { OrgUnit, OrgUnitPath } from "../entities/OrgUnit"; | ||
import { OrgUnitsRepository } from "../repositories/OrgUnitsRepository"; | ||
|
||
export class GetOrgUnitsUseCase { | ||
constructor(private orgUnitsRepository: OrgUnitsRepository) {} | ||
|
||
execute(options: { paths: OrgUnitPath[] }): Promise<OrgUnit[]> { | ||
return this.orgUnitsRepository.getFromPaths(options.paths); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,8 @@ body { | |
li { | ||
line-height: 1.75; | ||
} | ||
|
||
table th, | ||
table td { | ||
border: none !important; | ||
} |
Oops, something went wrong.