Skip to content

Commit

Permalink
Release 1.2.1
Browse files Browse the repository at this point in the history
Bugfixing:
- Fix bug on 2.38 user edition

Merge remote-tracking branch 'upstream/development'
  • Loading branch information
ifoche committed Feb 23, 2023
2 parents 46c1c30 + 5bbcd2e commit c9a481f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "user-extended-app",
"description": "DHIS2 Extended User app",
"version": "1.2.0",
"version": "1.2.1",
"license": "GPL-3.0",
"author": "EyeSeeTea team",
"homepage": ".",
Expand Down
3 changes: 3 additions & 0 deletions src/data/repositories/UserD2ApiRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ export class UserD2ApiRepository implements UserRepository {
skype: user?.skype,
telegram: user?.telegram,
twitter: user?.twitter,
userRoles: user?.userCredentials.userRoles,
username: user?.userCredentials.username,
disabled: user?.userCredentials.disabled,
userCredentials: {
...existingUser.userCredentials,
disabled: user?.userCredentials.disabled,
Expand Down
4 changes: 1 addition & 3 deletions src/legacy/List/List.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,7 @@ export class ListHybrid extends React.Component {
const newValue = action === "disable";
const response = await updateUsers(this.context.d2, users, user => {
if (user?.userCredentials?.disabled !== newValue) {
return set("userCredentials.disabled", newValue, user);
} else if (user?.disabled !== newValue) {
return set("disabled", newValue, user);
return set("disabled", newValue, set("userCredentials.disabled", newValue, user));
} else {
return null;
}
Expand Down
3 changes: 3 additions & 0 deletions src/legacy/models/userHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const propertiesIgnoredOnImport = ["id", "created", "lastUpdated", "lastLogin"];

const userCredentialsFields = ["username", "password", "userRoles", "disabled", "openId"];

const user238MissingFields = ["username", "userRoles", "disabled"];

const columnNameFromPropertyMapping = {
id: "ID",
username: "Username",
Expand Down Expand Up @@ -317,6 +319,7 @@ function getUserPayloadFromPlainAttributes(baseUser, userFields) {
id: (baseUser.userCredentials && baseUser.userCredentials.id) || generateUid(),
userInfo: { id: userRoot.id },
},
...clean(_(userFields).pick(user238MissingFields).value()),
};
}

Expand Down
5 changes: 3 additions & 2 deletions src/webapp/components/user-list-table/UserListTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,11 @@ export const UserListTable: React.FC<UserListTableProps> = ({
pageSizeInitialValue: 25,
},
searchBoxLabel: i18n.t("Search by name or username..."),
onActionButtonClick: () => navigate("/new"),
// FIXME: Disabled as long as user creation via /new does not work.
// onActionButtonClick: () => navigate("/new"),
onReorderColumns,
};
}, [openSettings, enableReplicate, editUsers, onReorderColumns, reload, navigate]);
}, [openSettings, enableReplicate, editUsers, onReorderColumns, reload]);

const refreshRows = useCallback(
async (
Expand Down

0 comments on commit c9a481f

Please sign in to comment.