Skip to content

[NAE-2412] EnumerationMap, MultichoiceMap with 'caseref' component are editable on unassigned task#330

Open
SamuelPalaj wants to merge 5 commits into
release/6.5.0from
NAE-2412
Open

[NAE-2412] EnumerationMap, MultichoiceMap with 'caseref' component are editable on unassigned task#330
SamuelPalaj wants to merge 5 commits into
release/6.5.0from
NAE-2412

Conversation

@SamuelPalaj
Copy link
Copy Markdown
Contributor

@SamuelPalaj SamuelPalaj commented May 19, 2026

Description

  • added disabled property to task ref component
  • fixed behavior of task and case list components on unassigned task

Fixes NAE-2412

How Has Been This Tested?

manualy

Test Configuration

Name Tested on
OS windows 11
Runtime 20.19.0
Dependency Manager npm10.8.2
Framework version Angular 13.3
Run parameters
Other configuration

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes have been checked, personally or remotely, with @...
  • I have commented my code, particularly in hard-to-understand areas
  • I have resolved all conflicts with the target branch of the PR
  • I have updated and synced my code with the target branch
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes:
    • Lint test
    • Unit tests
    • Integration tests
  • I have checked my contribution with code analysis tools:
  • I have made corresponding changes to the documentation:
    • Developer documentation
    • User Guides
    • Migration Guides

Summary by CodeRabbit

  • New Features

    • Introduces configurable selection behavior (editable / visible / hidden) to headers, panels and lists.
    • Selection UI (checkboxes, radio buttons, enumeration controls) now shows or hides and can be disabled based on the configured selection behavior.
    • Components expose a disabled state that propagates to task panels, action buttons and pagination where applicable.
  • Bug Fixes

    • Removed a redundant disabled input from the case list paginator.

Review Change Stack

…e editable on unassigned task

- added disabled property to task ref component
- fixed behavior of task and case list components on unassigned task
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

Warning

Rate limit exceeded

@SamuelPalaj has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 38 minutes and 24 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: dec9efc3-f484-460c-b45a-9a7fced4af0f

📥 Commits

Reviewing files that changed from the base of the PR and between 2bd1f60 and 620478e.

📒 Files selected for processing (3)
  • projects/netgrif-components/src/lib/header/header-modes/edit-mode/edit-mode.component.html
  • projects/netgrif-components/src/lib/header/header-modes/search-mode/search-mode.component.html
  • projects/netgrif-components/src/lib/header/header-modes/sort-mode/sort-mode.component.html

Walkthrough

Adds a SelectionBehavior enum and showSelection inputs across headers, panels, and lists, introduces selection-mode helpers, reflows templates to pass showSelection, and propagates disabled state (including optional portal-data detection) to disable UI controls and pagination.

Changes

SelectionBehavior integration & disabled propagation

Layer / File(s) Summary
SelectionBehavior enum & public API
projects/netgrif-components-core/src/lib/panel/configuration/selection-behavior.ts, projects/netgrif-components-core/src/lib/panel/public-api.ts
Adds exported SelectionBehavior enum and re-exports it from the panel public API.
Header components adopt showSelection
projects/netgrif-components-core/src/lib/header/abstract-header.component.ts, projects/netgrif-components-core/src/lib/header/header-modes/abstract-header-mode.component.ts, projects/netgrif-components/src/lib/header/header.component.html
Abstract header and mode components replace approval with showSelection: SelectionBehavior, add isInSelectionMode() / isSelectionDisabled() helpers, and header template passes showSelection to mode components.
Header mode templates use selection helpers
projects/netgrif-components/src/lib/header/header-modes/edit-mode/edit-mode.component.html, projects/netgrif-components/src/lib/header/header-modes/search-mode/search-mode.component.html, projects/netgrif-components/src/lib/header/header-modes/sort-mode/sort-mode.component.html
Mode templates conditionally render selection controls via isInSelectionMode() and bind [disabled]="isSelectionDisabled()"; enumeration controls use mat-icon-button with disableRipple.
Case panel selection helpers
projects/netgrif-components-core/src/lib/panel/case-panel/abstract-case-panel.component.ts, projects/netgrif-components/src/lib/panel/case-panel/case-panel.component.html
AbstractCasePanelComponent now uses showSelection: SelectionBehavior and provides selection helper methods; case-panel template uses those helpers to render/disable approval controls.
Default case list & paginator integration
projects/netgrif-components-core/src/lib/view/case-view/components/default-case-list/abstract-default-case-list.component.ts, projects/netgrif-components/src/lib/view/case-view/components/case-list-paginator/case-list-paginator.component.html, projects/netgrif-components/src/lib/view/case-view/components/case-list/case-list.component.html
Default case list accepts showSelection and provides isSelectionDisabled(); paginator and case list templates pass showSelection and bind disabled to isSelectionDisabled() or disabled.
DefaultCaseRefListView selection resolver
projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component.ts, .../default-case-ref-list-view.component.html
Adds resolveSelectionBehavior() which returns a SelectionBehavior based on approval/disabled state; templates use it when invoking nc-header and nc-case-list-paginator.
Task view selection & portal-data disabled detection
projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component.ts, .../default-task-view.component.html
DefaultTaskView optionally injects DATA_FIELD_PORTAL_DATA and exposes disabled() to detect form-control disabled state; template passes [disabled]="disabled()" to task pagination.
DefaultTaskList adjustments and disabled input
projects/netgrif-components-core/src/lib/panel/task-panel-list/default-task-panel-list/abstract-default-task-list.component.ts
Adds @Input() disabled, updates RxJS imports (adds takeUntil), reworks subscriptions to use takeUntil, and guards expansion open/expand logic in onRedirect().
Templates pass showSelection and reflow
projects/netgrif-components/src/lib/header/header.component.html, projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component.html
Templates stop passing approval and instead pass showSelection (often via resolveSelectionBehavior()), and some bindings were reformatted/reflowed.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

