Commit Graph

1621 Commits

Author SHA1 Message Date
Buck Doyle
2211ec777b Move breadcrumbs objects into shared layout object (#9576)
Various page objects had breadcrumbs and breadcrumbFor within them, this
moves those to the existing Layout page object that contains shared page objects.
2020-12-10 11:51:22 -06:00
Buck Doyle
863c194733 Fix job recommendation test flakiness (#9591)
Instead of creating recommendations for all the jobs used
across these tests, this creates a specific job with
a higher group count, which reduces the likelihood
of having no recommendations to 0.0001%.

It was incorrect to assume that each task group would always
have recommendations, since there’s a 1% chance that a task
won’t have a recommendation. (10% chance for CPU and memory.)
This uses the number of groups with recommendations instead.
2020-12-10 10:10:25 -06:00
Michael Lange
2af9430db5 Test coverage for the scale event serializer 2020-12-07 12:28:47 -08:00
Michael Lange
a93e95d259 Guard against a null Meta property in the scale event API 2020-12-07 12:28:23 -08:00
Buck Doyle
e84a360e42 Fix allocation count in CSI volumes table (#9515)
This closes #9495. As detailed in there, the collection query GET
/v1/volumes?type=csi doesn’t return ReadAllocs and WriteAllocs, so the #
Allocs cell was always showing 0 upon first load because it was derived
from the lengths of those arrays. This uses the heretofore-ignored
CurrentReaders and CurrentWriters values to calculate the total instead.

The single-resource query GET /v1/volume/csi%2F:id doesn’t return
CurrentReaders and CurrentWriters that absence doesn’t override the
stored values when visiting an individual item.

Thanks to @apollo13 for reporting this and to @tgross for the API logs
and suggestion.
2020-12-07 08:51:41 -06:00
Buck Doyle
3b59e1bec7 Migrate preview deployments from Netlify to Vercel (#9471)
This adds:

* a script for building and deploying the Ember UI and Storybook to
  Vercel
* configuration for that deployment
* a header link to the UI to link to Storybook when built with
  STORYBOOK_LINK=true

It also removes a file used to configure Netlify redirects.

The Netlify setup had two “sites”: nomad-storybook and nomad-ui. I
attempted to replicate that here but ran into some platform limitations
with Vercel: two “projects” cannot share the same root directory without
also sharing the same vercel.json that lets us specify configuration
such as the rewrite needed to handle deep linking into the Ember UI. I
tried having Storybook use /ui/storybook as the root directory (and
adding a symbolically-linked package.json to bypass Vercel’s refusal
to build without it) but that produced broken Storybook deployments.

This instead combines the two projects into one
(nomad-storybook-and-ui), defaults to forwarding / to /ui/, and
adds the header link to the UI to navigate to Storybook.

Rather than have a complex build script in the Vercel configuration UI,
this delegates to a script in the repository.
2020-12-07 08:33:49 -06:00
Buck Doyle
5efc15954a Add DAS namespaces toggle and fix empty card bug (#9337)
This builds on filtering to allow the optimize page to show recommendations
for the active namespace vs all namespaces. If turning off the toggle causes
the summary from the active card to become excluded from the filtered list,
the active summary changes, as with the facets.

It also includes a fix for this bug:
https://github.com/hashicorp/nomad/pull/9294#pullrequestreview-527748994
2020-11-30 08:18:44 -06:00
Buck Doyle
40084e4a9a Add query parameter to override Mirage scenario (#9380) 2020-11-30 08:12:15 -06:00
Tim Gross
8351c3f9d6 csi/api: populate ReadAllocs/WriteAllocs fields (#9377)
The API is missing values for `ReadAllocs` and `WriteAllocs` fields, resulting
in allocation claims not being populated in the web UI. These fields mirror
the fields in `nomad/structs.CSIVolume`. Returning a separate list of stubs
for read and write would be ideal, but this can't be done without either
bloating the API response with repeated full `Allocation` data, or causing a
panic in previous versions of the CLI.

The `nomad/structs` fields are persisted with nil values and are populated
during RPC, so we'll do the same in the HTTP API and populate the `ReadAllocs`
and `WriteAllocs` fields with a map of allocation IDs, but with null
values. The web UI will then create its `ReadAllocations` and
`WriteAllocations` fields by mapping from those IDs to the values in
`Allocations`, instead of flattening the map into a list.
2020-11-25 16:44:06 -05:00
Tim Gross
101ae734e8 csi/ui: show Node Only for volumes when controllers aren't required (#9416)
Plugin health for controllers should show "Node Only" in the UI only when both
conditions are true: controllers are not required, and no controllers have
registered themselves (0 expected controllers). This accounts for "monolith"
plugins which might register as both controllers and nodes but not necessarily
have `ControllerRequired = true` because they don't implement the Controller
RPC endpoints we need (this requirement was added in #7844)

This changeset includes the following fixes:

* Update the Plugins tab of the UI so that monolith plugins don't show "Node
  Only" once they've registered.
* Add the missing "Node Only" logic to the Volumes tab of the UI.
2020-11-25 14:50:33 -05:00
Tim Gross
b5a4871e8d ui/csi: fix links to volume IDs (#9355) 2020-11-13 15:44:34 -05:00
Michael Lange
99244af196 Fix flaky lifecycle chart tests 2020-11-12 09:16:53 -08:00
Michael Lange
edd296ff51 Revert "Temporarily remove poststop from the UI"
This reverts commit f8a505ea2f.
2020-11-12 09:16:52 -08:00
Michael Lange
e7bd23a481 Add missing feature fixture that was introduced while this feature was being developed 2020-11-11 16:43:47 -08:00
Michael Lange
84b100952b Merge pull request #9294 from hashicorp/f-ui/das-filter-toggle
UI: Add DAS summary table filtering
2020-11-11 14:04:25 -08:00
Buck Doyle
e8c53938af Move page object component to reflect page order 2020-11-10 13:42:15 -06:00
Buck Doyle
996251c9e1 Remove unnecessary uses of createList 2020-11-10 13:38:27 -06:00
Buck Doyle
8d5fa9e911 Remove unused action
This is a remnant of another approach I tried when rerouting
/optimize when the filter excluded all summaries.
2020-11-10 10:07:48 -06:00
Buck Doyle
470129eca3 Add redirect to parent when filter excludes all 2020-11-10 09:38:46 -06:00
Buck Doyle
783e9dd995 Fix proceed to use filtered summaries 2020-11-09 15:00:58 -06:00
Buck Doyle
3206e97064 Add check that active summary isn’t filtered out 2020-11-09 13:02:16 -06:00
Buck Doyle
20d32fd101 Add no matches empty state 2020-11-09 09:41:18 -06:00
Buck Doyle
3708ce0d17 Add count to search field placeholder 2020-11-09 09:32:49 -06:00
Buck Doyle
d4df1e0459 Add summary-filtering field
This only filters by slug for now… 🧐
2020-11-09 09:28:40 -06:00
Buck Doyle
d181be70c2 Remove copypasted to-be-unused query parameters 2020-11-09 09:04:14 -06:00
Buck Doyle
86ed12a7f3 Add facets for recommendation summaries
This is mostly copied from the jobs list. One uncertainty
is what to do when changing a facet causes the currently-
active card to be excluded from the filtered list 🤔
2020-11-06 15:53:58 -06:00
Buck Doyle
7b9f8b5cb1 Fix job detail crash when recommendations off (#9269)
Without this, visiting any job detail page on Nomad OSS would crash with
an error like this:

Error: Ember Data Request GET
/v1/recommendations?job=ping%F0%9F%A5%B3&namespace=default returned a
404 Payload (text/xml)

The problem was twofold.

1. The recommendation ability didn’t include anything about checking
whether the feature was present. This adds a request to
/v1/operator/license on application load to determine which features are
present and store them in the system service. The ability now looks for
'Dynamic Application Sizing' in that feature list.

2. Second, I didn’t check permissions at all in the job-fetching or job
detail templates.
2020-11-06 08:21:38 -06:00
Michael Lange
88a7458488 Merge pull request #9271 from hashicorp/b-ui/missing-warning-in-stories
UI: Update lingering instances of the old warning icon in stories
2020-11-05 13:56:07 -08:00
Michael Lange
a69eb82cfc Show dismissable no live updating notice on the topology page 2020-11-04 19:25:12 -08:00
Michael Lange
6c5597d548 Update lingering instances of the old warning icon in stories 2020-11-04 19:24:39 -08:00
Michael Lange
3cb5bbb0f8 Show a partial view notice when ACLs are enabled and the mgmt token isn't being used 2020-11-04 15:24:34 -08:00
Michael Lange
916c119269 Update URL for namespace globbing 2020-11-04 15:23:47 -08:00
Michael Lange
5f9267cd2d Forbidden state for the topo viz 2020-11-04 12:32:22 -08:00
Buck Doyle
ba17e2191b Add DAS subroute and copy button (#9201)
This continues iteration on the DAS UI by adding the ability to directly
navigate to a recommendation summary by (namespaced) slug and a copy
button for the direct navigation link.

It includes a change to CopyButton allowing it to take a block that’s
rendered within the button.

It also changes some instances of multi-relationship traversal to use
in-summary attributes, such as summary.jobNamespace instead of
summary.job.namespace.name.
2020-11-04 12:22:24 -06:00
Buck Doyle
1b0f4203bc Change node id search to prefix-only (#9244)
This test has been periodically failing, like here:
https://app.circleci.com/pipelines/github/hashicorp/nomad/12879/workflows/40c0445c-b244-4a04-a5a3-d9685b656c94/jobs/114751/tests

The failure was because sometimes the first node contains the
beginning of the ”otherNode” id somewhere within its id. It seems
less useful to match within the node, so this changes id search to
only match at the beginning of the id.
2020-11-04 12:12:31 -06:00
Michael Lange
187f778056 Merge pull request #9074 from Liraim/fix_download
ui: "View Raw File" download using JS instead simple link
2020-11-04 10:09:35 -08:00
Michael Lange
52226f3a5a Merge pull request #9256 from hashicorp/ui/upgrade-node
Use Node v12 for UI development
2020-11-04 10:06:41 -08:00
Michael Lange
b9bbea6596 Use Node v12 for UI development 2020-11-04 09:04:22 -08:00
Michael Lange
c6f410f551 Merge pull request #9240 from hashicorp/f-ui/topo-viz-tooltips
UI: Topo Viz Tooltips
2020-11-02 13:46:58 -08:00
Michael Lange
5411ed830e Fix the raw 'blue' in recommendation cards to use '$blue' 2020-11-02 13:29:44 -08:00
Michael Lange
cf2cac1785 Replace visualViewport with the more compatible scrollX and scrollY 2020-11-02 13:25:50 -08:00
Michael Lange
24b0e41036 Add tooltips to the topo viz 2020-11-02 13:25:33 -08:00
Vyacheslav Morov
21de0aee50 Add type=button to View Raw Data buttons. 2020-11-01 02:47:11 +03:00
Vyacheslav Morov
160b038314 Change to button.
Rewrite tests to check that proper urls was called.
2020-10-31 23:11:14 +03:00
Michael Lange
595e1a3c19 Make the style-string property glimmer safe 2020-10-30 16:14:31 -07:00
Michael Lange
ae81d7c3ea Add new is-static chart tooltip variant and decouple from charts 2020-10-30 16:14:31 -07:00
Buck Doyle
d986fa1fdc Add handling for empty state flaky test edge case (#9234)
This test occasionally fails because the random generation
sometimes produces a node with no allocations, such as here:
https://app.circleci.com/pipelines/github/hashicorp/nomad/12735/workflows/9a407f87-0383-48ee-8e41-7e6e351dce28/jobs/113130/steps

This is a temporary measure to solve it without trying to force the
generated data to always have an allocation.
2020-10-30 15:57:09 -05:00
Michael Lange
5d21e55063 Add namespace and task states query params to the topo viz route 2020-10-29 11:28:41 -07:00
Buck Doyle
2dc95a10ab Fix Firefox positioning of chart resource label (#9209)
alignment-baseline appears to be ignored in Firefox, but dominant-baseline
works. This also moves the anchor into CSS.
2020-10-29 08:13:41 -05:00
Buck Doyle
828487352b Add DAS UI code from enterprise (#9192)
This is a few combined iterations on the DAS feature.
2020-10-29 07:46:42 -05:00