mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 15:33:04 +00:00
CST-11045 Improved css and remove console log and interpolation, added small notify regarding service compatibility
This commit is contained in:
@@ -61,6 +61,8 @@ export class SubmissionSectionCoarNotifyComponent extends SectionModelComponent
|
||||
patterns: string[] = [];
|
||||
selectedServices: { [key: string]: LdnService } = {};
|
||||
patternsLoaded = false;
|
||||
selectedService: any;
|
||||
|
||||
|
||||
public AlertTypeEnum = AlertType;
|
||||
/**
|
||||
@@ -181,6 +183,18 @@ export class SubmissionSectionCoarNotifyComponent extends SectionModelComponent
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
addService() {
|
||||
this.patterns.push('');
|
||||
}
|
||||
|
||||
|
||||
removeService(index: number) {
|
||||
if (index >= 0 && index < this.patterns.length) {
|
||||
this.patterns.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the customEvent (ex. drag-drop move event).
|
||||
* The customEvent is stored inside event.$event
|
||||
@@ -301,25 +315,43 @@ export class SubmissionSectionCoarNotifyComponent extends SectionModelComponent
|
||||
*/
|
||||
fetchLdnServices() {
|
||||
this.ldnServicesRD$ = this.ldnServicesService.findAll().pipe(
|
||||
getFirstCompletedRemoteData()
|
||||
getFirstCompletedRemoteData()
|
||||
);
|
||||
|
||||
this.ldnServicesRD$.subscribe((data) => {
|
||||
if (this.patternsLoaded) {
|
||||
this.patterns.forEach((pattern) => {
|
||||
this.selectedServices[pattern] = data.payload.page.find((service) =>
|
||||
this.hasInboundPattern(service, `Request ${pattern}`)
|
||||
this.hasInboundPattern(service, pattern)
|
||||
);
|
||||
|
||||
//console.log('Pattern:', pattern);
|
||||
//console.log('Service:', this.selectedServices[pattern]);
|
||||
|
||||
if (this.selectedServices[pattern]) {
|
||||
//console.log('Name:', this.selectedServices[pattern].name);
|
||||
//console.log('Description:', this.selectedServices[pattern].description);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
protected getSectionStatus(): Observable<boolean> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
hasInboundPattern(service: any, patternType: string): boolean {
|
||||
return service.notifyServiceInboundPatterns.some(pattern => pattern.pattern === patternType);
|
||||
//console.log('Pattern Type:', patternType);
|
||||
//console.log('Inbound Patterns in Service:', service.notifyServiceInboundPatterns);
|
||||
|
||||
const hasPattern = service.notifyServiceInboundPatterns.some((pattern: { pattern: string; }) => {
|
||||
//console.log('Checking Pattern:', pattern.pattern);
|
||||
return pattern.pattern === patternType;
|
||||
});
|
||||
|
||||
//console.log('Has Inbound Pattern:', hasPattern);
|
||||
return hasPattern;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user