-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#165053196 admin is able to view department details. #244
base: develop
Are you sure you want to change the base?
Conversation
0da71c2
to
337cebb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to update the getAssignedAssets().
The Test Coverage decreased. Update the test as well.
@@ -19,7 +19,7 @@ export class DepartmentDetailComponent extends React.Component { | |||
|
|||
|
|||
assetsAssigned = (assets) => { | |||
if (isEmpty(assets.assets_assigned)) { | |||
if (isEmpty(assets.assets_assigned.result)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be assets.assets_assigned.results
337cebb
to
08ce4ea
Compare
@@ -15,11 +15,11 @@ export class DepartmentDetailComponent extends React.Component { | |||
} | |||
|
|||
getAssignedAssets = assets => | |||
this.props.getAssetsSuccess({ results: assets.assets_assigned, count: assets.assets_assigned.length }, ''); | |||
this.props.getAssetsSuccess({ results: assets.assets_assigned.results, count: assets.assets_assigned.results.length }, ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.props.getAssetsSuccess({ results: assets.assets_assigned.results, count: assets.assets_assigned.results.length }, ''); | |
this.props.getAssetsSuccess({ results: assets.assets_assigned.results, count: assets.assets_assigned.count }, ''); |
</Header> | ||
<Header> | ||
Total Assets Assigned: {details.assets_assigned.length} | ||
Total Assets Assigned: {assets_assigned.results.length} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Total Assets Assigned: {assets_assigned.results.length} | |
Total Assets Assigned: {assets_assigned.count} |
08ce4ea
to
bbd4a9f
Compare
What does this PR do?
View Assets assigned to a department.
Description of Task to be completed?
Allow Admin to view departments details or appropriate message.
How should this be manually tested?
Login with an admin email(The properties of this user should read as folllows: admin: true, superuser: false)
Visit
Home -> Departments
What are the relevant pivotal tracker stories?
#165053196
Any background context you want to add?
N/A
Important notes
N/A
Packages installed
N/A
Deployment note
Related PRs branch | PR (branch_name) | (pr_link)
Todos
Screenshots