Medium

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title directly addresses the main issue: making EnumerationMap and MultichoiceMap with caseref components editable on unassigned tasks, which is the core problem this changeset solves.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@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: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@projects/netgrif-components-core/src/lib/panel/task-panel-list/default-task-panel-list/abstract-default-task-list.component.ts`:
- Around line 106-122: Guard access to this.route and avoid the nested
subscription: only subscribe if this.route is present (e.g. check this.route !=
null), then replace the inner .subscribe on this._tasks$ with a pipe operator
(use switchMap or map + take(1)) so the tasks stream is consumed once (and add
takeUntil(this._unsubscribe$) on the outer chain to prevent leaks). When
resolving the panel ref, store const panelRef =
this._taskPanelRefs.get(this._redirectTaskId) and null-check it before calling
panelRef.open() or setting panelRef.expanded to avoid crashes if the ref isn't
registered yet; keep using this._unsubscribe$ for teardown.

In
`@projects/netgrif-components/src/lib/header/header-modes/edit-mode/edit-mode.component.html`:
- Around line 2-4: The enumeration control (mat-icon) invokes setValue() even
when the component is disabled; update the click handling to respect the
disabled flag so enumeration approvals aren't editable when disabled. Locate the
mat-icon with (click)="setValue();$event.stopPropagation();" and change its
handler to guard on the disabled property (for example: (click)="disabled ?
$event.stopPropagation() : (setValue(); $event.stopPropagation())") or
alternatively restrict rendering with *ngIf="approval && typeApproval ===
'enumeration' && !disabled" so setValue() is never called when disabled.

In
`@projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component.ts`:
- Around line 60-62: The disabled() method currently returns a possibly
undefined value due to optional chaining; update it so it always returns a
boolean by coercing the optional expression to boolean (e.g. using !! or
Boolean(...) or the nullish coalescing operator with false) when reading
this._dataFieldPortalData?.dataField?.formControlRef.disabled; keep the same
method name disabled and the same properties (_dataFieldPortalData, dataField,
formControlRef) but ensure the final returned value is a boolean.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e510ad99-2e9f-49c2-a2ae-98609372171b

📥 Commits

Reviewing files that changed from the base of the PR and between 5b46f21 and 4d1a638.

📒 Files selected for processing (19)
  • projects/netgrif-components-core/src/lib/header/abstract-header.component.ts
  • projects/netgrif-components-core/src/lib/header/header-modes/abstract-header-mode.component.ts
  • projects/netgrif-components-core/src/lib/panel/case-panel/abstract-case-panel.component.ts
  • projects/netgrif-components-core/src/lib/panel/task-panel-list/default-task-panel-list/abstract-default-task-list.component.ts
  • projects/netgrif-components-core/src/lib/panel/task-panel/abstract-task-panel.component.ts
  • projects/netgrif-components-core/src/lib/view/case-view/components/case-list-paginator/abstract-case-list-paginator.component.ts
  • projects/netgrif-components-core/src/lib/view/case-view/components/default-case-list/abstract-default-case-list.component.ts
  • projects/netgrif-components/src/lib/header/header-modes/edit-mode/edit-mode.component.html
  • projects/netgrif-components/src/lib/header/header-modes/search-mode/search-mode.component.html
  • projects/netgrif-components/src/lib/header/header-modes/sort-mode/sort-mode.component.html
  • projects/netgrif-components/src/lib/header/header.component.html
  • projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component.html
  • projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component.html
  • projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component.ts
  • projects/netgrif-components/src/lib/panel/case-panel/case-panel.component.html
  • projects/netgrif-components/src/lib/panel/task-panel-list-pagination/task-list-pagination.component.html
  • projects/netgrif-components/src/lib/panel/task-panel/task-panel.component.html
  • projects/netgrif-components/src/lib/view/case-view/components/case-list-paginator/case-list-paginator.component.html
  • projects/netgrif-components/src/lib/view/case-view/components/case-list/case-list.component.html
💤 Files with no reviewable changes (1)
  • projects/netgrif-components-core/src/lib/view/case-view/components/case-list-paginator/abstract-case-list-paginator.component.ts

Copy link
Copy Markdown
Contributor

@Kovy95 Kovy95 May 20, 2026

Choose a reason for hiding this comment

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

can we rename all "approval" properties to "showSelection"? it is more intuitive (my bad naming from previous implementation)

change type boolean to ENUM with 3 values - Editable, Visible, Hidden, default value hidden

@Input() showCasePanelIcon = true;
@Input() showDeleteMenu = false;
@Input() textEllipsis = false;
@Input() public disabled: boolean = false;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is replaced with enu, in previous comment

@Input() public indeterminate: boolean;
@Input() public approvalFormControl: FormControl;
@Input() public typeApproval: string;
@Input() public disabled: boolean = false;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

rename approval and rework to enum, and remove this disabled property

@Input() showSearchButton = true;
@Input() showTableSection = true;
@Input() public approval: boolean;
@Input() public disabled: boolean = false;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

rename approval and rework to enum, and remove this disabled property

<div fxLayout="row" fxFlex="100" fxLayoutAlign="start center" class="netgrif-input netgrif-header-input netgrif-input-fix netgrif-zero-field-wrapper">
<mat-checkbox *ngIf="approval && typeApproval === 'multichoice'" [formControl]="approvalFormControl" [indeterminate]="indeterminate"
(click)="$event.stopPropagation();" color='primary' class="checkbox-padding"></mat-checkbox>
(click)="$event.stopPropagation();" color='primary' class="checkbox-padding" [disabled]="disabled"></mat-checkbox>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

turn of the ripple if you change this to button

…e editable on unassigned task

- selection-behavior.ts enum added
- unification of disabled and approval flags into showSelection in case-list component of caseRef field
@coderabbitai coderabbitai Bot added the Medium label May 21, 2026
Copy link
Copy Markdown

@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: 3

♻️ Duplicate comments (1)
projects/netgrif-components-core/src/lib/panel/task-panel-list/default-task-panel-list/abstract-default-task-list.component.ts (1)

105-109: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

takeUntil notifier usage still leaves redirect subscriptions hanging.

The nested _tasks$ subscription is still open-ended, and takeUntil(this._unsubscribe$) won’t fire on destroy if the notifier is only completed (no next). This can keep subscriptions alive longer than intended.

Suggested fix
-import {filter, takeUntil} from 'rxjs/operators';
+import {filter, take, takeUntil} from 'rxjs/operators';
...
-                this._tasks$.pipe(takeUntil(this._unsubscribe$)).subscribe(tasks => {
+                this._tasks$.pipe(take(1), takeUntil(this._unsubscribe$)).subscribe(tasks => {
                     const task = tasks.find(t => t.task.stringId === this._redirectTaskId);
                     const panelRef = this._taskPanelRefs.get(this._redirectTaskId);
                     if (!!task && !task.initiallyExpanded && !!panelRef) {
                         panelRef.open();
                         panelRef.expanded = true;
                         this._unsubscribe$.next();
                     }
                 });
     ngOnDestroy(): void {
         super.ngOnDestroy();
         this.taskEvent.complete();
+        this._unsubscribe$.next();
         this._unsubscribe$.complete();
         if (this._unsub) {
             this._unsub.unsubscribe();
         }
     }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@projects/netgrif-components-core/src/lib/panel/task-panel-list/default-task-panel-list/abstract-default-task-list.component.ts`
