Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: Build KV v2 overview page #28106

Merged
merged 19 commits into from
Aug 16, 2024
Merged

Conversation

hellobontempo
Copy link
Contributor

Description

This PR builds the overview page. This does not implement the component

Screenshot 2024-08-16 at 10 19 23 AM

deleted 🗑️

Screenshot 2024-08-16 at 10 18 24 AM

destroyed ❌

Screenshot 2024-08-16 at 10 18 52 AM

TODO only if you're a HashiCorp employee

  • Backport Labels: If this PR is in the ENT repo and needs to be backported, backport
    to N, N-1, and N-2, using the backport/ent/x.x.x+ent labels. If this PR is in the CE repo, you should only backport to N, using the backport/x.x.x label, not the enterprise labels.
    • If this fixes a critical security vulnerability or severity 1 bug, it will also need to be backported to the current LTS versions of Vault. To ensure this, use all available enterprise labels.
  • ENT Breakage: If this PR either 1) removes a public function OR 2) changes the signature
    of a public function, even if that change is in a CE file, double check that
    applying the patch for this PR to the ENT repo and running tests doesn't
    break any tests. Sometimes ENT only tests rely on public functions in CE
    files.
  • Jira: If this change has an associated Jira, it's referenced either
    in the PR description, commit message, or branch name.
  • RFC: If this change has an associated RFC, please link it in the description.
  • ENT PR: If this change has an associated ENT PR, please link it in the
    description. Also, make sure the changelog is in this PR, not in your ENT PR.

@hellobontempo hellobontempo added this to the 1.18.0-rc milestone Aug 16, 2024
@hellobontempo hellobontempo requested a review from a team as a code owner August 16, 2024 17:19
@hellobontempo hellobontempo changed the title UI: Build KV overview page UI: Build KV v2 overview page Aug 16, 2024
@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Aug 16, 2024
@@ -16,6 +16,7 @@ import { obfuscateData } from 'core/utils/advanced-secret';
* <JsonEditor @title="Policy" @value={{hash foo="bar"}} @viewportMargin={{100}} />
*
* @param {string} [title] - Name above codemirror view
* @param {boolean} [showToolbar=true] - If false, toolbar and title are hidden
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noticed this and accidentally committed 😅

<Hds::Text::Display @weight="bold" @size="300" data-test-overview-card-title={{@cardTitle}}>
{{@cardTitle}}
</Hds::Text::Display>
<div class="flex row-wrap space-between" data-test-overview-card={{@cardTitle}}>
Copy link
Contributor Author

@hellobontempo hellobontempo Aug 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so I could pass a badge to the card title. While both customSubtext and @subText are passable, I opted to make customTitle and @cardTitle mutually exclusive

@@ -43,7 +43,7 @@ function dateFromString(str) {
return null;
}

export function dateFormat([value, style], { withTimeZone = false }) {
export function dateFormat([value, style = 'MMM d yyyy, h:mm:ss aa'], { withTimeZone = false }) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got tired of looking through the codebase to find the format style we use and noticed how inconsistent we can be. I reached out to design to confirm what the default style should be. As a follow-on PR I'll update the other instances of timestamps (like in the card container)

Copy link

github-actions bot commented Aug 16, 2024

Build Results:
All builds succeeded! ✅

Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
~}}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally this lived in ui/lib/kv/addon/components/page/secret/paths.hbs moved everything but the header to this component so it could render in the overview and the paths route

condensed version

Screenshot 2024-08-16 at 10 24 17 AM

uncondensed (page) version

Screenshot 2024-08-16 at 10 24 57 AM

<KvPathsCard @backend={{@backend}} @path={{@path}} @isCondensed={{true}} />
</Hds::Card::Container>

{{#if @subkeys.subkeys}}
Copy link
Contributor Author

@hellobontempo hellobontempo Aug 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The subkeys response is

{
  "subkeys": {
    "foo": null,
    "bar": {
      "baz": null
    },
    "quux": null
  },
  "metadata": {
    "created_time": "2021-12-14T20:28:00.773477Z",
    "custom_metadata": null,
    "deletion_time": "",
    "destroyed": false,
    "version": 1
  }
}

since there is also metadata attached I opted to pass the whole response instead of separating the args so that we could differentiate where the metadata comes from. (even though it's a little weird to see @subkeys.subkeys)

Copy link

github-actions bot commented Aug 16, 2024

CI Results:
All Go tests succeeded! ✅

Copy link
Contributor

@hashishaw hashishaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Just some minor nits

<LinkTo @route="secret.details" @models={{array @backend @path}} data-test-secrets-tab="Secret">Secret</LinkTo>
</li>
<li>
<LinkTo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forget, do we hide the metadata tab on the other pages if they can't read metadata?

Copy link
Contributor Author

@hellobontempo hellobontempo Aug 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great question! We don't. I think we have the page handle hide/show logic more granularly because the details in the Metadata tab can be gleaned from custom_metadata from the secret OR @metadata. Plus the toolbar has delete/edit actions that technically a user could still perform without READ metadata. Thanks for asking! It prompted me to go check 👀

ui/lib/kv/addon/components/page/secret/overview.js Outdated Show resolved Hide resolved
@hellobontempo
Copy link
Contributor Author

✅ enterprise tests
Screenshot 2024-08-16 at 2 39 21 PM

@hellobontempo hellobontempo merged commit 30da9ae into main Aug 16, 2024
31 checks passed
@hellobontempo hellobontempo deleted the ui/VAULT-29470/add-kv-overview-page branch August 16, 2024 21:40
akshya96 pushed a commit that referenced this pull request Aug 20, 2024
* move date-from-now helper to addon

* make overview cards consistent across engines

* make kv-paths-card component

* remove overview margin all together

* small styling changes for paths card

* small selector additions

* add overview card test

* add overview page and test

* add default timestamp format

* cleanup paths test

* fix dateFromNow import

* fix selectors, cleanup pki selectors

* and more selector cleanup

* make deactivated state single arg

* fix template and remove @isDeleted and @isDestroyed

* add test and hide badge unless deactivated

* address failings from changing selectors

* oops, not ready to show overview tab just yet!

* add deletionTime to currentSecret metadata getter
akshya96 added a commit that referenced this pull request Aug 20, 2024
* auto-roll billing start enos test

* enos: don't expect curl available in docker image (#27984)

Signed-off-by: Ryan Cragun <me@ryan.ec>

* Update interoperability-matrix.mdx (#27977)

Updating the existing Vault/YubiHSM integration with a newer version of Vault as well as now supporting Managed Keys.

* Update hana db pkg (#27950)

* database/hana: use go-hdb v1.10.1

* docs/hana: quotes around password so dashes don't break it

* Clarify audit log failure telemetry docs. (#27969)

* Clarify audit log failure telemetry docs.

* Add the note about the misleading counts

* Auto-rolling billing start docs PR  (#27926)

* auto-roll docs changes

* addressing comments

* address comments

* Update website/content/api-docs/system/internal-counters.mdx

Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>

* addressing some changes

* update docs

* update docs with common explanation file

* updated note info

* fix 1.18 upgrade doc

* fix content-check error

* Update website/content/partials/auto-roll-billing-start-example.mdx

Co-authored-by: miagilepner <mia.epner@hashicorp.com>

---------

Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>
Co-authored-by: miagilepner <mia.epner@hashicorp.com>

* docker: add upgrade notes for curl removal (#27995)

Signed-off-by: Ryan Cragun <me@ryan.ec>

* Update vault-plugin-auth-jwt to v0.21.1 (#27992)

* docs: fix upgrade 1.16.x (#27999)

Signed-off-by: Ryan Cragun <me@ryan.ec>

* UI: Add unsupportedCriticalCertExtensions to jwt config expected payload (#27996)

* Client Count Docs Updates/Cleanup (#27862)

* Docs changes

* More condensation of docs

* Added some clarity on date ranges

* Edited wording'

* Added estimation client count info

* Update website/content/api-docs/system/internal-counters.mdx

Co-authored-by: miagilepner <mia.epner@hashicorp.com>

---------

Co-authored-by: miagilepner <mia.epner@hashicorp.com>

* update(kubernetes.mdx): k8s-tokenreview URL (#27993)

Co-authored-by: akshya96 <87045294+akshya96@users.noreply.github.com>

* Update programmatic-management.mdx to clarify Terraform prereqs (#27548)

* UI: Replace getNewModel with hydrateModel when model exists (#27978)

* Replace getNewModel with hydrateModel when model exists

* Update getNewModel to only handle nonexistant model types

* Update test

* clarify test

* Fix auth-config models which need hydration not generation

* rename file to match service name

* cleanup + tests

* Add comment about helpUrl method

* Changelog for 1.17.3, 1.16.7 enterprise, 1.15.13 enterprise (#28018)

* changelog for 1.17.3, 1.16.7 enterprise, 1.15.13 enterprise

* Add spacing to match older changelogs

* Fix typo in variables.tf (#27693)

intialize -> initialize

Co-authored-by: akshya96 <87045294+akshya96@users.noreply.github.com>

* Update 1_15-auto-upgrade.mdx (#27675)

* Update 1_15-auto-upgrade.mdx

* Update known issue version numbers for AP issue

---------

Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>

* Update 1_16-default-policy-needs-to-be-updated.mdx (#27157)

Made a few grammar changes plus updating term from Vault IU to Vault UI

* change instances variable to hosts

* for each hosts

* add cluster addr port

* Add ENVs using NewTestDockerCluster (#27457)

* Add ENVs using NewTestDockerCluster

Currently NewTestDockerCluster had no means for setting any
environment variables. This makes it tricky to create test
for functionality that require thems, like having to set
AWS environment variables.

DockerClusterOptions now exposes an option to pass extra
enviroment variables to the containers, which are appended
to the existing ones.

* adding changelog

* added test case for setting env variables to containers

* fix changelog typo; env name

* Update changelog/27457.txt

Co-authored-by: akshya96 <87045294+akshya96@users.noreply.github.com>

* adding the missing copyright

---------

Co-authored-by: akshya96 <87045294+akshya96@users.noreply.github.com>

* UI: Build KV v2 overview page (#28106)

* move date-from-now helper to addon

* make overview cards consistent across engines

* make kv-paths-card component

* remove overview margin all together

* small styling changes for paths card

* small selector additions

* add overview card test

* add overview page and test

* add default timestamp format

* cleanup paths test

* fix dateFromNow import

* fix selectors, cleanup pki selectors

* and more selector cleanup

* make deactivated state single arg

* fix template and remove @isDeleted and @isDestroyed

* add test and hide badge unless deactivated

* address failings from changing selectors

* oops, not ready to show overview tab just yet!

* add deletionTime to currentSecret metadata getter

* Bump actions/download-artifact from 4.1.7 to 4.1.8 (#27704)

Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.7 to 4.1.8.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@65a9edc...fa0a91b)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: akshya96 <87045294+akshya96@users.noreply.github.com>

* Bump actions/setup-node from 4.0.2 to 4.0.3 (#27738)

Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.0.2 to 4.0.3.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@60edb5d...1e60f62)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: akshya96 <87045294+akshya96@users.noreply.github.com>

* Add valid IP callout (#28112)

Co-authored-by: Yoko Hyakuna <yoko@hashicorp.com>

* Refactor SSH Configuration workflow (#28122)

* initial copy from other #28004

* pr feedback

* grr

* Bump browser-actions/setup-chrome from 1.7.1 to 1.7.2 (#28101)

Bumps [browser-actions/setup-chrome](https://github.com/browser-actions/setup-chrome) from 1.7.1 to 1.7.2.
- [Release notes](https://github.com/browser-actions/setup-chrome/releases)
- [Changelog](https://github.com/browser-actions/setup-chrome/blob/master/CHANGELOG.md)
- [Commits](browser-actions/setup-chrome@db1b524...facf10a)

---
updated-dependencies:
- dependency-name: browser-actions/setup-chrome
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: divyaac <divya.chandrasekaran@hashicorp.com>

* Bump vault-gcp-secrets-plugin (#28089)

Co-authored-by: divyaac <divya.chandrasekaran@hashicorp.com>

* docs: correct list syntax (#28119)

Co-authored-by: divyaac <divya.chandrasekaran@hashicorp.com>

* add semgrepconstraint check in skip step

---------

Signed-off-by: Ryan Cragun <me@ryan.ec>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Adam Rowan <92474478+bear359@users.noreply.github.com>
Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
Co-authored-by: Paul Banks <pbanks@hashicorp.com>
Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>
Co-authored-by: miagilepner <mia.epner@hashicorp.com>
Co-authored-by: Scott Miller <smiller@hashicorp.com>
Co-authored-by: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com>
Co-authored-by: divyaac <divya.chandrasekaran@hashicorp.com>
Co-authored-by: Roman O'Brien <58272664+romanobrien@users.noreply.github.com>
Co-authored-by: Adrian Todorov <adrian.todorov@hashicorp.com>
Co-authored-by: VAL <val@hashicorp.com>
Co-authored-by: Ikko Eltociear Ashimine <eltociear@gmail.com>
Co-authored-by: Owen Zhang <86668876+owenzorrin@users.noreply.github.com>
Co-authored-by: gkoutsou <gkoutsou@users.noreply.github.com>
Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Frappier <92055993+jonathanfrappier@users.noreply.github.com>
Co-authored-by: Yoko Hyakuna <yoko@hashicorp.com>
Co-authored-by: Angel Garbarino <Monkeychip@users.noreply.github.com>
Co-authored-by: Max Levine <max@maxlevine.co.uk>
Co-authored-by: Steffy Fort <steffyfort@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed pr/no-changelog ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants