Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export class PanelsComponent implements OnInit {
constructor() {
this.case_ = {
lastModified: null,
lastModifiedDataSet: null,
visualId: 'ABC-123456789',
petriNetObjectId: null,
processIdentifier: 'net',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ describe('PermissionService', () => {
color: 'color',
creationDate: [],
lastModified: [],
lastModifiedDataSet: [],
visualId: '',
resetArcTokens: {},
processIdentifier: '',
Expand Down Expand Up @@ -235,6 +236,7 @@ describe('PermissionService', () => {
color: 'color',
creationDate: [],
lastModified: [],
lastModifiedDataSet: [],
visualId: '',
resetArcTokens: {},
processIdentifier: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ class TestWrapperComponent {
color: 'color',
creationDate: [],
lastModified: [],
lastModifiedDataSet: [],
visualId: '',
resetArcTokens: {},
processIdentifier: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface Case {
* ]
*/
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.

/**
* **Example:** PER-1669965980
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export class MockCaseResourceService {
content: [
{
lastModified: [2022, 11, 28],
lastModifiedDataSet: [],
visualId: 'TST-123548',
petriNetObjectId: undefined,
processIdentifier: 'test-process',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export function createMockCase(stringId = 'stringId',
petriNetId = 'petriNetId'): Case {
return {
lastModified: [],
lastModifiedDataSet: [],
visualId: '',
petriNetObjectId: {
timestamp: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class TestComponent {
creationDate: undefined,
icon: '',
lastModified: undefined,
lastModifiedDataSet: undefined,
petriNetId: '',
petriNetObjectId: undefined,
processIdentifier: '',
Expand Down
Loading