Skip to content

Commit

Permalink
Fix request item display when no user ID on oxe-web-admin
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis committed Jul 12, 2023
1 parent 716bafb commit 5bca61b
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 13 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Change Log
All notable changes to this project will be documented in this file.

## [1.16.3] - 2023-07-XX

### Fixed

- Request item display when no user ID on oxe-web-admin

## [1.16.2] - 2023-07-12

### Fixed
Expand Down
58 changes: 45 additions & 13 deletions oxe-web-admin/src/component/item/Request.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,21 @@ export default class Request extends Component {
settings: null,
});

getRequest.call(this, "user/get_user/" + this.props.info.user_id, (data) => {
if (this.props.info.user_id) {
getRequest.call(this, "user/get_user/" + this.props.info.user_id, (data) => {
this.setState({
user: data,
});
}, (response) => {
nm.warning(response.statusText);
}, (error) => {
nm.error(error.message);
});
} else {
this.setState({
user: data,
user: "No user",
});
}, (response) => {
nm.warning(response.statusText);
}, (error) => {
nm.error(error.message);
});
}

getRequest.call(this, "request/get_request_enums", (data) => {
this.setState({
Expand Down Expand Up @@ -330,8 +336,10 @@ export default class Request extends Component {
/>
}

{this.state.user && this.state.settings
? <DialogSendMail
{this.state.user
&& this.state.user !== "No user"
&& this.state.settings
&& <DialogSendMail
trigger={
<button
className={"blue-background"}
Expand All @@ -347,20 +355,44 @@ export default class Request extends Component {
+ (this.getSettingValue("PROJECT_NAME") !== null
? this.getSettingValue("PROJECT_NAME") + " " : "") + "Support Team"}
/>
: <Loading
}

{this.state.user
&& this.state.user === "No user"
&& this.state.settings
&& <Message
text="No action available"
height={50}
/>
}

{(!this.state.user
|| !this.state.settings)
&& <Loading
height={50}
/>
}
</div>

<div className="col-md-6 row-spaced">
<h3>User</h3>
{this.state.user !== null
? <User

{this.state.user === null
&& <Loading
height={50}
/>
}

{this.state.user !== null && this.state.user !== "No user"
&& <User
id={this.state.user.id}
email={this.state.user.email}
/>
: <Loading
}

{this.state.user !== null && this.state.user === "No user"
&& <Message
text="No user identified in this request"
height={50}
/>
}
Expand Down

0 comments on commit 5bca61b

Please sign in to comment.