Skip to content
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

Merged
merged 5 commits into from
Nov 22, 2023

Conversation

philrenaud
Copy link
Contributor

@philrenaud philrenaud commented Nov 8, 2023

Resolves #19035

Adds an Actions dropdown on the task index page

image

Note: This formerly resolved #19018 as well, but we decided to work toward a design (persistent action service sidebar) that makes this undesirable.

@@ -338,13 +338,4 @@ export default class ClientController extends Controller.extend(
}
}
// #endregion metadata

Copy link
Contributor Author

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.

Copy link
Contributor

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?

{{#if this.allocation.job.actions.length}}
<td />
{{/if}}

Copy link
Contributor Author

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:
image

If anything, maybe I should set the condition here for "show tasks" being turned on

Copy link
Contributor

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 🤔

Comment on lines +33 to +34
<Hds::PageHeader class="job-page-header" as |PH|>
<PH.Title data-test-title>
Copy link
Contributor Author

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;
Copy link
Contributor Author

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.

@philrenaud philrenaud force-pushed the 19018-ui-actions-implementation-in-task-fly-out branch from ef2ef13 to 69f457a Compare November 8, 2023 20:00
get hasActionPermissions() {
return this.can.can('exec allocation');
}
}
Copy link
Contributor Author

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!

Copy link

github-actions bot commented Nov 8, 2023

Ember Test Audit comparison

main c8645da26adf40fd560f22a16393b3d20a6e4c97 change
passes 1538 1538 0
failures 0 0 0
flaky 0 0 0
duration 12m 39s 538ms 10m 51s 997ms -1m 47s 541ms

@philrenaud philrenaud force-pushed the 19018-ui-actions-implementation-in-task-fly-out branch 2 times, most recently from 43b0fe7 to 265df7c Compare November 10, 2023 16:27
@philrenaud philrenaud changed the title [ui] UI actions implementation in task fly out and task index [ui] UI actions implementation on task index Nov 10, 2023
@@ -2,14 +2,14 @@ name: test-ui
on:
pull_request:
paths:
- 'ui'
- 'ui/**'
Copy link
Contributor

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

Copy link
Contributor

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?

{{#if this.allocation.job.actions.length}}
<td />
{{/if}}

Comment on lines +51 to +58
{{#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}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spacing between the buttons at different levels is a bit jarring.

I think we're also missing the Actions button at the alloc and group level?

image image image

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@philrenaud philrenaud force-pushed the 19018-ui-actions-implementation-in-task-fly-out branch from c8645da to 3c9c975 Compare November 21, 2023 14:46
@philrenaud philrenaud force-pushed the 19018-ui-actions-implementation-in-task-fly-out branch from 3c9c975 to eb68dab Compare November 21, 2023 14:47
@philrenaud philrenaud merged commit e03e674 into main Nov 22, 2023
@philrenaud philrenaud deleted the 19018-ui-actions-implementation-in-task-fly-out branch November 22, 2023 06:18
Copy link

github-actions bot commented Feb 3, 2025

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implementation on Task page [ui] Actions implementation in Task Fly-out
2 participants