From 404e0f507f15d4b207d978465601bf53a5afd875 Mon Sep 17 00:00:00 2001 From: Jordi BC Date: Thu, 29 Sep 2022 11:28:29 +0200 Subject: [PATCH 1/4] Use switch to show short names in all uses of the OrgUnitsSelector component. Closes https://app.clickup.com/t/2ghev8r --- .../List/organisation-unit-dialog/OrgUnitDialog.component.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/legacy/List/organisation-unit-dialog/OrgUnitDialog.component.js b/src/legacy/List/organisation-unit-dialog/OrgUnitDialog.component.js index b264245..0aa04ff 100644 --- a/src/legacy/List/organisation-unit-dialog/OrgUnitDialog.component.js +++ b/src/legacy/List/organisation-unit-dialog/OrgUnitDialog.component.js @@ -124,6 +124,7 @@ class OrgUnitDialog extends React.Component { filterByProgram: false, selectAll: false, }} + showNameSetting={true} /> ); From eb3e5e73f49d5aeee959d96f22d3321cc698568c Mon Sep 17 00:00:00 2001 From: Jordi BC Date: Thu, 29 Sep 2022 11:44:57 +0200 Subject: [PATCH 2/4] Use show-short-names switch in OrgUnitsSelectorFF too. This component is used when editing a user, in step 2. I missed this location in the previous commit. As far as I can see there is no other use of the OrgUnitsSelector component anywhere else. --- src/webapp/components/user-form/components/OrgUnitSelectorFF.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/webapp/components/user-form/components/OrgUnitSelectorFF.tsx b/src/webapp/components/user-form/components/OrgUnitSelectorFF.tsx index 6324a5d..6b393de 100644 --- a/src/webapp/components/user-form/components/OrgUnitSelectorFF.tsx +++ b/src/webapp/components/user-form/components/OrgUnitSelectorFF.tsx @@ -50,6 +50,7 @@ export const OrgUnitSelectorFF = ({ input, meta, validationText, ...rest }: OrgU filterByProgram: false, selectAll: false, }} + showNameSetting={true} /> {!!message && } From 125150fb4a362a6b7856bde99d3f62c343232289 Mon Sep 17 00:00:00 2001 From: Jordi BC Date: Thu, 6 Oct 2022 18:49:29 +0200 Subject: [PATCH 3/4] Comment out all uses of accountExpiry. This way, when we update a user we do not send an empty value for accountExpiry. Dhis2 interprets now an empty value as setting it to its first date, 1970-01-01, and that stops the users from being able to connect (since the date is in the past). --- src/data/models/UserModel.ts | 4 ++-- src/data/repositories/UserD2ApiRepository.ts | 8 ++++---- src/domain/entities/User.ts | 4 ++-- src/webapp/components/user-form/UserForm.tsx | 4 ++-- src/webapp/components/user-form/utils.ts | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/data/models/UserModel.ts b/src/data/models/UserModel.ts index 8046bd1..ab5751a 100644 --- a/src/data/models/UserModel.ts +++ b/src/data/models/UserModel.ts @@ -40,7 +40,7 @@ export const UserModel: Codec = Schema.object({ ldapId: Schema.optional(Schema.string), externalAuth: Schema.boolean, password: Schema.string, - accountExpiry: Schema.string, + // accountExpiry: Schema.string, }); export const ApiUserModel: Codec = Schema.object({ @@ -76,6 +76,6 @@ export const ApiUserModel: Codec = Schema.object({ ldapId: Schema.optionalSafe(Schema.string, ""), externalAuth: Schema.boolean, password: Schema.string, - accountExpiry: Schema.string, + // accountExpiry: Schema.string, }), }); diff --git a/src/data/repositories/UserD2ApiRepository.ts b/src/data/repositories/UserD2ApiRepository.ts index ab34ede..4dc96b3 100644 --- a/src/data/repositories/UserD2ApiRepository.ts +++ b/src/data/repositories/UserD2ApiRepository.ts @@ -136,7 +136,7 @@ export class UserD2ApiRepository implements UserRepository { ldapId: user?.userCredentials.ldapId, externalAuth: user?.userCredentials.externalAuth, password: user?.userCredentials.password, - accountExpiry: user?.userCredentials.accountExpiry, + // accountExpiry: user?.userCredentials.accountExpiry, }, }; }); @@ -281,7 +281,7 @@ export class UserD2ApiRepository implements UserRepository { ldapId: userCredentials.ldapId, externalAuth: userCredentials.externalAuth, password: userCredentials.password, - accountExpiry: userCredentials.accountExpiry, + // accountExpiry: userCredentials.accountExpiry, authorities, }; } @@ -314,7 +314,7 @@ export class UserD2ApiRepository implements UserRepository { ldapId: input.ldapId ?? "", externalAuth: input.externalAuth ?? "", password: input.password ?? "", - accountExpiry: input.accountExpiry ?? "", + // accountExpiry: input.accountExpiry ?? "", }, }; } @@ -347,7 +347,7 @@ const fields = { ldapId: true, externalAuth: true, password: true, - accountExpiry: true, + // accountExpiry: true, }, } as const; diff --git a/src/domain/entities/User.ts b/src/domain/entities/User.ts index bc80639..1bea0d4 100644 --- a/src/domain/entities/User.ts +++ b/src/domain/entities/User.ts @@ -28,7 +28,7 @@ export interface User { ldapId?: string; externalAuth: boolean; password: string; - accountExpiry: string; + // accountExpiry: string; authorities: string[]; } @@ -59,7 +59,7 @@ export const defaultUser: User = { ldapId: "", externalAuth: false, password: "", - accountExpiry: "", + // accountExpiry: "", authorities: [""], }; export interface AccessPermissions { diff --git a/src/webapp/components/user-form/UserForm.tsx b/src/webapp/components/user-form/UserForm.tsx index 881275c..805a560 100644 --- a/src/webapp/components/user-form/UserForm.tsx +++ b/src/webapp/components/user-form/UserForm.tsx @@ -122,8 +122,8 @@ export const RenderUserWizardField: React.FC<{ row: number; field: UserFormField /> ); // TODO: Convert to date field - case "accountExpiry": - return ; + // case "accountExpiry": + // return ; case "userGroups": return ; case "userRoles": diff --git a/src/webapp/components/user-form/utils.ts b/src/webapp/components/user-form/utils.ts index c80e735..4a3ac62 100644 --- a/src/webapp/components/user-form/utils.ts +++ b/src/webapp/components/user-form/utils.ts @@ -40,8 +40,8 @@ export const getUserName = (field: UserFormField) => { return i18n.t("Name"); case "password": return i18n.t("Password"); - case "accountExpiry": - return i18n.t("Account expiration date"); + // case "accountExpiry": + // return i18n.t("Account expiration date"); case "surname": return i18n.t("Surname"); case "username": From 553e798b360b256a6820da238cb8b0d337515e61 Mon Sep 17 00:00:00 2001 From: Ignacio Foche Perez Date: Thu, 6 Oct 2022 19:27:22 +0200 Subject: [PATCH 4/4] version bumped --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2889e94..7dd4e4f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "user-extended-app", "description": "DHIS2 Extended User app", - "version": "1.1.0", + "version": "1.1.1", "license": "GPL-3.0", "author": "EyeSeeTea team", "homepage": ".",