Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add setup screen #470

Merged
merged 3 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .vite/deps_temp_2fce2642/package.json

This file was deleted.

68 changes: 58 additions & 10 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2024-11-14T05:07:50.716Z\n"
"PO-Revision-Date: 2024-11-14T05:07:50.716Z\n"
"POT-Creation-Date: 2024-11-26T05:08:32.550Z\n"
"PO-Revision-Date: 2024-11-26T05:08:32.550Z\n"

msgid "edit dataset"
msgstr ""
Expand Down Expand Up @@ -38,6 +38,15 @@ msgstr ""
msgid "Project name is required"
msgstr ""

msgid "Cannot be blank: {{fieldName}}"
msgstr ""

msgid "{{fieldName}} must be a positive number"
msgstr ""

msgid "At least one org. unit is required"
msgstr ""

msgid "Add"
msgstr ""

Expand Down Expand Up @@ -173,6 +182,15 @@ msgstr ""
msgid "No Selected"
msgstr ""

msgid "Show closed projects"
msgstr ""

msgid "Filter projects"
msgstr ""

msgid "<No value>"
msgstr ""

msgid "Select Project"
msgstr ""

Expand All @@ -182,21 +200,54 @@ msgstr ""
msgid "DataSet description"
msgstr ""

msgid "Start Date"
msgid "Expiry Days"
msgstr ""

msgid ""
"How many days after the period before the dataSet is locked for changing "
"data. Example: 5 means: after February 5th it's not possible to make "
"changes to January anymore. 0 is no lock"
msgstr ""

msgid "End Date"
msgid "Open future periods for data entry"
msgstr ""

msgid "Select org units"
msgstr ""

msgid "There is already a dataset with this name"
msgstr ""

msgid "Validating..."
msgstr ""

msgid "Please select the regions you want to share this dataSet with"
msgstr ""

msgid "Saving..."
msgstr ""

msgid "Data set saved successfully"
msgstr ""

msgid "The dataSet is finished. Press the button Save to save the data"
msgstr ""

msgid "Save"
msgstr ""

msgid "and {{number}} more."
msgstr ""

msgid "Description"
msgstr ""

msgid "Linked Project"
msgstr ""

msgid "Organisation Units"
msgstr ""

msgid "Setup"
msgstr ""

Expand All @@ -215,12 +266,6 @@ msgstr ""
msgid "Merge"
msgstr ""

msgid "Organisation Units"
msgstr ""

msgid "Save"
msgstr ""

msgid "Bulk update strategy: {{actionLabel}}"
msgstr ""

Expand Down Expand Up @@ -265,3 +310,6 @@ msgstr ""

msgid "Removing DataSets"
msgstr ""

msgid "Loading..."
msgstr ""
71 changes: 57 additions & 14 deletions i18n/es.po
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: i18next-conv\n"
"POT-Creation-Date: 2024-11-14T05:07:50.716Z\n"
"POT-Creation-Date: 2024-11-26T05:08:32.550Z\n"
"PO-Revision-Date: 2018-10-25T09:02:35.143Z\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down Expand Up @@ -38,6 +38,15 @@ msgstr ""
msgid "Project name is required"
msgstr ""

msgid "Cannot be blank: {{fieldName}}"
msgstr ""

msgid "{{fieldName}} must be a positive number"
msgstr ""

msgid "At least one org. unit is required"
msgstr ""

msgid "Add"
msgstr "Añadir"

Expand Down Expand Up @@ -173,31 +182,72 @@ msgstr ""
msgid "No Selected"
msgstr ""

msgid "Show closed projects"
msgstr ""

msgid "Filter projects"
msgstr ""

msgid "<No value>"
msgstr ""

msgid "Select Project"
msgstr ""

msgid "DataSet name"
msgstr ""

#, fuzzy
msgid "DataSet description"
msgstr "Sección"
msgstr ""

msgid "Expiry Days"
msgstr ""

msgid "Start Date"
msgid ""
"How many days after the period before the dataSet is locked for changing "
"data. Example: 5 means: after February 5th it's not possible to make changes "
"to January anymore. 0 is no lock"
msgstr ""

