Skip to content

Commit

Permalink
fix : User type and Company information are missing from the detailed…
Browse files Browse the repository at this point in the history
… user profile view [CPCN-111] (#336)

* fix : User type and Company information are missing from the detailed user profile view [CPCN-111]

* fix linr
  • Loading branch information
devketanpro authored Apr 13, 2023
1 parent a6836e6 commit f954e0a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion assets/company-admin/components/CompanyAdminApp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class CompanyAdminAppComponent extends React.Component {
resendUserInvite={this.props.resendUserInvite}
currentUser={this.props.user}
products={this.props.products}
hideFields={['user_type', 'company']}
hideFields={['company']}
/>
)}
</div>
Expand Down
9 changes: 8 additions & 1 deletion assets/users/components/EditUser.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ function EditUserComponent({
const isAdmin = isUserAdmin(currentUser);
const isCompanyAdmin = isUserCompanyAdmin(currentUser);

let company = companies.map((value)=> value.name);

return (
<div className='list-item__preview' role={gettext('dialog')} aria-label={gettext('Edit User')}>
<div className='list-item__preview-header'>
Expand Down Expand Up @@ -148,7 +150,12 @@ function EditUserComponent({
readOnly={userTypeReadOnly(user, currentUser)}
onChange={onChange}
error={errors ? errors.user_type : null}/>)}
{hideFields.includes('company') ? null : (<SelectInput
{hideFields.includes('company') ? (<TextInput
name='company'
label={gettext('Company')}
value={company[0]}
onChange={onChange}
error={errors ? errors.role : null} />) : (<SelectInput
name='company'
label={gettext('Company')}
value={user.company}
Expand Down
4 changes: 2 additions & 2 deletions assets/users/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import {get} from 'lodash';

export const userTypes = [
{value: 'administrator', text: gettext('Administrator'), show_acc_mgr: false},
{value: 'internal', text: gettext('Internal'), show_acc_mgr: true},
{value: 'internal', text: gettext('Internal'), show_acc_mgr: false},
{value: 'public', text: gettext('Public'), show_acc_mgr: true},
{value: 'account_management', text: gettext('Account Management'), show_acc_mgr: false},
{value: 'company_admin', text: gettext('Company Admin'), show_acc_mgr: false},
{value: 'company_admin', text: gettext('Company Admin'), show_acc_mgr: true},
];

export function getUserLabel(code) {
Expand Down

0 comments on commit f954e0a

Please sign in to comment.