-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat(ember): add work item list #174
base: main
Are you sure you want to change the base?
Conversation
6623a1a
to
7696fc6
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.
Maybe add a short and sweet acceptance test?
f7fe4a5
to
06fe10d
Compare
update and improvement of the work item list, removed unnecessary parts relies on #210 |
510e2b8
to
88a37a5
Compare
Refactored to ember-resources and added basic acceptance tests. |
} | ||
|
||
get case() { | ||
return this.raw.case.parentWorkItem?.case || this.raw.case; |
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.
I don't see where we're fetching the parentWorkItem
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.
Removed
ember/.eslintignore
Outdated
# mirage | ||
/mirage/mirage |
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.
Why?
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.
Note for Prettier users
pin eslint-plugin-prettier to 2.6.0, or
add the following to .eslintignore: /mirage/mirage
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.
Have you tried it without this? ember-caluma
doesn't have this..
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.
Removed
ember/app/cases/detail/route.js
Outdated
const caseQuery = useCalumaQuery(this, allCases, () => ({ | ||
options: { pageSize: 1 }, | ||
filter: [{ id: case_id }], | ||
})); |
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 is not how useCalumaQuery
works. This needs to be a property on the controller.. Please check out the documentation in ember-caluma
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.
Instead of fetching the same case/work item (duplicating this code snippet) in the child controllers, i opted to fetch them in the parent route model. What would be the best alternative to useCalumaQuery
, just using apollo?
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.
Changed to apollo queries in controllers for both cases
@dropTask() | ||
*completeWorkItem() { | ||
yield this.apollo.mutate({ | ||
mutation: completeWorkItem, | ||
variables: { id: this.workItem.id }, | ||
}); | ||
|
||
this.actionButtonOnSuccess(); | ||
} |
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.
Use the built-in <WorkItemButton />
or the action button question type
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.
Changed to actionbutton
const workItemsQuery = useCalumaQuery(this, allWorkItems, () => ({ | ||
options: { pageSize: 1 }, | ||
filter: [{ id: work_item_id }], | ||
})); |
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.
Again, needs to be on the controller
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.
Changed
<div uk-drop> | ||
<div class="uk-card uk-card-body uk-card-small uk-card-default"> |
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.
I think you want to use the uk-dropdown
here - not a card in a drop
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.
Changed
@@ -8,7 +8,8 @@ | |||
</LinkTo> | |||
|
|||
<UkTab as |tab|> | |||
<tab.item @href="/">{{t "nav.documents"}}</tab.item> | |||
<tab.item @href="/form-builder">{{t "nav.form-builder"}}</tab.item> | |||
<tab.item @href="/">{{t "nav.cases"}}</tab.item> |
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.
<tab.item @href="/">{{t "nav.cases"}}</tab.item> | |
<tab.item @href="/" @linkToIndex={{true}}>{{t "nav.cases"}}</tab.item> |
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.
Changed
/> | ||
|
||
<div class="uk-width-expand uk-flex uk-flex-middle uk-text-meta uk-margin"> | ||
<span> |
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.
Why the span?
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.
Removed
ember/app/work-items/controller.js
Outdated
export default class WorkItemsController extends Controller { | ||
queryParams = ["order", "status"]; | ||
|
||
// Filters |
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.
I don't think that comment is very helpful, let's remove it
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.
Removed
ember/app/work-items/controller.js
Outdated
|
||
@action | ||
updateFilter(type, value) { | ||
set(this, type, value); |
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.
set(this, type, value); | |
this[type] = value; |
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.
Changed
8fd0dce
to
3f5f6a9
Compare
adds a new view to display the work items to the user