around lines 105 - 109, The nested subscription to this._tasks$ inside the pm
subscription can leak because takeUntil(this._unsubscribe$) relies on notifier
emission and the inner subscribe is started per pm; replace the nested subscribe
with a composed operator chain: when piping from the outer observable (the one
emitting pm with taskId) use switchMap or exhaustMap to switch into this._tasks$
(or use withLatestFrom(this._tasks$) or take(1) on this._tasks$) so each pm
emission maps to a single inner value and auto-unsubscribes; update references
to _redirectTaskId, pm, and this._tasks$ accordingly and remove the inner
.subscribe call so takeUntil(this._unsubscribe$) is applied to the whole chain.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@projects/netgrif-components-core/src/lib/panel/configuration/selection-behavior.ts`:
- Around line 1-5: Replace the numeric enum with a string-based enum for
SelectionBehavior so values serialize and log as readable names; update the enum
declaration SelectionBehavior { EDITABLE = "EDITABLE", VISIBLE = "VISIBLE",
HIDDEN = "HIDDEN" } and then adjust any places that compare or persist these
values (references to SelectionBehavior, usages in templates, inputs,
serialization/deserialization code) to expect and handle string values instead
of numeric indexes to avoid reverse-mapping surprises.

In
`@projects/netgrif-components/src/lib/header/header-modes/search-mode/search-mode.component.html`:
- Around line 4-6: The icon-only button rendered when isInSelectionMode() &&
typeApproval === 'enumeration' lacks an accessible name; update the <button> in
the search-mode template (the one that calls setValue() and stops propagation)
to include an appropriate aria-label (or aria-label plus matTooltip) such as
"Clear selection" or a translation key so screen readers can announce the
action; ensure you place the aria-label on the same element that has
(click)="setValue(); $event.stopPropagation();" and keep existing attributes
like [disabled] and [disableRipple].

In
`@projects/netgrif-components/src/lib/view/case-view/components/case-list-paginator/case-list-paginator.component.html`:
- Line 31: The paginator is being disabled by the broad isSelectionDisabled()
call in the mat-paginator binding which blocks normal navigation even when
selection UI is hidden; change the template to bind [disabled] to a narrower
predicate (e.g., isPaginationDisabled()) and implement that method in the
CaseListPaginatorComponent so it only returns true when selection UI is visible
AND not editable (for example check selectionVisible/selectionHidden flag plus
the existing editable check or accept a parameter to isSelectionDisabled).
Update the component class (CaseListPaginatorComponent) to add the new helper
method (or overload isSelectionDisabled with a context flag) and use its name in
the template so pagination remains enabled for hidden-selection scenarios.

---

Duplicate comments:
In
`@projects/netgrif-components-core/src/lib/panel/task-panel-list/default-task-panel-list/abstract-default-task-list.component.ts`:
- Around line 105-109: The nested subscription to this._tasks$ inside the pm
subscription can leak because takeUntil(this._unsubscribe$) relies on notifier
emission and the inner subscribe is started per pm; replace the nested subscribe
with a composed operator chain: when piping from the outer observable (the one
emitting pm with taskId) use switchMap or exhaustMap to switch into this._tasks$
(or use withLatestFrom(this._tasks$) or take(1) on this._tasks$) so each pm
emission maps to a single inner value and auto-unsubscribes; update references
to _redirectTaskId, pm, and this._tasks$ accordingly and remove the inner
.subscribe call so takeUntil(this._unsubscribe$) is applied to the whole chain.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c7f125f7-90ff-4eca-841d-8fca24bfabcf

📥 Commits

Reviewing files that changed from the base of the PR and between 4d1a638 and 2bd1f60.

📒 Files selected for processing (18)
  • projects/netgrif-components-core/src/lib/header/abstract-header.component.ts
  • projects/netgrif-components-core/src/lib/header/header-modes/abstract-header-mode.component.ts
  • projects/netgrif-components-core/src/lib/panel/case-panel/abstract-case-panel.component.ts
  • projects/netgrif-components-core/src/lib/panel/configuration/selection-behavior.ts
  • projects/netgrif-components-core/src/lib/panel/public-api.ts
  • projects/netgrif-components-core/src/lib/panel/task-panel-list/default-task-panel-list/abstract-default-task-list.component.ts
  • projects/netgrif-components-core/src/lib/view/case-view/components/case-list-paginator/abstract-case-list-paginator.component.ts
  • projects/netgrif-components-core/src/lib/view/case-view/components/default-case-list/abstract-default-case-list.component.ts
  • projects/netgrif-components/src/lib/header/header-modes/edit-mode/edit-mode.component.html
  • projects/netgrif-components/src/lib/header/header-modes/search-mode/search-mode.component.html
  • projects/netgrif-components/src/lib/header/header-modes/sort-mode/sort-mode.component.html
  • projects/netgrif-components/src/lib/header/header.component.html
  • projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component.html
  • projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-case-ref-list-view/default-case-ref-list-view.component.ts
  • projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/refs/default-task-view/default-task-view.component.ts
  • projects/netgrif-components/src/lib/panel/case-panel/case-panel.component.html
  • projects/netgrif-components/src/lib/view/case-view/components/case-list-paginator/case-list-paginator.component.html
  • projects/netgrif-components/src/lib/view/case-view/components/case-list/case-list.component.html
💤 Files with no reviewable changes (1)
  • projects/netgrif-components-core/src/lib/view/case-view/components/case-list-paginator/abstract-case-list-paginator.component.ts

Comment on lines +1 to +5
export enum SelectionBehavior {
EDITABLE,
VISIBLE,
HIDDEN
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial | 💤 Low value

Consider using string enum values.

Numeric enums reverse-map and serialize as integers, which makes logs and any persisted/config representation harder to read (e.g., 0 vs "EDITABLE"). Since this enum is part of the public API and likely to appear in template-facing inputs, string values are easier to debug and safer to refactor (no accidental positional dependency).

♻️ Proposed change
 export enum SelectionBehavior {
-    EDITABLE,
-    VISIBLE,
-    HIDDEN
+    EDITABLE = 'EDITABLE',
+    VISIBLE = 'VISIBLE',
+    HIDDEN = 'HIDDEN'
 }
📝 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
export enum SelectionBehavior {
EDITABLE,
VISIBLE,
HIDDEN
}
export enum SelectionBehavior {
EDITABLE = 'EDITABLE',
VISIBLE = 'VISIBLE',
HIDDEN = 'HIDDEN'
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@projects/netgrif-components-core/src/lib/panel/configuration/selection-behavior.ts`
around lines 1 - 5, Replace the numeric enum with a string-based enum for
SelectionBehavior so values serialize and log as readable names; update the enum
declaration SelectionBehavior { EDITABLE = "EDITABLE", VISIBLE = "VISIBLE",
HIDDEN = "HIDDEN" } and then adjust any places that compare or persist these
values (references to SelectionBehavior, usages in templates, inputs,
serialization/deserialization code) to expect and handle string values instead
of numeric indexes to avoid reverse-mapping surprises.

