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

Move lock message inputs from inline to actions cart #128

Merged
merged 18 commits into from
Jun 29, 2022
Merged

Conversation

tameremad
Copy link
Contributor

@tameremad tameremad commented Apr 22, 2022

The aim of this PR is to make locking an application or environment simpler. Most use cases include adding multiple locks at the same time (with the same message). So by moving the input field to the cart, the locking process is simpler for the users.

The BatchAction type is generated from the API proto file directly. This type includes a create...(env/app)...Lock. which was used to represent lock actions in the Cart.

After moving the input field, the lock button has to add lock actions to Cart without any lock message. which creates a problem because the message field is required for BatchAction but it's not yet available.

To solve it, This PR will:

  • Create a new Type Union of all the different actions, namely, CartAction, and then use it to represent different actions in the frontend.
  • Remove the input fields from ReleaseDialog/LockButtonGroup and from ReleaseDialog/CreateLockButton
  • Use CartAction instead of BatchAction in Warnings, Releases, ReleaseDialog, ActionsCart, and index.tsx.
  • Create a new file ActionDetails that contains the CartAction type, and the function to transform CartActions to BatchActions before sending the API request.
  • Move getActionDetails, ActionTypes from ConfirmationDialog to ActionDetails
  • Add an input field in CheckoutDialog that appears only when the cart contains create-lock actions. use this input as the lock message.
  • Add tests in ActionDetails.test and modify the tests of CheckoutDialog.test and ConfirmationDialog.test to use CartAction
  • Create an issue for more improvement points from this PR: Collection of small improvements. #195

Becuase of a problem on runtime in typescript the enum was undefined. therfore extracting it into a new file would solve the problem
Copy link
Contributor

@fdcds fdcds left a comment

Choose a reason for hiding this comment

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

Some more comments.

services/frontend-service/src/ui/ActionDetails.tsx Outdated Show resolved Hide resolved
services/frontend-service/src/ui/ActionDetails.tsx Outdated Show resolved Hide resolved
services/frontend-service/src/ui/ActionDetails.tsx Outdated Show resolved Hide resolved
services/frontend-service/src/ui/ActionDetails.tsx Outdated Show resolved Hide resolved
@tameremad tameremad requested a review from fdcds June 20, 2022 13:02
@tameremad tameremad merged commit 73374ba into main Jun 29, 2022
@tameremad tameremad deleted the TE/simple-locks branch June 29, 2022 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants