CST-12498 Final refactor

This commit is contained in:
Mattia Vianelli
2023-11-20 13:29:44 +01:00
parent 36778a09cb
commit 532f4725b2
5 changed files with 18 additions and 14 deletions

View File

@@ -183,6 +183,7 @@ export class LdnServiceFormEditComponent implements OnInit {
}
/**
* Generates an array of patch operations based on form changes
* @returns Array of patch operations
@@ -253,6 +254,7 @@ export class LdnServiceFormEditComponent implements OnInit {
patternArray.controls[index].patchValue({patternLabel: this.translateService.instant('ldn-service.form.pattern.' + patternValue + '.label')})
}
/**
* Selects an outbound item filter by updating its value based on the provided filter value and index
* @param filterValue - The selected filter value
@@ -418,6 +420,7 @@ export class LdnServiceFormEditComponent implements OnInit {
this.markedForDeletionOutboundPattern.splice(i, 1);
}
}
/**
* Deletes marked inbound patterns from the form model
*/

View File

@@ -137,7 +137,7 @@ export class LdnServiceFormComponent implements OnInit {
}
/**
* Handles the creation of an LDN service by validating form fields,
* Handles the creation of an LDN service by retrieving and validating form fields,
* and submitting the form data to the LDN services endpoint.
*/
createService() {
@@ -334,6 +334,7 @@ export class LdnServiceFormComponent implements OnInit {
private sendBack() {
this.router.navigateByUrl('admin/ldn/services');
}
/**
* Creates a form group for an outbound pattern in the notifyServiceOutboundPatterns form array.
*

View File

@@ -84,7 +84,7 @@ export const mockLdnServices: LdnService[] = [{
get self(): string {
return "";
},
},{
}, {
uuid: "2",
enabled: false,
score: 0,

View File

@@ -15,7 +15,7 @@ import {LdnServicesOverviewComponent} from './ldn-services-directory.component';
import {createSuccessfulRemoteDataObject$} from "../../../shared/remote-data.utils";
import {createPaginatedList} from "../../../shared/testing/utils.test";
describe('LdnServicesOverviewComponent', ( ) => {
describe('LdnServicesOverviewComponent', () => {
let component: LdnServicesOverviewComponent;
let fixture: ComponentFixture<LdnServicesOverviewComponent>;
let ldnServicesService;
@@ -45,7 +45,8 @@ describe('LdnServicesOverviewComponent', ( ) => {
{provide: PaginationService, useValue: paginationService},
{
provide: NgbModal, useValue: {
open: () => { /*comment*/}
open: () => { /*comment*/
}
}
},
{provide: ChangeDetectorRef, useValue: {}},

View File

@@ -27,7 +27,7 @@ import {TranslateService} from '@ngx-translate/core';
/**
* The `LdnServicesOverviewComponent` is a component that provides an overview of LDN (Linked Data Notifications) services.
* It displays a paginated list of LDN services, allows users to edit and delete services,
* toggle the status of each service directly form the page and allows for creation of new services redirecting the user on the creation form
* toggle the status of each service directly form the page and allows for creation of new services redirecting the user on the creation/edit form
*/
@Component({
selector: 'ds-ldn-services-directory',
@@ -52,7 +52,6 @@ export class LdnServicesOverviewComponent implements OnInit, OnDestroy {
modalRef: any;
constructor(
protected ldnServicesService: LdnServicesService,
protected paginationService: PaginationService,