</div>
</mat-accordion>
<mat-paginator [length]="length" [pageSize]="pageSize" [pageIndex]="pageIndex" color="primary" [disabled]="disabled"
<mat-paginator [length]="length" [pageSize]="pageSize" [pageIndex]="pageIndex" color="primary" [disabled]="isSelectionDisabled()"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Paginator disable condition is too broad and can block normal navigation.

Line 31 disables paging whenever selection is not editable. That also affects hidden-selection scenarios, so regular case-list pagination can become unintentionally disabled.

Suggested fix
-        <mat-paginator [length]="length" [pageSize]="pageSize" [pageIndex]="pageIndex" color="primary" [disabled]="isSelectionDisabled()"
+        <mat-paginator [length]="length" [pageSize]="pageSize" [pageIndex]="pageIndex" color="primary"
+                       [disabled]="isInSelectionMode() && isSelectionDisabled()"
                        [pageSizeOptions]="pageSizeOptions" (page)="onPageChanged($event)" showFirstLastButtons>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@projects/netgrif-components/src/lib/view/case-view/components/case-list-paginator/case-list-paginator.component.html`
at line 31, The paginator is being disabled by the broad isSelectionDisabled()
call in the mat-paginator binding which blocks normal navigation even when
selection UI is hidden; change the template to bind [disabled] to a narrower
predicate (e.g., isPaginationDisabled()) and implement that method in the
CaseListPaginatorComponent so it only returns true when selection UI is visible
AND not editable (for example check selectionVisible/selectionHidden flag plus
the existing editable check or accept a parameter to isSelectionDisabled).
Update the component class (CaseListPaginatorComponent) to add the new helper
method (or overload isSelectionDisabled with a context flag) and use its name in
the template so pagination remains enabled for hidden-selection scenarios.

…e editable on unassigned task

- aria-label added to clear selection buttons
@sonarqubecloud
Copy link
Copy Markdown

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