mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
CST-12498 Final refactor
This commit is contained in:
@@ -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
|
||||
@@ -370,8 +372,8 @@ export class LdnServiceFormEditComponent implements OnInit {
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the form and navigates back to the LDN services page
|
||||
*/
|
||||
* Resets the form and navigates back to the LDN services page
|
||||
*/
|
||||
resetFormAndLeave() {
|
||||
this.sendBack();
|
||||
this.closeModal();
|
||||
@@ -418,6 +420,7 @@ export class LdnServiceFormEditComponent implements OnInit {
|
||||
this.markedForDeletionOutboundPattern.splice(i, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes marked inbound patterns from the form model
|
||||
*/
|
||||
|
@@ -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.
|
||||
*
|
||||
|
@@ -84,7 +84,7 @@ export const mockLdnServices: LdnService[] = [{
|
||||
get self(): string {
|
||||
return "";
|
||||
},
|
||||
},{
|
||||
}, {
|
||||
uuid: "2",
|
||||
enabled: false,
|
||||
score: 0,
|
||||
|
@@ -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: {}},
|
||||
|
@@ -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,14 +52,13 @@ export class LdnServicesOverviewComponent implements OnInit, OnDestroy {
|
||||
modalRef: any;
|
||||
|
||||
|
||||
|
||||
constructor(
|
||||
protected ldnServicesService: LdnServicesService,
|
||||
protected paginationService: PaginationService,
|
||||
protected modalService: NgbModal,
|
||||
public cdRef: ChangeDetectorRef,
|
||||
private notificationService: NotificationsService,
|
||||
private translateService: TranslateService,
|
||||
protected ldnServicesService: LdnServicesService,
|
||||
protected paginationService: PaginationService,
|
||||
protected modalService: NgbModal,
|
||||
public cdRef: ChangeDetectorRef,
|
||||
private notificationService: NotificationsService,
|
||||
private translateService: TranslateService,
|
||||
) {
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user