mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-31 01:35:15 +02:00
Fix bug custom fields default values undefined (#945)
* Fix bug in selected custom fields in admin panel invite user * WIP * Fix style * WIP
This commit is contained in:
parent
a7cb7f376c
commit
534bf3624a
@ -51,14 +51,7 @@ class AdminPanelViewUser extends React.Component {
|
||||
}
|
||||
|
||||
renderUserInfo() {
|
||||
const {
|
||||
name,
|
||||
disabled,
|
||||
email,
|
||||
verified,
|
||||
customfields,
|
||||
loading
|
||||
} = this.state;
|
||||
const { name, disabled, email, verified, customfields, loading } = this.state;
|
||||
|
||||
return (
|
||||
<div className="admin-panel-view-user__content">
|
||||
@ -187,10 +180,7 @@ class AdminPanelViewUser extends React.Component {
|
||||
const authorsListWithoutMe = r.data.authors.filter(author => author.id != this.props.params.userId);
|
||||
|
||||
return authorsListWithoutMe.map(author => {
|
||||
const {
|
||||
id,
|
||||
name
|
||||
} = author;
|
||||
const { id, name } = author;
|
||||
|
||||
return {
|
||||
name,
|
||||
@ -207,10 +197,7 @@ class AdminPanelViewUser extends React.Component {
|
||||
transformUserListToAutocomplete() {
|
||||
return(
|
||||
this.state.userList.map((user) => {
|
||||
const {
|
||||
id,
|
||||
name
|
||||
} = user;
|
||||
const { id, name } = user;
|
||||
|
||||
return ({
|
||||
id: id*1,
|
||||
@ -236,27 +223,20 @@ class AdminPanelViewUser extends React.Component {
|
||||
}
|
||||
|
||||
renderCustomField(_customfield) {
|
||||
const {
|
||||
customfield,
|
||||
value,
|
||||
id
|
||||
} = _customfield;
|
||||
const { customfield, value, id } = _customfield;
|
||||
|
||||
return (
|
||||
<div className="admin-panel-view-user__info-item" key={`customFieldId__${id}`}>
|
||||
{customfield}
|
||||
<div className="admin-panel-view-user__info-box">
|
||||
{value}
|
||||
{(value !== "") ? value : <div className="admin-panel-view-user__empty-content">Empty</div>}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
getTicketListProps() {
|
||||
const {
|
||||
tickets,
|
||||
loading
|
||||
} = this.state;
|
||||
const { tickets, loading } = this.state;
|
||||
|
||||
return {
|
||||
type: 'secondary',
|
||||
@ -268,15 +248,7 @@ class AdminPanelViewUser extends React.Component {
|
||||
}
|
||||
|
||||
onUserRetrieved(result) {
|
||||
const {
|
||||
name,
|
||||
email,
|
||||
verified,
|
||||
tickets,
|
||||
disabled,
|
||||
customfields,
|
||||
userList
|
||||
} = result.data;
|
||||
const { name, email, verified, tickets, disabled, customfields, userList } = result.data;
|
||||
|
||||
this.setState({
|
||||
name,
|
||||
|
@ -9,6 +9,7 @@
|
||||
display: inline-block;
|
||||
margin-right: 20px;
|
||||
min-width: 200px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
&-box {
|
||||
@ -20,6 +21,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
&__empty-content {
|
||||
font-style: italic;
|
||||
color: $dark-grey;
|
||||
}
|
||||
|
||||
&__action-buttons {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ class InviteUserWidget extends React.Component {
|
||||
this.state = {
|
||||
loading: false,
|
||||
email: null,
|
||||
customFields: []
|
||||
customFields: null
|
||||
};
|
||||
}
|
||||
|
||||
@ -41,6 +41,8 @@ class InviteUserWidget extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
if(!this.state.customFields) return null;
|
||||
|
||||
return (
|
||||
<Widget className={this.getClass()}>
|
||||
<Header title={i18n('INVITE_USER')} description={i18n('INVITE_USER_VIEW_DESCRIPTION')} />
|
||||
|
@ -40,6 +40,7 @@ class MainSignUpWidget extends React.Component {
|
||||
|
||||
render() {
|
||||
if(!this.state.customFields) return null;
|
||||
|
||||
return (
|
||||
<Widget className={this.getClass()}>
|
||||
<Header title={i18n('SIGN_UP')} description={i18n('SIGN_UP_VIEW_DESCRIPTION')} />
|
||||
|
Loading…
x
Reference in New Issue
Block a user