-
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] Rework of node/job attributes/meta using PathTree #23290
[ui] Rework of node/job attributes/meta using PathTree #23290
Conversation
Ember Test Audit comparison
|
a61fe30
to
7b922a9
Compare
7b922a9
to
38326a8
Compare
@@ -793,7 +793,7 @@ | |||
{{capitalize a.item.name}} | |||
Attributes | |||
</div> | |||
{{#if a.item.attributes.structured}} | |||
{{#if a.item.attributesShort}} |
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 conditional here now matches the property we use, rather than being a proxy for it.
@editable={{@editable}} | ||
@onKVSave={{@onKVSave}} | ||
@copyable={{@copyable}} | ||
/> |
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.
Two notable changes here:
- We no longer show the "key-prefix-only" blue headers like we used to. These were
colspan="2"
/full-width rows that both broke table accessibility conventions and made the page taller than it needed to be (especially with a lot of client metadata) - we place "terminal" items first, and then nested ones below, kind of like a filesystem layout might look in an explorer window, rather than alphabetizing all prefixes. I am less attached to this change but it feels right so far.
@@ -39,11 +39,14 @@ export default class PathTree { | |||
/** | |||
* @param {MutableArray<VariableModel>} variables | |||
*/ | |||
constructor(variables) { | |||
constructor(variables, { delimiter = '/' } = {}) { |
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 stopped short of fully generifying this (changing .files[]
to .terminal[]
etc.) but did:
- parameterize the delimiter
- add
prefix
as a returned field for ease of use in the UI
@@ -81,27 +92,4 @@ module('Integration | Component | attributes table', function (hooks) { | |||
'properties' | |||
); | |||
}); | |||
|
|||
test('should render a row for key/value pairs even when the value is another object', async function (assert) { |
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.
Test became obsolete when we stopped showing the blue "key" rows.
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.
LGTM! In addition to reviewing the code as best I can, I also took a look through the UI preview build and everything looks as I'd expect.
One note which is probably out of scope for this PR: the faded-out prefix is kinda low-contrast relative to the background. In places like Node attributes, where we don't show a "tree", this means that we never display the prefix value as black text. Snippet of what I mean from here:
Here "kernel" is never being shown to the user as black text, only faded.
@tgross your comment got me to spitball with some components a bit; what would you think about the look of metadata/attributes if they were set in our Is this too visually heavy for what it is? |
Yeah, feels heavy to me. |
145e13b
to
d318131
Compare
This extends and reuses PathTree logic originally written for Variables in #13202
This PR specifically fixes a bug where a metadata k/v item wouldn't show up in the UI if its full key was the prefix of a nested child key.
For example, this metadata:
would produce the following:
and now produces: