Commit Graph

1734 Commits

Author SHA1 Message Date
Phil Renaud 4c58356af1 Path Tree compaction refactor (#13415)
* Bones of a just-in-time compaction pathTree

* wooo got compaction going in sub-ms times

* PR cleanup

* Path compaction tests

* lint fix to equal instead of .ok()

* Name prop specifically being equality checked
2022-07-11 13:34:05 -04:00
Phil Renaud 7eb462454b Secure Variables form validation improvements (#13335)
* Validation tests for secure variables form: duplicate path error

* Validation for dot in key name

* Defensive pattern on copy keyValues
2022-07-11 13:34:05 -04:00
Phil Renaud 311d9d1cda variable index header and deletion hook (#13302)
* variable index header and deletion hook

* Some visual improvements to edit header and back button

* Mirage fixtures for variables

* Deletion flow test

* Account for disabled state of add-more button

* Transition destination changes after design chat

* Simplified parent folder path by adding to variable model

* Lint cleanup

* test update to reflect path redirect on delete

* No longer have to re-traverse to a deleted var folder after deletion, tests updated
2022-07-11 13:34:05 -04:00
Phil Renaud e79fea2b4e Notify a user if they try to make a variable with an existing path (#13278)
* Notify a user if they try to make a variable with an existing path

* Stylize error fade

* Bugfix: if you click the dupe link to a variable you havent previously loaded, you lack its keyvalues

* rename and typefix for duplicate path warning
2022-07-11 13:34:04 -04:00
Phil Renaud e58999d62b Disable path input when model is not new (#13273)
* Disable path input when model is not new

* isDisabled tests for secure variables path
2022-07-11 13:34:04 -04:00
Phil Renaud da4cb6422e Secure Variables: Build a path tree and traverse it at /variables/*path (#13202)
* Recursive trie-building with variable paths

* tree structure applied to new path routes and a new util class

* Breadcrumbs for SV paths and prompt when nothing exists at a path

* Lint and test cleanup

* Pre-review cleanup

* lintfix

* Abstracted pathtree each-ins into a new component class

* Path tree component styles

* Types added and PR feedback addressed

* Path tree to variable paths

* Slightly simpler path QP mods

* More pr feedback handling

* Trim moved into a function on variable model

* Traversal and compaction tests for PathTree

* Trim Path tests

* Variable-paths component tests

* Lint fixup for tests
2022-07-11 13:34:04 -04:00
Phil Renaud a628e2969a Secure Variables UI: /variables/new and /variables/*path (#13069)
* variables.new initialized

* Hacky but savey

* Variable wildcard route and multiple creatable at a time

* multiple KVs per variable

* PR Prep cleanup and lintfix

* Delog

* Data mocking in mirage for variables

* Linting fixes

* Re-implement absent params

* Adapter and model tests

* Moves the path-as-id logic to a serializer instead of adapter

* Classic to serializer and lint cleanup

* Pluralized save button (#13140)

* Autofocus modifier and better Add More button UX (#13145)

* Secure Variables: show/hide functionality when adding new values (#13137)

* Flight Icons added and show hide functionality

* PR cleanup

* Linting cleanup

* Position of icon moved to the right of input

* PR feedback addressed

* Delete button and stylistic changes to show hide

* Hmm, eslint doesnt like jsdoc-usage as only reason for import

* More closely match the button styles and delete test

* Simplified new.js model

* Secure Variables: /variables/*path/edit route and functionality (#13170)

* Variable edit page init

* Significant change to where we house model methods

* Lintfix

* Edit a variable tests

* Remove redundant tests

* Asserts expected

* Mirage factory updated to reflect model state
2022-07-11 13:34:04 -04:00
Phil Renaud 7ddc4c8359 Secure Variables UI: Router setup and /variables/index route + guards (#12967)
* Route init

* Bones of a mirage-mocked secure variables policy

* Functinoing policy for list vars

* Delog and transition on route

* Basic guard test

* Page guard tests for secure variables

* Cleanup and unit tests for variables ability

* Linter cleanup

* Set expectations for test assertions

* PR feedback addressed

* Read label changed to View per suggestion
2022-07-11 13:34:03 -04:00
Phil Renaud 462c6653ac
[bugfix, ui] Allow running jobs from a namespace-limited token (#13659)
* Allow running jobs from a namespace-limited token

* qpNamespace cleanup

* Looks like parse can deal with a * namespace

* A little diff cleanup

* Defensive destructuring

* Removing accidental friendly-fire on can-scale

* Testfix: Job run buttons from jobs index

* Testfix: activeRegion job adapter string

* Testfix: unit tests for job abilities correctly reflect the any-namespace rule

* Testfix: job editor test looks for requests with namespace applied on plan
2022-07-11 12:33:17 -04:00
Phil Renaud 84a59ff059
[ui] Fix a bug where redirects after planning/editing a job didn't include namespace (#13588)
* Job editing and planning handles namespace as part of ID instead of queryParam

* Changelog added

* Tests updated to reflect new namespace redirects
2022-07-05 15:58:56 -04:00
Phil Renaud 2e6e95e78c
[ui] Reinstate Meta and Payload sections to Parameterized Child Jobs (#13473)
* Shift meta off job.definition and decodedPayload alias to passed arg

* Changelog
2022-06-24 15:03:08 -04:00
Phil Renaud 45dc1cfd58
12986 UI fails to load job when there is an "@" in job name in nomad 130 (#13012)
* LastIndexOf and always append a namespace on job links

* Confirmed the volume equivalent and simplified idWIthNamespace logic

* Changelog added

* PR comments addressed

* Drop the redirect for the time being

* Tests updated to reflect namespace on links

* Task detail test default namespace link for test
2022-05-13 17:01:27 -04:00
Georges-Etienne Legendre 864be37c73
Fix Exec not working with reverse proxy X-Nomad-Token (#12925)
* Capture token secret on fetch

* Fix tests

* Fix lint errors
2022-05-10 13:42:12 -04:00
Phil Renaud 6a8f98723e
Chronological most-recent evals by default (#12847)
* Chronological most-recent evals by default

* Adding reverse: true to the list of expected queryparams in test

* changelog
2022-05-05 16:11:27 -04:00
Luiz Aoqui 758e85bc84
ui: fix an error when navigating to a task group (#12832)
Clicking in a task group row in the job details page would throw the
error:

Uncaught Error: You didn't provide enough string/numeric parameters to satisfy all of the dynamic segments for route jobs.job.task-group. Missing params: name
    createParamHandlerInfo http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:4814
    applyToHandlers http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:4804
    applyToState http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:4801
    getTransitionByIntent http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:4843
    transitionByIntent http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:4836
    refresh http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:4885
    refresh http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:2254
    queryParamsDidChange http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:2326
    k http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:2423
    triggerEvent http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:2349
    fireQueryParamDidChange http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:4863
    getTransitionByIntent http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:4848
    transitionByIntent http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:4836
    doTransition http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:4853
    transitionTo http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:4882
    _doTransition http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:2392
    transitionTo http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:2177
    gotoTaskGroup http://localhost:4646/ui/assets/nomad-ui-4a2c1941e03e60e1feef715f23cf268c.js:623
...

This was caused because the attribute being passed to the transitionTo
function was not the task group name, but the whole model.
2022-05-02 11:01:19 -04:00
Phil Renaud 067234792a
Moves the evaluations table toolbar outside of the table-container (#12799) 2022-04-28 16:08:46 -04:00
Jai 316daf581e
fix broken link to `task-group` in `Recent Allocation` table in `jobs.job.index` (#12765)
* chore:  run prettier on hbs files

* ui:  ensure to pass a real job object to task-group link

* chore:  add changelog entry

* chore: prettify template

* ui:  template helper for formatting jobId in LinkTo component

* ui:  handle async relationship

* ui:  pass in job id to model arg instead of job model

* update test for serialized namespace

* ui:  defend against null  in tests

* ui:  prettified template added whitespace

* ui:  rollback ember-data to 3.24 because watcher return undefined on abort

* ui: use format-job-helper instead of job model via alloc

* ui: fix whitespace in template caused by prettier using template helper

* ui: update test for new namespace

* ui: revert prettier change

Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
2022-04-28 14:02:15 -04:00
Phil Renaud 182bead357
[ui, mirage] Evaluation mocks (#12471)
* Linear and Branching mock evaluations

* De-comment

* test-trigger

* Making evaluation trees dynamic

* Reinstated job relationship on eval mock

* Dasherize job prefix back to normal

* Handle bug where UUIDKey is not present on job

* Appending node to eval

* Job ID as a passed property

* Remove unused import

* Branching evals set up as generatable
2022-04-27 12:11:24 -04:00
Jai b3985db31f
bug: fix filter and search (#12587)
* chore:  remove commented out code and skipped tests

* refact:  triggeredBy requires filter expression not qp

* refact:  use filter expression dsl instead of named params

* fix:  add  type

* docs:  add in-line reference to filter expression DSL

* fix:  update filter copy for non-matches

* fix:  correct conditional logic to render no match copy
2022-04-22 15:40:13 -04:00
Phil Renaud aed56e5732
Sets up a new z-modal z-index and assigns it to the sidebar (#12758) 2022-04-22 15:23:49 -04:00
Phil Renaud 15872cc2d4
[ui] Disconnected Clients: "Unknown" allocations in the UI (#12544)
* Unknown status for allocations accounted for

* Canary string removed

* Test cleanup

* Generate unknown in mirage

* aacidentally oovervoowled

* Update ui/app/components/allocation-status-bar.js

Co-authored-by: Derek Strickland <1111455+DerekStrickland@users.noreply.github.com>

* Disconnected state on job status in client

* Renaming Disconnected to Unknown in the job-status-in-client

* Unknown accounted for on job rows filtering and testsfix

* Adding lostAllocs as a computed dependency

* Unknown client status within acceptance test

* Swatches updated and PR comments addressed

* Unknown and disconnected added to test fixtures

Co-authored-by: Derek Strickland <1111455+DerekStrickland@users.noreply.github.com>
2022-04-22 11:25:02 -04:00
Phil Renaud a5bef3ce72
[ui, bugfix] Link fix for volumes where per_alloc=true (#12713)
* Allocation page linkfix

* fix added to task page and computed prop moved to allocation model

* Fallback query added to task group when specific volume isnt knowable

* Delog

* link text reflects alloc suffix

* Helper instead of in-template conditionals

* formatVolumeName unit test

* Removing unused helper import
2022-04-21 13:57:18 -04:00
Luiz Aoqui bf7110b4c8
ui: fix bug that prevented files streaming (#12719)
During the Ember dependecy upgrade work,
https://github.com/hashicorp/nomad/commit/ce8c039f4ce7359d60ede5dee36b9cef82
moved the `isSupported` method from using Ember's `reopenClass` to a
getter, but `reopenClass` creates a static method, so the getter must be
static as well.
2022-04-20 14:39:18 -04:00
Tim Gross 267c056e0e
ui: remove beta tag from gutter menu for CSI (#12570) 2022-04-14 14:56:04 -04:00
Phil Renaud 311a6d82c9
Importing string methods directly from @ember/string (#12499)
* Capitalize methods

* Let ESLint yell at us again

* Dasherize
2022-04-07 15:51:41 -04:00
Phil Renaud a6c33b6a74
Inlines related evaluations flexbox (#12475) 2022-04-06 11:35:25 -04:00
Phil Renaud b072bf2ec1
Merge pull request #12473 from hashicorp/f-ui/evals-unshown-copy-change
Copy change, simplifies explanation for no related eval chart
2022-04-06 08:13:28 -04:00
Luiz Aoqui 16c167f180
ui: hide triggered by and status filters for now (#12472) 2022-04-05 21:14:16 -04:00
Phil Renaud 5a749eb437 Copy change, simplifies explanation for no related eval chart 2022-04-05 16:59:50 -04:00
Jai 71673f03b2
ui: eval filter (#12243)
* ui:  add triggeredBy filter

* add namespace filter

* fix:  namespace is a reserved keyword

* ui: filter by type and search

* fix:  rename closure action to

* chore:  fix data-test-attr
2022-04-05 15:30:36 -04:00
Jai 7690fda6ba
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 14:34:37 -04:00
Karthick Ramachandran 122115c0ba
make stop job message clearer (#12252) 2022-03-24 16:38:43 -04:00
Michael Klein e096a0a5ab
Upgrade Ember and friends 3.28 (#12215)
* chore: upgrade forward compatible packages

* chore: v3.20.2...v3.24.0

* chore: silence string prototype extension deprecation

* refact: don't test clicking disabled button job-list

Recent test-helper upgrades will guard against clicking disabled buttons
as this is not something that real users can do. We need to change our
tests accordingly.

* fix: await async test helper `expectError`

We have to await this async test function otherwise the test's
rendering context will be torn down before we run assertions
against it.

* fix: don't try to click disabled two-step-button

Recent test-helper updates prohibit clicking disabled buttons. We need
to adapt the tests accordingly.

* fix: recommendation-accordion

Use up-to-date semantics for handling list-accordion closing
in recommendation-accordion.

* fixes toggling recommendation-accordion toggle.

* fix: simple-unless linting error application.hbs

There's no reason to use unless here - we can use if instead.

* fix: no-quoteless-attributes recommendation accordion

* fix: no-quoteless-attributes recommendation-chart

* fix: allow `unless` - global-header.hbs

This is a valid use of unless in our opinion.

* fix: allow unless in job-diff

This is not a great use for unless but we don't want to change this
behavior atm.

* fix: no-attrs-in-components list-pager

There is no need to use this.attrs in classic components. When we
will convert to glimmer we will use `@`-instead.

* fix: simple-unless job/definition

We can convert to a simple if here.

* fix: allow inline-styles stats-box component

To make linter happy.

* fix: disable no-action and no-invalid-interactive

Will be adressed in follow-up PRs.

* chore: update ember-classic-decorator to latest

* chore: upgrade ember-can to latest

* chore: upgrade ember-composable-helpers to latest

* chore: upgrade ember-concurrency

* fix: recomputation deprecation `Trigger`

schedule `do` on actions queue to work around recomputation deprecation
when triggering Trigger on `did-insert`.

* chore: upgrade ember-cli-string-helpers

* chore: upgrade ember-copy

* chore: upgrade ember-data-model-fragments

* chore: upgrade ember-deprecation-workflow

* chore: upgrade ember-inline-svg

* chore: upgrade ember-modifier

* chore: upgrade ember-truth-helpers

* chore: upgrade ember-moment & ember-cli-moment-shim

* chore: upgrade ember-power-select

* chore: upgrade ember-responsive

* chore: upgrade ember-sinon

* chore: upgrade ember-cli-mirage

For now we will stay on 2.2 - upgrades > 2.3 break the build.

* chore: upgrade 3.24.0 to 3.28.5

* fix: add missing classic decorators on adapters

* fix: missing classic decorators to serializers

* fix: don't reopen Ember.Object anymore

* fix: remove unused useNativeEvents

ember-cli-page-objects doesn't provide this method anymore

* fix: add missing attributeBindings for test-selectors

ember-test-selectors doesn't provides automatic bindings for
data-test-* attributes anymore.

* fix: classic decorator for application serializer test

* fix: remove `removeContext` from tests.

It is unneeded and ember-cli-page-objects doesn't provides
this method anymore.

* fix: remove deprecations `run.*`-invocations

* fix: `collapseWhitespace` in optimize test

* fix: make sure to load async relationship before access

* fix: dependent keys for relationship computeds

We need to add `*.isFulfilled` as dependent keys for computeds that
access async relationships.

* fix: `computed.read`-invocations use `read` instead

* chore: prettify templates

* fix: use map instead of mapBy ember-cli-page-object

Doesn't work with updated ember-cli-page-object anymore.

* fix: remove remaining deprecated `run.*`-calls

* chore: add more deprecations deprecation-workflow

* fix: `implicit-injection`-deprecation

All routes that add watchers will need to inject the store-service
as the store service is internally used in watchers.

* fix: more implicit injection deprecations

* chore: silence implicit-injection deprecation

We can tackle the deprecation when we find the time.

* fix: new linting errors after upgrade

* fix: remove merge conflicts prettierignore

* chore: upgrade to run node 12.22 when building binaries
2022-03-08 12:28:36 -05:00
Jai Bhagat 8958d48ca9 ui: external links open in new tabs 2022-02-25 09:24:37 -05:00
Michael Klein 99e8583990 fix: linting issues and remove remainidn pauseTest 2022-02-17 16:06:49 +01:00
Michael Klein 649f59190e fix: breadcrumbs allocations due to recent namespace changes
* change the breadcrumbs generation to use `idWithNamespace`
* adapt tests to reflect new URLs for jobs with namespaces
2022-02-17 14:38:27 +01:00
Michael Klein b0a90b425e fix: allocations page tests regarding job links
Default namespaced jobs don't append the `@default`-id anymore due
to recent `jobs.job#serialize` changes.
2022-02-17 11:56:29 +01:00
Michael Klein d8b89e64dc fix: some test fixes module-for-job
* less clever™ metaprogramming when checking for expectedURL
* clicking slices job-client-status-summary needs to change its
  behavior and not pass the namespace query-param anymore.
2022-02-16 17:47:29 +01:00
Michael Klein ecaf6d3299 refact: don't pass namespace as query-param in job-subnav
The new ID handling gives us this behavior for free and we don't need
to drill the namespace down through all the route-layers anymore.
2022-02-16 17:44:16 +01:00
Michael Klein 3202e5036d refact: use `idWithNamespace` in serialize hook jobs.job
This will give us 'correct' URLs for free when we only pass a `job`-model
to a `LinkTo` that links to the `jobs.job.*`-routes.
2022-02-16 17:42:26 +01:00
Michael Klein cbb72edf68 fix: job-dispatch tests after namespace changes 2022-02-16 15:22:41 +01:00
Michael Klein b75188d8ed feat: improve namespace handling job-route 2022-02-16 15:03:02 +01:00
Michael Klein dd410401bd refact: use `idWithNamespace` in job-row links 2022-02-16 15:02:39 +01:00
Michael Klein 6903ba33b3 refact: render jobs.index template again 2022-02-16 15:02:06 +01:00
Michael Klein 34cb277f9c feat: add `idWithNamespace`-getter job model 2022-02-16 15:01:25 +01:00
Jai Bhagat 6a5fa75078 temp: bug in region selector causing failing test 2022-02-10 10:55:32 -05:00
Jai Bhagat fd5d766c41 temp: csi refactor 2022-02-10 09:14:32 -05:00
Jai Bhagat 4f802449dc temp: namespace model refact 2022-02-10 09:11:42 -05:00
ttys3 5faf344152
style: fix up very long tag word breaking the allocation service table width (#11995) 2022-02-04 19:40:03 -05:00
ttys3 1ab3b4d3d8
correct task row memory unit (#11980) 2022-02-02 17:00:25 -05:00
Jai Bhagat 8533abde2e fix: update eval serializer to latest changes 2022-01-28 10:16:23 -05:00
Jai Bhagat 3cc798d967 chore: fix js linting 2022-01-28 09:37:32 -05:00
Jai Bhagat 3eb34a577e style: add styling icons and padding to table footer buttons 2022-01-28 09:35:44 -05:00
Jai Bhagat e5b154e295 feat: add pagination and filtering to evaluations view 2022-01-28 09:35:44 -05:00
Jai Bhagat 1f80081c9d feat: add pagination to evaluations.index 2022-01-28 09:35:44 -05:00
Jai Bhagat 9086d4e2d4 feat: add meta evaluations
To support pagination on evaluations queries.
2022-01-28 09:35:44 -05:00
Jai Bhagat 9128f13676 feat: extract status cell logic into component 2022-01-28 09:35:44 -05:00
Jai Bhagat e3ca737f97 fix: move evaluations template to index and inside page layout 2022-01-28 09:35:43 -05:00
Jai Bhagat aaa2dadf16 chore: run prettier on gutter-menu 2022-01-28 09:35:43 -05:00
Jai Bhagat ab4c768340 feat: add evalutions view with table 2022-01-28 09:35:43 -05:00
André 518fc11dca
ui: move volume link to the source column and fix the link target (#11896)
The link target used the volume name instead of the volume id.
Fixes issue #11884.
2022-01-26 14:17:29 -05:00
Jai Bhagat 2249722ec6 refact: fix tests after contextual job page changes 2022-01-26 11:31:18 -05:00
Jai Bhagat be43976db0 ui: prettify remaining files 2022-01-26 11:28:21 -05:00
Jai Bhagat 0b368e43eb fix: protect route if not auth 2022-01-24 11:07:17 -05:00
Jai Bhagat d075d6f7cb feat: add conditional rendering logic to template for not auth concern 2022-01-24 11:07:15 -05:00
Jai Bhagat fe63af5484 fix: prevent async request for node relationship on alloc 2022-01-24 11:06:30 -05:00
Jai Bhagat 9bb3e7a4f7 fix: update component props for glimmer syntax 2022-01-24 11:06:10 -05:00
Jai Bhagat cc8c9672e7 fix: update conditional rendering of clients tab 2022-01-24 11:06:08 -05:00
Jai Bhagat c3a305f807 fix: move node loading to jobs.job route and add auth logic 2022-01-24 11:05:50 -05:00
Luiz Aoqui ee83fb8bb1 ui: add "read client" ability 2022-01-24 11:05:48 -05:00
Jai Bhagat b36864c476 refact: move gotoClients logic down to component 2022-01-24 11:04:52 -05:00
Jai Bhagat b027d0bec7 fix: remove debugger 2022-01-24 11:04:51 -05:00
Jai Bhagat 7797463228 fix: router expect identifier instead of model for trans to job page 2022-01-24 11:04:51 -05:00
Jai Bhagat 336c3b428a refact: move gotoJob to component 2022-01-24 11:04:51 -05:00
Jai Bhagat 16c90dd865 chore: prettify job/index controller 2022-01-24 11:04:51 -05:00
Jai Bhagat 0079fc3b6f chore: prettify children template 2022-01-24 11:04:51 -05:00
Jai Bhagat a12e60c822 chore: prettify jobs index template 2022-01-24 11:04:51 -05:00
Jai Bhagat f17ba0277e chore: prettify job-row template 2022-01-24 11:04:51 -05:00
Jai Bhagat 2ec864c67e refact: move gotoTaskGroup action to component
Previously, the router service was not available to components. Now that it is,
we no longer need to prop-drill this linking action.
2022-01-24 11:04:48 -05:00
Jai Bhagat 458100a0f9 chore: prettify task-groups template 2022-01-24 11:04:15 -05:00
Jai Bhagat 179103f2b6 refactor: compute jobClientStatus in summary backing class component 2022-01-24 11:04:14 -05:00
Jai Bhagat d130dea4e0 refact: move conditional rendering logic from job-page to job-client-status-summary 2022-01-24 11:04:12 -05:00
Jai Bhagat 28af157d35 refact: remove unused backing component classes and extend periodic and param-child to use Glimmer 2022-01-24 11:02:26 -05:00
Jai Bhagat c6c334d5d5 refact: job-page/batch template to use contextual components 2022-01-24 11:02:06 -05:00
Jai Bhagat b3ae93d51e refact: job-page/parameterized-child template to use contextual components 2022-01-24 11:02:05 -05:00
Jai Bhagat 02311dae72 refact: job-page/parameterized template to use contextual components 2022-01-24 11:02:05 -05:00
Jai Bhagat 961b0178e1 refact: job-page/periodic-child template to use contextual components 2022-01-24 11:02:05 -05:00
Jai Bhagat 689b0d9fb7 refact: job-page/periodic template to use contextual components 2022-01-24 11:02:05 -05:00
Jai Bhagat 46754b2f65 refact: job-page/service template to use contextual components 2022-01-24 11:02:05 -05:00
Jai Bhagat be0e624768 refact: job-page/sysbatch template to use contextual components 2022-01-24 11:02:05 -05:00
Jai Bhagat c938f7d109 refact: job-page/system template to use contextual components 2022-01-24 11:02:05 -05:00
Jai Bhagat d23dcc1ede feat: create job-page contextual component 2022-01-24 11:02:04 -05:00
Jai Bhagat 43a0983a23 ui: prepare rebase for contextual job-page 2022-01-24 10:58:28 -05:00
Jai Bhagat 52cf998e2c ui: fix remaining linting errors 2022-01-20 10:39:02 -05:00
Jai Bhagat 3a9057a89c ui: prettify js files 2022-01-20 09:54:56 -05:00
Jai Bhagat 88dd72a2ad ui: disable no-string-protype-extensions where its currently in use 2022-01-20 09:46:49 -05:00
Jai Bhagat 645db53775 ui: disable linting on files that use controllerFor 2022-01-20 09:46:49 -05:00
Jai Bhagat c4bc5ab352 ui: fix auto-fixable linting errors 2022-01-20 09:46:45 -05:00
Jai Bhagat 337920263f refact: add data-test-selectors and correct css selectors in summary 2022-01-14 10:23:06 -05:00
Jai Bhagat 2268cc1d6c styling: remove clickable link text decoration override to match new mocks 2022-01-14 10:20:36 -05:00
Jai Bhagat 2dddb20471 fix: typo in data-test-selector 2022-01-14 10:19:01 -05:00
Jai Bhagat d058029f90 styling: update styling to match new figma mocks 2022-01-14 10:14:44 -05:00
Jai Bhagat fe9f35c587 feat: add clicking functionality to alloc status legend 2022-01-14 10:14:44 -05:00
Luiz Aoqui c7ae13a1f3
Fix ACL requirements for job details UI (#11672) 2022-01-12 21:26:02 -05:00
Luiz Aoqui 7a1500c122
ui: fix CI (#11785) 2022-01-06 16:01:55 -05:00
Jai Bhagat d1342550df refact: clean-up breadcrumb invocations 2021-12-23 12:41:52 -05:00
Jai Bhagat 3533f62c6f fix: remove unecessary breadcrumb 2021-12-23 12:33:15 -05:00
Jai Bhagat 6369c4af7d chore: clean-up merge conflict after rebase 2021-12-21 07:52:06 -05:00
Jai Bhagat b859406bd5 styling: fix opacity for last child in the list 2021-12-21 07:47:06 -05:00
Jai Bhagat c765d4c519 style: centering and spacing for titled breadcrumbs 2021-12-21 07:47:05 -05:00
Jai Bhagat c24923a858 feat: handle title behavior for job breadcrumb 2021-12-21 07:47:05 -05:00
Jai Bhagat 9551d41c08 refact: add title to breadcrumb generator
All breadcrumbs do not need a title property because some views
drill down by using a tab-based UI (e.g. CSI volumes and the Job Overview)

The goal is to help us identify breadcrumbs that are non-descriptive (i.e.
breadcrumbs that display as an ID).
2021-12-21 07:47:05 -05:00
Jai Bhagat 008f538222 style: add styling for title on breadcrumbs 2021-12-21 07:47:05 -05:00
Jai Bhagat f6dda0526c feat: add title to default breadcrumb component 2021-12-21 07:47:05 -05:00
Jai Bhagat c302f3a5cd update: add comment to explain loading namespaces in alloc route 2021-12-21 07:47:05 -05:00
Jai Bhagat edb330e701 fix: delete jobs route - ember creates this for us 2021-12-21 07:47:05 -05:00
Jai Bhagat 34a55dec48 fix: add in for topology route 2021-12-21 07:47:03 -05:00
Jai Bhagat db3abcbed4 fix: update breadcrumb tests according to new breadcrumb structure 2021-12-21 07:46:28 -05:00
Jai Bhagat 88526aac65 refactor: delete app-breadcrumbs component file 2021-12-21 07:46:28 -05:00
Jai Bhagat 5cc0fc20cc refactor: remove double each in app breadcrumbs 2021-12-21 07:46:28 -05:00
Jai Bhagat e53a6072de chore: write tests for trigger component 2021-12-21 07:46:28 -05:00
Jai Bhagat 1188a5632f fix: handle case for async relationships 2021-12-21 07:46:27 -05:00
Jai Bhagat f7602d9a2a fix: resolve parent on job still issue with alloc job async relationship 2021-12-21 07:46:27 -05:00
Jai Bhagat e957e5b7d7 feat: create trigger component
Create Trigger Component and deprecate Breadcrumb-Utils pattern.
2021-12-21 07:46:25 -05:00
Jai Bhagat ede70ab0d9 fix: delete old breadcrumbs and replace with bucket 2021-12-21 07:45:24 -05:00
Jai Bhagat 346c436a6e fix: delete state from routes and move to controllers and add renderless component to templates 2021-12-21 07:45:12 -05:00
Jai Bhagat 0ffd638d19 feat: create bucket service to register, deregister and store breadcrumbs 2021-12-21 07:42:26 -05:00
Jai 90cdc7b47a
Merge pull request #11578 from hashicorp/f-ui/clickable-links-allocs
clickable links in allocations chart
2021-12-20 10:08:01 -05:00
Jai 93d5ef596f
Merge pull request #11545 from hashicorp/f-ui/add-alloc-filters-on-table
Add Allocation Filters in Client View
2021-12-18 09:39:53 -05:00
Jai 2b7fb2c5bd
Merge pull request #11544 from hashicorp/f-ui/add-filters-to-allocs
Add filters to Allocations
2021-12-18 09:38:28 -05:00
Luiz Aoqui dad4a0984b
ui: fix action call to set filter query param 2021-12-17 20:41:53 -05:00
Luiz Aoqui c7dafba66e
ui: fix job allocation filter by status, remove version filter, and add tests 2021-12-17 19:50:43 -05:00
Luiz Aoqui fdc023019e
ui: fix file formating 2021-12-17 19:47:25 -05:00
Luiz Aoqui e6a202b408
ui: fix linting 2021-12-17 18:55:41 -05:00
Luiz Aoqui dbb47b5bc9
ui: fix task group alloc filter and add tests 2021-12-17 18:49:47 -05:00
Luiz Aoqui 1ae40fcc37
ui: display empty message in the client details page if there are no allocations to show 2021-12-17 18:49:47 -05:00
Luiz Aoqui 660f4a8b1e
ui: fix client details page alloc status filter and replace task group with namespace and job 2021-12-17 18:49:42 -05:00
Jai 416a40bbcc
fix: more descriptive parameters in sort function
Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
2021-12-17 09:46:29 -05:00
Jai e813f27b7b
fix: remove eslint disable indent 2021-12-17 09:36:42 -05:00
Jai Bhagat 9d9042f95e feat: add sliceClick to job-page/summary 2021-12-16 11:24:03 -05:00
Jai Bhagat d508c10d8d chore: prettify job-page/summary 2021-12-16 11:23:05 -05:00
Luiz Aoqui b59a333727
UI: Add tests for prodcut links (#11645) 2021-12-07 19:51:17 -05:00
Tim Gross 39acac33a0
ui: change Consul/Vault base URL field name (#11589)
Give ourselves some room for extension in the UI configuration block
by naming the field `ui_url`, which will let us have an `api_url`.
Fix the template path to ensure we're getting the right value from the
API.
2021-11-30 13:20:29 -05:00
Jai Bhagat 7241a8b24e fix: add job version filter 2021-11-23 18:24:01 -05:00
Jai Bhagat 203940e26d fix: filter callbacks use different param 2021-11-23 17:57:35 -05:00
Jai Bhagat 0341171a53 feat: 🎸 add consul and vault links to global header 2021-11-22 16:59:22 -05:00
Jai Bhagat 3f78c6e717 feat: add filters to alloc table in task group view 2021-11-20 15:07:27 -05:00
Jai Bhagat 2e08f71e5d fix: re-order multiselect and search boxes 2021-11-20 14:48:28 -05:00
Jai Bhagat 2857e703d2 feat: add taskgroup filter to alloc table 2021-11-20 12:18:02 -05:00
Jai Bhagat 78fd8e350b feat: add filter client allocations table 2021-11-20 11:22:48 -05:00
Jai Bhagat 883502fccf disable eslint for indentation 2021-11-20 10:49:31 -05:00
Jai Bhagat 2f0f6fc0fa feat: add taskgroup filter to alloc 2021-11-20 10:30:48 -05:00
Jai Bhagat e3ae0ea7ae feat: add client status filter 2021-11-20 10:21:28 -05:00
Jai Bhagat 8e15b6c12e feat: add status filter to allocations 2021-11-20 10:04:15 -05:00
Tim Gross e729133134
api: return 404 for alloc FS list/stat endpoints (#11482)
* api: return 404 for alloc FS list/stat endpoints

If the alloc filesystem doesn't have a file requested by the List
Files or Stat File API, we currently return a HTTP 500 error with the
expected "file not found" error message. Return a HTTP 404 error
instead.

* update FS Handler

Previously the FS handler would interpret a 500 status as a 404
in the adapter layer by checking if the response body contained
the text  or is the response status
was 500 and then throw an error code for 404.

Co-authored-by: Jai Bhagat <jaybhagat841@gmail.com>
2021-11-17 11:15:07 -05:00
Luiz Aoqui 521acf688e
ui: upgrade sass 1.32.6 -> 1.43.4 2021-11-05 18:09:19 -04:00
Luiz Aoqui a45ef5d47f
ui: minor fixes 2021-11-05 18:09:16 -04:00
Luiz Aoqui 6183e22ae2
ui: fix after ugrading d3-selection 2021-11-05 18:09:15 -04:00
Luiz Aoqui beadf3dbe5
ui: upgrade d3-selection 1.4.2 -> 3.0.0 2021-11-05 18:09:14 -04:00
Luiz Aoqui 2288f33e38
ui: fix tests broken by d3-format upgrade 2021-11-05 18:09:13 -04:00
Luiz Aoqui 5496aa9461
ui: upgrade bulma 0.7.5 -> 0.8.2 2021-11-05 18:09:09 -04:00
pangratz 0fdedc344b fix: ensure reloading an allocation doesn't result in an infinite loop
`allocation.reload()` has differnt semantics for reloading, as it will
reload the record in the background and immediately resolve [1].

By using the stores' findRecord and specifying `backgroundReload:
false`, we make sure we await the response from the server and hereby
have the complete record once we continue in the code.

Using `allocation.reoad()` causes and infinite loop when we upgrade
ember-data to 3.16 (and model fragments to 5.0.0-beta.2).

[1] This is, unless `shouldBackgroundReload` on the adapter returns
false, but it's true by default.
2021-11-04 16:27:40 +01:00
Luiz Aoqui 645a87f6b3
ui: update task group alloc summary chart to use new `SummaryLegendItem` component (#11375) 2021-10-25 11:14:01 -04:00
Luiz Aoqui 2c7bfb7000
ui: persist node drain settings (#11368) 2021-10-22 10:51:31 -04:00
Luiz Aoqui dc5222f6e5
ui: display Nomad version in the Clients and Servers table (#11366) 2021-10-22 10:33:06 -04:00
Luiz Aoqui a7eb72f7d1
ui: use `get` to access job meta value (#11370) 2021-10-22 10:05:48 -04:00
Luiz Aoqui b73ecf684b
ui: update favicon (#11371) 2021-10-22 09:40:38 -04:00
Luiz Aoqui fce1a03897
ui: create tooltip component (#11363) 2021-10-21 13:12:33 -04:00
Luiz Aoqui 362c8c54f4
ui: set * as the default namespace selector (#11357) 2021-10-21 10:24:07 -04:00
Luiz Aoqui dceeccfc5d
ui: add client name tooltip when displaying client ID in tables (#11358) 2021-10-21 10:23:06 -04:00
Luiz Aoqui c0023c6c85
Update job details box (#11288) 2021-10-12 16:36:10 -04:00
Jai 563d609118
System Batch UI, Client Status Bar Chart and Client Tab page view (#11078) 2021-10-07 17:11:38 -04:00
Luiz Aoqui 305f0b5702
ui: set the job namespace when redirecting after the job is dispatched (#11141) 2021-09-07 12:27:33 -04:00
Luiz Aoqui eb0ed980a5
ui: set namespace when looking for and displaying children jobs (#11110) 2021-09-01 14:40:25 -04:00
Luiz Aoqui c1d1906628
ui: add missing pipe separator in parameterized and periodic jobs (#11020) 2021-08-10 13:48:20 -04:00
Jai 29a7fe6efa
Merge pull request #10666 from hashicorp/b-ui/search-namespaces
ui: Fix fuzzy search namespace-handling
2021-08-10 13:13:20 -04:00
Jai Bhagat a9b9132f35 edit hierarchy to lead with namespace before job 2021-08-10 10:35:36 -04:00
Luiz Aoqui d283e90c35
ui: only dipslay "Dispatch Job" button on parameterized jobs (#11019) 2021-08-09 17:49:08 -04:00
Luiz Aoqui a81e6a427d
ui: fix job dispatch page when job doesn't have any meta fields (#10934) 2021-08-03 13:50:43 -04:00
Jai Bhagat e7f0cd28f3 edit fuzzy search callback logic
Namespaces are set-up in Nomad to be an object that has an id property.
However, namespaces actually don't have that shape. Our search was expecting
a namespace object, but we actually don't have a namespace assigned to jobs
in our config and namespace is set to null. Normally, these namespaces would
be set to default, but that would require us to refactor our Mirage config
if we wanted to assert that namespaces are 'default' and not null. So this is
a bandaid solution.
2021-07-26 17:25:43 -04:00
Jai Bhagat 1440b562e0 Merge remote-tracking branch 'origin/main' into b-ui/search-namespaces 2021-07-22 15:16:30 -04:00
Jai Bhagat 0fba0ce778 edit namespace property in handlebar file to use computed property in component 2021-07-22 11:43:45 -04:00
Jai Bhagat e6b579ab8f address merge conflicts 2021-07-21 17:30:11 -04:00
Nicholas Cioli 4d9fa38a5e
ui: add parameterized dispatch interface (#10675)
* ui: add parameterized dispatch interface

This commit adds a new interface for dispatching parameteried jobs, if
the user has the right permissions. The UI can be accessed by viewing a
parameterized job and clicking on the "Dispatch Job" button located in
the "Job Launches" section.

* fix failing lint test

* clean up dispatch and remove meta

This commit cleans up a few things that had typos and
inconsistent naming. In line with this, the custom
`meta` view was removed in favor of using the
included `AttributesTable`.

* ui: encode dispatch job payload and start adding tests

* ui: remove unused test imports

* ui: redesign job dispatch form

* ui: initial acceptance tests for dispatch job

* ui: generate parameterized job children with correct id format

* ui: fix job dispatch breadcrumb link

* ui: refactor job dispatch component into glimmer component and add form validation

* ui: remove unused CSS class

* ui: align job dispatch button

* ui: handle namespace-specific requests on job dispatch

* ui: rename payloadMissing to payloadHasError

* ui: don't re-fetch job spec on dispatch job

* ui: keep overview tab selected on job dispatch page

* ui: fix task and task-group linting

* ui: URL encode job id on dispatch job tests

* ui: fix error when job meta is null

* ui: handle job dispatch from adapter

* ui: add more tests for dispatch job page

* ui: add "job dispatch" capability check

* ui: update job dispatch from code review

Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
2021-07-20 18:27:41 -04:00
Jai Bhagat cc61ad66bf refactoring for same regression in job versions
In job versions, if you have an ACL token with a write policy
you should be able to revert a job, however, that was not the
case here. This is because we're using ember-can to check if
the user can run a job. That permission relies on policiesSupportRunning
which uses a function called namespaceIncludesCapability. We're going to
need to refactor any cases that use this function.
2021-07-20 16:24:42 -04:00
Jai Bhagat 08a728ac91 edit ember-can to add additional attribute for namespace
We wanted the ability to get our namespace from query params
in order to do this, we're using additional attributes via
ember-can to set a bound property directly from our
handlebar file. This sets us up better in the event that
the namespace filter changes on the UI because our handlebar
file will be aware of the change, whereas our ability may not
update as the namespace filter updates.
2021-07-13 15:14:38 -04:00
Georges-Etienne Legendre d057025ce6
Capture ACL Token from self API call for Reverse Proxy use-case (#10563)
* Proposed fix for #10561

Signed-off-by: Georges-Etienne Legendre <legege@legege.com>

* Add acceptance tests for reverse proxy use-case

Signed-off-by: Georges-Etienne Legendre <legege@legege.com>

* Use reads instead of computed/get

Signed-off-by: Georges-Etienne Legendre <legege@legege.com>

* Move back the line closer to the task

Signed-off-by: Georges-Etienne Legendre <legege@legege.com>

* skip a11y-audit-called lint rule on reverse proxy tests

Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
2021-07-12 20:42:08 -04:00
Jai Bhagat 46f8b3dc66 refactor tests that depend on Agent fixutres in Mirage 2021-07-08 08:01:15 -04:00
Jai Bhagat 2efa6cc7e4 add agent serializer
This commit adds a serializer for the Agent. When the factory was originally
designed to have the Member properities directly on the Agent class which was
not set-up properly technically, but since we didn't really make use of the
Agent endpoint.
2021-07-06 16:42:07 -04:00
Jai Bhagat b92ab047ff edit the computed agent version property
This PR edits the computed agent version that is returned upon hitting
the agent self request endpoint. The reason is because we believe that
the Agent Member Tag property sometimes returns null because we may have
cases where there are only clients and no servers and only servers are
included in the Serf Gossip Protocol. There may be other cases where we
do in fact have servers but the node is erased for some reason. We are
unsure how to replicate that issue, however.

edit mirage config

This commit updates the Mirage Config because our acceptance tests
depend on the Mirage Config, while we rely on Mirage Factories to
populate fixture data for us to use when to run the Nomad UI locally

Revert "update the open-button disability functionality depending on a job's state"

This reverts commit 5190b308a51d55a7b0617854164c155d36d7e513.
2021-06-14 13:22:36 -04:00
Florian Apolloner ad472e8079 Fixed global-search keyboard shortcut for non-english keyboard layouts.
Closes #10646
2021-06-07 13:32:38 -04:00
Buck Doyle 5f9ad112e4
Add namespace to allocation search result label
Is “@ namespace” sensible? 🧐
2021-05-27 14:03:05 -05:00
Buck Doyle 14bd99196a
Change fuzzy search to search all namespaces
Thanks to @apollo13 for reporting this in #10101.
2021-05-27 13:45:34 -05:00
Buck Doyle e618c06076
Add namespace to job search results 2021-05-27 13:35:30 -05:00
Buck Doyle 7b42bb0e2d
ui: Fix server list leader determination for IPv6 (#10530)
This closes #10513, thanks to @bastelfreak for the report.
GET /status/leader returns an IPv6 host with square brackets
around the IP address as expected, but the rpcAddr property
on the agent model does not.

This fixes rpcAddr, updates the Mirage /status/leader mock
to properly format an IPv6 host, and changes the agent
factory to sometimes produce IPv6 addresses.

I added a formatHost utility function to centralise the
conditional square bracket-wrapping that would have
otherwise been further scattered around.
2021-05-13 12:29:51 -05:00
Georges-Etienne Legendre 5ad8c8136a
Fix exec not working for another region (#10539)
This conditionally includes a region query parameter when
opening the exec socket.
2021-05-13 09:14:16 -05:00
Buck Doyle 4e4a83039f
ui: Fix bug where switching topo viz allocation highlights doesn’t update charts (#10490)
This closes #10489. It adds `dependentKeyCompat` to the allocation getter so it works
as expected as a dependent key for the `tracker` computed property, as described here:
https://guides.emberjs.com/release/upgrading/current-edition/tracked-properties/#toc_backwards-compatibility
2021-05-03 10:36:18 -05:00
Michael Lange e8593ec1bb
ui: Update namespaces design (#10444)
This rethinks namespaces as a filter on list pages rather than a global setting.

The biggest net-new feature here is being able to select All (*) to list all jobs
or CSI volumes across namespaces.
2021-04-29 15:00:59 -05:00
Buck Doyle b9f462fdc1
ui: Add optional memory max to task details ribbon (#10459)
This is the first step in #10268. If a maximum is not specified, the
task group sum uses the memory number instead. The maximum is only
shown when it’s higher than the memory sum.
2021-04-28 15:38:14 -05:00
Buck Doyle 6d037633da
ui: Change global search to use fuzzy search API (#10412)
This updates the UI to use the new fuzzy search API. It’s a drop-in
replacement so the / shortcut to jump to search is preserved, and
results can be cycled through and chosen via arrow keys and the
enter key.

It doesn’t use everything returned by the API:
* deployments and evaluations: these match by id, doesn’t seem like
  people would know those or benefit from quick navigation to them
* namespaces: doesn’t seem useful as they currently function
* scaling policies
* tasks: the response doesn’t include an allocation id, which means they
  can’t be navigated to in the UI without an additional query
* CSI volumes: aren’t actually returned by the API

Since there’s no API to check the server configuration and know whether
the feature has been disabled, this adds another query in
route:application#beforeModel that acts as feature detection: if the
attempt to query fails (500), the global search field is hidden.

Upon having added another query on load, I realised that beforeModel was
being triggered any time service:router#transitionTo was being called,
which happens upon navigating to a search result, for instance, because
of refreshModel being present on the region query parameter. This PR
adds a check for transition.queryParamsOnly and skips rerunning the
onload queries (token permissions check, license check, fuzzy search
feature detection).

Implementation notes:

* there are changes to unrelated tests to ignore the on-load feature
  detection query
* some lifecycle-related guards against undefined were required to
  address failures when navigating to an allocation
* the minimum search length of 2 characters is hard-coded as there’s
  currently no way to determine min_term_length in the UI
2021-04-28 13:31:05 -05:00
Buck Doyle 90ecbdf522
Add job version revert buttons (#10336)
This adds a Revert two-step button to the JobVersions component for
not-current versions, which redirects to the overview on success. It
checks the job version before and after reversion to mitigate the edge
case where reverting to an otherwise-identical version has no effect, as
discussed in #10337.

It uses existing facilities for handling other errors and disabling the
button when permissions are lacking.
2021-04-20 08:33:16 -05:00
Michael Lange 05f4c5d0bd Stop downloading files in tests 2021-04-13 16:40:17 -07:00
Buck Doyle 713b0c4140
Add removal of OTT query parameter with delay (#10319)
This followup to #10066 adds a step to clear the one-time token
from the URL after the application has loaded. The delay is
required for it to actually clear, but only when the OTT is present
to avoid slowing down the entire test suite.
2021-04-13 11:56:59 -05:00
Buck Doyle 6d67e90763
Add exchange of one-time token on UI load (#10066)
This adds UI support for receiving the one-time token passed via query parameter, as in #10134
and related PRs, and exchanging it for its corresponding secret ID. When this works, it’s mostly
invisible, with a brief flash of the OTT onscreen.

The authentication failure message now suggests the -authenticate flag.

When OTT exchange fails, it shows a whole-page error.

This includes a known UX shortcoming in that the OTT will not disappear from the URL when an
identifier is specified on the command line, like nomad ui -authenticate jobname. The goal is to
address that shortcoming in a forthcoming pull request.
2021-04-01 13:21:30 -05:00
Michael Lange b6af7a31e2 Aggregate the BANs in the cluster details panel 2021-03-31 09:29:14 -07:00
Michael Lange a0e59f81ab Use common helpers and utils for formatting hertz 2021-03-31 09:29:14 -07:00
Michael Lange bf6fb48ca6 Format all bytes using helpers, even the ones that are already MiBs 2021-03-31 09:29:02 -07:00
Michael Lange 2a614b18a2 Add startingUnit option to the unit formatting utils 2021-03-31 09:29:02 -07:00
Michael Lange dc41e731ce format-scheduled-bytes helper 2021-03-31 09:29:02 -07:00
Michael Lange 285c9a9b50 Refactor formatBytes helper to use core units util 2021-03-31 09:29:01 -07:00
Michael Lange f6a377cd12 Units utils
Consolidates all the bytes and hertz units logic in one place.
2021-03-31 09:29:01 -07:00
Buck Doyle 07831ab455
Update to v4 of Ember Power Select (#10226)
This closes #10146.

Because of cibernox/ember-power-select#1203, which documents
the current impossibility of attaching test selectors to a
PowerSelect invocation, this uses test selectors on parent
containers instead, occasionally adding wrappers when needed.
I chose to leave the existing test selectors in the hopes that
we can return to using them eventually, but I could easily
remove them if it seems like extra noise now.

Presumably for the same reason, @class no longer works, so
this adjusts the scoping of global search CSS to preserve the style
of the search control.

I also included an update to the latest version of
ember-test-selectors, since we were far behind and I tried
that before finding the aforelinked issue.

Finally, this replaces ember-cli-uglify with ember-cli-terser to address
production build failures as described at ember-cli/ember-cli#9290.
2021-03-26 08:55:12 -05:00
Michael Lange f1f124340b Remove errant log line 2021-03-24 15:34:46 -07:00
Michael Lange 4f51a55293 Correctly sort tasks in alloc stat tracker so the main task takes precedence 2021-03-24 15:10:46 -07:00
Michael Lange c9590ac715 Guard against empty data when determining active linechart data 2021-03-24 15:09:47 -07:00
Michael Lange 7b60146045 Fix line-wrapping issue with chart tooltips 2021-03-24 14:13:30 -07:00
Michael Lange d787dda298 Use more explicit branching of reserved amounts based on metric type 2021-03-24 13:55:18 -07:00
Michael Lange ab9c824c42 Remove old primary metric 2021-03-24 13:52:52 -07:00
Michael Lange 38e7804afc Update topology info box primary metric 2021-03-24 13:52:52 -07:00
Michael Lange 7ea7a1699d Updated old tests 2021-03-24 13:52:52 -07:00
Michael Lange ae22c09398 Tests for PrimaryMetric::Allocation 2021-03-24 13:52:52 -07:00
Michael Lange ac4f173389 Tests for PrimaryMetric::Node 2021-03-24 13:52:52 -07:00
Michael Lange 464b51ac03 Remove now unused chartClass arg from LineChart 2021-03-24 13:52:52 -07:00
Michael Lange 747219feb7 Improved language around what the client stat charts represent 2021-03-24 13:52:52 -07:00
Michael Lange 3f46f77f92 New PrimaryMetric::Task component 2021-03-24 13:52:51 -07:00
Michael Lange 0b4a1e510f Apply the new multi-line primary metric to the alloc index page 2021-03-24 13:52:51 -07:00
Michael Lange 0016290871 Memoize the tracker and the series properties to avoid repeat computation
In addition to this computation being wasteful, it introduces a bug
where the allocation on a stats tracker can update twice in one render,
which isn't allowed in Glimmer (ironically, Glimmmer's lack of
auto-memoization introduced the issue).
2021-03-24 13:52:51 -07:00
Michael Lange 6a8d3340b0 Refactored multi-series allocation variant of the primary metric component 2021-03-24 13:52:51 -07:00
Michael Lange 3707e59f37 Refactor stats-time-series to allow for multiple series 2021-03-24 13:52:51 -07:00
Michael Lange c066fdd80f Sort and index multi-series data correctly in line chart
- Sorting must be done on copies to preserve orders.
 - Indices should be reversed since rendering is also reversed (the back
   layer (the tallest) is rendered first to create the stacking effect).
2021-03-24 13:52:51 -07:00
Michael Lange 3c51105a85 Stacked percentages of tasks for alloc charts
This leverages the existing pre-processing being done in the
allocation-stats-tracker to also create additive percentages relative to
the allocation resources vs. the task resources.

This can then be used in a chart to create a stacked area representation
of consumption.
2021-03-24 13:52:51 -07:00
Michael Lange 014e7ef333 Simple bind helper
This binds a function to a target before passing it along to another
component. It's normal to expect to get to use `this` within functions
on components and controllers, but (sans actions) that doesn't happen
automatically.
2021-03-24 13:52:51 -07:00
Michael Lange c01f3c60fc Refactor PrimaryMetric into parts/purposes
Currently, PrimaryMetric is already overloaded on multiple dimensions:
metric and resource type.

This refactor will use multiple components as a form of control flow
instead spidering conditionals, which are only getting worse as the
charts for each resource type diverge.
2021-03-24 13:52:51 -07:00
Michael Lange 1e01228c66 Compute and render reserved annotations for client stats 2021-03-24 13:52:30 -07:00
Michael Lange 45ce4368c5 Pass the LineChart named blocks through to callers of StatsTimeSeries 2021-03-24 13:52:30 -07:00
Drew Bailey befcd11579
add on update to services table in allocation details (#10153)
* add on update to services table in allocation details

* populate onupdate test data
2021-03-11 12:28:38 -05:00
Michael Lange 744f86eb65 Move complex annotation hbs logic into JS
As @backspace pointed out, we're processing a bunch of other stuff
anyway, so might as well process the active state there too where it's
more likely to be expected.
2021-03-09 17:19:52 -08:00
Michael Lange f1633e2be0 No longer include an automatic tooltip in LineChart
It is now required to use the one yielded by the :after named block.
2021-03-08 21:02:01 -08:00
Michael Lange 15b68cc00c Integration test coverage for horizontal annotations and tooltips 2021-03-08 20:22:01 -08:00
Michael Lange afc626b9cb Pre format x and y values for the yielded tooltip component in line chart 2021-03-08 15:41:18 -08:00
Michael Lange 165ebc43cb Document all the tooltip variations
Under a new Charts/Primitives section in Storybook
2021-03-08 15:41:18 -08:00
Michael Lange d48dd688fb Bring the ordinal color sequence from chart-colors to the new color-scales construct
This also required re-ordering the SCSS imports since this depends on
colors introduced by bulma.
2021-03-08 15:41:04 -08:00
Michael Lange 6a1b35e03a Unify the distribution bar tooltip and the line chart tooltip styles/patterns 2021-03-08 15:41:04 -08:00
Michael Lange 94655d1ff6 New storybook CSS helpers (hover region, multiples variations) 2021-03-08 15:41:04 -08:00
Michael Lange 498d9d2b36 Factor the tooltip out of line-chart and into a primitive 2021-03-08 15:41:04 -08:00
Michael Lange 391aef9c4d Use chart scales to generate tooltip swatch options 2021-03-08 15:41:03 -08:00
Michael Lange 4a4e7f0af2 Don't deal with color classes at all in LineChart
Expect this to be set on the visual yielded components directly
2021-03-08 15:41:03 -08:00
Michael Lange 1905d8ad71 Support multi-dimensional data in LineChart
When a @dataProp is provided, the LineChart component assumes data is an
array of data series. It will map by the data prop and flatten to
compute the domains of the data.
2021-03-08 15:41:03 -08:00
Michael Lange c8778248ab Add chart color scales in scss 2021-03-08 15:41:03 -08:00
Michael Lange ed7447af81 Yield HAnnotations through LineChart 2021-03-08 15:41:03 -08:00