Commit Graph

1452 Commits

Author SHA1 Message Date
Michael Lange 11a42b6075 Acceptance test for PluginDetail 2020-05-06 17:36:45 -07:00
Michael Lange f3bae3b535 Don't wrap between icons and health text 2020-05-06 17:22:42 -07:00
Michael Lange 38c03f180b Use lazyClick to avoid multiple transitionToRoutes being in flight as once 2020-05-06 17:22:42 -07:00
Michael Lange 2369254a3e Refactor AllocationRow qualifyAllocation
There was a missing edge case where a job is pending. I took the moment
to also refactor the code to use async/await which cleaned up the
promise chaining.
2020-05-06 17:22:42 -07:00
Michael Lange f9882d42e6 Plugin detail page object 2020-05-06 17:21:49 -07:00
Michael Lange 517db723cd Sort allocations on the plugin detail page 2020-05-06 17:21:49 -07:00
Michael Lange 41c4746aaf Test coverage for the plugins list page 2020-05-06 17:21:48 -07:00
Michael Lange e98095bcbd Page object for Plugins List 2020-05-06 17:21:48 -07:00
Michael Lange 59bb9a516e Correct the table headers for dates on the volume page 2020-05-06 17:21:48 -07:00
Michael Lange 665ba3b2f7 Add a nodes table as well 2020-05-06 17:21:48 -07:00
Michael Lange 105e7203cf Set color in addition to fill for the icon class
Structure icons have fill set to currentColor hardcored in their markup.
This mean setting fill to a color in CSS does nothing, but setting color
now does.
2020-05-06 17:21:47 -07:00
Michael Lange 4ec53234d1 Add icons to the plugin alloc row component 2020-05-06 17:21:47 -07:00
Michael Lange 874556704d Use the correct plugin property for the breadcrumb 2020-05-06 17:21:47 -07:00
Michael Lange 778e7fdb07 New PluginAllocationRow derivative of AllocationRow 2020-05-06 17:21:46 -07:00
Michael Lange 7c56fcaecb Emulate belongsTo relationship in storage fragments 2020-05-06 17:21:46 -07:00
Michael Lange 6f84c685b6 Add short option to date formatters 2020-05-06 17:21:46 -07:00
Michael Lange 210f6cdb00 Update storage controller mirage code to accommodate EDMF's lack of relationships 2020-05-06 17:21:46 -07:00
Michael Lange ca6849ebaa Refactor AllocationRow to use AllocationStat 2020-05-06 17:21:45 -07:00
Michael Lange f55133e76e Separate AllocationStat component for containing the multiple states a stat tracker can be in 2020-05-06 17:21:45 -07:00
Michael Lange d94177085e Setup the plugin detail page 2020-05-06 17:21:45 -07:00
Michael Lange ffcaef6b22 Model out the rest of the CSI Plugin properties 2020-05-06 17:21:44 -07:00
Michael Lange b3f140fee6 Plugins table on the plugins list page 2020-05-06 17:21:44 -07:00
Michael Lange bf35d92224 Clean up the csi volume page 2020-05-06 17:21:44 -07:00
Michael Lange 7d524ac341 Set up routes, controllers, and template basics for the plugins page 2020-05-06 17:21:43 -07:00
Michael Lange dba9a25a13 Add a subnav to the volumes page 2020-05-06 17:21:43 -07:00
Michael Lange 1b47885bdb Update plugin model and serializer to match final API 2020-05-06 17:21:42 -07:00
Michael Lange 343d4e0b81 Add constraints table to the volume detail page 2020-05-06 17:21:42 -07:00
Buck Doyle 95c938b75b
Migrate page objects away from jQuery (#7843)
This is part of #7834’s jQuery removal goal. It addresses a couple of jQuery-related deprecation warnings and also uses “native events mode” for ember-cli-page-object, which is needed so it doesn’t have to use jQuery via the Ember global.
2020-05-06 15:14:12 -05:00
Buck Doyle 0b2fc7532d
UI: Remove Ember Freestyle (#7839)
This completes the migration to Storybook by replacing the colour palette and typeface components that I left out.
2020-05-06 15:11:15 -05:00
Michael Lange 034eeb1ddb
Merge pull request #7855 from hashicorp/b-ui/alloc-wrong-reserved-resources
UI: Make allocation reference own task group instead of job's task group when job versions don't match
2020-05-06 10:08:37 -07:00
Mahmood Ali 24e0c7f081 ui: only count running allocations in client view
In the client view list, only show running allocations count for each
client, rather than include already completed tasks.

This is done for two reasons:

First, consitency with the CLI: `nomad node status --allocs` only
shows running allocs.

Second, and more importantly, the count is useful to estimate how loaded
the clients are.  Allocs that have completed (but not GCed yet) have
very little value to operators.
2020-05-05 21:31:58 -04:00
Michael Lange 260da00852 Add embedded task group to allocation to reference when allocation is historical 2020-05-01 14:30:02 -07:00
Michael Lange 91b97e0170 Stabilize job and allocation job versions in fixtures 2020-05-01 14:29:24 -07:00
Michael Lange 9a857a7042 Comment why the allocation has to be reloaded 2020-05-01 14:27:53 -07:00
Jasmine Dahilig a9004faa11
UI: Add representations for task lifecycles (#7659)
This adds details about task lifecycles to allocations, task groups,
and tasks. It includes a live-updating timeline-like chart on allocations.
2020-04-30 08:15:19 -05:00
Michael Lange 21ef3633be Make the no connection error on the logs page dismissable 2020-04-29 17:36:17 -07:00
Michael Lange e74cd16252 Fix race condition where stdout and stderr requests can cause a no connection error
This would happen because a no connection error happens after the second request fails, but
that's because it's assumed the second request is to a server node. However, if a user clicks
stderr fast enough, the first and second requests are both to the client node. This changes
the logic to check if the request is to the server before deeming log streaming a total failure.
2020-04-29 17:36:17 -07:00
Michael Lange aafbeaba75 Clicking stdout/stderr when already on that tab is now a noop 2020-04-29 17:36:16 -07:00
Michael Lange 7452a9a57d Abort log fetch request when failing over from client to server
Typically a failover means that the client can't be reached. However, if
the client does eventually return after the timeout period, the log will
stream indefinitely. This fixes that using an API that wasn't broadly
available at the time this was first written.
2020-04-29 17:34:49 -07:00
Michael Lange 9ba563c48e Always pass credential in fetch requests, but also treat options reasonably
Now options can be provided without also having to remember to pass
credentials. This is convenient for abort controller signals.
2020-04-29 17:34:49 -07:00
Buck Doyle d4708860f0
UI: Fix exec popup link for job id ≠ name (#7815)
This closes #7814. It makes URL-generation more central and changes
the exec URL to include job id instead of name.
2020-04-29 07:54:04 -05:00
Buck Doyle 438aec636a
UI: update exec styles to match conventions (#7811) 2020-04-28 08:33:07 -05:00
Michael Lange 0dac605902
Merge pull request #7689 from hashicorp/ui/plumb-proxy-config-to-proxy
UI Plumb proxy config to proxy
2020-04-22 19:31:27 -07:00
Buck Doyle 6da959f0ed
UI: Update ember-fetch to 6.7.2 (#7713)
This gets rid of this warning in the console:
Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
2020-04-22 09:10:55 -05:00
Buck Doyle 0c2acb01b9 Remove superseded note
This closes #7465.
2020-04-21 19:52:45 -07:00
Michael Lange 82dc694c70 Disable the proxy when Mirage is enabled
This is to prevent max socket connection errors that can stop
the live reload server from responding.
2020-04-21 19:52:44 -07:00
Michael Lange 7a4852d44b Use existing ember proxy config within our custom proxy 2020-04-21 19:52:43 -07:00
Michael Lange a34363efd3 Remove now superfluous lint-staged arguments 2020-04-09 20:46:32 -07:00
Michael Lange 45eb6fd7f3 Upgrade Husky 2020-04-09 20:45:37 -07:00
Michael Lange 03d4afe9e0 Upgrade lint-staged
Version 10 fixes an issue where if lint-staged fails while linting
a partially staged file, all unstaged changes will be removed from
the working tree. Now when this happens, unstaged changes will be
in the stash.
2020-04-09 20:41:35 -07:00
dependabot[bot] f565841782
build(deps): bump acorn from 5.7.3 to 5.7.4 in /ui (#7346)
Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/5.7.3...5.7.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-04-07 10:50:21 -04:00
Michael Lange 35d4b48644
Merge pull request #7577 from hashicorp/f-ui/csi-beta-label
UI: Change CSI to Storage and mark it as beta
2020-04-06 13:21:11 -07:00
Buck Doyle f10906e006
UI: add exec handling for dead jobs/task states (#7637)
This closes #7456. It hides the terminal when the job is dead and
displays an error when trying to open an exec session for a task
that isn’t running. There’s a skipped test for the latter behaviour
that I’ll have to come back for.
2020-04-06 14:08:22 -05:00
Buck Doyle fc7de8b153
UI: add live-updating to exec sidebar (#7499)
This closes #7454. It makes use of the existing watchable tools to
allow the exec popup sidebar to be live-updating. It also adds
alphabetic sorting of task groups and tasks.
2020-04-06 13:52:42 -05:00
Michael Lange bf9887083b
Merge pull request #7630 from hashicorp/f-ui/csi-acceptance-tests
UI: CSI Acceptance Tests
2020-04-06 09:37:45 -07:00
Mahmood Ali 23be53a366
Merge pull request #7612 from hashicorp/b-auth-alloc-exec-ws
Authenticate alloc/exec websocket requests
2020-04-06 09:24:51 -04:00
Michael Lange 2955d356e7 Test coverage for the volume detail page 2020-04-04 17:13:40 -07:00
Michael Lange 25f4f5a61d Sort allocation tables by modify index 2020-04-04 17:11:58 -07:00
Michael Lange a1d2e585a1 Update breadcrumb to match side menu 2020-04-04 17:11:29 -07:00
Michael Lange 6b798518b9 Fix the allocations page compoent to support multiple prop keys
It was designed to be used this way, but allocationFor has never
worked as intended 🤦
2020-04-04 10:56:12 -07:00
Michael Lange 76bead58a3 Add page size select tests to volumes list tests 2020-04-04 09:58:34 -07:00
Michael Lange e8e41c5757 Acceptance tests for the volumes list page 2020-04-03 19:28:12 -07:00
Michael Lange 0d90d082bc Page object for volumes list 2020-04-03 19:28:11 -07:00
Michael Lange 59427662d0 Handle namespaces in the mirage handler for volumes 2020-04-03 19:28:10 -07:00
Michael Lange fb44f76800 Correctly handle the namespace query param and forbidden state 2020-04-03 19:28:09 -07:00
Michael Lange 280fa5d53b Annotate volume row and make the tr clickable 2020-04-03 19:27:44 -07:00
Michael Lange 62aa943a95 Filter out volumes that don't match the chosen namespace 2020-04-03 19:27:11 -07:00
Michael Lange 62b7a07189 Sort alphabetically, A first 2020-04-03 19:26:26 -07:00
Michael Lange 1729d41509
Merge pull request #7574 from hashicorp/f-ui/configurable-page-sizes
UI Configurable Page Sizes
2020-04-03 16:06:17 -07:00
Mahmood Ali 340f9a5e91 ui: explicit reference to window.localStorage 2020-04-03 14:31:19 -04:00
Buck Doyle 2940aa14e5 Remove redundant step assertion 2020-04-03 12:54:47 -05:00
Buck Doyle b9a2d20445 Remove redundant pause 2020-04-03 12:53:57 -05:00
Buck Doyle e6ecd2bf4f Remove redundant assertions
These are more things that are already covered elsewhere.
2020-04-03 12:52:39 -05:00
Buck Doyle 4de1255a31 Remove redundant assertions from token exec test
This only needs to check that the token is sent, the rest of
the assertions were covered by the previous test.
2020-04-03 12:35:51 -05:00
Buck Doyle cb6f110b97 Remove intermediate storage variable 2020-04-03 12:27:03 -05:00
Buck Doyle b12f97bb81 Change to setting token directly
Most tests bypass setting the token via the UI, instead choosing
to set it in localStorage directly, because the acceptance tests
for the token UI are sufficient to exercise that part of the UI,
so this speeds up the test a bit.
2020-04-03 12:26:25 -05:00
Buck Doyle 0ec5e95f46 Add space 2020-04-03 12:21:44 -05:00
Buck Doyle fbe40a5d36
UI: add handling for exec command-editing keys (#7601)
This is a minimal implementation that closes #7463. It doesn’t include
true support for moving around within the command to edit using arrow
keys because it gets too complex when managing wrapping at the edge of
the terminal. Instead, arrow keys are ignored. It also ignores ^A and
^E, which are cursor manipulations that pose similar problems to arrow
keys. It does support ^U, which deletes the entire command.

It also allows a command to be pasted, which was previously unsupported.
This is accomplished by migrating from Xterm.js’s onKey handler to
onData, which is recommended here:
https://github.com/xtermjs/xterm.js/issues/2673#issuecomment-574897733

onData is a higher-level handler that issues events with the final
interpreted data instead of the individual key events. That means the
processing in this PR has changed from inspecting DOM key events to
inspecting their ASCII equivalents, which I’ve extracted into a utility
dictionary for use in tests and implementation.

One consequence of ignoring most control characters is that if you paste
a string that includes a control character, that character will be
stripped. It’s somewhat strange for compound sequences like arrow keys; 
if you run copy('/bin/b' + '\x1b[D' + 'ash') in a Javascript console and
paste what’s on the clipboard, you get "/bin/b[Dash". That’s because
the left arrow key, as in that centre portion of the string,
is represented by the escape character and a coded sequence. Stripping
the control character leaves the coded sequence as part of the paste.
That seems like an acceptable compromise vs either ignoring any pasted
string with control characters (confusing UX) or trying to interpret and
strip all such compound control sequences (difficult to be exhaustive).
2020-04-03 12:14:47 -05:00
Mahmood Ali cec76a4f66 ui: send authentication ws handshake
Have the UI send the authentication websocket handshake message.
2020-04-03 11:49:22 -04:00
Michael Lange edea9faf22 Refactor page-size-select page object into a reusable component 2020-04-02 15:52:44 -07:00
Michael Lange 49019bd967 Make table foot fields consistent at all breakpoints
This effectively overrides Bulma's default field layout tweaks
at different breakpoints. This includes going from flex to block
and different font-sizes.
2020-04-02 13:41:41 -07:00
Michael Lange b1d5a77e76 Remove extranneous order property
The "default" order values as set by Bulma are different for different
breakpoints. Since this wasn't considering breakpoints, it resulted
in the unexpected reordering of pagination elements as different page
widths. Turns out removing this property gives us what we want.
2020-04-02 13:27:29 -07:00
Michael Lange 81e7296447 Apply the page size select behavior to the other pages with the page size selector 2020-04-02 12:50:37 -07:00
Michael Lange f08fd23d00 Factor page select tests into their own behavior 2020-04-02 12:50:36 -07:00
Michael Lange 70eb558b65 Acceptance tests for the page size selector on the jobs list view 2020-04-02 12:50:35 -07:00
Michael Lange e0110e1757 Repeat new pagination pattern throughout the app 2020-04-02 12:50:34 -07:00
Michael Lange 8dc54a6164 Reset current page when changing page size 2020-04-02 12:50:33 -07:00
Michael Lange 3d02f61455 Replace crusty lt and gt with chevron icons 2020-04-02 12:50:32 -07:00
Michael Lange 546751a9b4 Style the page size selector 2020-04-02 12:50:31 -07:00
Michael Lange 53954d1bc3 Add page size select to the jobs list page 2020-04-02 12:50:30 -07:00
Michael Lange 06524fe5a7 Page size select component 2020-04-02 12:50:29 -07:00
Michael Lange 3fc1874c0e New service for storing user settings 2020-04-02 12:50:28 -07:00
Buck Doyle 3bc13a715e
UI: Fix confirmation position for right-aligned TSBs (#7590)
Without this, the confirmation text was extending beyond the
edge of the page.
2020-04-02 11:58:29 -05:00
Michael Lange d91de05fc1 Fix flaky serializer test 2020-04-01 14:54:05 -07:00
Michael Lange 3a3a7f5fb4 Add new gutter menu tag pattern to Storybook 2020-04-01 10:57:33 -07:00
Michael Lange 37a1a32209 Move beta to a tag 2020-04-01 10:49:47 -07:00
Buck Doyle eba07dabe5
CI: add xUnit reporting for UI tests (#7585)
This surfaces test failures more clearly on CircleCI by adding
testem-multi-reporter to report both via the default TAP reporter
as well as an xUnit reporter whose output is stored as an artefact.
2020-04-01 11:19:44 -05:00
Buck Doyle eaf64849f6
UI: Add localStorage persistence of exec command (#7563)
This closes #7469. Trivial thanks to localStorageProperty! 🥳
2020-04-01 08:08:42 -05:00
Michael Lange 28ba7e8075 Change CSI to Storage and mark it as beta 2020-03-31 18:21:55 -07:00
Buck Doyle d70c3fbb3e
UI: Add exec loading template (#7566)
This closes #7460. Before this, there was an incongruous flash
of the non-exec UI during loading.
2020-03-31 13:59:43 -05:00
Buck Doyle 61164b856e
UI: Change exec button to not show on dead jobs (#7548)
I still want to add acceptance tests for the existence
of these buttons but this change makes the exec button
for jobs behave similarly to the others.
2020-03-31 13:11:26 -05:00
Michael Lange 6eaf79f928 Tests for the new volumes facet 2020-03-30 17:33:46 -07:00
Michael Lange b8ce8c436f Account for an empty string node class 2020-03-30 17:33:45 -07:00
Michael Lange 01341530e7 Add a volume facet to the clients list page 2020-03-30 17:33:44 -07:00
Michael Lange fdd2f8df37 Use new text encoder for stream frames
This pattern was introduced with Exec and fixes the multibyte encoding
issue that the native window.atob has.
2020-03-30 12:50:43 -07:00
Michael Lange 2711eb032c
Merge pull request #7470 from kybin/kybin-patch-1
UI: decode unicode properly in log page
2020-03-30 12:06:51 -07:00
Michael Lange 2db4f5519a Guard against a null value for the HostVolumes hash
When a node has no host volumes, the API response will
have a null value for the HostVolumes attribute, which
in turn becomes a null value instead of an empty array
in the store. This protects against that, ensuring host
volumes is always an array.
2020-03-26 09:54:59 -07:00
Buck Doyle 8932686aa6
UI: Fix check for Mirage presence setting up sockets (#7497)
Without this, exec UI doesn’t work at all in the binary. I made an
unfortunate error in not copying the environment check from
app/utils/fetch.js.
2020-03-25 13:23:23 -05:00
Buck Doyle 398db02449
UI: Change determination of exec sidebar active tasks (#7491)
This closes #7476. The decomposition of computed properties
is necessary to avoid nested aggregate dependent keys; the
previous dependent key of `taskGroup` will be inadequate
when the sidebar becomes live-updating.
2020-03-25 12:08:33 -05:00
Michael Lange 1bd6a69067
UI: Support for CSI (#7446)
Closes #7197 #7199

Note: Test coverage is limited to adapter and serializer unit tests. All
acceptance tests have been stubbed and all features have been manually
tested end-to-end.

This represents Phase 1 of #6993 which is the core workflow of CSI in
the UI. It includes a couple new pages for viewing all external volumes
as well as the allocations associated with each. It also updates
existing volume related views on job and allocation pages to handle both
Host Volumes and CSI Volumes.
2020-03-25 07:51:26 -05:00
Buck Doyle 674da96a59
UI: add exec terminal (#6697)
This connects Xterm.js to a Nomad exec websocket so people
can interact on clients via live sessions. There are buttons on
job, allocation, task group, and task detail pages that open a
popup that lets them edit their shell command and start a
session.

More is to come, as recorded in issues.
2020-03-24 18:22:16 -05:00
kim yongbin 4378db612b
UI: decode unicode properly in log page 2020-03-25 01:03:39 +09:00
Michael Lange bc87d0a440 Remove the question mark from the Volume th
This makes it consistent with other volume columns across the app.
2020-02-14 16:56:51 -08:00
Michael Lange fe685f897f Correct a test and a dependent key 2020-02-14 16:44:28 -08:00
Michael Lange c7c37250c8 Improve the node serializer tests 2020-02-13 17:42:41 -08:00
Michael Lange 53c2086a08 Add assertion for the volume k/v pairs in task rows 2020-02-13 17:11:39 -08:00
Michael Lange b47ce637ed Refactor task row info test to use 'as' 2020-02-13 17:11:38 -08:00
Michael Lange 41fad6b649 Test coverage for the volume table on the task group page 2020-02-13 17:11:37 -08:00
Michael Lange 44a961f4f8 Test coverage for the task detail volumes table 2020-02-13 17:11:35 -08:00
Michael Lange 0e6c81d3ef Add volume table to the task detail page 2020-02-13 17:11:34 -08:00
Michael Lange e4dcd9c2a4 Add volume requirements table to the task group page 2020-02-13 17:11:33 -08:00
Michael Lange 3fbd267263 Add volumes column to the task row component 2020-02-13 17:11:32 -08:00
Michael Lange 9186f75c6a Fix a bug where the NodeListStub API response would override existing HostVolumes in the store 2020-02-13 17:11:31 -08:00
Michael Lange 895d74c503 Test coverage for change in resource rows 2020-02-13 17:11:30 -08:00
Michael Lange c57993f0a5 Add volume to the client row 2020-02-13 17:11:29 -08:00
Michael Lange c0f1aff963 Fix flaky host volumes test 2020-02-13 17:11:28 -08:00
Michael Lange b3452cc33c Add volume column to allocation row 2020-02-13 17:11:27 -08:00
Michael Lange 61a3b4919f Add volume column to task group row 2020-02-13 17:11:26 -08:00
Michael Lange 18cf59b22f Test coverage for the host volumes table 2020-02-13 17:11:25 -08:00
Michael Lange 1e40837731 Add a Host Volumes table to the client detail page 2020-02-13 17:11:24 -08:00
Michael Lange 849c996887 Data layer for Host Volumes in the UI 2020-02-13 17:11:22 -08:00
Michael Lange ccefc46912
Merge pull request #7099 from hashicorp/b-ui/mobile-styles-not-full-width
UI: Override the max-width on mobile to avoid losing space due to non-existent gutter menu
2020-02-07 14:27:50 -08:00
Michael Lange 1431343d18 Override the max-width on mobile to avoid losing space due to non-existent gutter menu 2020-02-07 14:22:00 -08:00
Michael Lange c7543ee020 Explicit transparent bg on popover actions 2020-02-07 14:17:13 -08:00
Michael Lange 8a9b60f011 Call out the 'down' status too, since it's a pretty bad one 2020-01-31 12:56:15 -08:00
Michael Lange 38d23b5ba8 Add an animation for the initializing state 2020-01-31 12:56:11 -08:00
Michael Lange f00a50a55b Redo the node-status-light CSS to be icon-based 2020-01-31 12:56:08 -08:00
Michael Lange 536a597a92 New node initializing icon 2020-01-31 12:56:05 -08:00
Michael Lange 9dbdbc23dd Assign icons to node statuses 2020-01-31 12:56:02 -08:00
Michael Lange 89532e27e3 Add an icon inside the node status light 2020-01-31 12:55:59 -08:00
Michael Lange 0f8ea7d37a Allow for an icon within the node status light 2020-01-31 12:55:55 -08:00
Michael Lange 31b83b1c70 Acceptance test for disabled node write controls 2020-01-31 09:41:37 -08:00
Michael Lange 5c4c05824a Account for disabled ACLs in ability tests 2020-01-31 09:41:36 -08:00
Michael Lange 59897f9716 Handle the case where ACLs aren't enabled in abilities 2020-01-31 09:41:36 -08:00
Michael Lange 175f80da16 Fix token referencing from the token controller, as well as resetting 2020-01-31 09:41:35 -08:00
Michael Lange 9438330329 Add an explanatory tooltip to the unauthorized node drain popover 2020-01-31 09:41:33 -08:00
Michael Lange 4eac743262 Update disabled 'Run Job' button to use standard disabled style 2020-01-31 09:41:32 -08:00
Michael Lange eb7d34df6b Disable options for popover and drain-popover 2020-01-30 21:29:29 -08:00
Michael Lange 1599b8b5fc Disabled button styles 2020-01-30 21:29:28 -08:00
Michael Lange cdd7a4fdb7 New disabled buttons story 2020-01-30 21:29:26 -08:00
Michael Lange 7c796a33a9 Refetch all ACL things when the token changes 2020-01-30 21:29:24 -08:00
Michael Lange c7af942652 Enable the eligibility toggle conditionally based on acls 2020-01-30 21:29:22 -08:00
Michael Lange 2dac1d6705 Refactor ability tests to use a setup hook for ability lookup 2020-01-30 21:29:21 -08:00
Michael Lange 1fae4083eb Add an ability for client permissions 2020-01-30 21:29:19 -08:00
Michael Lange d7a3c15530 Replace custom parse-duration implementation with an existing lib 2020-01-23 16:34:38 -08:00
Michael Lange c0d57149ca Update client detail test given change to the compositeStatus property 2020-01-23 16:34:38 -08:00
Michael Lange 75987840bb Tweak vertical spacing of headings 2020-01-23 16:34:37 -08:00
Michael Lange b4ab7b02ba Remove superfluous information from the client details ribbon 2020-01-23 16:34:36 -08:00
Michael Lange 7c6bf3b09c Increase the size and spacing of the toggle component 2020-01-23 16:34:35 -08:00
Michael Lange 41eaec2d9b Use qunit-dom where applicable 2020-01-23 16:34:35 -08:00
Michael Lange c7b7789bd4 Stack the popover menu under the subnav 2020-01-23 16:34:34 -08:00
Michael Lange 1dd1298626 New test coverage for the drain capabilities 2020-01-23 16:34:34 -08:00
Michael Lange 0f41bfafad Update existing tests 2020-01-23 16:34:33 -08:00
Michael Lange 5e95633481 PopoverMenu integration tests 2020-01-23 16:34:32 -08:00
Michael Lange 3b534bbdf9 Integration tests for the toggle component 2020-01-23 16:34:32 -08:00
Michael Lange bc555f7758 Update the client detail page object 2020-01-23 16:34:31 -08:00
Michael Lange 8deea899c1 Model the notification pattern as a page object component 2020-01-23 16:34:30 -08:00
Michael Lange 7edbf5ff58 Clear all notifications when resetting the controller 2020-01-23 16:34:29 -08:00
Michael Lange ae85882ca7 Switch drain popover checkboxes for toggles 2020-01-23 16:34:29 -08:00
Michael Lange 54d33f9ad7 Toggle bugs: focus and multiline alignment 2020-01-23 16:34:28 -08:00
Michael Lange 76bfed5f25 Swap the eligiblity checkbox out for a toggle 2020-01-23 16:34:27 -08:00
Michael Lange 95e6068d5d New toggle component 2020-01-23 16:34:27 -08:00
Michael Lange faa15bc581 Force drain button in the drain info box 2020-01-23 16:34:26 -08:00
Michael Lange 82a62089b3 Make outline buttons have a solid white background 2020-01-23 16:34:25 -08:00
Michael Lange 80642b8868 Modifiers to the two-step-button 2020-01-23 16:34:25 -08:00
Michael Lange 7097591281 Drain stop and update and notifications 2020-01-23 16:34:24 -08:00
Michael Lange 9c9c6b08c3 Drain complete notification 2020-01-23 16:34:24 -08:00
Michael Lange 8b19a19908 Fill out the metrics and time since values in the drain summary 2020-01-23 16:34:23 -08:00
Michael Lange 35671a3bd4 Fill in the drain strategy ribbon values 2020-01-23 16:34:22 -08:00
Michael Lange 6e3e8d01e2 Stub out all the markup for the new drain strategy view 2020-01-23 16:34:22 -08:00
Michael Lange 47924d05d3 Polish for the drain popover 2020-01-23 16:34:21 -08:00
Michael Lange deb1dc7ffe Refactor parseDuration to support multi-character units 2020-01-23 16:34:20 -08:00
Michael Lange c5e662a751 Test coverage for the parse duration util 2020-01-23 16:34:20 -08:00
Michael Lange 395ba979a7 Extract the duration parsing into a util 2020-01-23 16:34:19 -08:00
Michael Lange fd16612be3 Factor out the drain popover and implement its behaviors 2020-01-23 16:34:18 -08:00
Michael Lange d13af1bcb5 Add triggerClass support to the popover menu 2020-01-23 16:34:18 -08:00
Michael Lange ada745a59f Let dropdowns assume their full width 2020-01-23 16:34:17 -08:00
Michael Lange a3f32e61c1 Initial layout of the drain options popover 2020-01-23 16:34:16 -08:00
Michael Lange d1cf0e1054 More form styles as needed for the drain form 2020-01-23 16:34:16 -08:00
Michael Lange 01d0efb317 Multiline modifier for tooltips 2020-01-23 16:34:15 -08:00
Michael Lange 75c9e80251 Update the dropdown styles to be more similar to button styles 2020-01-23 16:34:14 -08:00
Michael Lange 20f83da76a PopoverMenu component 2020-01-23 16:34:14 -08:00
Michael Lange e685179c99 Eligibility toggling behavior 2020-01-23 16:34:13 -08:00
Michael Lange bfa34d5273 Update the underlying node model when toggling eligibility in mirage 2020-01-23 16:34:12 -08:00
Michael Lange a8af3d67be Add tooltip to the eligibility control 2020-01-23 16:34:11 -08:00
Michael Lange 47daa980a5 Reformat the client detail page to use the two-row header design 2020-01-23 16:34:11 -08:00
Michael Lange c8e29c7060 cancelDrain adapter method 2020-01-23 16:34:10 -08:00
Michael Lange b162fa8a28 Update drain methods to properly wrap DrainSpec params 2020-01-23 16:34:09 -08:00
Michael Lange dae33efa1d drain and forceDrain adapter methods 2020-01-23 16:34:09 -08:00
Michael Lange 85066eee07 Mock the drain endpoint 2020-01-23 16:34:08 -08:00
Michael Lange 321b5fb6e6 Add isMigrating property to the allocation model 2020-01-23 16:34:07 -08:00
Michael Lange aad8536949 Implement eligibility toggling in the data layer 2020-01-23 16:34:07 -08:00
Michael Lange 94955c8b08 Mock the eligibility endpoint in mirage 2020-01-23 16:34:06 -08:00
Buck Doyle 576bcf554f
UI: Migrate to Storybook (#6507)
I originally planned to add component documentation, but as this dragged on and I found that JSDoc-to-Markdown sometimes needed hand-tuning, I decided to skip it and focus on replicating what was already present in Freestyle. Adding documentation is a finite task that can be revisited in the future.

My goal was to migrate everything from Freestyle with as few changes as possible. Some adaptations that I found necessary:
• the DelayedArray and DelayedTruth utilities that delay component rendering until slightly after initial render because without them:
  ◦ charts were rendering with zero width
  ◦ the JSON viewer was rendering with empty content
• Storybook in Ember renders components in a routerless/controllerless context by default, so some component stories needed changes:
  ◦ table pagination/sorting stories access to query params, which necessitates some reaching into Ember internals to start routing and dynamically generate a Storybook route/controller to render components into
  ◦ some stories have a faux controller as part of their Storybook context that hosts setInterval-linked dynamic computed properties
• some jiggery-pokery with anchor tags
  ◦ inert href='#' had to become href='javascript:;
  ◦ links that are actually meant to navigate need target='_parent' so they don’t navigate inside the Storybook iframe

Maybe some of these could be addressed by fixes in ember-cli-storybook but I’m wary of digging around in there any more than I already have, as I’ve lost a lot of time to Storybook confusion and frustrations already 😞

The STORYBOOK=true environment variable tweaks some environment settings to get things working as expected in the Storybook context.

I chose to:
• use angle bracket invocation within stories rather than have to migrate them soon after having moved to Storybook
• keep Freestyle around for now for its palette and typeface components
2020-01-21 15:46:32 -06:00
Buck Doyle 66ab14144a
ui: Change Run Job availability based on ACLs (#5944)
This builds on API changes in #6017 and #6021 to conditionally turn off the
“Run Job” button based on the current token’s capabilities, or the capabilities
of the anonymous policy if no token is present.

If you try to visit the job-run route directly, it redirects to the job list.
2020-01-20 14:57:01 -06:00
Drew Bailey f97d2e96c1
refactor api profile methods
comment why we ignore errors parsing params
2020-01-09 15:15:12 -05:00
Buck Doyle 6ff6a41df8
Fix flapping status light test (#6852)
I unintentionally introduced a flapping test in #6817. The
draining status of the node will be randomly chosen and
that flag takes precedence over eligibility. This forces
the draining flag to be false rather than random so the
test should no longer flap.

See here for an example failure:
https://circleci.com/gh/hashicorp/nomad/26368
2019-12-13 09:02:02 -06:00
Buck Doyle 09067b4eb7
UI: Fix client sorting (#6817)
There are two changes here, and some caveats/commentary:

1. The “State“ table column was actually sorting only by status. The state was not an actual property, just something calculated in each client row, as a product of status, isEligible, and isDraining. This PR adds isDraining as a component of compositeState so it can be used for sorting.

2. The Sortable mixin declares dependent keys that cause the sort to be live-updating, but only if the members of the array change, such as if a new client is added, but not if any of the sortable properties change. This PR adds a SortableFactory function that generates a mixin whose listSorted computed property includes dependent keys for the sortable properties, so the table will live-update if any of the sortable properties change, not just the array members. There’s a warning if you use SortableFactory without dependent keys and via the original Sortable interface, so we can eventually migrate away from it.
2019-12-12 13:06:54 -06:00
Michael Lange ed8fd28a10
Merge pull request #6808 from hashicorp/b-ui/unclosed-log-streams
UI: Unclosed log streams
2019-12-12 10:55:49 -08:00
Tim Gross 74a01477fd
Merge pull request #6631 from hashicorp/dependabot/npm_and_yarn/ui/lodash.mergewith-4.6.2
Bump lodash.mergewith from 4.6.1 to 4.6.2 in /ui
2019-12-09 09:47:14 -05:00
Tim Gross 06e30473c0
Merge pull request #6629 from hashicorp/dependabot/npm_and_yarn/ui/lodash.defaultsdeep-4.6.1
Bump lodash.defaultsdeep from 4.6.0 to 4.6.1 in /ui
2019-12-09 09:47:05 -05:00
dependabot[bot] 28ff457228
Bump lodash.mergewith from 4.6.1 to 4.6.2 in /ui
Bumps [lodash.mergewith](https://github.com/lodash/lodash) from 4.6.1 to 4.6.2.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2019-12-09 13:37:45 +00:00
Tim Gross 7ab879f347
Merge pull request #6628 from hashicorp/dependabot/npm_and_yarn/ui/handlebars-4.1.2
Bump handlebars from 4.1.1 to 4.1.2 in /ui
2019-12-09 08:37:10 -05:00
Tim Gross 48608acd37
Bump fstream from 1.0.11 to 1.0.12 in /ui (#6630)
Bumps [fstream](https://github.com/npm/fstream) from 1.0.11 to 1.0.12.
- [Release notes](https://github.com/npm/fstream/releases)
- [Commits](https://github.com/npm/fstream/compare/v1.0.11...v1.0.12)

Signed-off-by: dependabot[bot] <support@github.com>
2019-12-09 08:36:57 -05:00
dependabot[bot] 0d89b2f5ea Bump lodash.merge from 4.6.1 to 4.6.2 in /ui (#6632)
Bumps [lodash.merge](https://github.com/lodash/lodash) from 4.6.1 to 4.6.2.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2019-12-09 08:36:44 -05:00
dependabot[bot] 12e34aef1d
Bump lodash.defaultsdeep from 4.6.0 to 4.6.1 in /ui
Bumps [lodash.defaultsdeep](https://github.com/lodash/lodash) from 4.6.0 to 4.6.1.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.6.0...4.6.1)

Signed-off-by: dependabot[bot] <support@github.com>
2019-12-06 14:13:32 +00:00
dependabot[bot] 66ff8a191f
Bump handlebars from 4.1.1 to 4.1.2 in /ui
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/wycats/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.1.1...v4.1.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-12-06 14:13:27 +00:00
dependabot[bot] 2020fbc7a4
Bump fstream from 1.0.11 to 1.0.12 in /ui
Bumps [fstream](https://github.com/npm/fstream) from 1.0.11 to 1.0.12.
- [Release notes](https://github.com/npm/fstream/releases)
- [Commits](https://github.com/npm/fstream/compare/v1.0.11...v1.0.12)

Signed-off-by: dependabot[bot] <support@github.com>
2019-12-06 14:13:19 +00:00
Michael Lange 13d9e5ead7 Don't initialize variables before you need them 2019-12-05 10:51:51 -08:00
Michael Lange 2c6392ff1e Light test coverage for the stream-logger class 2019-12-05 00:19:36 -08:00
Michael Lange 9504d10ce7 Fix a race condition where a response sent after the logger stops never gets canceled 2019-12-05 00:19:35 -08:00
Buck Doyle 5b4b4740b2 Update ivy-codemirror to unreleased commit
This addon hasn’t been released in a while but we’d like to
get the fix for this bug that’s causing an inability to
copy long documents in Firefox:
https://github.com/codemirror/CodeMirror/issues/2703

It also includes a deprecation fix:
https://github.com/IvyApp/ivy-codemirror/pull/40
2019-10-25 10:34:02 -05:00
Buck Doyle e525ff99d3
Remove inverse block for list-pagination (#6523)
As the angle bracket invocation RFC says:

> There is no dedicated syntax for passing an "else" block
> directly. If needed, that can be passed using the named
> blocks syntax.

https://github.com/emberjs/rfcs/blob/master/text/0311-angle-bracket-invocation.md#block

Unfortunately, using a contextual component doesn’t help as
the yield inside that component will still result in content
rendering that would show when the source isn’t empty. So
we decided to change the interface so you have to check
whether the source is empty before using it, which aligns with
how list-table works.
2019-10-24 07:05:43 -05:00
Buck Doyle 9b2fb14e51
UI: Update Ember to 3.12 LTS (#6419)
This is mostly deprecation fixes and blueprint changes. There
are some dependency updates too; the changes to Ember
Basic Dropdown necessitated changing it to angle bracket
component invocation. The conversion of the rest of the
templates will happen separately.
2019-10-15 13:32:58 -05:00
Michael Lange d6bbd0f9e5 Use max-width to ensure the width rule is observed in Firefox 2019-10-10 10:34:33 -07:00
Buck Doyle 9a3a6c3f62
UI: Update to Ember 3.8 LTS (#5968) 2019-10-08 13:44:19 -05:00
Buck Doyle 5da134d074
UI: Change Mirage data to be stable in development (#6389)
This sets a default-but-query-configurable Faker seed in development,
via faker-seed. It also changes uses of Math.random to use Faker’s
randomness so auto-generated data remains stable in development.
2019-10-03 09:13:08 -05:00
Buck Doyle 75aa2e36ee
UI: Change factories to be more dynamic (#6387)
I noticed while working on #6166 that some of the factory properties
that used Faker’s randomisation features are using their output
rather than a function that would call the randomiser. This means that
the randomisation happens once and the value is used for every model
generated by the factory. This wraps the randomiser calls in functions
so different models can have different values.
2019-09-30 09:44:22 -05:00
Buck Doyle 8950626c55
UI: Update Mirage to 1.1.2 (#6166) 2019-09-26 13:47:07 -05:00
Buck Doyle 1a47a11c95
UI: Restore proxy tag tests (#6360)
The recurring problem here was that sometimes the factories would
generate more than one task, and it was random whether the task
with the proxy task would be the first in the list. This ensures
that the proxy task is always first so the tests can run again.
2019-09-26 11:50:01 -05:00
Buck Doyle f55d95694c
UI: Remove proxy tag tests again (#6359)
I thought #6343 would fix the flapping but it didn’t 😞
2019-09-20 15:27:33 -05:00
Buck Doyle d707038429
UI: Fix Connect proxy tag (#6343)
This fixes a race condition in the pseudo-relationship between a
TaskState and a Task that was causing the Consul Connect proxy tag
to sometimes show on the wrong task. There’s no direct Ember Data-style
relationship between a TaskState and its Task; instead, it’s determined
by searching for a Task with the matching name. The related Task was
sometimes stored before everything was ready and not recalculated when
the name became known. This ensures the relationship is accurate if the
TaskState’s name property changes.
2019-09-19 08:09:49 -05:00
Mahmood Ali f82f45c026 add some ui development tips 2019-09-17 08:51:24 -04:00
Mahmood Ali e33437635d
Merge pull request #6327 from hashicorp/b-ui-alloc-no-services
ui: protect against no services
2019-09-17 06:33:52 -04:00
Michael Lange 96b91ff6ec
Merge pull request #6274 from hashicorp/f-ui/restore-headless-testing
UI: Restore local headless testing
2019-09-17 00:15:41 -07:00
Mahmood Ali 16f7a3f31b ui: protect against nil services
Protect against case where an alloc has no services and avoid
dereferencing null.

Here, we ensure that the model and test serializers mimic the API by
having nil TaskGroup.Services instead of an empty array.
2019-09-16 16:50:30 -04:00
Buck Doyle 4ca5662895
UI: Remove Connect proxy tag tests again (#6284)
This semi-reverts #6275, as the tests are intermittently
failing in CI.
2019-09-05 14:34:47 -05:00
Buck Doyle dc43dbdad2
UI: Restore Connect proxy tag tests (#6275)
These are the tests skipped in #6271.
2019-09-05 14:09:32 -05:00
Buck Doyle ee0e74186f
UI: Move kind property to task (#6271)
I put this property in the wrong place. 

I’ve found how to fix the mock API in the tests but
they’re failing to pass with headless Chrome only,
so they’re skipped for now.
2019-09-05 13:14:54 -05:00
Buck Doyle 24b0be1625 Restore local headless testing
I’ve been unable to use ember test without --server for a
while. This brings in the fix from ember-cli/ember-cli#8774
2019-09-05 11:24:05 -05:00
Buck Doyle ec65c8e260
Add handling for not-running task filesystem query (#6267) 2019-09-04 17:38:26 -05:00
Buck Doyle b5e5798e54
UI: add Consul Connect features (#6108) 2019-09-04 09:39:56 -05:00
Buck Doyle 49b9dd5b9b
UI: Add creation time to evaluations table (#6050) 2019-08-22 08:11:24 -05:00
Michael Lange 74c9b1ac60
Merge pull request #5871 from hashicorp/f-ui/alloc-fs
UI: Allocation file system explorer
2019-08-20 10:18:23 -07:00
Michael Lange 1e620953e4 Remove the temporary allocationFileExplorer mirage scenario 2019-08-20 09:40:49 -07:00
Buck Doyle ed652051d4
Add ability to control Mirage logging via query (#6105)
This lets us turn Mirage logging on without editing any
files, which makes it easier to switch between branches.
2019-08-20 08:36:08 -05:00
Michael Lange 9b669d7e38 Use the standard empty state when a dir is empty 2019-08-19 17:16:26 -07:00
Michael Lange fd6d5b274f
Merge pull request #6048 from hashicorp/f-ui/alloc-fs-files
UI: Alloc FS: File Viewer
2019-08-19 10:36:28 -07:00
Michael Lange 836e7426b8 Encode characters in file paths to ensure proper URIs 2019-08-14 12:54:11 -07:00
Michael Lange 38fce53936 Prevent a change in height when switching from a dir to a file 2019-08-08 15:41:47 -07:00