This is an automated email from the ASF dual-hosted git repository.
scottyaslan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new 443bfcb0fc NIFI-14315: Ensuring the bulletin level is included in the
request payload when editing a Controller Service. (#9765)
443bfcb0fc is described below
commit 443bfcb0fc0bc0fbff6f9a0c3e60afd7fc611283
Author: Matt Gilman <[email protected]>
AuthorDate: Wed Mar 5 11:54:53 2025 -0500
NIFI-14315: Ensuring the bulletin level is included in the request payload
when editing a Controller Service. (#9765)
- Removing usage of legacy nx cache.
---
.../edit-controller-service.component.spec.ts | 47 +++++++++++++++++++++-
.../edit-controller-service.component.ts | 1 +
nifi-frontend/src/main/frontend/nx.json | 3 +-
3 files changed, 48 insertions(+), 3 deletions(-)
diff --git
a/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/controller-service/edit-controller-service/edit-controller-service.component.spec.ts
b/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/controller-service/edit-controller-service/edit-controller-service.component.spec.ts
index b28a812d22..c439ef2f13 100644
---
a/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/controller-service/edit-controller-service/edit-controller-service.component.spec.ts
+++
b/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/controller-service/edit-controller-service/edit-controller-service.component.spec.ts
@@ -26,6 +26,8 @@ import { ClusterConnectionService } from
'../../../../service/cluster-connection
import 'codemirror/addon/hint/show-hint';
import { MockComponent } from 'ng-mocks';
import { ContextErrorBanner } from
'../../context-error-banner/context-error-banner.component';
+import { Client } from '../../../../service/client.service';
+import { Revision } from '@nifi/shared';
describe('EditControllerService', () => {
let component: EditControllerService;
@@ -546,6 +548,11 @@ describe('EditControllerService', () => {
}
};
+ const mockRevision: Revision = {
+ clientId: 'client-id',
+ version: 1
+ };
+
beforeEach(() => {
TestBed.configureTestingModule({
imports: [EditControllerService,
MockComponent(ContextErrorBanner), NoopAnimationsModule],
@@ -557,7 +564,19 @@ describe('EditControllerService', () => {
isDisconnectionAcknowledged: jest.fn()
}
},
- { provide: MatDialogRef, useValue: null }
+ { provide: MatDialogRef, useValue: null },
+ {
+ provide: Client,
+ useValue: {
+ getRevision: () => mockRevision
+ }
+ },
+ {
+ provide: ClusterConnectionService,
+ useValue: {
+ isDisconnectionAcknowledged: () => true
+ }
+ }
]
});
fixture = TestBed.createComponent(EditControllerService);
@@ -568,4 +587,30 @@ describe('EditControllerService', () => {
it('should create', () => {
expect(component).toBeTruthy();
});
+
+ it('should dispatch edit action on form submission', () => {
+ const mockFormData = {
+ name: 'service-name',
+ bulletinLevel: 'DEBUG',
+ comments: 'service-comments',
+ properties: []
+ };
+
+ jest.spyOn(component.editControllerService, 'next');
+ component.editControllerServiceForm.setValue(mockFormData);
+ component.submitForm();
+
+ expect(component.editControllerService.next).toHaveBeenCalledWith({
+ payload: {
+ revision: mockRevision,
+ disconnectedNodeAcknowledged: true,
+ component: {
+ id: data.id,
+ name: mockFormData.name,
+ bulletinLevel: mockFormData.bulletinLevel,
+ comments: mockFormData.comments
+ }
+ }
+ });
+ });
});
diff --git
a/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/controller-service/edit-controller-service/edit-controller-service.component.ts
b/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/controller-service/edit-controller-service/edit-controller-service.component.ts
index 63accd49b9..d8f2731495 100644
---
a/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/controller-service/edit-controller-service/edit-controller-service.component.ts
+++
b/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/controller-service/edit-controller-service/edit-controller-service.component.ts
@@ -172,6 +172,7 @@ export class EditControllerService extends TabbedDialog {
component: {
id: this.request.controllerService.id,
name: this.editControllerServiceForm.get('name')?.value,
+ bulletinLevel:
this.editControllerServiceForm.get('bulletinLevel')?.value,
comments: this.editControllerServiceForm.get('comments')?.value
}
};
diff --git a/nifi-frontend/src/main/frontend/nx.json
b/nifi-frontend/src/main/frontend/nx.json
index 8bf8c73c5f..3ffc39a96f 100644
--- a/nifi-frontend/src/main/frontend/nx.json
+++ b/nifi-frontend/src/main/frontend/nx.json
@@ -77,6 +77,5 @@
"@nx/angular:component": {
"style": "scss"
}
- },
- "useLegacyCache": true
+ }
}