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-21532] Create message #24407

Conversation

kiannaquach
Copy link
Contributor

@kiannaquach kiannaquach commented Dec 6, 2023

The create/edit form will be simplified once the form refresh work starts happening. Most of this create/edit form component uses HDS radiosets and datetime-local. Alternatively, I could also add this to the form-field component to simplify this code.

custom-messages

Things fixed from bugs I found:

  • On the list view, it was using a previous iteration of the ConfirmAction. I updated it so that it uses the updated version.
  • I accidentally merged the wrong merge conflict change for one of sidebar tests into the sidebranch I fix that issue here.

TODO:

  • update the start and end time so that it prepopulates the datetime-local and update the POST request to accept an id on edit VAULT-21534
  • selecting "never" for end time doesn't current work with the api since support hasn't been added yet.
  • write acceptance tests for create / edit when backend merges the api to main.

@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Dec 6, 2023
@kiannaquach
Copy link
Contributor Author

This PR is reliant on the new changes to the radio editType in the FormField component. #24542

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.

Excellent work! Just one small question, but great job working through all the comments 🚢

* Messages::MessageExpirationDateForm components are used to display list of messages.
* @example
* ```js
* <Messages::MessageExpirationDateForm @message={{this.message}} @attr={{attr}} />
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of having this component manage setting the model value, could you just pass the attribute and an "onChange" function that passes back the end time as either an empty string or a timestamp? I don't think you'd need a component file in that case 🤔
That way this component acts more as a fancy input, and all of the model updates happen in the create-and-edit- form

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 did something similar at one point in this PR, but removed it since I thought it was easier to understand this way since you're able to see the logic in the template rather than navigating back to the create-and-edit- to see the onChange action. 🤷‍♀️ I think we'll need a component no matter what since the groupValue and formDateTime tracked properties are initially set in the constructor based on whether an endTime exists. An argument can be made that this could be in the create-and-edit- too, but I feel like this should be role of the message-expiration-date-form

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'll make note of this as a possible improvement, but don't think it should be a blocker for merging this in the sidebranch. The next ticket I'll work on is the edit so I'll try addressing this there.

Copy link
Contributor

Choose a reason for hiding this comment

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

Definitely. My suggestion was based on handling the input similar to the pattern of how other form fields work. You definitely have more context here! I find attribute changes are easier to follow if all input components are responsible for is returning the selected/inputed value. In this case, that'd be an ISO timestamp string.

@kiannaquach kiannaquach merged commit 6d87e6e into ui/VAULT-19096/customizable-banners Dec 14, 2023
63 checks passed
@kiannaquach kiannaquach deleted the ui/VAULT-21532/create-custom-message branch December 14, 2023 21:07
kiannaquach added a commit that referenced this pull request Jan 23, 2024
* UI: [VAULT-21521] Initial config-ui engine and routes set up (#23922)

* UI: [VAULT-21526] Create adapter, serializer, and model files (#23947)

* UI: [VAULT-21588] Add Custom Messages to the sidebar (#23946)

* UI: [VAULT-21527] Mirage setup (#24000)

* UI: [VAULT-21530] Custom Messages List View w/ Pagination and LazyPaginatedQuery (#24133)

* UI: Add list to adapter query param (#24187)

* UI: [VAULT-21532] Create message (#24407)

* WIP create message

* Add breadcrumns

* Create and edit form

* Add save to create/edit form

* Add cancel and todo

* Fix cancel route

* Fix breadcrumb label to be title case

* add start time logic

* Update breadcrumb

* Fix breadcrumbs and merge conflict test

* Update create form description

* Fix sidenav so it always highlights

* Fix up forms

* Mostly working create form

* Form cleanup

* Fix link title and href form fields

* Default startTime

* Fix messages

* Update dropdown to use the updated ConfirmAction component

* Update create and edit form

* Add wip tests

* Fix breadcrumb formatter

* Comment out test

* Update create message test

* Update more tests

* Add comment for fixing date on edit

* Update Message form

* Code cleanup!

* Add validation tests

* Remove authenticated from route model

* SOme more code cleanup

* Add controller so authenticated is parsed

* Working radio buttons

* Use an object instead of arrays

* Wip date form

* Fix license headers

* Fix license headers addition of files

* Fix copyright format issues and clean up code

* Fix tests

* Rename FormField radio getter and ay11 improvements

* Address feedback

* Fix specific date so it remembers the values

* Address feedback!

* Update more form fields

* Use formfield action instead

* Update to every

* Update syntax of onchange

* Fix tests

* Update willDestroy so it doesnt break tests

* Remove set and brodcast datetimelocal

* Put FormField back the way it was in favor of putting FormField to a seperate PR

* Remove getter in formfield component file

* Address more feedback

* Put back test

* Update datetime string format var name and location

* UI: [VAULT-21534 VAULT-21533 VAULT-21536] edit, preview, and delete custom message (#24603)

* Working edit

* VAULT-21536 update delete message and create/update flash message

* VAULT-21533 add preview modal

* Update serializer

* Preview refinements

* Move preview to its own component

* Move breadcrumbs to setupController

* Add more tests

* Address some feedback

* Address more feedback!

* Update serailizer

* Remove stylesheet

* Add comment

* UI: [VAULT-21435] Message details (#24645)

* WIP

* Fix timezone bug

* Fix date issues on create/edit form

* Add details screen

* Use allFields instead of formFields

* Fix tests

* Address comments!

* UI: VAULT-21538 unauth endpoint message display (#24665)

* WIP unauth display

* Add modal custom message

* Close multiple modals

* Update todo with ticket number

* On init make custom message request

* Use serializer

* Update fetchMessages

* Add copyright headers

* Add services and serializers

* Send null instead of empty strings

* Fix tests!

* Add copywrite headers

* Add some acceptance tests

* Test cleanup

* Put tests back

* pass hooks to module

* Move module out

* Seperate tests

* Copywrite

* Add aria-prohibited-attr runList options

* Code cleanup

* Add date-time-local transform

* Add copyright headers

* Remove comments

* Remove date transform stuff for now!

* Put getISODateFormat back into the serailize function

* UI: Date time local transform (#24694)

* Date time local

* Add deserialize

* Add copyright header

* check if date exists

* Use parseISO for date strings since datefns requires this in new update

* Update tests

* Ensure we cehck for an ISOString

* Add checks so tests wont fail

* Update parseISO

* Address feedback

* UI: multiple banner message on create and edit form (#24742)

* WIP multiple banner message on create and edit form

* Fix tests

* Put checks back

* Add try/catch to query

* Fix breadcrumbs

* Add page size to pagination

* Add multiple modal message tests

* Address feedback

* Check for valid form first

* Add extra checks

* Address feedback

* Move getter to the route

* Fix tests!

* Address more feedback

* Use still when cancelling

* Update multiple banner modal

* Fix tests

* Set user confirmation to empty string

* UI: VAULT-21539 auth messages display (#24842)

* 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

* UI: [VAULT-22908] Update kv object editor, add max number of messages 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

* Add changelog

* UI: fix link bug and add colors (#24977)

* Fix edit bug and put transform back

* Edit badgeColor

* Add tests

* Revert changes to transform

* Edit badge colors

* remove universal object transform

* Update changelog filename

* UI: Add form inline warning (#24986)

* Add form inline warning

* Remove title

* Only show form warning for unauth

* Address feedback!
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.

4 participants