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

[4/4] DXCDT-317: Add confirmation prompt on open editor updates #603

Merged
merged 2 commits into from
Jan 12, 2023

Conversation

sergiught
Copy link
Contributor

@sergiught sergiught commented Jan 11, 2023

🔧 Changes

The CLI asks for confirmation before an entity is deleted. However, we should also ask for confirmation before updating a template. The reason is because sometimes developers have a tough time wielding the built-in editor (ex: VIM) and accidents may occur; a confirmation would prevent any unintended updates. This practice is already employed with the universal login template. This can be overridden with a --force flag or if the templates are piped-in.

📚 References

🔬 Testing

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@sergiught sergiught marked this pull request as ready for review January 11, 2023 20:02
@sergiught sergiught requested a review from a team as a code owner January 11, 2023 20:02
@@ -211,11 +212,20 @@ func updateEmailTemplateCmd(cli *cli) *cobra.Command {
&inputs.Body,
oldTemplate.GetBody(),
inputs.Template+".*.liquid",
cli.emailTemplateEditorHint,
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's remove emailTemplateEditorHint as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the only one I can remove safely:)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in ec270f6 (#603).

@@ -310,11 +310,20 @@ func updateActionCmd(cli *cli) *cobra.Command {
&inputs.Code,
oldAction.GetCode(),
inputs.Name+".*.js",
cli.actionEditorHint,
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's remove actionEditorHint as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is still being used in the create cmd.

@@ -351,12 +351,21 @@ func updateRuleCmd(cli *cli) *cobra.Command {
&inputs.Script,
oldRule.GetScript(),
oldRule.GetName()+".*.js",
cli.ruleEditorHint,
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's remove ruleEditorHint as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is still being used in the create cmd.

Copy link
Contributor

@willvedd willvedd left a comment

Choose a reason for hiding this comment

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

👍

Base automatically changed from patch/DXCDT-317-refactor-rules-update-part-3 to v1 January 12, 2023 18:53
@sergiught sergiught force-pushed the patch/DXCDT-317-confirm-part-4 branch from ec270f6 to 2001b96 Compare January 12, 2023 18:59
@sergiught sergiught merged commit 73176f4 into v1 Jan 12, 2023
@sergiught sergiught deleted the patch/DXCDT-317-confirm-part-4 branch January 12, 2023 19:04
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.

3 participants