msgid "End Date"
msgid "Open future periods for data entry"
msgstr ""

msgid "Select org units"
msgstr ""

msgid "There is already a dataset with this name"
msgstr ""

msgid "Validating..."
msgstr ""

msgid "Please select the regions you want to share this dataSet with"
msgstr ""

msgid "Saving..."
msgstr ""

msgid "Data set saved successfully"
msgstr ""

msgid "The dataSet is finished. Press the button Save to save the data"
msgstr ""

msgid "Save"
msgstr ""

msgid "and {{number}} more."
msgstr ""

msgid "Description"
msgstr ""

msgid "Linked Project"
msgstr ""

msgid "Organisation Units"
msgstr ""

msgid "Setup"
msgstr ""

Expand All @@ -216,12 +266,6 @@ msgstr ""
msgid "Merge"
msgstr ""

msgid "Organisation Units"
msgstr ""

msgid "Save"
msgstr ""

msgid "Bulk update strategy: {{actionLabel}}"
msgstr ""

Expand Down Expand Up @@ -267,9 +311,8 @@ msgstr ""
msgid "Removing DataSets"
msgstr ""

#, fuzzy
#~ msgid "Description"
#~ msgstr "Sección"
msgid "Loading..."
msgstr ""

#~ msgid "Hello {{name}}"
#~ msgstr "Hola {{name}}"
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "5.2.0",
"react-window": "1.8.10",
"real-cancellable-promise": "^1.1.2",
"styled-components": "6.1.11",
"styled-jsx": "^5.1.6",
Expand All @@ -57,6 +58,7 @@
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
"@types/react-router-dom": "5.3.3",
"@types/react-window": "1.8.8",
"@types/styled-components": "5.1.24",
"@vitejs/plugin-react": "^3.1.0",
"@vitest/coverage-v8": "^0.32.4",
Expand Down
18 changes: 17 additions & 1 deletion src/CompositionRoot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,30 @@ import { DataSetD2Repository } from "$/data/repositories/DataSetD2Repository";
import { DataSetTestRepository } from "$/data/repositories/DataSetTestRepository";
import { LogD2Repository } from "$/data/repositories/LogD2Repository";
import { LogTestRepository } from "$/data/repositories/LogTestRepository";
import { OrgUnitD2Repository } from "$/data/repositories/OrgUnitD2Repository";
import { OrgUnitTestRepository } from "$/data/repositories/OrgUnitTestRepository";
import { ProjectD2Repository } from "$/data/repositories/ProjectD2Repository";
import { ProjectTestRepository } from "$/data/repositories/ProjectTestRepository";
import { SharingD2Repository } from "$/data/repositories/SharingD2Repository";
import { SharingRepository } from "$/data/repositories/SharingRepository";
import { SharingTestRepository } from "$/data/repositories/SharingTestRepository";
import { DataSetRepository } from "$/domain/repositories/DataSetRepository";
import { LogRepository } from "$/domain/repositories/LogRepository";
import { OrgUnitRepository } from "$/domain/repositories/OrgUnitRepository";
import { ProjectRepository } from "$/domain/repositories/ProjectRepository";
import { GetAllProjectsUseCase } from "$/domain/usecases/GetAllProjectsUseCase";
import { GetDataSetsByIdsUseCase } from "$/domain/usecases/GetDataSetsByIdsUseCase";
import { GetDataSetsUseCase } from "$/domain/usecases/GetDataSetsUseCase";
import { GetLogsUseCase } from "$/domain/usecases/GetLogsUseCase";
import { GetOrgUnitsByIdsUseCase } from "$/domain/usecases/GetOrgUnitsByIdsUseCase";
import { GetProjectsUseCase } from "$/domain/usecases/GetProjectsUseCase";
import { MigrateDataSetProjectsUseCase } from "$/domain/usecases/MigrateDataSetProjectsUseCase";
import { RemoveDataSetsUseCase } from "$/domain/usecases/RemoveDataSetsUseCase";
import { SaveDataSetUseCase } from "$/domain/usecases/SaveDataSetUseCase";
import { SaveOrgUnitDataSetUseCase } from "$/domain/usecases/SaveOrgUnitDataSetUseCase";
import { SaveSharingDataSetsUseCase } from "$/domain/usecases/SaveSharingDataSetsUseCase";
import { SearchSharingUseCase } from "$/domain/usecases/SearchSharingUseCase";
import { ValidateDataSetNameUseCase } from "$/domain/usecases/ValidateDataSetNameUseCase";
import { UserD2Repository } from "./data/repositories/UserD2Repository";
import { UserTestRepository } from "./data/repositories/UserTestRepository";
import { UserRepository } from "./domain/repositories/UserRepository";
Expand All @@ -33,6 +40,7 @@ type Repositories = {
dataSetsRepository: DataSetRepository;
logRepository: LogRepository;
projectRepository: ProjectRepository;
orgUnitRepository: OrgUnitRepository;
};

function getCompositionRoot(repositories: Repositories) {
Expand All @@ -41,12 +49,14 @@ function getCompositionRoot(repositories: Repositories) {
getByIds: new GetDataSetsByIdsUseCase(repositories.dataSetsRepository),
getAll: new GetDataSetsUseCase(repositories.dataSetsRepository),
remove: new RemoveDataSetsUseCase(repositories.dataSetsRepository),
save: new SaveSharingDataSetsUseCase(repositories.dataSetsRepository),
saveSharing: new SaveSharingDataSetsUseCase(repositories.dataSetsRepository),
saveOrgUnits: new SaveOrgUnitDataSetUseCase(repositories.dataSetsRepository),
migrateProjects: new MigrateDataSetProjectsUseCase(
repositories.dataSetsRepository,
repositories.projectRepository
),
validateName: new ValidateDataSetNameUseCase(repositories.dataSetsRepository),
save: new SaveDataSetUseCase(repositories.dataSetsRepository),
},
logs: {
getByDataSets: new GetLogsUseCase(
Expand All @@ -56,11 +66,15 @@ function getCompositionRoot(repositories: Repositories) {
},
projects: {
get: new GetProjectsUseCase(repositories.projectRepository),
getAll: new GetAllProjectsUseCase(repositories.projectRepository),
},
sharing: {
search: new SearchSharingUseCase(repositories.sharingRepository),
},
users: { getCurrent: new GetCurrentUserUseCase(repositories.usersRepository) },
orgUnits: {
getByIds: new GetOrgUnitsByIdsUseCase(repositories.orgUnitRepository),
},
};
}

Expand All @@ -71,6 +85,7 @@ export function getWebappCompositionRoot(api: D2Api) {
sharingRepository: new SharingD2Repository(api),
logRepository: new LogD2Repository(api),
projectRepository: new ProjectD2Repository(api),
orgUnitRepository: new OrgUnitD2Repository(api),
};

return getCompositionRoot(repositories);
Expand All @@ -83,6 +98,7 @@ export function getTestCompositionRoot() {
sharingRepository: new SharingTestRepository(),
logRepository: new LogTestRepository(),
projectRepository: new ProjectTestRepository(),
orgUnitRepository: new OrgUnitTestRepository(),
};

return getCompositionRoot(repositories);
Expand Down
7 changes: 7 additions & 0 deletions src/data/repositories/D2ApiCategoryOption.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { D2Api } from "$/types/d2-api";
import _ from "$/domain/entities/generic/Collection";
import { chunkRequest } from "$/data/utils";
import { FutureData } from "$/domain/entities/generic/Future";
import { Maybe } from "$/utils/ts-utils";

export class D2ApiCategoryOption {
constructor(private api: D2Api) {}
Expand All @@ -22,3 +23,9 @@ export class D2ApiCategoryOption {
}

export type D2CategoryOptionType = { id: string; displayName: string; lastUpdated: ISODateString };
export type D2CategoryOptionDates = {
startDate: Maybe<ISODateString>;
endDate: Maybe<ISODateString>;
};

export type D2CategoryOptionWithDates = D2CategoryOptionType & D2CategoryOptionDates;
Loading
Loading