-
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] UI actions implementation on task index #19036
[ui] UI actions implementation on task index #19036
Conversation
@@ -338,13 +338,4 @@ export default class ClientController extends Controller.extend( | |||
} | |||
} | |||
// #endregion metadata | |||
|
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.
As a side-effect here, I've decided to always show the "Actions" column on clients/:clientid pages (under alloc table).
Before, this ended up looking a bit jarring and now it'll take up a small amount of space but with the benefit of a consistent look/feel. See also the {{true}} pass in the client index handlebars file.
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.
+1 on avoid conditional rendering as it can make the UI surprising (why do I only see this thing sometimes?)
More over though, I think I would not have an Actions
column at all. AllocationRow
is already quite crowded and adding more rows just makes everything more "squishy" and knowing the number of actions in an alloc doesn't seem very relevant.
Side note: not sure if this will be fixed in a follow-up PR, but the column rendering seems wrong?
nomad/ui/app/templates/components/allocation-row.hbs
Lines 140 to 142 in ff928a8
{{#if this.allocation.job.actions.length}} | |
<td /> | |
{{/if}} |
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.
Thanks; ended up removing the condition on allocation-row.hbs and kept the otherwise empty td there permanently.
The row is getting too crowded for sure, and I'll address that in a future PR; for now, the allocation row's actions column serves only to let the task-sub-row actions dropdown have space held for it:
If anything, maybe I should set the condition here for "show tasks" being turned on
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.
Ahh OK, I saw actions.length
somewhere and thought this would be a number 😅
Not sure why I didn't see the ...
button 🤔
<Hds::PageHeader class="job-page-header" as |PH|> | ||
<PH.Title data-test-title> |
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.
Further added the Helios PageHeader component here as the right-aligned buttons look nicer with it.
@@ -7,7 +7,7 @@ section.notifications { | |||
position: fixed; | |||
bottom: 20px; | |||
right: 20px; | |||
z-index: 100; | |||
z-index: $z-notification; |
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.
A fun new z-index, since we want to launch actions from the sidebar, the notifications for those actions should also show up above the sidebar.
ef2ef13
to
69f457a
Compare
get hasActionPermissions() { | ||
return this.can.can('exec allocation'); | ||
} | ||
} |
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.
Not much to this file yet, but expect big things soon as we use this service to persist running-in-the-background actions websockets among other things!
Ember Test Audit comparison
|
43b0fe7
to
265df7c
Compare
.github/workflows/test-ui.yml
Outdated
@@ -2,14 +2,14 @@ name: test-ui | |||
on: | |||
pull_request: | |||
paths: | |||
- 'ui' | |||
- 'ui/**' |
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.
Not sure if this will cause a merge conflict, but may be better to undo it in this PR.
@@ -338,13 +338,4 @@ export default class ClientController extends Controller.extend( | |||
} | |||
} | |||
// #endregion metadata | |||
|
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.
+1 on avoid conditional rendering as it can make the UI surprising (why do I only see this thing sometimes?)
More over though, I think I would not have an Actions
column at all. AllocationRow
is already quite crowded and adding more rows just makes everything more "squishy" and knowing the number of actions in an alloc doesn't seem very relevant.
Side note: not sure if this will be fixed in a follow-up PR, but the column rendering seems wrong?
nomad/ui/app/templates/components/allocation-row.hbs
Lines 140 to 142 in ff928a8
{{#if this.allocation.job.actions.length}} | |
<td /> | |
{{/if}} |
{{#if this.shouldShowActions}} | ||
<Hds::Dropdown class="actions-dropdown" as |dd|> | ||
<dd.ToggleButton @color="secondary" @text="Actions" @size="medium" /> | ||
{{#each this.model.task.actions as |action|}} | ||
<dd.Interactive {{on "click" (perform this.runAction action (get (object-at 0 action.allocations) "id"))}} @text="{{action.name}}" /> | ||
{{/each}} | ||
</Hds::Dropdown> | ||
{{/if}} |
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.
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.
The spacing on the Task and Job page will be the norm for all pages; I'm rolling it the new PageHeader component on a page-by-page basis.
I hadn't considered the spacing issue too off-putting, but this comment makes me think should do a wholesale switch-over soon.
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.
Actions on Group and Alloc level, I was planning to leave until the Actions service from #19084 is wrapped up; I'll handle that in a future PR.
c8645da
to
3c9c975
Compare
3c9c975
to
eb68dab
Compare
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
Resolves #19035
Adds an Actions dropdown on the task index page
Note: This formerly resolved #19018 as well, but we decided to work toward a design (persistent action service sidebar) that makes this undesirable.