[DURACOM-191] Add missing data service

This commit is contained in:
Giuseppe Digilio
2024-03-17 19:21:56 +01:00
parent 2e8817712a
commit 00479132ab
2 changed files with 7 additions and 6 deletions

View File

@@ -27,6 +27,7 @@ import { WORKSPACEITEM } from './eperson/models/workspaceitem.resource-type';
import { FEEDBACK } from './feedback/models/feedback.resource-type'; import { FEEDBACK } from './feedback/models/feedback.resource-type';
import { METADATA_FIELD } from './metadata/metadata-field.resource-type'; import { METADATA_FIELD } from './metadata/metadata-field.resource-type';
import { METADATA_SCHEMA } from './metadata/metadata-schema.resource-type'; import { METADATA_SCHEMA } from './metadata/metadata-schema.resource-type';
import { SUGGESTION } from './notifications/models/suggestion-objects.resource-type';
import { SUGGESTION_SOURCE } from './notifications/models/suggestion-source-object.resource-type'; import { SUGGESTION_SOURCE } from './notifications/models/suggestion-source-object.resource-type';
import { SUGGESTION_TARGET } from './notifications/models/suggestion-target-object.resource-type'; import { SUGGESTION_TARGET } from './notifications/models/suggestion-target-object.resource-type';
import { QUALITY_ASSURANCE_EVENT_OBJECT } from './notifications/qa/models/quality-assurance-event-object.resource-type'; import { QUALITY_ASSURANCE_EVENT_OBJECT } from './notifications/qa/models/quality-assurance-event-object.resource-type';
@@ -130,6 +131,7 @@ export const LAZY_DATA_SERVICES: LazyDataServicesMap = {
[QUALITY_ASSURANCE_EVENT_OBJECT.value]: () => import('./notifications/qa/events/quality-assurance-event-data.service').then(m => m.QualityAssuranceEventDataService), [QUALITY_ASSURANCE_EVENT_OBJECT.value]: () => import('./notifications/qa/events/quality-assurance-event-data.service').then(m => m.QualityAssuranceEventDataService),
[QUALITY_ASSURANCE_SOURCE_OBJECT.value]: () => import('./notifications/qa/source/quality-assurance-source-data.service').then(m => m.QualityAssuranceSourceDataService), [QUALITY_ASSURANCE_SOURCE_OBJECT.value]: () => import('./notifications/qa/source/quality-assurance-source-data.service').then(m => m.QualityAssuranceSourceDataService),
[QUALITY_ASSURANCE_TOPIC_OBJECT.value]: () => import('./notifications/qa/topics/quality-assurance-topic-data.service').then(m => m.QualityAssuranceTopicDataService), [QUALITY_ASSURANCE_TOPIC_OBJECT.value]: () => import('./notifications/qa/topics/quality-assurance-topic-data.service').then(m => m.QualityAssuranceTopicDataService),
[SUGGESTION.value]: () => import('./notifications/suggestions-data.service').then(m => m.SuggestionsDataService),
[SUGGESTION_SOURCE.value]: () => import('./notifications/source/suggestion-source-data.service').then(m => m.SuggestionSourceDataService), [SUGGESTION_SOURCE.value]: () => import('./notifications/source/suggestion-source-data.service').then(m => m.SuggestionSourceDataService),
[SUGGESTION_TARGET.value]: () => import('./notifications/target/suggestion-target-data.service').then(m => m.SuggestionTargetDataService), [SUGGESTION_TARGET.value]: () => import('./notifications/target/suggestion-target-data.service').then(m => m.SuggestionTargetDataService),
[DUPLICATE.value]: () => import('./submission/submission-duplicate-data.service').then(m => m.SubmissionDuplicateDataService), [DUPLICATE.value]: () => import('./submission/submission-duplicate-data.service').then(m => m.SubmissionDuplicateDataService),

View File

@@ -6,11 +6,11 @@ import { Observable } from 'rxjs';
import { NotificationsService } from '../../shared/notifications/notifications.service'; import { NotificationsService } from '../../shared/notifications/notifications.service';
import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model'; import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
import { dataService } from '../cache/builders/build-decorators';
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
import { RequestParam } from '../cache/models/request-param.model'; import { RequestParam } from '../cache/models/request-param.model';
import { ObjectCacheService } from '../cache/object-cache.service'; import { ObjectCacheService } from '../cache/object-cache.service';
import { CoreState } from '../core-state.model'; import { CoreState } from '../core-state.model';
import { IdentifiableDataService } from '../data/base/identifiable-data.service';
import { ChangeAnalyzer } from '../data/change-analyzer'; import { ChangeAnalyzer } from '../data/change-analyzer';
import { DefaultChangeAnalyzer } from '../data/default-change-analyzer.service'; import { DefaultChangeAnalyzer } from '../data/default-change-analyzer.service';
import { FindListOptions } from '../data/find-list-options.model'; import { FindListOptions } from '../data/find-list-options.model';
@@ -21,7 +21,6 @@ import { UpdateDataServiceImpl } from '../data/update-data.service';
import { HALEndpointService } from '../shared/hal-endpoint.service'; import { HALEndpointService } from '../shared/hal-endpoint.service';
import { NoContent } from '../shared/NoContent.model'; import { NoContent } from '../shared/NoContent.model';
import { Suggestion } from './models/suggestion.model'; import { Suggestion } from './models/suggestion.model';
import { SUGGESTION } from './models/suggestion-objects.resource-type';
import { SuggestionSource } from './models/suggestion-source.model'; import { SuggestionSource } from './models/suggestion-source.model';
import { SuggestionTarget } from './models/suggestion-target.model'; import { SuggestionTarget } from './models/suggestion-target.model';
import { SuggestionSourceDataService } from './source/suggestion-source-data.service'; import { SuggestionSourceDataService } from './source/suggestion-source-data.service';
@@ -65,8 +64,7 @@ export class SuggestionDataServiceImpl extends UpdateDataServiceImpl<Suggestion>
* The service handling all Suggestion Target REST requests. * The service handling all Suggestion Target REST requests.
*/ */
@Injectable({ providedIn: 'root' }) @Injectable({ providedIn: 'root' })
@dataService(SUGGESTION) export class SuggestionsDataService extends IdentifiableDataService<Suggestion> {
export class SuggestionsDataService {
protected searchFindBySourceMethod = 'findBySource'; protected searchFindBySourceMethod = 'findBySource';
protected searchFindByTargetAndSourceMethod = 'findByTargetAndSource'; protected searchFindByTargetAndSourceMethod = 'findByTargetAndSource';
@@ -85,12 +83,11 @@ export class SuggestionsDataService {
*/ */
private suggestionTargetsDataService: SuggestionTargetDataService; private suggestionTargetsDataService: SuggestionTargetDataService;
private responseMsToLive = 10 * 1000;
/** /**
* Initialize service variables * Initialize service variables
* @param {RequestService} requestService * @param {RequestService} requestService
* @param {RemoteDataBuildService} rdbService * @param {RemoteDataBuildService} rdbService
* @param {Store} store
* @param {ObjectCacheService} objectCache * @param {ObjectCacheService} objectCache
* @param {HALEndpointService} halService * @param {HALEndpointService} halService
* @param {NotificationsService} notificationsService * @param {NotificationsService} notificationsService
@@ -102,6 +99,7 @@ export class SuggestionsDataService {
constructor( constructor(
protected requestService: RequestService, protected requestService: RequestService,
protected rdbService: RemoteDataBuildService, protected rdbService: RemoteDataBuildService,
protected store: Store<CoreState>,
protected objectCache: ObjectCacheService, protected objectCache: ObjectCacheService,
protected halService: HALEndpointService, protected halService: HALEndpointService,
protected notificationsService: NotificationsService, protected notificationsService: NotificationsService,
@@ -110,6 +108,7 @@ export class SuggestionsDataService {
protected comparatorSources: DefaultChangeAnalyzer<SuggestionSource>, protected comparatorSources: DefaultChangeAnalyzer<SuggestionSource>,
protected comparatorTargets: DefaultChangeAnalyzer<SuggestionTarget>, protected comparatorTargets: DefaultChangeAnalyzer<SuggestionTarget>,
) { ) {
super('suggestions', requestService, rdbService, objectCache, halService);
this.suggestionsDataService = new SuggestionDataServiceImpl(requestService, rdbService, null, objectCache, halService, notificationsService, http, comparatorSuggestions, this.responseMsToLive); this.suggestionsDataService = new SuggestionDataServiceImpl(requestService, rdbService, null, objectCache, halService, notificationsService, http, comparatorSuggestions, this.responseMsToLive);
this.suggestionSourcesDataService = new SuggestionSourceDataService(requestService, rdbService, null, objectCache, halService, notificationsService, http, comparatorSources); this.suggestionSourcesDataService = new SuggestionSourceDataService(requestService, rdbService, null, objectCache, halService, notificationsService, http, comparatorSources);
this.suggestionTargetsDataService = new SuggestionTargetDataService(requestService, rdbService, null, objectCache, halService, notificationsService, http, comparatorTargets); this.suggestionTargetsDataService = new SuggestionTargetDataService(requestService, rdbService, null, objectCache, halService, notificationsService, http, comparatorTargets);