open-nomad/ui/app/components/evaluation-sidebar/detail.hbs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

176 lines
5.7 KiB
Handlebars
Raw Normal View History

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
}}
Epic: Evaluation Detail Sidebar (#12370) * chore: prettify gutter-menu * chore: add portal packages * styling: add styles sidebar and portal behavior * ui: sidebar component * ui: create and implement statechart for evals * ui: actor-relationship service and provider component * ui: d3 hierarchy computation * chore: add render-modifiers and curved arrows * ui: create evaluation actor div * fix related evaluations schema * ui: register/deregister evaluation divs * ui: handle resize behavior * bug: infinite re-render cycle * fix: conditional logic to prevent infinite render of flex resizing * ui: related evaluations schema and request param * ui: fix testing for evaluations * refact: make related-evals a proper has-many * chore: don't pauseTest * temp: debug d3 hierarchy * ui: move derived state logic into backing component class for detail * ui: deprecated related evaluations logic in statechart * ui: update evaluation models * ui: update logic to paint svg in non-viewable scroll region * ui: update styling * ui: testing for eval detail view * ui: delete detail from template directory * ui: break detail component down * ui: static data for /evaluation/:id endpoint * ui: fix styling of d3 viz * ui: add query parameter adapter for evals * ui: last minute design requests * wip: address browser updating detail view behavior * refact: handle query-state change in statechart * conditional class looking for currentEval equality (#12411) * F UI/evaluation detail sidebar rel evals (#12415) * ui: remove busy id alias from statechart * ui: edit related evaluations viz error message * ui: bug fixes on related evaluations view (#12423) * ui: remove busy id alias from statechart * ui: edit related evaluations viz error message * ui: update error state * ui: related evaluation outline styling * Related evaluation stylefile and non-link if it matches the active sidebar (#12428) * Adds tabbable and keyboard pressable evaluation table rows (#12433) * ui: fix failing eval list tests (#12437) * ui: move styling into classes (#12438) * fix test failures (#12444) * ui: move styling into classes * ui: eslint disable * ui: allocations have evaluations as async relationships * ui: fix evaluation refresh button (#12447) * ui: move styling into classes * ui: eslint disable * ui: allocations have evaluations as async relationships * ui: refresh bug * ui: final touches on sidebar (#12462) * chore: turn off template linting rules Temporarily turning off template linting because we dont have a set CSS convention and the release needs to go out ASAP. * doc: deprecate out of date comments and vars * ui: edit mirage server fetch logic * ui: style sidebar relative * Modification to mocked related evals and manually set 100% height on svg (#12460) * F UI/evaluation detail sidebar final touches (#12463) * chore: turn off template linting rules Temporarily turning off template linting because we dont have a set CSS convention and the release needs to go out ASAP. * doc: deprecate out of date comments and vars * ui: edit mirage server fetch logic * ui: style sidebar relative * ui: account for new related eval added to chain Co-authored-by: Michael Klein <michael@firstiwaslike.com> Co-authored-by: Phil Renaud <phil@riotindustries.com>
2022-04-05 18:34:37 +00:00
{{#let this.currentEvalDetail as |evaluation|}}
[ui] general keyboard navigation: 1.3.4 release (#14138) * Initialized keyboard service Neat but funky: dynamic subnav traversal 👻 generalized traverseSubnav method Shift as special modifier key Nice little demo panel Keyboard shortcuts keycard Some animation styles on keyboard shortcuts Handle situations where a link is deeply nested from its parent menu item Keyboard service cleanup helper-based initializer and teardown for new contextual commands Keyboard shortcuts modal component added and demo-ghost removed Removed j and k from subnav traversal Register and unregister methods for subnav plus new subnavs for volumes and volume register main nav method Generalizing the register nav method 12762 table keynav (#12975) * Experimental feature: shortcut visual hints * Long way around to a custom modifier for keyboard shortcuts * dynamic table and list iterative shortcuts * Progress with regular old tether * Delogging * Table Keynav tether fix, server and client navs, and fix to shiftless on modified arrow keys Go to Optimize keyboard link and storage key changed to g r parameterized jobs keyboard nav Dynamic numeric keynav for multiple tables (#13482) * Multiple tables init * URL-bind enumerable keyboard commands and add to more taskRow and allocationRows * Type safety and lint fixes * Consolidated push to keyCommands * Default value when removing keyCommands * Remove the URL-based removal method and perform a recompute on any add Get tests passing in Keynav: remove math helpers and a few other defensive moves (#13761) * Remove ember math helpers * Test fixes for jobparts/body * Kill an unneeded integration helper test * delog * Trying if disabling percy lets this finish * Okay so its not percy; try parallelism in circle * Percyless yet again * Trying a different angle to not have percy * Upgrade percy to 1.6.1 [ui] Keyboard nav: "u" key to go up a level (#13754) * U to go up a level * Mislabelled my conditional * Custom lint ignore rule * Custom lint ignore rule, this time with commas * Since we're getting rid of ember math helpers elsewhere, do the math ourselves here Replace ArrowLeft etc. with an ascii arrow (#13776) * Replace ArrowLeft etc. with an ascii arrow * non-mutative helper cleanup Keyboard Nav: let users rebind their shortcuts (#13781) * click-outside and shortcuts enabled/disabled toggle * Trap focus when modal open * Enabled/disabled saved to localStorage * Autofocus edit button on variable index * Modal overflow styles * Functional rebind * Saving rebinds to localStorage for all majors * Started on defaultCommandBindings * Modal header style and cancel rebind on escape * keyboardable keybindings w buttons instead of spans * recording and defaultvalues * Enter short-circuits rebind * Only some commands are rebindable, and dont show dupes * No unused get import * More visually distinct header on modal * Disallowed keys for rebind, showing buffer as you type, and moving dedupe to modal logic willDestroy hook to prevent tests from doubling/tripling up addEventListener on kb events remove unused tests Keyboard Navigation acceptance tests (#13893) * Acceptance tests for keyboard modal * a11y audit fix and localStorage clear * Bind/rebind/localStorage tests * Keyboard tests for dynamic nav and tables * Rebinder and assert expectation * Second percy snapshot showing hints no longer relevant Weird issue where linktos with query props specifically from the task-groups page would fail to route / hit undefined.shouldSuperCede errors Adds the concept of exclusivity to a keycommand, removing peers that also share its label Lintfix Changelog and PR feedback Changelog and PR feedback Fix to rebinding in firefox by blurring the now-disabled button on rebind (#14053) * Secure Variables shortcuts removed * Variable index route autofocus removed * Updated changelog entry * Updated changelog entry * Keynav docs (#14148) * Section added to the API Docs UI page * Added a note about disabling * Prev and Next order * Remove dev log and unneeded comments
2022-08-17 16:59:33 +00:00
{{#if this.isSideBarOpen}}
{{keyboard-commands this.keyCommands}}
{{/if}}
Epic: Evaluation Detail Sidebar (#12370) * chore: prettify gutter-menu * chore: add portal packages * styling: add styles sidebar and portal behavior * ui: sidebar component * ui: create and implement statechart for evals * ui: actor-relationship service and provider component * ui: d3 hierarchy computation * chore: add render-modifiers and curved arrows * ui: create evaluation actor div * fix related evaluations schema * ui: register/deregister evaluation divs * ui: handle resize behavior * bug: infinite re-render cycle * fix: conditional logic to prevent infinite render of flex resizing * ui: related evaluations schema and request param * ui: fix testing for evaluations * refact: make related-evals a proper has-many * chore: don't pauseTest * temp: debug d3 hierarchy * ui: move derived state logic into backing component class for detail * ui: deprecated related evaluations logic in statechart * ui: update evaluation models * ui: update logic to paint svg in non-viewable scroll region * ui: update styling * ui: testing for eval detail view * ui: delete detail from template directory * ui: break detail component down * ui: static data for /evaluation/:id endpoint * ui: fix styling of d3 viz * ui: add query parameter adapter for evals * ui: last minute design requests * wip: address browser updating detail view behavior * refact: handle query-state change in statechart * conditional class looking for currentEval equality (#12411) * F UI/evaluation detail sidebar rel evals (#12415) * ui: remove busy id alias from statechart * ui: edit related evaluations viz error message * ui: bug fixes on related evaluations view (#12423) * ui: remove busy id alias from statechart * ui: edit related evaluations viz error message * ui: update error state * ui: related evaluation outline styling * Related evaluation stylefile and non-link if it matches the active sidebar (#12428) * Adds tabbable and keyboard pressable evaluation table rows (#12433) * ui: fix failing eval list tests (#12437) * ui: move styling into classes (#12438) * fix test failures (#12444) * ui: move styling into classes * ui: eslint disable * ui: allocations have evaluations as async relationships * ui: fix evaluation refresh button (#12447) * ui: move styling into classes * ui: eslint disable * ui: allocations have evaluations as async relationships * ui: refresh bug * ui: final touches on sidebar (#12462) * chore: turn off template linting rules Temporarily turning off template linting because we dont have a set CSS convention and the release needs to go out ASAP. * doc: deprecate out of date comments and vars * ui: edit mirage server fetch logic * ui: style sidebar relative * Modification to mocked related evals and manually set 100% height on svg (#12460) * F UI/evaluation detail sidebar final touches (#12463) * chore: turn off template linting rules Temporarily turning off template linting because we dont have a set CSS convention and the release needs to go out ASAP. * doc: deprecate out of date comments and vars * ui: edit mirage server fetch logic * ui: style sidebar relative * ui: account for new related eval added to chain Co-authored-by: Michael Klein <michael@firstiwaslike.com> Co-authored-by: Phil Renaud <phil@riotindustries.com>
2022-04-05 18:34:37 +00:00
<Portal @target="eval-detail-portal">
<div
data-test-eval-detail
data-test-eval-detail-is-open={{this.isSideBarOpen}}
class="sidebar {{if this.isSideBarOpen "open"}}"
{{on-click-outside
this.closeSidebar
capture=true
exceptSelector="tr[data-eval-row]"
}}
>
{{#if this.isLoading}}
<div data-test-eval-loading>
<section class="section has-text-centered">
<LoadingSpinner />
</section>
</div>
{{/if}}
{{#if this.isError}}
<div data-test-eval-detail-header class="error-header">
<button
data-test-eval-sidebar-x
class="button is-borderless"
type="button"
{{on "click" this.closeSidebar}}
>
{{x-icon "cancel"}}
</button>
</div>
<div class="error-container">
<div data-test-eval-error class="error-message">
<h1 data-test-error-title class="title is-spaced">
Not Found
</h1>
<p data-test-error-message class="subtitle">
The requested evaluation could not be found. You may not be authorized to view this evaluation, it may have been garbage collected, or the ID is invalid.
</p>
</div>
</div>
{{/if}}
{{#if this.isSuccess}}
{{! Evaluation Detail Header}}
<div data-test-eval-detail-header class="detail-header">
<h1 data-test-title class="title">
{{evaluation.shortId}}
<span class="bumper-left tag is-primary">
{{evaluation.status}}
</span>
</h1>
<button
data-test-eval-sidebar-x
class="button is-borderless"
type="button"
{{on "click" this.closeSidebar}}
>
{{x-icon "cancel"}}
</button>
</div>
{{! Start Evaluation Stats}}
<div class="boxed-section is-small">
<div
class="boxed-section-body inline-definitions"
style="display: flex;"
>
<span class="label" style="width: 6.125rem;">
Evaluation Details
</span>
<div style="display: flex; flex-direction: column">
<span class="pair">
<span class="term">
Job
</span>
<LinkTo
data-test-evaluation-job
@model={{concat evaluation.plainJobId "@" evaluation.namespace
}}
@route="jobs.job"
>
{{evaluation.plainJobId}}
</LinkTo>
</span>
<span class="pair">
<span class="term">
Triggered By
</span>
{{evaluation.triggeredBy}}
</span>
</div>
<div style="display: flex; flex-direction: column">
<span class="pair">
<span class="term">
Priority
</span>
{{evaluation.priority}}
</span>
</div>
<div style="display: flex; flex-direction: column">
<span class="pair">
<span class="term">
Created
</span>
{{format-month-ts evaluation.createTime}}
</span>
<span class="pair">
<span class="term">
Placement Failure
</span>
{{evaluation.hasPlacementFailures}}
</span>
</div>
</div>
</div>
{{! Placement Failures}}
{{#if evaluation.failedTGAllocs}}
<div class="boxed-section is-danger">
<div class="boxed-section-head">
Placement Failures
</div>
<div class="boxed-section-body">
{{#each evaluation.failedTGAllocs as |placementFailure|}}
<PlacementFailure @failedTGAlloc={{placementFailure}} />
{{/each}}
</div>
</div>
{{/if}}
{{! Related Evaluations}}
{{#if this.descendentsMap}}
<EvaluationSidebar::RelatedEvaluations
@fns={{hash
handleResize=this.handleResize
handleEvaluationClick=@fns.handleEvaluationClick
}}
@data={{hash
width=this.width
height=this.height
parentEvaluation=this.parentEvaluation
descendentsMap=this.descendentsMap
activeEvaluationID=this.currentEvalDetail.id
}}
/>
{{else}}
<div class="boxed-section">
<div class="boxed-section-head">
Related Evaluations
</div>
<div class="boxed-section-body">
<div data-test-eval-error class="error-message title">
<p data-test-error-message class="subtitle">
The related evaluations cannot be visualized.
Epic: Evaluation Detail Sidebar (#12370) * chore: prettify gutter-menu * chore: add portal packages * styling: add styles sidebar and portal behavior * ui: sidebar component * ui: create and implement statechart for evals * ui: actor-relationship service and provider component * ui: d3 hierarchy computation * chore: add render-modifiers and curved arrows * ui: create evaluation actor div * fix related evaluations schema * ui: register/deregister evaluation divs * ui: handle resize behavior * bug: infinite re-render cycle * fix: conditional logic to prevent infinite render of flex resizing * ui: related evaluations schema and request param * ui: fix testing for evaluations * refact: make related-evals a proper has-many * chore: don't pauseTest * temp: debug d3 hierarchy * ui: move derived state logic into backing component class for detail * ui: deprecated related evaluations logic in statechart * ui: update evaluation models * ui: update logic to paint svg in non-viewable scroll region * ui: update styling * ui: testing for eval detail view * ui: delete detail from template directory * ui: break detail component down * ui: static data for /evaluation/:id endpoint * ui: fix styling of d3 viz * ui: add query parameter adapter for evals * ui: last minute design requests * wip: address browser updating detail view behavior * refact: handle query-state change in statechart * conditional class looking for currentEval equality (#12411) * F UI/evaluation detail sidebar rel evals (#12415) * ui: remove busy id alias from statechart * ui: edit related evaluations viz error message * ui: bug fixes on related evaluations view (#12423) * ui: remove busy id alias from statechart * ui: edit related evaluations viz error message * ui: update error state * ui: related evaluation outline styling * Related evaluation stylefile and non-link if it matches the active sidebar (#12428) * Adds tabbable and keyboard pressable evaluation table rows (#12433) * ui: fix failing eval list tests (#12437) * ui: move styling into classes (#12438) * fix test failures (#12444) * ui: move styling into classes * ui: eslint disable * ui: allocations have evaluations as async relationships * ui: fix evaluation refresh button (#12447) * ui: move styling into classes * ui: eslint disable * ui: allocations have evaluations as async relationships * ui: refresh bug * ui: final touches on sidebar (#12462) * chore: turn off template linting rules Temporarily turning off template linting because we dont have a set CSS convention and the release needs to go out ASAP. * doc: deprecate out of date comments and vars * ui: edit mirage server fetch logic * ui: style sidebar relative * Modification to mocked related evals and manually set 100% height on svg (#12460) * F UI/evaluation detail sidebar final touches (#12463) * chore: turn off template linting rules Temporarily turning off template linting because we dont have a set CSS convention and the release needs to go out ASAP. * doc: deprecate out of date comments and vars * ui: edit mirage server fetch logic * ui: style sidebar relative * ui: account for new related eval added to chain Co-authored-by: Michael Klein <michael@firstiwaslike.com> Co-authored-by: Phil Renaud <phil@riotindustries.com>
2022-04-05 18:34:37 +00:00
</p>
</div>
</div>
</div>
{{/if}}
{{! Evaluation JSON Response}}
<div class="boxed-section">
<div class="boxed-section-head">
Evaluation Response
</div>
<div class="boxed-section-body is-full-bleed">
<JsonViewer @json={{evaluation}} />
</div>
</div>
{{/if}}
</div>
</Portal>
{{/let}}