Skip to content

Conversation

@vignesh05904
Copy link
Contributor

@vignesh05904 vignesh05904 commented Jul 29, 2025

Description

theme upgrade to primeng_18

Clickup

https://app.clickup.com/1864988/v/l/li/901607316229

Summary by CodeRabbit

  • New Features

    • Upgraded PrimeNG to the latest version and added new theme support.
    • Enabled asynchronous animations and explicit theming options.
  • Refactor

    • Replaced all dropdown components with select components across the application for improved consistency and compatibility.
    • Updated toggle and chips components to their latest equivalents.
    • Updated related CSS and SCSS selectors to match new component class names.
  • Bug Fixes

    • Improved multi-value input handling with enhanced chip entry and management.
  • Chores

    • Removed outdated PrimeNG styles and updated dependencies for better maintainability.

@vignesh05904 vignesh05904 requested a review from ashwin1111 as a code owner July 29, 2025 16:18
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 29, 2025

Walkthrough

This update systematically migrates the codebase from using PrimeNG's Dropdown and InputSwitch components to the newer Select and ToggleSwitch components. All related HTML templates, TypeScript imports, CSS/SCSS selectors, and Storybook stories are updated accordingly. PrimeNG dependencies are upgraded, and theming and animation configurations are made explicit in the Angular module setup. Additional logic is introduced to manually handle chip input in forms where component APIs have changed.

Changes

Cohort / File(s) Change Summary
PrimeNG Dependency and Theming Updates
package.json, angular.json, src/app/app.module.ts, src/app/app.component.ts
Upgrades primeng to v18, adds @primeng/themes, removes old CSS includes, and configures theming/animations explicitly. Updates PrimeNG config usage in app component.
Component Migration: Dropdown → Select
src/app/**/*.html, src/app/**/*.ts, src/app/**/*.scss, src/app/**/*.module.ts, src/app/shared/shared.module.ts, src/stories/*.ts
Replaces all instances of <p-dropdown> with <p-select>, updates imports from DropdownModule to SelectModule, and adjusts related TypeScript and Storybook files.
Component Migration: InputSwitch → ToggleSwitch
src/app/**/*.module.ts, src/app/shared/shared.module.ts, src/stories/*.ts
Replaces InputSwitchModule with ToggleSwitchModule in imports and module arrays.
Component Migration: Chips → AutoComplete
src/app/shared/components/configuration/configuration-skip-export/configuration-skip-export.component.html, src/app/shared/components/si/helper/skip-export/skip-export.component.html, src/app/shared/shared.module.ts
Replaces <p-chips> with <p-autocomplete> for multi-value input fields. Updates module imports accordingly.
Manual Chip Input Handling
src/app/shared/components/configuration/configuration-skip-export/configuration-skip-export.component.ts, src/app/shared/components/si/helper/skip-export/skip-export.component.ts
Adds methods for handling chip entry via keyboard and blur events, replacing previous component API features.
CSS/SCSS Selector Updates
src/assets/scss/*.scss, src/app/**/*.scss, src/styles.scss
Updates all selectors from .p-dropdown, .p-dropdown-*, .p-chips* to .p-select, .p-select-*, .p-autocomplete* to match new component class names.
Type/Import Adjustments for Filter/Options
src/app/integrations/bamboo-hr/configuration/configuration.component.ts, src/app/shared/components/configuration/email-multi-select-field/email-multi-select-field.component.ts, src/app/shared/components/helper/mapping/generic-mapping-table/generic-mapping-table.component.ts
Updates types and imports from DropdownFilterOptions to SelectFilterOptions to align with new Select component API.
Other Minor Adjustments
src/app/shared/components/input/dropdown/dropdown.component.ts, src/app/shared/components/onboarding/clone-setting/clone-setting-field/clone-setting-field.component.html
Changes component selectors and template tags to match new naming conventions.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AngularComponent
    participant PrimeNGSelect
    participant FormControl
    participant ManualChipHandler

    User->>AngularComponent: Interacts with <p-select> (was <p-dropdown>)
    AngularComponent->>PrimeNGSelect: Binds options, handles selection
    PrimeNGSelect-->>AngularComponent: Emits selection event
    AngularComponent->>FormControl: Updates form value

    User->>ManualChipHandler: Types value, presses comma/Enter or blurs field
    ManualChipHandler->>FormControl: Adds chip value to form array
    ManualChipHandler->>InputElement: Clears input
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15–25 minutes

