-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[ui] Allocation route services table: show task-level services #14199
Merged
philrenaud
merged 6 commits into
main
from
14198-show-task-level-services-on-the-alloc-page
Aug 22, 2022
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ef66170
Adds service fragments to allocations and union taskGroup and task se…
philrenaud 21458df
Lintfixes and changelog entry
philrenaud 747952b
Lintfixes and changelog entry
philrenaud 96ea953
Split taskServices computed so @each computation doesnt have to nest
philrenaud 065df46
Lintfix
philrenaud f14031c
Small defensive condition added to service getter
philrenaud File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:feature | ||
[ui] Services table: Display task-level services in addition to group-level services. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ import { lazyClick } from 'nomad-ui/helpers/lazy-click'; | |
import { watchRecord } from 'nomad-ui/utils/properties/watch'; | ||
import messageForError from 'nomad-ui/utils/message-from-adapter-error'; | ||
import classic from 'ember-classic-decorator'; | ||
import { union } from '@ember/object/computed'; | ||
|
||
@classic | ||
export default class IndexController extends Controller.extend(Sortable) { | ||
|
@@ -47,10 +48,22 @@ export default class IndexController extends Controller.extend(Sortable) { | |
} | ||
|
||
@computed('[email protected]') | ||
get services() { | ||
get groupServices() { | ||
return (this.get('model.taskGroup.services') || []).sortBy('name'); | ||
} | ||
|
||
@computed('[email protected]') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
get taskServices() { | ||
const allTaskServicesFragments = | ||
this.get('model.states').mapBy('task.services').compact() || []; | ||
const allTaskServices = allTaskServicesFragments | ||
.map((frag) => frag.toArray()) | ||
.flat(); | ||
return allTaskServices.sortBy('name'); | ||
} | ||
|
||
@union('taskServices', 'groupServices') services; | ||
philrenaud marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
onDismiss() { | ||
this.set('error', null); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
suggestion:
This is an asynchronous request.allocations.allocation
does not load theTaskGroup
and this should trigger a fetch request.TaskGroup
can fail as a request here and we won't notify the user.