Skip to content

[NAE-2462] Builder component decomposition - #345

Open
Kovy95 wants to merge 34 commits into
release/6.6.0from
NAE-2462
Open

[NAE-2462] Builder component decomposition #345
Kovy95 wants to merge 34 commits into
release/6.6.0from
NAE-2462

Conversation

@Kovy95

@Kovy95 Kovy95 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Description

-add fixes of toolbar for scrollbar on smaller devices or datafields

  • performance fixes for builder to be ready as datafield
  • add processref as new datafield
  • rework of form builder
  • rework of info label
  • remove paper component

Implements NAE-2462

Dependencies

none

Third party dependencies

none

Blocking Pull requests

There are no dependencies on other PR

How Has Been This Tested?

  • manually

Test Configuration

<Please describe configuration for tests to run if applicable, like program parameters, host OS, VM configuration etc. You can use >

Name Tested on
OS linux mint 21
Runtime node 20.18.0
Dependency Manager npm 10.8.2
Framework version angular 17
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
    • Added process-reference fields that can embed and display related process cases.
    • Added process-reference support to the form builder, including configuration and selection options.
    • Improved builder layouts with dedicated panels, responsive canvas sizing, and clearer process, task, and transition details.
    • Added loading indicators and safer persistence for builder changes and preferences.
  • Bug Fixes
    • Improved canvas interaction performance, resizing, zoom behavior, and handling of incomplete imports.
    • Updated release documentation and compatibility for the latest PetriFlow version.

machacjozef and others added 30 commits March 19, 2025 19:11
- change the setting and getting properties from localStorage
- fix the change detection bug
- fix the problem with sending two requests on backend
- add new case ref component view
[NAE-2463] Builder change localStorage sets
…e/6.5.0

# Conflicts:
#	.github/workflows/master-build.yml
#	.github/workflows/release-build.yml
- update changelog
- performance fixes for builder to be ready as datafield
- performance fixes for builder
- remove z in simulation mode
- add fixes of toolbar for scrollbar on smaller devices or datafields
- add processref as new datafield
- rework of form builder
- rework of info label
- remove paper component
Kovy95 added 2 commits July 30, 2026 16:04
# Conflicts:
#	projects/netgrif-components/src/lib/builder/modeler/edit-mode/edit-mode.service.ts
#	projects/netgrif-components/src/lib/builder/modeler/edit-mode/services/modes/canvas-tool-context.ts
# Conflicts:
#	package.json
#	projects/netgrif-components-core/package.json
#	projects/netgrif-components/package.json
@Kovy95
Kovy95 requested review from Retoocs and mazarijuraj August 3, 2026 08:09
@Kovy95 Kovy95 self-assigned this Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Kovy95, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 43 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 29462769-9979-4f77-8c00-9993ee7176a5

📥 Commits

Reviewing files that changed from the base of the PR and between 6b66398 and fe17c87.

📒 Files selected for processing (4)
  • projects/netgrif-components/src/lib/builder/builder.component.ts
  • projects/netgrif-components/src/lib/builder/modeler/services/canvas/canvas-mode-service.ts
  • projects/netgrif-components/src/lib/builder/modeler/simulation-mode/simulation-mode.service.ts
  • projects/netgrif-components/src/lib/data-fields/process-ref/process-ref-default/process-ref-default.component.spec.ts

Walkthrough

The PR adds process-reference field support, embedded builder cases, scoped local storage, loading state, canvas interaction updates, and a panel-based form-builder layout. It also updates service paths, package versions, tests, examples, tab rendering, and the 6.5.0 changelog.

Changes

Builder and process-reference changes

Layer / File(s) Summary
Process-reference field and embedded builder
projects/netgrif-components-core/..., projects/netgrif-components/src/lib/data-fields/process-ref/..., projects/netgrif-components/src/lib/builder/...
Adds the ProcessRefField model, conversion, portal rendering, registry wiring, field-list option, and referenced-case loading.
Scoped storage and builder integration
projects/netgrif-components/src/lib/builder/services/..., projects/netgrif-components/src/lib/builder/dialogs/..., projects/netgrif-components/src/lib/builder/modeler/...
Adds LocalStorageService, replaces direct storage access, and exposes builder loading state.
Canvas and simulation interaction updates
projects/netgrif-components/src/lib/builder/modeler/services/canvas/..., projects/netgrif-components/src/lib/builder/modeler/simulation-mode/..., projects/netgrif-components/src/lib/builder/modeler/edit-mode/...
Passes NgZone and tab data through canvas tools, moves pointer handlers outside Angular, adds Panzoom configuration, and adds lifecycle cleanup.
Form-builder layout and presentation
projects/netgrif-components/src/lib/builder/form-builder/..., projects/netgrif-components/src/lib/builder/builder.theme.scss
Replaces sidenavs with left, canvas, and right panels. Gridster refreshes after panel resizing. Information-label and builder styles are revised.
Module, example, and release alignment
projects/nae-example-app/..., projects/netgrif-components/src/lib/tabs/..., package.json, projects/netgrif-components/package.json, CHANGELOG.md
Updates imports, test setup, tab portal rendering, Petriflow versions, examples, and the 6.5.0 changelog.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant FieldConverterService
  participant ProcessRefDefaultComponent
  participant BuilderComponent
  participant CaseService
  FieldConverterService->>ProcessRefDefaultComponent: create ProcessRefField
  ProcessRefDefaultComponent->>BuilderComponent: render builder portal
  BuilderComponent->>CaseService: load referenced case
  CaseService-->>BuilderComponent: return case and reload events
Loading

Possibly related PRs

Suggested labels: improvement, new feature, breaking change, Large

🚥 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 title clearly identifies the main change: decomposition of the Builder component.
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.

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.

@coderabbitai coderabbitai Bot added breaking change Fix or feature that would cause existing functionality doesn't work as expected improvement New feature or request Large new feature labels Aug 3, 2026
@sonarqubecloud

sonarqubecloud Bot commented Aug 3, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
26.3% Coverage on New Code (required ≥ 50%)

See analysis details on SonarQube Cloud

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 13

🤖 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/nae-example-app/src/app/doc/builder-example/builder-tabs-example.component.ts`:
- Line 1: Restore OnPush change detection for BuilderTabsExampleComponent by
importing ChangeDetectionStrategy and configuring the component decorator with
ChangeDetectionStrategy.OnPush. Keep the existing tab initialization unchanged;
only retain the default strategy if required by a demonstrated tab-rendering
regression, accompanied by a regression test.

In
`@projects/netgrif-components-core/src/lib/task-content/services/field-converter.service.ts`:
- Around line 112-114: Add a ProcessRefField branch to resolveType() that
returns FieldTypeResource.PROCESS_REF, matching the ProcessRefField construction
already handled in toClass() and ensuring reverse type resolution does not
return undefined.

In `@projects/netgrif-components/src/lib/builder/builder.component.ts`:
- Around line 148-153: Update the getOneCase subscription in the
dataFieldPortalData branch to handle request errors; when loading the initial
case fails, clear the loading state and transition through the component’s
existing error or fallback mechanism so the embedded builder is no longer
blocked.

In
`@projects/netgrif-components/src/lib/builder/form-builder/field-list/field-list.component.ts`:
- Around line 143-145: Update typeTitle in the field-list component to return an
empty string when the computed name is absent, while preserving the existing
capitalization behavior for non-nullish types.

In
`@projects/netgrif-components/src/lib/builder/form-builder/form-builder.component.scss`:
- Around line 45-49: Move the `@media` print block out of
form-builder.component.scss into the application’s global stylesheet so the body
selector applies to the document body. Preserve the margin and box-shadow rules,
and scope .page through the global Builder selector if necessary rather than
relying on component encapsulation.

In
`@projects/netgrif-components/src/lib/builder/form-builder/info-label/info-label.component.scss`:
- Around line 22-25: Update the .info-label-group flex container with min-width:
0, and ensure metadata text in .info-label-title can wrap by adding
overflow-wrap: anywhere (or implement ellipsis together with a tooltip). Apply
the same overflow protection to the related styles covering the additional
referenced range.

In
`@projects/netgrif-components/src/lib/builder/modeler/edit-mode/edit-mode.service.ts`:
- Line 351: Update the temporary arc endpoint assignment in the edit-mode arc
rendering logic to fall back to intersect.x and intersect.y when finalX or
finalY is NaN, keeping zero-length arcs anchored at the source node instead of
(0, 0).

In
`@projects/netgrif-components/src/lib/builder/modeler/services/canvas/canvas-mode-service.ts`:
- Around line 77-85: Update the canvas initialization/render flow around
renderModel and the canvas assignment so that, when a canvas becomes available,
all existing wrappers in elements are attached to it, including places,
transitions, and arcs. Do not rely only on the optional add calls in newSvgPlace
and related creation methods; rebuild or iterate the existing collection using
the established canvas add methods, preserving elements.findNode() availability
and avoiding duplicate attachments.
- Around line 28-38: Tie the tabSelected$ subscription in CanvasModeService to
the service/component lifecycle so it is disposed when the owning
BuilderComponent-scoped service is destroyed. Use takeUntilDestroyed() with the
appropriate DestroyRef or bind it to the relevant
EditableComponent/SimulationModeComponent destruction, while preserving the
existing panzoom.reset behavior when selected becomes true.

In
`@projects/netgrif-components/src/lib/builder/services/builder-integration.service.ts`:
- Around line 107-110: Update setData in BuilderIntegrationService to retain the
latest HistoryChange received while _loading is true instead of discarding it,
then persist that snapshot when the active request settles. Serialize the
task-write flow around the existing persistence logic so queued updates are
processed after completion and older XML snapshots cannot overwrite newer edits.

In
`@projects/netgrif-components/src/lib/builder/services/local-storage.service.ts`:
- Around line 10-12: Update LocalStorageService’s constructor to also inject
DATA_FIELD_PORTAL_DATA and derive _prefix from its referenced case ID when
NAE_TAB_DATA does not provide processCase data. Preserve the existing tab-data
prefix behavior and use the data-field portal value only as the fallback.

In
`@projects/netgrif-components/src/lib/data-fields/process-ref/process-ref-default/process-ref-default.component.scss`:
- Around line 9-13: Update the child-element styling in the process-ref-default
component stylesheet to remove the unsupported ::ng-deep selector. Preserve the
min-width, min-height, and width rules through a properly scoped selector if
they are required; otherwise remove the unused rule.

In
`@projects/netgrif-components/src/lib/data-fields/process-ref/process-ref-default/process-ref-default.component.spec.ts`:
- Around line 22-23: Update the spec around the CaseRefDefaultComponent suite to
test ProcessRefDefaultComponent: render nc-process-ref-default with
ProcessRefField, adjust the component type and related setup accordingly, and
rename the describe suite to ProcessRefDefaultComponent.
🪄 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 Plus

Run ID: fa40d393-46b4-42b6-948d-efe7705d0875

📥 Commits

Reviewing files that changed from the base of the PR and between 0b26a16 and 040af1e.

📒 Files selected for processing (87)
  • CHANGELOG.md
  • package.json
  • projects/nae-example-app/src/app/doc/builder-example/builder-tabbed-case-view/builder-tabbed-case-view.component.ts
  • projects/nae-example-app/src/app/doc/builder-example/builder-tabs-example.component.ts
  • projects/netgrif-components-core/src/lib/data-fields/models/component.ts
  • projects/netgrif-components-core/src/lib/data-fields/process-ref-field/model/process-ref-field.ts
  • projects/netgrif-components-core/src/lib/data-fields/process-ref-field/process-ref-default/abstract-process-ref-default.component.ts
  • projects/netgrif-components-core/src/lib/data-fields/public-api.ts
  • projects/netgrif-components-core/src/lib/task-content/model/field-type-resource.ts
  • projects/netgrif-components-core/src/lib/task-content/services/field-converter.service.ts
  • projects/netgrif-components-core/src/lib/user/services/user.service.ts
  • projects/netgrif-components/package.json
  • projects/netgrif-components/src/lib/builder/builder.component.spec.ts
  • projects/netgrif-components/src/lib/builder/builder.component.ts
  • projects/netgrif-components/src/lib/builder/builder.module.ts
  • projects/netgrif-components/src/lib/builder/builder.theme.scss
  • projects/netgrif-components/src/lib/builder/dialogs/dialog-manage-roles/dialog-manage-roles.component.ts
  • projects/netgrif-components/src/lib/builder/dialogs/dialog-model-edit/dialog-model-edit.component.ts
  • projects/netgrif-components/src/lib/builder/dialogs/dialog-transition-edit/dialog-transition-edit.component.ts
  • projects/netgrif-components/src/lib/builder/form-builder/edit-panel/edit-panel.component.spec.ts
  • projects/netgrif-components/src/lib/builder/form-builder/edit-panel/edit-panel.component.ts
  • projects/netgrif-components/src/lib/builder/form-builder/field-list/field-list.component.html
  • projects/netgrif-components/src/lib/builder/form-builder/field-list/field-list.component.spec.ts
  • projects/netgrif-components/src/lib/builder/form-builder/field-list/field-list.component.ts
  • projects/netgrif-components/src/lib/builder/form-builder/field-list/field-list.service.ts
  • projects/netgrif-components/src/lib/builder/form-builder/form-builder.component.html
  • projects/netgrif-components/src/lib/builder/form-builder/form-builder.component.scss
  • projects/netgrif-components/src/lib/builder/form-builder/form-builder.component.spec.ts
  • projects/netgrif-components/src/lib/builder/form-builder/form-builder.component.ts
  • projects/netgrif-components/src/lib/builder/form-builder/form-builder.module.ts
  • projects/netgrif-components/src/lib/builder/form-builder/gridster/gridster.component.spec.ts
  • projects/netgrif-components/src/lib/builder/form-builder/gridster/gridster.component.ts
  • projects/netgrif-components/src/lib/builder/form-builder/info-label/info-label.component.html
  • projects/netgrif-components/src/lib/builder/form-builder/info-label/info-label.component.scss
  • projects/netgrif-components/src/lib/builder/form-builder/info-label/info-label.component.spec.ts
  • projects/netgrif-components/src/lib/builder/form-builder/info-label/info-label.component.ts
  • projects/netgrif-components/src/lib/builder/form-builder/paper/paper.component.html
  • projects/netgrif-components/src/lib/builder/form-builder/paper/paper.component.scss
  • projects/netgrif-components/src/lib/builder/form-builder/paper/paper.component.spec.ts
  • projects/netgrif-components/src/lib/builder/form-builder/paper/paper.component.ts
  • projects/netgrif-components/src/lib/builder/modeler/actions-mode/actions-master-detail.service.ts
  • projects/netgrif-components/src/lib/builder/modeler/control-panel/control-panel.component.scss
  • projects/netgrif-components/src/lib/builder/modeler/control-panel/control-panel.service.ts
  • projects/netgrif-components/src/lib/builder/modeler/data-mode/data-detail/data-detail.component.ts
  • projects/netgrif-components/src/lib/builder/modeler/data-mode/data-master-detail.service.ts
  • projects/netgrif-components/src/lib/builder/modeler/edit-mode/context-menu/menu-items/model/manage-model-permissions-menu-item.ts
  • projects/netgrif-components/src/lib/builder/modeler/edit-mode/context-menu/menu-items/transition/edit-form-menu-item.ts
  • projects/netgrif-components/src/lib/builder/modeler/edit-mode/context-menu/menu-items/transition/edit-transition-actions-menu-item.ts
  • projects/netgrif-components/src/lib/builder/modeler/edit-mode/context-menu/menu-items/transition/edit-transition-permissions-menu-item.ts
  • projects/netgrif-components/src/lib/builder/modeler/edit-mode/edit-mode.component.scss
  • projects/netgrif-components/src/lib/builder/modeler/edit-mode/edit-mode.component.spec.ts
  • projects/netgrif-components/src/lib/builder/modeler/edit-mode/edit-mode.component.ts
  • projects/netgrif-components/src/lib/builder/modeler/edit-mode/edit-mode.service.ts
  • projects/netgrif-components/src/lib/builder/modeler/edit-mode/services/modes/canvas-tool-context.ts
  • projects/netgrif-components/src/lib/builder/modeler/edit-mode/services/modes/canvas-tool.ts
  • projects/netgrif-components/src/lib/builder/modeler/edit-mode/services/modes/select-tool.ts
  • projects/netgrif-components/src/lib/builder/modeler/history-mode/history-master-detail.service.ts
  • projects/netgrif-components/src/lib/builder/modeler/model-import-service.ts
  • projects/netgrif-components/src/lib/builder/modeler/modeler.component.scss
  • projects/netgrif-components/src/lib/builder/modeler/modeler.component.ts
  • projects/netgrif-components/src/lib/builder/modeler/role-mode/role-detail/role-detail.component.ts
  • projects/netgrif-components/src/lib/builder/modeler/role-mode/role-master-detail.service.ts
  • projects/netgrif-components/src/lib/builder/modeler/services/canvas/canvas-listener-tool.ts
  • projects/netgrif-components/src/lib/builder/modeler/services/canvas/canvas-mode-service.ts
  • projects/netgrif-components/src/lib/builder/modeler/services/history/history.service.ts
  • projects/netgrif-components/src/lib/builder/modeler/simulation-mode/simulation-mode.component.html
  • projects/netgrif-components/src/lib/builder/modeler/simulation-mode/simulation-mode.component.ts
  • projects/netgrif-components/src/lib/builder/modeler/simulation-mode/simulation-mode.service.ts
  • projects/netgrif-components/src/lib/builder/modeler/simulation-mode/tool/change-data-tool.ts
  • projects/netgrif-components/src/lib/builder/modeler/simulation-mode/tool/event-simulation.tool.ts
  • projects/netgrif-components/src/lib/builder/modeler/simulation-mode/tool/grid-tool.ts
  • projects/netgrif-components/src/lib/builder/modeler/simulation-mode/tool/reset-position-and-zoom-tool.ts
  • projects/netgrif-components/src/lib/builder/modeler/simulation-mode/tool/reset-simulation.tool.ts
  • projects/netgrif-components/src/lib/builder/modeler/simulation-mode/tool/simulation-tool.ts
  • projects/netgrif-components/src/lib/builder/modeler/simulation-mode/tool/switch-label-tool.ts
  • projects/netgrif-components/src/lib/builder/modeler/simulation-mode/tool/task-simulation.tool.ts
  • projects/netgrif-components/src/lib/builder/modeler/task-mode/task-mode.component.ts
  • projects/netgrif-components/src/lib/builder/public-api.ts
  • projects/netgrif-components/src/lib/builder/services/builder-integration.service.ts
  • projects/netgrif-components/src/lib/builder/services/builder-mode.service.spec.ts
  • projects/netgrif-components/src/lib/builder/services/builder-mode.service.ts
  • projects/netgrif-components/src/lib/builder/services/local-storage.service.ts
  • projects/netgrif-components/src/lib/data-fields/process-ref/process-ref-default/process-ref-default.component.html
  • projects/netgrif-components/src/lib/data-fields/process-ref/process-ref-default/process-ref-default.component.scss
  • projects/netgrif-components/src/lib/data-fields/process-ref/process-ref-default/process-ref-default.component.spec.ts
  • projects/netgrif-components/src/lib/data-fields/process-ref/process-ref-default/process-ref-default.component.ts
  • projects/netgrif-components/src/lib/tabs/tab-view/tab-view.component.html
💤 Files with no reviewable changes (6)
  • projects/netgrif-components/src/lib/builder/form-builder/paper/paper.component.html
  • projects/netgrif-components/src/lib/builder/form-builder/paper/paper.component.scss
  • projects/netgrif-components/src/lib/builder/form-builder/paper/paper.component.ts
  • projects/netgrif-components/src/lib/builder/form-builder/form-builder.module.ts
  • projects/netgrif-components/src/lib/builder/form-builder/paper/paper.component.spec.ts
  • projects/netgrif-components-core/src/lib/user/services/user.service.ts

Comment thread projects/netgrif-components/src/lib/builder/builder.component.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Fix or feature that would cause existing functionality doesn't work as expected improvement New feature or request Large new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants