Skip to content

[NAE-2461] Create case filter only deployed#343

Open
Retoocs wants to merge 5 commits into
release/6.6.0from
NAE-2461
Open

[NAE-2461] Create case filter only deployed#343
Retoocs wants to merge 5 commits into
release/6.6.0from
NAE-2461

Conversation

@Retoocs

@Retoocs Retoocs commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Description

  • add deployment state in petri-net-reference.ts
  • add filter on create case to filter only deployed nets
  • fixed some memory leaks and deprecated method calls

Implements NAE-2461

Dependencies

No new dependencies were introduced

Third party dependencies

No new dependencies were introduced

Blocking Pull requests

There are no dependencies on other PR

How Has Been This Tested?

Manually and by unit tests

Test Configuration

Name Tested on
OS Ubuntu 24.04.1 LTS
Runtime Node 23.6.1
Dependency Manager NPM 11.0.0
Framework version Angular 19.2.2
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 deployment status tracking across workflows/process definitions with states: Draft, Deployed, Archived, and Trash.
    • Workflow/process items now carry deployment state, enabling UI and logic to react accordingly (including examples and panel/header behavior).
  • Bug Fixes

    • New case creation is now restricted to deployed workflows.
    • Improved cleanup of active subscriptions and ensured dialogs complete reliably.
    • When no eligible deployed workflows are available, the app now shows an error and avoids attempting creation.

- add deployment state in petri-net-reference.ts
- add filter on create case to filter only deployed nets
@Retoocs Retoocs self-assigned this Jul 9, 2026
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Changes

The PR adds deployment-state data to petri-net references and Net, filters case-creation candidates to deployed nets, improves subscription lifecycle handling, and updates related fixtures and examples.

Deployment state contract and Net storage

Layer / File(s) Summary
Deployment state contract and Net storage
projects/netgrif-components-core/src/lib/resources/interface/petri-net-reference.ts, projects/netgrif-components-core/src/lib/process/net.ts, projects/netgrif-components-core/src/lib/process/net.spec.ts, projects/netgrif-components-core/src/lib/utility/tests/utility/create-mock-net.ts
PetriNetReference defines deployment states, Net stores and exposes deploymentState, and shared Net tests and mocks use DeploymentState.DEPLOYED.

Case creation lifecycle and filtering

Layer / File(s) Summary
Case creation lifecycle and filtering
projects/netgrif-components-core/src/lib/view/case-view/service/case-view-service.ts
CaseViewService cleans up its active-filter subscription, limits one-shot observable flows, handles unavailable nets, and filters allowed nets to deployed states.

Deployment state in fixtures and examples

Layer / File(s) Summary
Deployment state in component fixtures and examples
projects/nae-example-app/src/app/doc/..., projects/netgrif-components-core/src/lib/{authorization,header,panel,view}/..., projects/netgrif-components/src/lib/panel/...
Authorization, header, panel, tree, and example-app fixtures add deployed state values to Net and workflow objects.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested labels: improvement, bugfix, Medium

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main change: filtering case creation to deployed nets.

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.

Retoocs added 3 commits July 9, 2026 19:31
- fix memory leaks in case-view-service.ts
- fix deprecated use of subscribe method
@Retoocs
Retoocs marked this pull request as ready for review July 9, 2026 17:51
@Retoocs

Retoocs commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review this PR

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

@Retoocs I'll review this PR now.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot added breaking change Fix or feature that would cause existing functionality doesn't work as expected improvement New feature or request Medium labels Jul 10, 2026

@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: 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/header/case-header/case-header.service.spec.ts`:
- Line 37: Update the DeploymentState import in the case-header service spec to
use single quotes instead of double quotes, matching the existing import style
in the file.

In
`@projects/netgrif-components-core/src/lib/view/case-view/service/case-view-service.ts`:
- Line 296: Update createDefaultNewCase to return myCase.asObservable() instead
of the raw Subject, matching createNewCase and preventing callers from accessing
Subject mutation methods.
- Around line 264-296: Ensure the myCase Subject is completed on every failure
path in createDefaultNewCase: call myCase.complete() before returning when no
nets are available, and after handling errors in both the createCase and
getNewCaseAllowedNets subscriptions. Keep the existing success completion
unchanged.
🪄 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: 42804f79-66af-4a19-838b-66a30370d6d5

📥 Commits

Reviewing files that changed from the base of the PR and between 6a78c83 and 5aff374.

📒 Files selected for processing (13)
  • projects/nae-example-app/src/app/doc/panels/panels.component.ts
  • projects/nae-example-app/src/app/doc/sidemenu-example/sidemenu-example.component.ts
  • projects/netgrif-components-core/src/lib/authorization/permission/permission.service.spec.ts
  • projects/netgrif-components-core/src/lib/header/case-header/case-header.service.spec.ts
  • projects/netgrif-components-core/src/lib/panel/workflow-panel/abstract-workflow-panel.component.spec.ts
  • projects/netgrif-components-core/src/lib/process/net.spec.ts
  • projects/netgrif-components-core/src/lib/process/net.ts
  • projects/netgrif-components-core/src/lib/resources/interface/petri-net-reference.ts
  • projects/netgrif-components-core/src/lib/utility/tests/utility/create-mock-net.ts
  • projects/netgrif-components-core/src/lib/view/case-view/service/case-view-service.ts
  • projects/netgrif-components-core/src/lib/view/tree-case-view/tree-component/case-tree.service.spec.ts
  • projects/netgrif-components/src/lib/panel/public-workflow-panel/public-workflow-panel.component.spec.ts
  • projects/netgrif-components/src/lib/panel/workflow-panel/workflow-panel.component.spec.ts

- fix subject completion
- fix return value encapsulation
- fix imports
@coderabbitai coderabbitai Bot added bugfix and removed breaking change Fix or feature that would cause existing functionality doesn't work as expected labels Jul 10, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 10, 2026
@sonarqubecloud

Copy link
Copy Markdown

@mazarijuraj
mazarijuraj changed the base branch from release/6.5.0 to release/6.6.0 July 16, 2026 10:20
@mazarijuraj
mazarijuraj dismissed coderabbitai[bot]’s stale review July 16, 2026 10:20

The base branch was changed.

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

Labels

bugfix improvement New feature or request Medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant