-
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] Adds meta k/v tables to Task Group and Task pages #24594
Changes from all commits
5c80ed0
5902561
85b168f
2f5069a
935d000
1fb8c7e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:improvement | ||
ui: Adds metadata tables to Task Group and Task pages | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
PlacementFailures=(component "job-page/parts/placement-failures" job=@job) | ||
TaskGroups=(component "job-page/parts/task-groups" job=@job) | ||
RecentAllocations=(component "job-page/parts/recent-allocations" job=@job activeTask=@activeTask setActiveTaskQueryParam=@setActiveTaskQueryParam) | ||
Meta=(component "job-page/parts/meta" job=@job) | ||
Meta=(component "job-page/parts/meta" meta=@job.meta) | ||
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. This generally changes the context from "This is a component for jobs, it knows how to get metadata from a job" to "This is a component for metadata, it is given metadata" |
||
DasRecommendations=(component | ||
"job-page/parts/das-recommendations" job=@job | ||
) | ||
|
@@ -35,4 +35,4 @@ | |
|
||
) | ||
) | ||
}} | ||
}} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,8 @@ export default Factory.extend({ | |
// Set in the TaskGroup factory | ||
volumeMounts: [], | ||
|
||
meta: null, | ||
|
||
JobID: '', | ||
|
||
name: (id) => `task-${dasherize(faker.hacker.noun())}-${id}`, | ||
|
@@ -128,5 +130,9 @@ export default Factory.extend({ | |
}); | ||
task.update({ schedule: schedule }); | ||
} | ||
|
||
if (task.withMeta) { | ||
task.update({ meta: { raw: { foo: 'bar' } } }); | ||
} | ||
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. This is a factory file! Used by our mocking service (Mirage), and our tests, this gives us some private convenience methods when creating mocked objects like tasks/task groups. In this case, applying |
||
}, | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,6 +60,8 @@ export default create({ | |
clientSource: text('[data-test-volume-client-source]'), | ||
}), | ||
|
||
hasMeta: isPresent('[data-test-meta]'), | ||
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. These are "test pages": a way to have nice syntactic sugar in our actual tests (like |
||
|
||
events: collection('[data-test-task-event]', { | ||
time: text('[data-test-task-event-time]'), | ||
type: text('[data-test-task-event-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.
You might notice that this is using the
...this.meta.raw
format where the above task-group model is usingthis.get('meta.raw')
. Theget
syntax is valid JS and everything, but is more of an old-ember convention, and task group models have existed longer than task models in our codebase.You can see these old-ember ways of doing things scattered throughout: look for a
@classic
decorator near the top of the class declaration.