Skip to content

[NAE-2401] Timestamp of case dataSet change#320

Open
Kovy95 wants to merge 2 commits intorelease/6.4.2from
NAE-2401
Open

[NAE-2401] Timestamp of case dataSet change#320
Kovy95 wants to merge 2 commits intorelease/6.4.2from
NAE-2401

Conversation

@Kovy95
Copy link
Copy Markdown
Contributor

@Kovy95 Kovy95 commented Apr 2, 2026

Description

  • add lastModifiedDataSet property to case

Implements NAE-2401

Dependencies

none

Third party dependencies

  • No new dependencies were introduced

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 LinuxMint 22
Runtime Node 20.18.0
Dependency Manager NPM 10.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
    • Added tracking for dataset modification timestamps across case management, enabling better visibility into when datasets were last updated.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 2, 2026

Caution

Review failed

An error occurred during the review process. Please try again later.

Walkthrough

A new property lastModifiedDataSet of type NaeDate is added to the Case interface, with corresponding updates to test fixtures, mock objects, and component initialization code to include this property across the codebase.

Changes

Cohort / File(s) Summary
Interface Definition
projects/netgrif-components-core/src/lib/resources/interface/case.ts
Added lastModifiedDataSet: NaeDate property to the exported Case interface.
Test Fixtures & Mocks
projects/netgrif-components-core/src/lib/authorization/permission/permission.service.spec.ts, projects/netgrif-components-core/src/lib/panel/case-panel/abstract-case-panel.component.spec.ts, projects/netgrif-components-core/src/lib/utility/tests/mocks/mock-case-resource.service.ts, projects/netgrif-components-core/src/lib/utility/tests/utility/create-mock-case.ts, projects/netgrif-components/src/lib/view/tree-case-view/tree-component/add-child-node/add-child-node.component.spec.ts
Updated test case objects and mocks to include lastModifiedDataSet property (initialized to [], undefined, or null depending on context).
Component Initialization
projects/nae-example-app/src/app/doc/panels/panels.component.ts
Added lastModifiedDataSet: null to the initialized case_ object in PanelsComponent constructor.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

improvement

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'NAE-2401 Timestamp of case dataSet change' directly describes the main change: adding a lastModifiedDataSet property to track when case data sets are modified.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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


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.

@coderabbitai coderabbitai bot added the improvement New feature or request label Apr 2, 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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@projects/netgrif-components-core/src/lib/resources/interface/case.ts`:
- Line 24: The interface field lastModifiedDataSet is declared as a required
NaeDate but actual payloads and tests assign null, undefined, or empty arrays;
change its declaration to be optional and nullable (e.g., lastModifiedDataSet?:
NaeDate | null) in the interface to reflect real usage, and update any
tests/mocks (where [] is used) to use null/undefined or adjust mock data to
match the new nullable type; ensure references in panels.component.ts and
add-child-node.component.spec.ts still compile against lastModifiedDataSet?:
NaeDate | null.
🪄 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: f4437736-9aff-4356-91c2-f0fce59eb241

📥 Commits

Reviewing files that changed from the base of the PR and between 28679ae and e980c6a.

📒 Files selected for processing (7)
  • projects/nae-example-app/src/app/doc/panels/panels.component.ts
  • projects/netgrif-components-core/src/lib/authorization/permission/permission.service.spec.ts
  • projects/netgrif-components-core/src/lib/panel/case-panel/abstract-case-panel.component.spec.ts
  • projects/netgrif-components-core/src/lib/resources/interface/case.ts
  • projects/netgrif-components-core/src/lib/utility/tests/mocks/mock-case-resource.service.ts
  • projects/netgrif-components-core/src/lib/utility/tests/utility/create-mock-case.ts
  • projects/netgrif-components/src/lib/view/tree-case-view/tree-component/add-child-node/add-child-node.component.spec.ts

* ]
*/
lastModified: NaeDate;
lastModifiedDataSet: NaeDate;
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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Case interface declaration:"
rg -nP 'lastModifiedDataSet\s*:\s*NaeDate' projects/netgrif-components-core/src/lib/resources/interface/case.ts

echo
echo "Null/undefined assignments of lastModifiedDataSet in repository:"
rg -nP 'lastModifiedDataSet\s*:\s*(null|undefined)\b' --type ts

echo
echo "All explicit assignments for quick audit:"
rg -nP 'lastModifiedDataSet\s*:' --type ts

Repository: netgrif/components

Length of output: 1540


🏁 Script executed:

# Check NaeDate type definition
rg -nP 'type NaeDate|interface NaeDate' --type ts

# Get context around null assignment in panels.component.ts
head -60 projects/nae-example-app/src/app/doc/panels/panels.component.ts | tail -10

# Get context around undefined assignment in add-child-node.component.spec.ts
head -70 projects/netgrif-components/src/lib/view/tree-case-view/tree-component/add-child-node/add-child-node.component.spec.ts | tail -10

# Check if there's any deserialization logic for Case
rg -n 'deserialize|fromJSON|fromResponse' projects/netgrif-components-core/src/lib/resources/interface/case.ts -A 3

Repository: netgrif/components

Length of output: 755


🏁 Script executed:

# Check the complete case.ts interface to see all changes
cat -n projects/netgrif-components-core/src/lib/resources/interface/case.ts | head -50

# Check for deserialization or object mapping logic
rg -n 'lastModifiedDataSet' projects/netgrif-components-core/src/lib/resources -B 2 -A 2

# Check git to see what's being changed in this PR
git log --oneline -1 2>/dev/null || echo "Not a git repo"

Repository: netgrif/components

Length of output: 2047


Make lastModifiedDataSet nullable/optional to match actual payloads and usage.

Line 24 declares a required NaeDate, but codebase usage assigns null (panels.component.ts), undefined (add-child-node.component.spec.ts), and [] in test/mock data. The required type declaration is inconsistent with actual field behavior and creates a type safety gap.

Suggested fix
-    lastModifiedDataSet: NaeDate;
+    lastModifiedDataSet?: NaeDate | null;
📝 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
lastModifiedDataSet: NaeDate;
lastModifiedDataSet?: NaeDate | null;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@projects/netgrif-components-core/src/lib/resources/interface/case.ts` at line
24, The interface field lastModifiedDataSet is declared as a required NaeDate
but actual payloads and tests assign null, undefined, or empty arrays; change
its declaration to be optional and nullable (e.g., lastModifiedDataSet?: NaeDate
| null) in the interface to reflect real usage, and update any tests/mocks
(where [] is used) to use null/undefined or adjust mock data to match the new
nullable type; ensure references in panels.component.ts and
add-child-node.component.spec.ts still compile against lastModifiedDataSet?:
NaeDate | null.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 2, 2026

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

Labels

improvement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant