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: Added properties disableFindAndReplace,disableCheckBox and disa… #908

Open
wants to merge 3 commits into
base: next
Choose a base branch
from

Conversation

thisismayuresh
Copy link
Collaborator

@thisismayuresh thisismayuresh commented Dec 24, 2024

Enhanced Table Component with Conditional Disable Features

This update introduces additional flexibility to the table component by allowing users to conditionally disable certain features using the extras prop. With this new feature, specific functionalities like Find and Replace, Checkbox, and Serial Number (SrNo) can be easily enabled or disabled based on the value passed in the extras object.

New extras Prop

users can conditionally disable specific features. they can pass the extras prop with the following keys:

  • disableFindAndReplace: Disables the Find and Replace functionality.
  • disableCheckBox: Disables the Checkbox functionality (for row selection).
  • disableSrNo: Disables the Serial Number (SrNo) column.
  • If a feature is not passed or if its value is set to false, the corresponding feature will remain enabled.

Example Usage

const { showWidget, isImplerInitiated } = useImpler({
  templateId: templateData?._id,
  projectId: templateData?._projectId,
  accessToken: profileInfo?.accessToken,
  extras: {
    disableFindAndReplace: true,
    disableCheckBox: true, 
    disableSrNo: true
  }
});

In this example:

  • Find and Replace is disabled (disableFindAndReplace: true).
  • Checkbox functionality is disabled (disableCheckBox: true).
  • Serial Number column is disabled (disableSrNo: true).

Default Behavior

If the extras prop is not passed or if any key is missing from the extras object, the corresponding feature will remain enabled by default.

For example, if you only pass disableCheckBox: true but omit the other options, the Find and Replace and Serial Number features will remain enabled, while the checkbox feature will be disabled.

Benefits

Customizability: Users can now easily toggle which features are enabled or disabled based on project requirements.
Simplified Configuration: By using the extras object, you can manage multiple feature settings in a single configuration.
Flexibility: This new feature provides the flexibility to disable or enable specific features without needing to modify the core table logic.

Notes

  • The extras prop is optional. If not provided, all features will remain enabled by default.
  • If you wish to disable specific features, simply pass true for the corresponding keys in the extras object.
  • Missing or false values for the extras keys will ensure the features remain enabled.

Copy link

nx-cloud bot commented Dec 24, 2024

View your CI Pipeline Execution ↗ for commit 51cc020.

Command Status Duration Result
nx run-many --target=build --all ✅ Succeeded 1m 17s View ↗

☁️ Nx Cloud last updated this comment at 2024-12-24 13:18:41 UTC

apps/widget/src/hooks/Phase3/usePhase3.tsx Outdated Show resolved Hide resolved
apps/widget/src/hooks/Phase3/usePhase3.tsx Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants