Skip to content

Conversation

Bonymol-aot
Copy link
Contributor

@Bonymol-aot Bonymol-aot commented Jun 20, 2025

User description

Issue Tracking

JIRA: https://aottech.atlassian.net/browse/FWF-4820
Issue Type: BUG/ FEATURE

Changes

  • Success count down in attribute save
  • update disable condition when not private

PR Type

Enhancement


Description

  • import success countdown in filter modal

  • add countdown callback to save action

  • dynamic save button variant and label

  • enforce share option validation for save


Changes walkthrough 📝

Relevant files
Enhancement
AttributeFIlterModalBody.tsx
Implement save countdown and validation                                   

forms-flow-review/src/components/AttributeFilterModal/AttributeFIlterModalBody.tsx

  • import and initialize useSuccessCountdown hook
  • wrap saveFilterAttributes with countdown callback
  • introduce saveButtonVariant for success state
  • update save button label, variant, disabled logic
  • +46/-28 
    SaveFilterTab.tsx
    Update save icon and disable logic                                             

    forms-flow-review/src/components/TaskFilterModal/SaveFilterTab.tsx

  • extend saveIconColor with share filter checks
  • update save/update button disabled conditions
  • enforce shareFilter and specific role validation
  • +2/-2     

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @Bonymol-aot Bonymol-aot requested review from a team as code owners June 20, 2025 15:10
    Copy link

    Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Missing state update

    The new shareAttrFilter state is never updated because there's no onChange handler wired to update it when the user selects a share option. Without this, the share validation will not work as intended.

    const [shareAttrFilter, setShareAttrFilter] = useState(FILTER_SHARE_OPTIONS.PRIVATE); 
     const saveIconColor = getIconColor(isUnsavedFilter || !filterName || filterNameError|| !shareAttrFilter || deleteSuccess?.showSuccess);
    Countdown callback timing

    The onClose call is placed inside the setSaveSuccess callback of the countdown. Confirm that the modal should only close after the countdown delay and that other state updates (dispatches) happen before the modal closes.

    const response = await createFilter(filterToSave);
    
    setSaveSuccess(() => {
      onClose();  
    }, 2);
    Undefined variables

    The disabled condition references shareFilter and shareFilterForSpecificRole. Verify these props or state values exist and are updated correctly, otherwise the button may be permanently disabled or throw an error.

      createAndUpdateFilterButtonDisabled || filterNameError || deleteSuccess?.showSuccess || !shareFilter|| (shareFilter === SPECIFIC_USER_OR_GROUP && !shareFilterForSpecificRole)
    );

    Copy link

    Failed to generate code suggestions for PR

    @Josephalexantony-aot
    Copy link
    Member

    Please update the sonar issues if any necessary items are missing

    @arun-s-aot arun-s-aot merged commit 25c1052 into AOT-Technologies:develop Jun 21, 2025
    4 checks passed
    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.

    4 participants