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: Refactor conditional styles in conguration componets to common branding styles #1166

Merged
merged 5 commits into from
Jan 29, 2025

Conversation

DhaaraniCIT
Copy link
Contributor

@DhaaraniCIT DhaaraniCIT commented Jan 28, 2025

Description

feat: converting condition style in ngStyle to a common branding style

Clickup

https://app.clickup.com/t/

Summary by CodeRabbit

  • New Features
    • Enhanced styling options added across various components through the introduction of new branding properties.
  • Style
    • Updated class bindings in multiple components to utilize centralized branding styles, improving consistency and maintainability.
    • Simplified conditional styling logic for buttons and text fields, standardizing their appearance across different branding configurations.

Copy link
Contributor

coderabbitai bot commented Jan 28, 2025

Walkthrough

The pull request introduces multiple modifications across various components, primarily focusing on the addition of a readonly brandingStyle property in several classes. This property is initialized to enhance access to branding-related configurations. Additionally, updates to HTML templates involve replacing conditional class bindings with direct references to the brandingStyle object, streamlining styling logic and improving consistency. New properties are also added to the c1Styles and fyleStyles objects, expanding their structure with additional styling options relevant to configuration components and dashboard elements.

Changes

File Change Summary
src/app/integrations/intacct/intacct-main/intacct-export-log/intacct-completed-export-log/intacct-completed-export-log.component.ts Added a readonly brandingStyle property initialized from brandingConfig
src/app/branding/c1-style-config.ts Added new properties and objects to c1Styles, including inputLabelTextStyle, configurationBrandingClass, and configuration with various properties.
src/app/branding/fyle-style-config.ts Added new properties and objects to fyleStyles, including inputLabelTextStyle, configurationBrandingClass, and configuration with various properties.
src/app/integrations/business-central/business-central-shared/business-central-import-settings/business-central-import-settings.component.html Updated class binding for a paragraph element to use brandingStyle.common.inputLabelTextStyle.
src/app/integrations/qbd-direct/qbd-direct-shared/qbd-direct-import-settings/qbd-direct-import-settings.component.html Updated class binding and content for a paragraph element to use brandingStyle.common.inputLabelTextStyle and changed displayed content.
src/app/integrations/qbo/qbo-shared/qbo-import-settings/qbo-import-settings.component.html Updated class binding for a paragraph element to use brandingStyle.common.inputLabelTextStyle.
src/app/shared/components/configuration/configuration-import-field/configuration-import-field.component.html Updated class bindings to utilize properties from brandingStyle.
src/app/shared/components/configuration/configuration-import-field/configuration-import-field.component.ts Added a readonly brandingStyle property.
src/app/shared/components/configuration/configuration-multi-select/configuration-multi-select.component.html Updated class binding for an <h5> element to use brandingStyle.common.inputLabelTextStyle.
src/app/shared/components/configuration/configuration-multi-select/configuration-multi-select.component.ts Added a readonly brandingStyle property.
src/app/shared/components/configuration/configuration-schedule-export/configuration-schedule-export.component.html Updated class binding for an icon element to use brandingStyle.common.configurationBrandingClass.
src/app/shared/components/configuration/configuration-schedule-export/configuration-schedule-export.component.ts Added a readonly brandingStyle property.
src/app/shared/components/configuration/configuration-select-field/configuration-select-field.component.html Updated class binding for <h5> elements to use brandingStyle.common.inputLabelTextStyle.
src/app/shared/components/configuration/configuration-select-field/configuration-select-field.component.ts Added a readonly brandingStyle property.
src/app/shared/components/configuration/configuration-step-header/configuration-step-header.component.html Updated class binding for <h3> element to use brandingStyle.
src/app/shared/components/configuration/configuration-step-header/configuration-step-header.component.ts Added a readonly brandingStyle property.
src/app/shared/components/configuration/configuration-text-field/configuration-text-field.component.html Updated icon elements to use brandingStyle.common.configurationBrandingClass.
src/app/shared/components/configuration/configuration-text-field/configuration-text-field.component.ts Added a readonly brandingStyle property.
src/app/shared/components/configuration/configuration-toggle-field/configuration-toggle-field.component.html Updated class binding for an <h5> element to use brandingStyle.common.inputLabelTextStyle.
src/app/shared/components/configuration/configuration-toggle-field/configuration-toggle-field.component.ts Added a readonly brandingStyle property.
src/app/shared/components/dashboard/dashboard-error-section/dashboard-error-section.component.html Updated button class bindings to use brandingStyle.dashboard.dashboardErrorResolveBtnText.

Possibly related PRs

  • feat: common main pages shadow style conversion #1164: The changes in this PR involve the addition of a brandingStyle property in the IntacctCompletedExportLogComponent, which is relevant as it aligns with the main PR's introduction of a readonly brandingStyle property in the same component. Both PRs focus on enhancing the styling capabilities through the brandingStyle object.

Suggested reviewers

  • ashwin1111

Poem

🐰 A Rabbit's Code Whisper 🖥️
In lines of TypeScript, soft and neat,
A property declared, now twice complete.
Branding style, readonly and bright,
A gentle echo in the coding light.
Redundancy dances, a quirky delight! 🎉


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ca47680 and 1c2cf28.

📒 Files selected for processing (4)
  • src/app/branding/c1-style-config.ts (1 hunks)
  • src/app/branding/fyle-style-config.ts (1 hunks)
  • src/app/shared/components/configuration/configuration-import-field/configuration-import-field.component.html (5 hunks)
  • src/app/shared/components/configuration/configuration-step-header/configuration-step-header.component.html (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/app/shared/components/configuration/configuration-step-header/configuration-step-header.component.html
  • src/app/branding/fyle-style-config.ts
  • src/app/shared/components/configuration/configuration-import-field/configuration-import-field.component.html
  • src/app/branding/c1-style-config.ts

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the size/XS Extra Small PR label Jan 28, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d6a7307 and 7ace0b4.

📒 Files selected for processing (1)
  • src/app/integrations/intacct/intacct-main/intacct-export-log/intacct-completed-export-log/intacct-completed-export-log.component.ts (1 hunks)
🧰 Additional context used
🪛 GitHub Check: lint
src/app/integrations/intacct/intacct-main/intacct-export-log/intacct-completed-export-log/intacct-completed-export-log.component.ts

[failure] 72-72:
Trailing spaces not allowed

🪛 GitHub Actions: TypeScript Lint Check
src/app/integrations/intacct/intacct-main/intacct-export-log/intacct-completed-export-log/intacct-completed-export-log.component.ts

[error] 72-72: Trailing spaces not allowed (no-trailing-spaces)

🪛 GitHub Actions: Unit Test
src/app/integrations/intacct/intacct-main/intacct-export-log/intacct-completed-export-log/intacct-completed-export-log.component.ts

[error] 75-75: Duplicate identifier 'brandingStyle'. The variable name is already in use.

🔇 Additional comments (1)
src/app/integrations/intacct/intacct-main/intacct-export-log/intacct-completed-export-log/intacct-completed-export-log.component.ts (1)

73-73: LGTM!

The brandingStyle property is correctly declared as readonly and follows Angular best practices.

Comment on lines 73 to 75
readonly brandingStyle = brandingStyle;

readonly brandingStyle = brandingStyle;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove duplicate brandingStyle declaration.

The brandingStyle property is declared twice, which causes a TypeScript compilation error.

Apply this diff to fix the issue:

  readonly brandingStyle = brandingStyle;
-
-  readonly brandingStyle = brandingStyle;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
readonly brandingStyle = brandingStyle;
readonly brandingStyle = brandingStyle;
readonly brandingStyle = brandingStyle;
🧰 Tools
🪛 GitHub Actions: Unit Test

[error] 75-75: Duplicate identifier 'brandingStyle'. The variable name is already in use.

@@ -69,6 +69,8 @@
private searchQuerySubject = new Subject<string>();

readonly brandingContent = brandingContent.exportLog;

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove trailing spaces.

The line contains trailing spaces which violates the linting rules and causes pipeline failures.

Apply this diff to fix the issue:

-  
+
🧰 Tools
🪛 GitHub Check: lint

[failure] 72-72:
Trailing spaces not allowed

🪛 GitHub Actions: TypeScript Lint Check

[error] 72-72: Trailing spaces not allowed (no-trailing-spaces)

@github-actions github-actions bot added size/M Medium PR and removed size/XS Extra Small PR labels Jan 28, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (1)
src/app/shared/components/configuration/configuration-multi-select/configuration-multi-select.component.ts (1)

Line range hint 59-89: Remove commented-out drag-and-drop code.

The file contains commented-out drag-and-drop related methods that should be removed to maintain code cleanliness.

-//   DragStart(memo: string) {
-//     This.currentlyDragging = memo;
-// }
-// // On Drag End
-// DragEnd() {
-//     This.currentlyDragging = null;
-// }
-
-// // On Drop of Item to droppable area
-// Drop() {
-//     If (this.currentlyDragging) {
-//         Let currentlyDraggingIndex = this.options.indexOf(this.currentlyDragging)
-//         This.selected =
-//             [...this.selected, this.currentlyDragging];
-//         This.options =
-//             This.options.filter((val, i) => i !=
-//                 CurrentlyDraggingIndex);
-//         This.currentlyDragging = null;
-//     }
-// }
-// OnDragStart(index: number) {
-//   This.startIndex = index;
-// }
-
-// OnDrop(dropIndex: number) {
-//   Const general = this.options[this.startIndex]; // get element
-//   This.options.splice(this.startIndex, 1);       // delete from old position
-//   This.options.splice(dropIndex, 0, general);    // add to new position
-// }
🧹 Nitpick comments (5)
src/app/shared/components/configuration/configuration-select-field/configuration-select-field.component.ts (3)

Line range hint 31-32: Consider improving type safety for the options input.

The options input accepts multiple array types using union types. Consider creating a common interface or type that these option types can implement/extend to improve type safety and maintainability.

Example:

interface BaseOption {
  value: string;
  label?: string;
}

@Input() options: BaseOption[];

Line range hint 34-35: Address the TODO comment regarding app-specific types.

The TODO comment indicates technical debt. Consider creating a plan to remove app-specific types and implement a more generic approach.

Would you like me to help create an issue to track this technical debt and propose a solution?


Line range hint 171-183: Optimize lifecycle hooks implementation.

The ngOnChanges implementation could be improved:

  1. Consider using TypeScript's non-null assertion operator or optional chaining to avoid potential undefined errors
  2. The conditional logic could be simplified
ngOnChanges(changes: SimpleChanges): void {
  const control = this.form.get(this.formControllerName);
  if (control) {
    changes.isDisabled?.currentValue ? control.disable() : control.enable();
  }
}
src/app/branding/fyle-style-config.ts (1)

11-25: Consider adding documentation for style properties.

The new style properties are well-organized and follow consistent naming. However, adding JSDoc comments describing the purpose and usage of each property would improve maintainability.

Example documentation:

 export const fyleStyles = {
     common: {
         // ... existing properties
+        /** Padding for input label text elements */
         inputLabelTextStyle: 'tw-pt-8-px',
+        /** Common branding class for Fyle-specific styling */
         configurationBrandingClass: 'fyle'
     },
     // ... add similar documentation for other properties
 };
src/app/shared/components/configuration/configuration-select-field/configuration-select-field.component.html (1)

10-11: LGTM! Consider simplifying the conditional logic.

While the styling changes are good, the visibility conditions are quite complex. Consider breaking down the conditions into more readable chunks or moving the logic to the component.

Example refactor:

// In the component
get showFirstSubLabel(): boolean {
  return !(this.exportConfigurationIconPath && this.appName === AppName.TRAVELPERK) && 
         (this.subLabel !== undefined || 
          !['reimbursableExportType', 'cccExportType', 'creditCardExportType'].includes(this.formControllerName));
}

Then in the template:

-<h5 *ngIf="!(exportConfigurationIconPath && appName === AppName.TRAVELPERK ) && (subLabel !== undefined|| (formControllerName !== 'reimbursableExportType' && formControllerName!=='cccExportType' && formControllerName !== 'creditCardExportType'))"
+<h5 *ngIf="showFirstSubLabel"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7ace0b4 and ca47680.

📒 Files selected for processing (21)
  • src/app/branding/c1-style-config.ts (2 hunks)
  • src/app/branding/fyle-style-config.ts (1 hunks)
  • src/app/integrations/business-central/business-central-shared/business-central-import-settings/business-central-import-settings.component.html (1 hunks)
  • src/app/integrations/intacct/intacct-main/intacct-export-log/intacct-completed-export-log/intacct-completed-export-log.component.ts (1 hunks)
  • src/app/integrations/qbd-direct/qbd-direct-shared/qbd-direct-import-settings/qbd-direct-import-settings.component.html (1 hunks)
  • src/app/integrations/qbo/qbo-shared/qbo-import-settings/qbo-import-settings.component.html (1 hunks)
  • src/app/shared/components/configuration/configuration-import-field/configuration-import-field.component.html (5 hunks)
  • src/app/shared/components/configuration/configuration-import-field/configuration-import-field.component.ts (2 hunks)
  • src/app/shared/components/configuration/configuration-multi-select/configuration-multi-select.component.html (1 hunks)
  • src/app/shared/components/configuration/configuration-multi-select/configuration-multi-select.component.ts (2 hunks)
  • src/app/shared/components/configuration/configuration-schedule-export/configuration-schedule-export.component.html (1 hunks)
  • src/app/shared/components/configuration/configuration-schedule-export/configuration-schedule-export.component.ts (2 hunks)
  • src/app/shared/components/configuration/configuration-select-field/configuration-select-field.component.html (1 hunks)
  • src/app/shared/components/configuration/configuration-select-field/configuration-select-field.component.ts (2 hunks)
  • src/app/shared/components/configuration/configuration-step-header/configuration-step-header.component.html (1 hunks)
  • src/app/shared/components/configuration/configuration-step-header/configuration-step-header.component.ts (2 hunks)
  • src/app/shared/components/configuration/configuration-text-field/configuration-text-field.component.html (1 hunks)
  • src/app/shared/components/configuration/configuration-text-field/configuration-text-field.component.ts (2 hunks)
  • src/app/shared/components/configuration/configuration-toggle-field/configuration-toggle-field.component.html (1 hunks)
  • src/app/shared/components/configuration/configuration-toggle-field/configuration-toggle-field.component.ts (2 hunks)
  • src/app/shared/components/dashboard/dashboard-error-section/dashboard-error-section.component.html (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/app/integrations/intacct/intacct-main/intacct-export-log/intacct-completed-export-log/intacct-completed-export-log.component.ts
🔇 Additional comments (23)
src/app/shared/components/configuration/configuration-select-field/configuration-select-field.component.ts (1)

14-14: LGTM! Clean implementation of branding style.

The addition of brandingStyle import and readonly property follows good practices for maintaining consistent branding across the application.

Also applies to: 116-116

src/app/shared/components/configuration/configuration-text-field/configuration-text-field.component.ts (1)

3-3: LGTM! Changes align with standardization effort.

The addition of brandingStyle import and property follows the consistent pattern being implemented across components for standardized styling.

Also applies to: 28-29

src/app/branding/c1-style-config.ts (1)

11-26: LGTM! Style structure maintains consistency.

The new style properties mirror the structure in fyle-style-config.ts while appropriately customizing values for C1 branding. This consistent structure across different branding configurations improves maintainability.

src/app/shared/components/configuration/configuration-step-header/configuration-step-header.component.ts (1)

2-2: LGTM! Consistent implementation of branding styles.

The addition of brandingStyle follows the established pattern and maintains consistency with other branding-related properties in the component.

Also applies to: 33-34

src/app/shared/components/configuration/configuration-schedule-export/configuration-schedule-export.component.ts (1)

3-3: LGTM! Clean implementation of branding style.

The addition of brandingStyle aligns with the PR's objective to standardize styling approach.

Also applies to: 42-43

src/app/shared/components/configuration/configuration-toggle-field/configuration-toggle-field.component.ts (1)

3-3: LGTM! Consistent implementation of branding style.

The addition of brandingStyle follows the same pattern as other branding configurations in the component.

Also applies to: 48-49

src/app/shared/components/configuration/configuration-multi-select/configuration-multi-select.component.ts (1)

4-4: LGTM! Clean implementation of branding style.

The addition of brandingStyle is consistent with other components.

Also applies to: 46-47

src/app/shared/components/configuration/configuration-import-field/configuration-import-field.component.ts (1)

3-3: LGTM! Clean implementation of branding style.

The addition of brandingStyle is consistent with other components and doesn't impact the existing import field logic.

Also applies to: 113-114

src/app/shared/components/configuration/configuration-text-field/configuration-text-field.component.html (1)

11-12: LGTM! Improved styling consistency for password toggle icons.

The change simplifies the styling logic by using a centralized branding class instead of conditional styling, making it more maintainable while preserving the toggle functionality.

src/app/shared/components/configuration/configuration-toggle-field/configuration-toggle-field.component.html (1)

11-11: LGTM! Consistent styling for input label text.

The change appropriately uses the centralized brandingStyle for label text styling, improving maintainability.

src/app/shared/components/configuration/configuration-step-header/configuration-step-header.component.html (1)

6-6: LGTM! Semantic styling for configuration step header.

Good use of semantically named styling from brandingStyle.configurationComponents, making the code's intent clear.

src/app/shared/components/configuration/configuration-multi-select/configuration-multi-select.component.html (1)

8-8: LGTM! Consistent sub-label styling.

The change maintains consistency by using the same inputLabelTextStyle as other components.

src/app/shared/components/configuration/configuration-schedule-export/configuration-schedule-export.component.html (1)

40-40: LGTM! Simplified dropdown icon styling.

The change effectively replaces complex conditional logic with a centralized branding class, maintaining consistency with other components.

src/app/integrations/business-central/business-central-shared/business-central-import-settings/business-central-import-settings.component.html (1)

29-31: LGTM! Good improvement in styling consistency.

The change from conditional class binding to using brandingStyle.common.inputLabelTextStyle aligns well with the goal of standardizing styles across the application.

src/app/integrations/qbd-direct/qbd-direct-shared/qbd-direct-import-settings/qbd-direct-import-settings.component.html (1)

29-31: LGTM! Consistent implementation of branding style.

The change maintains styling consistency across components while properly utilizing the branding content for labels.

src/app/integrations/qbo/qbo-shared/qbo-import-settings/qbo-import-settings.component.html (1)

29-31: LGTM! Maintains consistency with other import settings components.

The implementation follows the same pattern as other components, ensuring a unified styling approach.

src/app/shared/components/dashboard/dashboard-error-section/dashboard-error-section.component.html (1)

27-29: LGTM! Excellent standardization of error resolution button styles.

All error resolution buttons now consistently use brandingStyle.dashboard.dashboardErrorResolveBtnText, ensuring uniform appearance across different error types.

Also applies to: 51-53, 92-94

src/app/shared/components/configuration/configuration-import-field/configuration-import-field.component.html (6)

44-44: LGTM! Improved styling maintainability.

The change from conditional class binding to using brandingStyle.common.inputLabelTextStyle aligns with the standardization effort and improves maintainability.


77-77: LGTM! Proper component-specific style organization.

The use of brandingStyle.configurationComponents.configurationImportSvgPadding follows good organization practices by keeping component-specific styles in a dedicated namespace.


104-105: LGTM! Clear separation of concerns in styling.

The changes maintain a clear distinction between component-specific and common styles while preserving the conditional rendering logic.


125-125: LGTM! Consistent styling for dependent field elements.

The changes maintain styling consistency across dependent field UI elements while properly organizing them under component-specific paths.

Also applies to: 128-128, 132-132


147-147: LGTM! Appropriate use of common styling.

The use of brandingStyle.common.configurationBrandingClass is appropriate for this Sage300-specific section, as the styling might be shared across similar configuration sections.


44-44: Verify the existence of all brandingStyle properties.

While the changes look good, let's verify that all the required brandingStyle properties exist in the component:

Also applies to: 77-77, 104-105, 125-125, 128-128, 132-132, 147-147

✅ Verification successful

All brandingStyle properties are verified and exist in the codebase

The properties are used consistently across multiple components, following the established patterns for both common and configuration-specific styling.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for the brandingStyle property definition and its interface/type
ast-grep --pattern 'readonly brandingStyle'

# Search for the properties being used
echo "Searching for brandingStyle properties usage..."
properties=(
  "common.inputLabelTextStyle"
  "configurationComponents.configurationImportSvgPadding"
  "configurationComponents.configurationImportFieldDependentField"
  "common.configurationBrandingClass"
  "configurationComponents.configurationImportFieldDropDownText"
  "configurationComponents.configurationImportFieldDependentFieldSvg"
)

for prop in "${properties[@]}"; do
  echo "Searching for: $prop"
  rg "brandingStyle\.$prop" -A 2
done

Length of output: 16025

@@ -1,4 +1,5 @@
import { BrandingConfiguration } from "../core/models/branding/branding-configuration.model";
import { configuration } from "../integrations/intacct/intacct.fixture";
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Remove unused import.

The import of configuration from intacct.fixture appears to be unused in this file.

-import { configuration } from "../integrations/intacct/intacct.fixture";

@DhaaraniCIT DhaaraniCIT changed the title feat: converting condition style in ngStyle to a common branding style feat: Refactor conditional styles in conguration componets to common branding styles Jan 28, 2025
@DhaaraniCIT
Copy link
Contributor Author

We are done with the converting all the style based on branding to a common branding style. This is the last PR for style

Comment on lines 19 to 23
configurationImportSvgPadding: 'tw-pt-16-px',
configurationImportFieldDependentField: 'tw-pr-24-px tw-pl-[58px]',
configurationImportFieldDependentFieldSvg: 'tw-pt-42-px',
configurationImportFieldDropDownText: '!tw-font-600 tw-text-12-px',
configurationStepHeaderH3Text: 'tw-text-18-px'
Copy link
Contributor

Choose a reason for hiding this comment

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

"configuration" is not required

},
mapping: {
mappingHeaderBoxShadow: 'tw-shadow-shadow-level-1'
},
configurationComponents: {
Copy link
Contributor

Choose a reason for hiding this comment

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

just configuration should do, "components" not required

Copy link

Unit Test Coverage % values
Statements 33.01% ( 4159 / 12597 )
Branches 26.39% ( 1174 / 4448 )
Functions 25.65% ( 895 / 3489 )
Lines 33.18% ( 4091 / 12328 )

@DhaaraniCIT DhaaraniCIT merged commit dac3bf2 into branding-css Jan 29, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Medium PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants