Skip to content

Commit

Permalink
fix: user management name changes (#1432)
Browse files Browse the repository at this point in the history
  • Loading branch information
Riddhiagrawal001 authored Sep 19, 2024
1 parent 1351aa6 commit ff64997
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let itemToObjMapperForRoles = dict => {

let getHeadingForRoles = (colType: rolesColTypes) => {
switch colType {
| RoleName => Table.makeHeaderInfo(~key="role_name", ~title="Role name")
| RoleName => Table.makeHeaderInfo(~key="role_name", ~title="Role name", ~showSort=true)
| RoleScope => Table.makeHeaderInfo(~key="role_scope", ~title="Role scope")
| EntityType => Table.makeHeaderInfo(~key="entity_type", ~title="Entity Type")
| ModulePermissions => Table.makeHeaderInfo(~key="groups", ~title="Module permissions")
Expand Down
13 changes: 7 additions & 6 deletions src/screens/UserManagement/UserRevamp/UserInfo.res
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ module TableRowForUserDetails = {
@react.component
let make = (
~arrayValue: array<UserManagementTypes.userDetailstype>,
~merchantName,
~parentIndex,
~noOfElementsInParent,
) => {
Expand All @@ -77,6 +76,11 @@ module TableRowForUserDetails = {
->Array.mapWithIndex((value, index) => {
let (statusValue, statusColor) = value.status->UserUtils.getLabelForStatus

let profileName = value.profile.name->isEmptyString ? value.profile.value : value.profile.name

let merchantName =
value.merchant.name->isEmptyString ? value.merchant.value : value.merchant.name

<tr className={`${index->borderStyle}`}>
<RenderIf condition={index == 0}>
<td
Expand All @@ -85,7 +89,7 @@ module TableRowForUserDetails = {
{merchantName->capitalizeString->React.string}
</td>
</RenderIf>
<td className=tableElementCss> {value.profile.name->React.string} </td>
<td className=tableElementCss> {profileName->React.string} </td>
<td className=tableElementCss>
{value.roleId->snakeToTitle->capitalizeString->React.string}
</td>
Expand Down Expand Up @@ -135,10 +139,7 @@ module UserAccessInfo = {
->Dict.keysToArray
->Array.mapWithIndex((items, parentIndex) => {
<TableRowForUserDetails
merchantName={items}
arrayValue={items->getObjectForThekey}
parentIndex
noOfElementsInParent
arrayValue={items->getObjectForThekey} parentIndex noOfElementsInParent
/>
})
->React.array}
Expand Down

0 comments on commit ff64997

Please sign in to comment.