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

feat: [SER-2215] Adding disable feature to dialog box buttons #5925

Merged
merged 2 commits into from
Jan 20, 2025

Conversation

pnrgenc
Copy link
Member

@pnrgenc pnrgenc commented Jan 16, 2025

No description provided.

Comment on lines 82 to 87
isButtonDisabled: function() {
return {
save: this.saveButtonDisabled,
cancel: this.cancelButtonDisabled
};
},

Choose a reason for hiding this comment

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

Why do you converted both props into a object?

In my opinion, this can lead to errors in the future, because when seeing isButtonDisabled the developer may expect a boolean and in reality is getting an object.

I suggest using the props directly and removing this

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed, thank you

Comment on lines 88 to 91
buttonStyle: function() {
return function(disabled) {
return disabled ? { opacity: 0.5 } : {};
};

Choose a reason for hiding this comment

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

You are using a computed property to return a method, this is bad practice.

It should be moved to methods, for example:

  getButtonStyle: function(disabled) {
    return disabled ? { opacity: 0.5 } : {};
  }

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed, thank you

@gabrieloliveirapinto gabrieloliveirapinto merged commit 2198bf1 into journey+content-main Jan 20, 2025
1 of 2 checks passed
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.

2 participants