Skip to content

Commit

Permalink
fix: user management name changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Riddhiagrawal001 committed Sep 19, 2024
1 parent 93382db commit 2731ad2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 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
10 changes: 7 additions & 3 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,7 +139,7 @@ module UserAccessInfo = {
->Dict.keysToArray
->Array.mapWithIndex((items, parentIndex) => {
<TableRowForUserDetails
merchantName={items}
// merchantName={getNameForMerchantId(items)}
arrayValue={items->getObjectForThekey}
parentIndex
noOfElementsInParent
Expand Down

0 comments on commit 2731ad2

Please sign in to comment.