Poem

Oh, what a hop from dropdown to select,
With toggles that gleam and chips to collect!
CSS classes pruned, imports anew,
PrimeNG’s fresh style, a sparkling view.
A bunny’s delight in code so neat—
This migration’s done, and now: time for a treat! 🥕✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch theme_to_primeng-18

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @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.

@vignesh05904 vignesh05904 changed the base branch from master to prime-ng-theme July 29, 2025 16:19
@vignesh05904 vignesh05904 removed the request for review from ashwin1111 July 29, 2025 16:19
@github-actions github-actions bot added the size/L Large PR label Jul 29, 2025
@github-actions
Copy link

🔁 Code Duplication Report - Angular

Format Files analyzed Total lines Total tokens Clones found Duplicated lines Duplicated tokens
typescript 730 53348 479070 318 5263 (9.87%) -0.23% 🚀 49460 (10.32%) -0.15% 🚀
scss 78 4574 26909 8 152 (3.32%) -0.12% 🚀 833 (3.10%) -0.31% 🚀
markup 295 12768 134663 158 1631 (12.77%) -0.05% 🚀 14493 (10.76%) -0.01% 🚀
python 4 727 5680 3 32 (4.40%) 368 (6.48%)
yaml 3 155 905 0 0 (0.00%) 0 (0.00%)
javascript 4 193 2175 0 0 (0.00%) 0 (0.00%)
markdown 11 2025 12147 0 0 (0.00%) 0 (0.00%)
bash 2 66 762 0 0 (0.00%) 0 (0.00%)
Total: 1127 73856 662311 487 7078 (9.58%) -0.48% 🚀 65154 (9.84%) -0.34% 🚀

🎉 This PR reduces duplicated code by 0.34%!

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: 8

🔭 Outside diff range comments (4)
src/app/shared/components/input/dropdown/dropdown.component.ts (1)

5-9: Inconsistent naming between selector and component class.

The selector has been updated to app-select but the component class remains DropdownComponent, and the template/style file paths still reference dropdown.component.*. This creates naming inconsistency that could confuse developers.

Consider renaming the component class and files for consistency:

-export class DropdownComponent {
+export class SelectComponent {

Also consider renaming the files:

  • dropdown.component.htmlselect.component.html
  • dropdown.component.scssselect.component.scss

And update the component decorator accordingly:

@Component({
  selector: 'app-select',
-  templateUrl: './dropdown.component.html',
-  styleUrls: ['./dropdown.component.scss']
+  templateUrl: './select.component.html',
+  styleUrls: ['./select.component.scss']
})
src/app/shared/components/menu/main-menu/main-menu.component.ts (1)

78-78: Remove invalid .clear() call on PrimeNG Select component

The PrimeNG <p-select> component does not expose a clear() method. You have two options to restore the intended “clear” behavior:

• Replace imperatively clearing with a model reset

  • File: src/app/shared/components/menu/main-menu/main-menu.component.ts
    Line: ~78
  • Remove:
    this.pDropdown()?.clear();
  • Add (for template-driven or reactive forms):
    // If using NgModel
    this.selectedValue = null;
    
    // Or if using a FormControl
    this.myForm.get('selectControl')?.setValue(null);
  • In your template, enable the clear icon:
    <p-select
      [options]="dropdownOptions"
      [(ngModel)]="selectedValue"
      [showClear]="true">
    </p-select>

• Or switch to the PrimeNG Dropdown component

  • Update your ViewChild to import and reference Dropdown from 'primeng/dropdown'
  • Use @ViewChild(Dropdown) and then this.pDropdown?.clear() will work as expected.

Please choose the approach that best fits your use case.

src/app/shared/components/helper/mapping/generic-mapping-table/generic-mapping-table.component.html (1)

18-30: Replace invalid resetFilter() call in p-select

The resetFilter() method no longer exists on PrimeNG v18’s <p-select> and will throw at runtime. You’ll need to remove that handler and use the officially supported clear mechanism.

• File: src/app/shared/components/helper/mapping/generic-mapping-table/generic-mapping-table.component.html
– Remove line 28:
(onFocus)="destinationAttributes.resetFilter()"
– Add [showClear]="true" to your <p-select> tag to expose a clear icon that resets both the selection and the filter input.
– If you still need to auto-clear the filter when the panel opens, you can use an (onShow) workaround (undocumented):
(onShow)="destinationAttributes.filterValue = ''"

<p-select #destinationAttributes
    appendTo="body"
    (onShow)="tableDropdownWidth()"
-   (onFocus)="destinationAttributes.resetFilter()"
+   [showClear]="true"
    [ngModel]="getDropdownValue(mapping)"
    [options]="destinationOptions"
    …>

After making this change, please smoke-test the dropdown to confirm filtering and clear behavior.

src/app/shared/components/helper/mapping/mapping-filter/mapping-filter.component.html (1)

10-20: Inconsistent i18n key namespace – violates component-level guideline

Most strings in this template use the mappingFilter.* namespace, but the select’s placeholder uses mapping.filterPlaceholder. Guidelines require a single top-level object per component; mixing mapping and mappingFilter breaks that rule and complicates translation maintenance.

Rename the key (and update translation files) so that all keys live under mappingFilter.

- [placeholder]="'mapping.filterPlaceholder' | transloco"
+ [placeholder]="'mappingFilter.filterPlaceholder' | transloco"
♻️ Duplicate comments (5)
src/app/shared/components/si/helper/dashboard-mapping-resolve/dashboard-mapping-resolve.component.html (1)

40-47: Duplicate of previous event-API concern

The employee mapping select uses the same (onShow) output; audit and update as above.

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

133-142: Duplicate selector issue already raised

Same nested-selector pattern (.p-select-label .p-placeholder .p-select-trigger) as in the mapping-fields stylesheet – once fixed there, consider applying a shared mixin/utility to avoid drift.

src/app/shared/components/menu/main-menu/main-menu.component.scss (1)

11-13: Duplicate selector issue

The nested selector chain suffers from the same DOM-mismatch highlighted in configuration-mapping-fields.component.scss. Please adjust accordingly.

src/app/shared/components/configuration/configuration-select-field/configuration-select-field.component.scss (1)

49-63: Duplicate selector issue

Same over-specific selector; see earlier comment for suggested correction.

src/app/shared/components/si/helper/skip-export/skip-export.component.html (1)

119-131: Same form-API mixup for the second condition

Replicate the fix applied to the first autocomplete.

🧹 Nitpick comments (17)
src/app/integrations/intacct/intacct-shared/intacct-import-settings/intacct-import-settings.component.ts (1)

460-461: Method name is now misleading—consider renaming to match <p-select> usage

Only the comment was updated, but the handler is still called onDropdownChange, which can confuse future readers now that the UI element is a <p-select>.
Renaming the method (and its template binding) to onSelectChange keeps the code self-describing.

src/app/shared/components/menu/main-menu/main-menu.component.ts (1)

45-45: Consider renaming property for clarity.

The ViewChild has been correctly updated to use Select, but the property name pDropdown is now misleading since it references a Select component.

-private pDropdown = viewChild(Select);
+private pSelect = viewChild(Select);

And update the usage on line 78:

-this.pDropdown()?.clear();
+this.pSelect()?.clear();
src/app/shared/components/helper/paginator/paginator.component.scss (2)

1-3: Consider reducing reliance on ::ng-deep for long-term maintainability

::ng-deep is already deprecated and may be removed in future Angular versions. Whenever possible, migrate these deep selectors to:

• A global stylesheet (e.g. styles.scss)
• An explicit host class exported by the component

This keeps style encapsulation intact and avoids future breakage.


13-15: Hard-coded right-padding may truncate long labels

The tw-pr-10-px utility forces a fixed padding on the selected label. If labels can be longer in certain locales (i18n) this may clip text when combined with the fixed width in line 2. Consider using tw-pr-xx only when truncation is acceptable or switch to tw-pr- with responsive breakpoints.

src/stories/CloneSettingField.stories.ts (1)

30-30: Import array ordering – move heavy modules last for faster HMR

Placing BrowserAnimationsModule and SharedModule before feature modules lets Storybook’s module federation tree-shake unused PrimeNG code faster. Minor but free perf win.

src/app/integrations/qbd/qbd-main/qbd-mapping/qbd-generic-mapping/qbd-generic-mapping.component.scss (1)

6-16: Avoid relying on ::ng-deep – consider a safer scoping strategy

::ng-deep is deprecated and may be removed in future Angular versions. Relying on it for all PrimeNG-specific overrides jeopardises forward-compatibility and leaks styles globally. Prefer one of:

  1. Move these rules to a global stylesheet (e.g. src/styles.scss) and drop ::ng-deep.
  2. Wrap the overrides with the new :host-context() selector if the styles must stay component-scoped.
  3. Leverage PrimeNG’s style APIs (CSS variables, theming) to avoid deep selectors altogether.

Upgrading to PrimeNG 18 is a good moment to pay this debt down.

src/app/integrations/netsuite/netsuite-shared/netsuite-import-settings/netsuite-custom-segment-dialog/netsuite-custom-segment-dialog.component.scss (1)

1-20: Same ::ng-deep caveat applies here

::ng-deep is again used for every .p-select override. Consider migrating to a safer scoping strategy (global stylesheet, :host-context, or PrimeNG theme variables) to avoid future breakage.

src/app/shared/components/si/helper/dashboard-mapping-resolve/dashboard-mapping-resolve.component.ts (1)

48-50: DOM query selector is brittle after component rename

The hard-coded selector .p-select-panel.p-component.ng-star-inserted assumes PrimeNG’s internal class names and that the overlay is already in the DOM at method call time. Any future CSS class change or timing issue will silently break the width adjustment.

Consider subscribing to onShow from p-select, and use the overlay element passed in the callback instead of document.querySelector, or use PrimeNG’s OverlayService to obtain the panel reference.

-const element = document.querySelector('.p-select-panel.p-component.ng-star-inserted') as HTMLElement;
+const overlay = event?.overlay as HTMLElement; // triggered via (onShow)
+if (overlay) {
+  overlay.style.width = '300px';
+}
src/app/shared/components/onboarding/clone-setting/clone-setting-field/clone-setting-field.component.html (1)

11-20: Align enum terminology with the new component name

The template now renders <app-select> but still checks for InputType.DROPDOWN. Keeping the old enum label after the migration is a small cognitive mismatch and can trip up future readers.

- *ngIf="inputType === InputType.DROPDOWN"
+ *ngIf="inputType === InputType.SELECT"

(or rename the enum value itself) – either way, tidying up the naming keeps intent crystal-clear.

src/styles.scss (1)

77-85: Keep legacy selector until full rollout is confirmed

The icon override now targets .p-select-trigger. If any screens still render a legacy .p-dropdown-trigger (e.g. in unfinished feature flags) the chevron will disappear. Consider a short-lived transition rule that covers both classes:

.p-dropdown-trigger,
.p-select-trigger { … }

Remove once the migration is 100 % rolled out.

src/app/shared/components/input/dropdown/dropdown.component.scss (1)

1-48: File/component naming is now misleading

All style rules moved to .p-select, yet the component is still called dropdown. A simple rename to select.component.* (class, selector & folder) will prevent future confusion and improve searchability.

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

25-41: Avoid binding a constant string to optionLabel

[optionLabel]="'value'" incurs the cost of change-detection with zero benefit.
Use a plain attribute instead:

-<p-select appendTo="body" [options]="accountingCompanyList" [optionLabel]="'value'" 
+<p-select appendTo="body" [options]="accountingCompanyList" optionLabel="value"

Same applies to every other p-select instance that binds a hard-coded string.

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

78-80: Static optionLabel / optionValue should be literal attributes

Multiple p-select tags bind a constant string:

[p-select ...] [optionLabel]="'display_name'"

Prefer plain attributes to cut unnecessary bindings:

- [optionLabel]="'display_name'"
+ optionLabel="display_name"

Apply to every occurrence in this template (tax group, Sage Intacct fields, Fyle fields, cost code/type selectors).

Also applies to: 106-108, 116-118, 134-135, 155-165, 174-182

src/app/shared/components/helper/mapping/generic-mapping-table/generic-mapping-table.component.ts (1)

100-110: Accessing internal PrimeNG DOM structure is brittle

Hard-coding .p-select-panel.p-component.ng-star-inserted couples the app to PrimeNG’s private markup. Minor library updates can silently break this selector.

Prefer the onShow output of <p-select> with a template reference variable, or overlayService events, to obtain the panel element without query-selecting internal class names.

At minimum, drop the .ng-star-inserted class from the selector:

-const element = document.querySelector('.p-select-panel.p-component.ng-star-inserted') as HTMLElement;
+const element = document.querySelector('.p-select-panel.p-component') as HTMLElement;
src/app/shared/components/configuration/configuration-mapping-fields/configuration-mapping-fields.component.scss (1)

5-19: Over-specific selector is likely ineffective with the new p-select DOM

p-select renders .p-select-label and .p-select-trigger as siblings inside the root .p-select.
The selector chain .p-select .p-select-label .p-placeholder .p-select-trigger assumes the trigger sits inside the placeholder element, which is no longer true and therefore never matches.

-:host ::ng-deep .p-select .p-select-label .p-placeholder .p-select-trigger { … }
+:host ::ng-deep .p-select.p-placeholder .p-select-trigger { … }

Same pattern is repeated in the file for hidden/visible chevron rules – consider revising all of them to match the actual markup to avoid bloated CSS and broken visuals.

src/app/shared/components/si/helper/skip-export/skip-export.component.html (1)

63-65: Minor: empty body tag

The closing </p-select> tag is on the next line but has no template body; consider self-closing <p-select ... /> to keep markup terse.

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

341-350: Consider improving type safety and event handling.

The keyboard event handling logic is correct, but there are opportunities for improvement:

  1. Use more specific TypeScript types instead of any
  2. Add null checks for target element
  3. Consider extracting the key list to a constant
+ private readonly CHIP_SEPARATOR_KEYS = [',', 'Enter'] as const;
+
- onKeyDown(event: any, fieldNumber: number): void {
+ onKeyDown(event: KeyboardEvent, fieldNumber: number): void {
-   const keyboardEvent = event as KeyboardEvent;
-   const target = keyboardEvent.target as HTMLInputElement;
+   const target = event.target as HTMLInputElement;
+   if (!target) return;
+   
-   if ((keyboardEvent.key === ',' || keyboardEvent.key === 'Enter') && target.value.trim()) {
+   if (this.CHIP_SEPARATOR_KEYS.includes(event.key as any) && target.value.trim()) {
-     keyboardEvent.preventDefault();
+     event.preventDefault();
      this.addChip(target.value.trim(), target, fieldNumber);
    }
  }

Comment on lines +48 to +57
provideAnimationsAsync(),
providePrimeNG({
theme: {
preset: Lara,
options: {
darkModeSelector: false,
cssLayer: false,
},
}
}),
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

Fix trailing comma ESLint violations.

The PrimeNG configuration is functionally correct, but there are trailing comma issues that need to be resolved.

Apply this diff to fix the linting errors:

         providePrimeNG({
             theme: {
                 preset: Lara,
                 options: {
                     darkModeSelector: false,
-                    cssLayer: false,
-                    },
-                }
+                    cssLayer: false
+                    }
+                }
         }),
📝 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
provideAnimationsAsync(),
providePrimeNG({
theme: {
preset: Lara,
options: {
darkModeSelector: false,
cssLayer: false,
},
}
}),
provideAnimationsAsync(),
providePrimeNG({
theme: {
preset: Lara,
options: {
darkModeSelector: false,
cssLayer: false
}
}
}),
🧰 Tools
🪛 GitHub Check: lint

[failure] 55-55:
Unexpected trailing comma


[failure] 54-54:
Unexpected trailing comma

🪛 GitHub Actions: TypeScript Lint Check

[error] 54-54: ESLint: Unexpected trailing comma (comma-dangle)

🤖 Prompt for AI Agents
In src/app/app.module.ts between lines 48 and 57, remove the trailing commas
after the last properties in the PrimeNG configuration object to fix ESLint
trailing comma violations. Ensure that no comma follows the last item in each
nested object or array within the providePrimeNG call.

Comment on lines +81 to 92
:host ::ng-deep .selectedItem .p-select-trigger, :host ::ng-deep .selectedAccItem .p-select-trigger{
@apply tw-hidden #{!important};
}

:host ::ng-deep .selectedAccItem .p-dropdown.p-disabled {
:host ::ng-deep .selectedAccItem .p-select.p-disabled {
@apply tw-bg-input-read-only-bg tw-opacity-100 tw-border tw-border-input-read-only-border #{!important}
}

:host ::ng-deep .selectedAccItem .p-dropdown.p-disabled .p-dropdown-label {
:host ::ng-deep .selectedAccItem .p-select.p-disabled .p-select-label {
@apply tw-text-input-read-only-text #{!important};
}

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

Selector change may miss the trigger element

p-select renders the caret inside .p-select-trigger inside the .p-select.
The previous rule hid .p-dropdown-trigger; the updated rule tries to hide .p-select-trigger, but the extra descendant space (.selectedItem .p-select-trigger) and the absence of the parent .p-select level can break specificity.

-:host ::ng-deep .selectedItem  .p-select-trigger
+:host ::ng-deep .selectedItem .p-select .p-select-trigger

Tighten the selector to guarantee the trigger stays hidden for the selected rows.

📝 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
:host ::ng-deep .selectedItem .p-select-trigger, :host ::ng-deep .selectedAccItem .p-select-trigger{
@apply tw-hidden #{!important};
}
:host ::ng-deep .selectedAccItem .p-dropdown.p-disabled {
:host ::ng-deep .selectedAccItem .p-select.p-disabled {
@apply tw-bg-input-read-only-bg tw-opacity-100 tw-border tw-border-input-read-only-border #{!important}
}
:host ::ng-deep .selectedAccItem .p-dropdown.p-disabled .p-dropdown-label {
:host ::ng-deep .selectedAccItem .p-select.p-disabled .p-select-label {
@apply tw-text-input-read-only-text #{!important};
}
:host ::ng-deep .selectedItem .p-select .p-select-trigger, :host ::ng-deep .selectedAccItem .p-select-trigger {
@apply tw-hidden #{!important};
}
:host ::ng-deep .selectedAccItem .p-select.p-disabled {
@apply tw-bg-input-read-only-bg tw-opacity-100 tw-border tw-border-input-read-only-border #{!important}
}
:host ::ng-deep .selectedAccItem .p-select.p-disabled .p-select-label {
@apply tw-text-input-read-only-text #{!important};
}
🤖 Prompt for AI Agents
In
src/app/shared/components/configuration/configuration-import-field/configuration-import-field.component.scss
between lines 81 and 92, the CSS selector for hiding the trigger element is too
loose and misses the parent .p-select level, which can cause the trigger to
remain visible. Update the selector to include the .p-select parent before
.p-select-trigger, removing the extra descendant space, to ensure the trigger
element is properly targeted and hidden for selected rows.

Comment on lines +352 to +358
onBlur(event: any, fieldNumber: number): void {
const target = event.target as HTMLInputElement;
// Replaces [addOnBlur]="true" functionality
if (target.value.trim()) {
this.addChip(target.value.trim(), target, fieldNumber);
}
}
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

Add null safety check for the target element.

The blur event handler should include a null check to prevent potential runtime errors.

- onBlur(event: any, fieldNumber: number): void {
+ onBlur(event: FocusEvent, fieldNumber: number): void {
    const target = event.target as HTMLInputElement;
+   if (!target) return;
+   
    // Replaces [addOnBlur]="true" functionality
    if (target.value.trim()) {
      this.addChip(target.value.trim(), target, fieldNumber);
    }
  }
📝 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
onBlur(event: any, fieldNumber: number): void {
const target = event.target as HTMLInputElement;
// Replaces [addOnBlur]="true" functionality
if (target.value.trim()) {
this.addChip(target.value.trim(), target, fieldNumber);
}
}
onBlur(event: FocusEvent, fieldNumber: number): void {
const target = event.target as HTMLInputElement;
if (!target) return;
// Replaces [addOnBlur]="true" functionality
if (target.value.trim()) {
this.addChip(target.value.trim(), target, fieldNumber);
}
}
🤖 Prompt for AI Agents
In
src/app/shared/components/configuration/configuration-skip-export/configuration-skip-export.component.ts
around lines 352 to 358, add a null safety check for the target element in the
onBlur method to prevent runtime errors. Before accessing target.value, verify
that event.target is not null or undefined, and only proceed if it is valid.
This ensures the method safely handles cases where the event target might be
missing.

Comment on lines +360 to +370
private addChip(value: string, inputElement: HTMLInputElement, fieldNumber: number): void {
const formControlName = fieldNumber === 1 ? 'value1' : 'value2';
const currentValues = this.skipExportForm.get(formControlName)?.value || [];

// Avoid duplicates
if (!currentValues.includes(value)) {
const newValues = [...currentValues, value];
this.skipExportForm.get(formControlName)?.setValue(newValues);
inputElement.value = ''; // Clear input after adding
}
}
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

Add error handling and validation for form control operations.

The addChip method should include error handling for form control operations and input validation.

  private addChip(value: string, inputElement: HTMLInputElement, fieldNumber: number): void {
+   if (!value || !inputElement) return;
+   
    const formControlName = fieldNumber === 1 ? 'value1' : 'value2';
-   const currentValues = this.skipExportForm.get(formControlName)?.value || [];
+   const formControl = this.skipExportForm.get(formControlName);
+   if (!formControl) return;
+   
+   const currentValues = formControl.value || [];

    // Avoid duplicates
    if (!currentValues.includes(value)) {
      const newValues = [...currentValues, value];
-     this.skipExportForm.get(formControlName)?.setValue(newValues);
+     formControl.setValue(newValues);
      inputElement.value = ''; // Clear input after adding
    }
  }
📝 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
private addChip(value: string, inputElement: HTMLInputElement, fieldNumber: number): void {
const formControlName = fieldNumber === 1 ? 'value1' : 'value2';
const currentValues = this.skipExportForm.get(formControlName)?.value || [];
// Avoid duplicates
if (!currentValues.includes(value)) {
const newValues = [...currentValues, value];
this.skipExportForm.get(formControlName)?.setValue(newValues);
inputElement.value = ''; // Clear input after adding
}
}
private addChip(value: string, inputElement: HTMLInputElement, fieldNumber: number): void {
if (!value || !inputElement) return;
const formControlName = fieldNumber === 1 ? 'value1' : 'value2';
const formControl = this.skipExportForm.get(formControlName);
if (!formControl) return;
const currentValues = formControl.value || [];
// Avoid duplicates
if (!currentValues.includes(value)) {
const newValues = [...currentValues, value];
formControl.setValue(newValues);
inputElement.value = ''; // Clear input after adding
}
}
🤖 Prompt for AI Agents
In
src/app/shared/components/configuration/configuration-skip-export/configuration-skip-export.component.ts
around lines 360 to 370, the addChip method lacks error handling and input
validation for form control operations. Add checks to ensure the form control
exists before accessing or setting its value, and validate the input value to
prevent adding empty or invalid entries. Include try-catch blocks or conditional
guards to handle potential errors gracefully during form control operations.

import { FormControl, FormGroup } from '@angular/forms';
import { TranslocoService } from '@jsverse/transloco';
import { DropdownFilterOptions } from 'primeng/dropdown';
import { SelectFilterOptions } from 'primeng/select';
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

SelectFilterOptions is imported but never used

This will raise a TypeScript unused-import error and break the build.

-import { SelectFilterOptions } from 'primeng/select';

Remove the import or wire it where it is actually required.

📝 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
import { SelectFilterOptions } from 'primeng/select';
🤖 Prompt for AI Agents
In
src/app/shared/components/helper/mapping/generic-mapping-table/generic-mapping-table.component.ts
at line 4, the import SelectFilterOptions from 'primeng/select' is not used
anywhere in the file. To fix the TypeScript unused-import error, remove this
import statement entirely from the file.

Comment on lines +36 to +37
<p-select appendTo="body" (onChange)="patchFormValue($event)" class="tw-pl-7" *ngIf="!locationEntity?.location_entity_name" [placeholder]="'intacctLocationEntity.selectLocationEntity' | transloco: { locationEntity: locationEntityLabel }" formControllerName="locationEntity" [options]="locationEntityOptions" optionLabel="value">
</p-select>
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

Typo – formControllerName should be formControlName

Angular’s reactive-forms directive is formControlName. The current typo prevents the control from registering, so validation and value updates will fail.

-<p-select … formControllerName="locationEntity" …>
+<p-select … formControlName="locationEntity" …>
🤖 Prompt for AI Agents
In
src/app/shared/components/si/core/intacct-location-entity/intacct-location-entity.component.html
at lines 36 to 37, the attribute formControllerName is incorrectly used instead
of formControlName. Replace formControllerName with formControlName to correctly
bind the form control, enabling proper validation and value updates in the
Angular reactive form.

Comment on lines +48 to 60
<p-autocomplete
[multiple]="true"
[typeahead]="false"
[forceSelection]="false"
styleClass="tw-w-[296px]"
[(ngModel)]="valueOption1"
formControlName="value1"
[placeholder]="'skipExport.enterValue' | transloco"
[suggestions]="[]"
(onKeyDown)="onKeyDown($event, 1)"
(onBlur)="onBlur($event, 1)">
</p-autocomplete>
<small class="chip-hint"><br>{{ 'skipExport.chipHint' | transloco }}</small>
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

ngModel and formControlName used together – this will throw NG0120

Angular prohibits using template-driven ([(ngModel)]) and reactive (formControlName) APIs on the same control. The new <p-autocomplete> has both:

[(ngModel)]="valueOption1" formControlName="value1"

At runtime the form will error and the control won’t behave predictably.

Suggested fix – drop ngModel and drive everything through the reactive form:

- [(ngModel)]="valueOption1"
+ (ngModelChange)="valueOption1 = $event" ngModelOptions="{standalone: true}"

or (preferred) remove ngModel entirely and patch the control inside addChip():

- [(ngModel)]="valueOption1"

Remember to update addChip() to this.skipExportForm.get('value1')?.setValue([...]).

🤖 Prompt for AI Agents
In src/app/shared/components/si/helper/skip-export/skip-export.component.html
lines 48 to 60, the <p-autocomplete> component incorrectly uses both [(ngModel)]
and formControlName on the same control, causing Angular NG0120 errors. To fix
this, remove the [(ngModel)] binding entirely and manage the form control value
exclusively through the reactive form. Update the addChip() method to patch the
form control value using this.skipExportForm.get('value1')?.setValue([...])
instead of modifying the ngModel variable.

Comment on lines +5 to 10
import { ToggleSwitchModule } from 'primeng/toggleswitch';
import { RadioButtonModule } from 'primeng/radiobutton';
import { ToastModule } from 'primeng/toast';
import { InputTextModule } from 'primeng/inputtext';
import { DropdownModule } from 'primeng/dropdown';
import { SelectModule } from 'primeng/select';
import { DialogModule } from 'primeng/dialog';
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

ToggleSwitchModule added but templates still use <p-inputSwitch> – build will break

All templates (e.g. intacct-import-settings.component.html lines 46, 60, 74, 139) still reference <p-inputSwitch>.
PrimeNG 18 replaces it with <p-toggleSwitch>. Either:

  1. Revert to InputSwitchModule or
  2. Rename every <p-inputSwitch> to <p-toggleSwitch> and adjust event names (onChangeonChange, API unchanged).

Failing to do so will cause a template compile error.

🤖 Prompt for AI Agents
In src/app/shared/shared.module.ts between lines 5 and 10, the code imports
ToggleSwitchModule but the templates still use the old <p-inputSwitch>
component, which will cause build errors. To fix this, either revert the import
to InputSwitchModule to match the existing template usage or update all template
files (e.g., intacct-import-settings.component.html lines 46, 60, 74, 139) to
replace <p-inputSwitch> with <p-toggleSwitch> and adjust any event bindings
accordingly. Ensure consistency between the imported module and the component
tags used in templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Large PR

Development

Successfully merging this pull request may close these issues.

1 participant