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: [VAULT-19096] Customizable banners #23945

Merged
merged 53 commits into from
Jan 23, 2024

Conversation

kiannaquach
Copy link
Contributor

@kiannaquach kiannaquach commented Nov 1, 2023

Description
Introduces custom messages settings, allowing users to view, and operators to configure system-wide messages for enterprise users.

New settings section in sidebar:
Settings section with Custom Messages

Each tab indicates where you want the message to be displayed. Navigate to the tab you want the message to be displayed and click on the create message button:
Create message button after

Fill out the create message form.
fill in the message details in create message form

Preview message before creating one.
preview a message

Display message details.
message details

Default message list view based on message location.
messages list view

To delete or edit a message you can find these actions in two places:
On the list view, click on the three dots and a dropdown appears with Edit or Delete.
edit-delete-1
Navigate to the details view by clicking on the message on the list view. There are buttons indicating to Delete or Edit a message.
edit-delete-2

Tickets completed:

  • VAULT-21521 engine and route setup
  • VAULT-21526 create ember-data files
  • VAULT-19096 add custom messages to sidenav
  • VAULT-21527 mirage setup
  • VAULT-21530 VAULT-21529 empty state for list view and list view
  • VAULT-21532 create message
  • VAULT-21534 VAULT-21533 VAULT-21536 edit, preview, and delete
  • VAULT-21435 Message details
  • VAULT-21538 unauth endpoint message display
  • VAULT-21539 auth messages display
  • VAULT-22908 update edit type kv

@kiannaquach kiannaquach added the ui label Nov 1, 2023
@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Nov 1, 2023
@kiannaquach kiannaquach added this to the 1.16.0-rc1 milestone Nov 1, 2023
* WIP auth message display

* Move block to show only when authenticated

* VAULT-22046 working search by name

* Some code clean up

* Fix merge conflict

* Add tests

* Fetch messages again after creation
… reached modal, small improvements (#24918)

* Update kv object editor to only use a single row

* continute using kv editype

* Fix failing dashboard tests!

* Fix failing test on sidebranch

* Fix tests and update validations

* Add optional tag

* Address feedback

* Add documentation

* Clear messages when logging out

* Fix tests!

* Add 100 message limit modal

* Add max message modal test

* Do more checks!

* Pair with Claire on the refactor of validator!

* Only show validationerror for multiple rows

* Update pageSize to 100 since when paginations are active it causes accessbility errors

* Fix tests!

* Add links to test

* Make banners dismissable

* Add cancel button

* Address feedback!

* Update test selectors

* Update validator

* Remove validations check in kvobjecteditor

* Revert validationError in kvobjecteditor template

* Put back if/else statements for link
kiannaquach and others added 4 commits January 22, 2024 11:34
* Fix edit bug and put transform back

* Edit badgeColor

* Add tests

* Revert changes to transform

* Edit badge colors

* remove universal object transform
Copy link

Build Results:
All builds succeeded! ✅

* Add form inline warning

* Remove title

* Only show form warning for unauth
Copy link
Contributor

@zofskeez zofskeez left a comment

Choose a reason for hiding this comment

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

Excited for this feature 🎉. Thank you for your efforts on this! 👏

ui/lib/config-ui/addon/routes/messages/create.js Outdated Show resolved Hide resolved
Comment on lines +33 to +53
async fetchMessages(ns) {
try {
const url = this.auth.currentToken
? '/v1/sys/internal/ui/authenticated-messages'
: '/v1/sys/internal/ui/unauthenticated-messages';
const opts = {
method: 'GET',
headers: {},
};
if (this.auth.currentToken) opts.headers['X-Vault-Token'] = this.auth.currentToken;
if (ns) opts.headers['X-Vault-Namespace'] = ns;
const result = await fetch(url, opts);
const body = await result.json();
if (body.errors) return (this.messages = []);
const serializer = this.store.serializerFor('config-ui/message');
this.messages = serializer.mapPayload(body);
this.bannerMessages?.forEach((bm) => (this.bannerState[bm.id] = true));
} catch (e) {
return e;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

It might have been nice to handle the request in the message adapter instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Open to changing it after merging this sidebranch since it's a code improvement :)

ui/lib/config-ui/addon/routes/messages/index.js Outdated Show resolved Hide resolved
ui/lib/config-ui/addon/routes/messages/message/edit.js Outdated Show resolved Hide resolved
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 ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants