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

Refactor Button component to handle icon visibility #10891

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Ayyanaruto
Copy link

@Ayyanaruto Ayyanaruto commented Oct 5, 2024

#10936
This pull request includes several changes to the Button component in the frontend/src/Editor/Components/Button.jsx file and updates to the buttonConfig in frontend/src/Editor/WidgetManager/configs/button.js. The changes primarily focus on refactoring the code and improving how the iconVisibility property is handled.

Changes to Button component:

  • Added component to the destructured props in the Button component. (frontend/src/Editor/Components/Button.jsx)
  • Moved iconVisibility from styles to component?.definition?.styles. (frontend/src/Editor/Components/Button.jsx)
  • Updated the conditional rendering to check iconVisibility.value instead of iconVisibility. (frontend/src/Editor/Components/Button.jsx)

Changes to buttonConfig:

  • Removed the visibility property from the icon configuration. (frontend/src/Editor/WidgetManager/configs/button.js)This commit refactors the Button component to handle the visibility of the icon. The code changes include:
  • Adding the component prop to the Button component to access the iconVisibility value from the component definition styles.
  • Updating the condition for rendering the icon based on the iconVisibility.value property.

The Button component is now able to properly handle the visibility of the icon.

Attachments
2024-10-05-13-05-47
2024-10-05-13-02-52

This commit refactors the Button component to handle the visibility of the icon. The code changes include:
- Adding the `component` prop to the `Button` component to access the `iconVisibility` value from the component definition styles.
- Updating the condition for rendering the icon based on the `iconVisibility.value` property.

The `Button` component is now able to properly handle the visibility of the icon.
@TooljetBot
Copy link
Collaborator

Code Review Agent Run Status

  • Limitations and other issues: The AI Code Review Agent was unable to review this change because Bito workspace ToolJet is downgraded to the plan that doesn’t include Code Review Agent feature.

    Please coordinate with your workspace admin to request an upgrade to the 10X Developer Plan.

Copy link

sonarcloud bot commented Oct 5, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
C Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

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