-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix: configuration footer fix #1088
Conversation
WalkthroughThe changes in this pull request focus on the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
PR description must contain a link to a ClickUp (case-insensitive) |
|
PR description must contain a link to a ClickUp (case-insensitive) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
src/app/shared/components/configuration/configuration-step-footer/configuration-step-footer.component.html (1)
Line range hint
18-30
: Consider optimizing button state handling.The template could be simplified to reduce duplication in button states. Consider extracting the common button properties and using a single button with dynamic content.
Here's a suggested refactor:
- <button *ngIf="ctaText !== 'Saving' && ctaText !== 'Syncing'" pButton type="button" class="p-button-raised" (click)="saveChanges()" [disabled]="isButtonDisabled"> - <span *ngIf="brandingConfig.brandId === 'co'"> - {{ ctaText | sentenceCase}} - </span> - <span *ngIf="brandingConfig.brandId === 'fyle'"> - {{ ctaText }} - </span> - <app-svg-icon *ngIf="brandingFeatureConfig.isIconsInsideButtonAllowed && ctaText !== 'Save' && AppName !== appName.QBD_DIRECT" [svgSource]="'arrow-tail-right-medium'" [width]="'18px'" [height]="'18px'" [styleClasses]="'tw-text-white tw-pl-10-px tw-pt-2-px tw-text-12-px'"></app-svg-icon> - </button> - <button *ngIf="ctaText === 'Saving' || ctaText === 'Syncing'" pButton type="button" class="p-button-raised" disabled> - {{ ctaText }} - <div *ngIf="brandingFeatureConfig.isIconsInsideButtonAllowed" class="tw-w-5 tw-h-5 tw-ml-2 tw-border-2 tw-border-b-transparent tw-border-r-transparent tw-border-l-transparent tw-border-t-border-tertiary tw-rounded-full tw-animate-spin"></div> - </button> + <button + pButton + type="button" + class="p-button-raised" + [disabled]="isButtonDisabled || ctaText === 'Saving' || ctaText === 'Syncing'" + (click)="saveChanges()"> + <span [ngSwitch]="true"> + <ng-container *ngSwitchCase="brandingConfig.brandId === 'co'"> + {{ ctaText | sentenceCase }} + </ng-container> + <ng-container *ngSwitchCase="brandingConfig.brandId === 'fyle'"> + {{ ctaText }} + </ng-container> + </span> + <ng-container [ngSwitch]="true"> + <app-svg-icon + *ngSwitchCase="brandingFeatureConfig.isIconsInsideButtonAllowed && ctaText !== 'Save' && AppName !== appName.QBD_DIRECT && ctaText !== 'Saving' && ctaText !== 'Syncing'" + [svgSource]="'arrow-tail-right-medium'" + [width]="'18px'" + [height]="'18px'" + [styleClasses]="'tw-text-white tw-pl-10-px tw-pt-2-px tw-text-12-px'"> + </app-svg-icon> + <div + *ngSwitchCase="brandingFeatureConfig.isIconsInsideButtonAllowed && (ctaText === 'Saving' || ctaText === 'Syncing')" + class="tw-w-5 tw-h-5 tw-ml-2 tw-border-2 tw-border-b-transparent tw-border-r-transparent tw-border-l-transparent tw-border-t-border-tertiary tw-rounded-full tw-animate-spin"> + </div> + </ng-container> + </button>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
src/app/shared/components/configuration/configuration-step-footer/configuration-step-footer.component.html
(1 hunks)
🔇 Additional comments (1)
src/app/shared/components/configuration/configuration-step-footer/configuration-step-footer.component.html (1)
24-24
: LGTM! The icon visibility logic is improved.
The additional condition ctaText !== 'Save'
makes sense from a UX perspective, as 'Save' actions typically don't need directional arrows. This aligns well with the existing conditions for branding and app name checks.
Let's verify the consistency of button states:
✅ Verification successful
The icon visibility logic is correctly implemented and consistent with the component's design
The verification confirms that:
- The component properly handles different button states through the
ctaText
input, including 'Save and Continue', 'Saving', and 'Save' - The Storybook stories demonstrate the expected button states and configurations
- The icon visibility condition
ctaText !== 'Save'
aligns with the component's usage patterns and states - The implementation is consistent with the branding configuration checks
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for all possible ctaText values and button states
# to ensure consistent handling across the codebase
# Search for places where ctaText is set
rg -t typescript "ctaText.*=" --glob "!dist/*" -A 2
# Search for other configuration footer instances
fd -e html -e ts "configuration.*footer" --exec rg -l "ctaText|p-button"
Length of output: 428
Script:
#!/bin/bash
# Let's check the component and story files to verify ctaText usage
cat ./src/app/shared/components/configuration/configuration-step-footer/configuration-step-footer.component.ts
echo "---"
cat ./src/stories/ConfigurationStepFooter.stories.ts
Length of output: 2657
Description
fix: configuration footer fix
Clickup
Please add link here
Summary by CodeRabbit
New Features
ctaText
.Bug Fixes