mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 10:34:15 +00:00
CST-5249_suggestion refactor deleting 'reciter', docs
This commit is contained in:
@@ -4,7 +4,7 @@ import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/r
|
|||||||
/**
|
/**
|
||||||
* Interface for the route parameters.
|
* Interface for the route parameters.
|
||||||
*/
|
*/
|
||||||
export interface AdminNotificationsSuggestionTargetsPageParams {
|
export interface AdminNotificationsPublicationClaimPageParams {
|
||||||
pageId?: string;
|
pageId?: string;
|
||||||
pageSize?: number;
|
pageSize?: number;
|
||||||
currentPage?: number;
|
currentPage?: number;
|
||||||
@@ -14,7 +14,7 @@ export interface AdminNotificationsSuggestionTargetsPageParams {
|
|||||||
* This class represents a resolver that retrieve the route data before the route is activated.
|
* This class represents a resolver that retrieve the route data before the route is activated.
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AdminNotificationsSuggestionTargetsPageResolver implements Resolve<AdminNotificationsSuggestionTargetsPageParams> {
|
export class AdminNotificationsPublicationClaimPageResolver implements Resolve<AdminNotificationsPublicationClaimPageParams> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method for resolving the parameters in the current route.
|
* Method for resolving the parameters in the current route.
|
||||||
@@ -22,7 +22,7 @@ export class AdminNotificationsSuggestionTargetsPageResolver implements Resolve<
|
|||||||
* @param {RouterStateSnapshot} state The current RouterStateSnapshot
|
* @param {RouterStateSnapshot} state The current RouterStateSnapshot
|
||||||
* @returns AdminNotificationsSuggestionTargetsPageParams Emits the route parameters
|
* @returns AdminNotificationsSuggestionTargetsPageParams Emits the route parameters
|
||||||
*/
|
*/
|
||||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): AdminNotificationsSuggestionTargetsPageParams {
|
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): AdminNotificationsPublicationClaimPageParams {
|
||||||
return {
|
return {
|
||||||
pageId: route.queryParams.pageId,
|
pageId: route.queryParams.pageId,
|
||||||
pageSize: parseInt(route.queryParams.pageSize, 10),
|
pageSize: parseInt(route.queryParams.pageSize, 10),
|
@@ -1,6 +1,6 @@
|
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { AdminNotificationsSuggestionTargetsPageComponent } from './admin-notifications-suggestion-targets-page.component';
|
import { AdminNotificationsSuggestionTargetsPageComponent } from './admin-notifications-publication-claim-page.component';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
@@ -0,0 +1,10 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-admin-notifications-publication-claim-page',
|
||||||
|
templateUrl: './admin-notifications-publication-claim-page.component.html',
|
||||||
|
styleUrls: ['./admin-notifications-publication-claim-page.component.scss']
|
||||||
|
})
|
||||||
|
export class AdminNotificationsSuggestionTargetsPageComponent {
|
||||||
|
|
||||||
|
}
|
@@ -2,7 +2,7 @@ import { URLCombiner } from '../../core/url-combiner/url-combiner';
|
|||||||
import { getNotificationsModuleRoute } from '../admin-routing-paths';
|
import { getNotificationsModuleRoute } from '../admin-routing-paths';
|
||||||
|
|
||||||
export const QUALITY_ASSURANCE_EDIT_PATH = 'quality-assurance';
|
export const QUALITY_ASSURANCE_EDIT_PATH = 'quality-assurance';
|
||||||
export const PUBLICATION_CLAIMS_PATH = 'publication-claims';
|
export const PUBLICATION_CLAIMS_PATH = 'publication-claim';
|
||||||
|
|
||||||
export function getQualityAssuranceRoute(id: string) {
|
export function getQualityAssuranceRoute(id: string) {
|
||||||
return new URLCombiner(getNotificationsModuleRoute(), QUALITY_ASSURANCE_EDIT_PATH, id).toString();
|
return new URLCombiner(getNotificationsModuleRoute(), QUALITY_ASSURANCE_EDIT_PATH, id).toString();
|
||||||
|
@@ -5,8 +5,8 @@ import { AuthenticatedGuard } from '../../core/auth/authenticated.guard';
|
|||||||
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||||
import { I18nBreadcrumbsService } from '../../core/breadcrumbs/i18n-breadcrumbs.service';
|
import { I18nBreadcrumbsService } from '../../core/breadcrumbs/i18n-breadcrumbs.service';
|
||||||
import { PUBLICATION_CLAIMS_PATH } from './admin-notifications-routing-paths';
|
import { PUBLICATION_CLAIMS_PATH } from './admin-notifications-routing-paths';
|
||||||
import { AdminNotificationsSuggestionTargetsPageComponent } from './admin-notifications-suggestion-targets-page/admin-notifications-suggestion-targets-page.component';
|
import { AdminNotificationsSuggestionTargetsPageComponent } from './admin-notifications-publication-claim-page/admin-notifications-publication-claim-page.component';
|
||||||
import { AdminNotificationsSuggestionTargetsPageResolver } from './admin-notifications-suggestion-targets-page/admin-notifications-suggestion-targets-page-resolver.service';
|
import { AdminNotificationsPublicationClaimPageResolver } from './admin-notifications-publication-claim-page/admin-notifications-publication-claim-page-resolver.service';
|
||||||
import { QUALITY_ASSURANCE_EDIT_PATH } from './admin-notifications-routing-paths';
|
import { QUALITY_ASSURANCE_EDIT_PATH } from './admin-notifications-routing-paths';
|
||||||
import { AdminQualityAssuranceTopicsPageComponent } from './admin-quality-assurance-topics-page/admin-quality-assurance-topics-page.component';
|
import { AdminQualityAssuranceTopicsPageComponent } from './admin-quality-assurance-topics-page/admin-quality-assurance-topics-page.component';
|
||||||
import { AdminQualityAssuranceEventsPageComponent } from './admin-quality-assurance-events-page/admin-quality-assurance-events-page.component';
|
import { AdminQualityAssuranceEventsPageComponent } from './admin-quality-assurance-events-page/admin-quality-assurance-events-page.component';
|
||||||
@@ -30,11 +30,11 @@ import {
|
|||||||
pathMatch: 'full',
|
pathMatch: 'full',
|
||||||
resolve: {
|
resolve: {
|
||||||
breadcrumb: I18nBreadcrumbResolver,
|
breadcrumb: I18nBreadcrumbResolver,
|
||||||
reciterSuggestionTargetParams: AdminNotificationsSuggestionTargetsPageResolver
|
suggestionTargetParams: AdminNotificationsPublicationClaimPageResolver
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
title: 'admin.notifications.recitersuggestion.page.title',
|
title: 'admin.notifications.publicationclaim.page.title',
|
||||||
breadcrumbKey: 'admin.notifications.recitersuggestion',
|
breadcrumbKey: 'admin.notifications.publicationclaim',
|
||||||
showBreadcrumbsFluid: false
|
showBreadcrumbsFluid: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -89,7 +89,7 @@ import {
|
|||||||
providers: [
|
providers: [
|
||||||
I18nBreadcrumbResolver,
|
I18nBreadcrumbResolver,
|
||||||
I18nBreadcrumbsService,
|
I18nBreadcrumbsService,
|
||||||
AdminNotificationsSuggestionTargetsPageResolver,
|
AdminNotificationsPublicationClaimPageResolver,
|
||||||
SourceDataResolver,
|
SourceDataResolver,
|
||||||
AdminQualityAssuranceSourcePageResolver,
|
AdminQualityAssuranceSourcePageResolver,
|
||||||
AdminQualityAssuranceTopicsPageResolver,
|
AdminQualityAssuranceTopicsPageResolver,
|
||||||
|
@@ -1,10 +0,0 @@
|
|||||||
import { Component } from '@angular/core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'ds-admin-notifications-reciter-page',
|
|
||||||
templateUrl: './admin-notifications-suggestion-targets-page.component.html',
|
|
||||||
styleUrls: ['./admin-notifications-suggestion-targets-page.component.scss']
|
|
||||||
})
|
|
||||||
export class AdminNotificationsSuggestionTargetsPageComponent {
|
|
||||||
|
|
||||||
}
|
|
@@ -3,7 +3,7 @@ import { NgModule } from '@angular/core';
|
|||||||
import { CoreModule } from '../../core/core.module';
|
import { CoreModule } from '../../core/core.module';
|
||||||
import { SharedModule } from '../../shared/shared.module';
|
import { SharedModule } from '../../shared/shared.module';
|
||||||
import { AdminNotificationsRoutingModule } from './admin-notifications-routing.module';
|
import { AdminNotificationsRoutingModule } from './admin-notifications-routing.module';
|
||||||
import { AdminNotificationsSuggestionTargetsPageComponent } from './admin-notifications-suggestion-targets-page/admin-notifications-suggestion-targets-page.component';
|
import { AdminNotificationsSuggestionTargetsPageComponent } from './admin-notifications-publication-claim-page/admin-notifications-publication-claim-page.component';
|
||||||
import { AdminQualityAssuranceTopicsPageComponent } from './admin-quality-assurance-topics-page/admin-quality-assurance-topics-page.component';
|
import { AdminQualityAssuranceTopicsPageComponent } from './admin-quality-assurance-topics-page/admin-quality-assurance-topics-page.component';
|
||||||
import { AdminQualityAssuranceEventsPageComponent } from './admin-quality-assurance-events-page/admin-quality-assurance-events-page.component';
|
import { AdminQualityAssuranceEventsPageComponent } from './admin-quality-assurance-events-page/admin-quality-assurance-events-page.component';
|
||||||
import { AdminQualityAssuranceSourcePageComponent } from './admin-quality-assurance-source-page-component/admin-quality-assurance-source-page.component';
|
import { AdminQualityAssuranceSourcePageComponent } from './admin-quality-assurance-source-page-component/admin-quality-assurance-source-page.component';
|
||||||
|
@@ -185,8 +185,8 @@ import { FlatBrowseDefinition } from './shared/flat-browse-definition.model';
|
|||||||
import { ValueListBrowseDefinition } from './shared/value-list-browse-definition.model';
|
import { ValueListBrowseDefinition } from './shared/value-list-browse-definition.model';
|
||||||
import { NonHierarchicalBrowseDefinition } from './shared/non-hierarchical-browse-definition';
|
import { NonHierarchicalBrowseDefinition } from './shared/non-hierarchical-browse-definition';
|
||||||
import { BulkAccessConditionOptions } from './config/models/bulk-access-condition-options.model';
|
import { BulkAccessConditionOptions } from './config/models/bulk-access-condition-options.model';
|
||||||
import { SuggestionTarget } from './suggestion-notifications/reciter-suggestions/models/suggestion-target.model';
|
import { SuggestionTarget } from './suggestion-notifications/models/suggestion-target.model';
|
||||||
import { SuggestionSource } from './suggestion-notifications/reciter-suggestions/models/suggestion-source.model';
|
import { SuggestionSource } from './suggestion-notifications/models/suggestion-source.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When not in production, endpoint responses can be mocked for testing purposes
|
* When not in production, endpoint responses can be mocked for testing purposes
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { ResourceType } from '../../../shared/resource-type';
|
import { ResourceType } from '../../shared/resource-type';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The resource type for the Suggestion object
|
* The resource type for the Suggestion object
|
@@ -1,4 +1,4 @@
|
|||||||
import { ResourceType } from '../../../shared/resource-type';
|
import { ResourceType } from '../../shared/resource-type';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The resource type for the Suggestion Source object
|
* The resource type for the Suggestion Source object
|
@@ -1,11 +1,11 @@
|
|||||||
import { autoserialize, deserialize } from 'cerialize';
|
import { autoserialize, deserialize } from 'cerialize';
|
||||||
|
|
||||||
import { SUGGESTION_SOURCE } from './suggestion-source-object.resource-type';
|
import { SUGGESTION_SOURCE } from './suggestion-source-object.resource-type';
|
||||||
import { excludeFromEquals } from '../../../utilities/equals.decorators';
|
import { excludeFromEquals } from '../../utilities/equals.decorators';
|
||||||
import { ResourceType } from '../../../shared/resource-type';
|
import { ResourceType } from '../../shared/resource-type';
|
||||||
import { HALLink } from '../../../shared/hal-link.model';
|
import { HALLink } from '../../shared/hal-link.model';
|
||||||
import { typedObject } from '../../../cache/builders/build-decorators';
|
import { typedObject } from '../../cache/builders/build-decorators';
|
||||||
import {CacheableObject} from '../../../cache/cacheable-object.model';
|
import {CacheableObject} from '../../cache/cacheable-object.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The interface representing the Suggestion Source model
|
* The interface representing the Suggestion Source model
|
@@ -1,4 +1,4 @@
|
|||||||
import { ResourceType } from '../../../shared/resource-type';
|
import { ResourceType } from '../../shared/resource-type';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The resource type for the Suggestion Target object
|
* The resource type for the Suggestion Target object
|
@@ -1,12 +1,12 @@
|
|||||||
import { autoserialize, deserialize } from 'cerialize';
|
import { autoserialize, deserialize } from 'cerialize';
|
||||||
|
|
||||||
|
|
||||||
import { CacheableObject } from '../../../cache/cacheable-object.model';
|
import { CacheableObject } from '../../cache/cacheable-object.model';
|
||||||
import { SUGGESTION_TARGET } from './suggestion-target-object.resource-type';
|
import { SUGGESTION_TARGET } from './suggestion-target-object.resource-type';
|
||||||
import { excludeFromEquals } from '../../../utilities/equals.decorators';
|
import { excludeFromEquals } from '../../utilities/equals.decorators';
|
||||||
import { ResourceType } from '../../../shared/resource-type';
|
import { ResourceType } from '../../shared/resource-type';
|
||||||
import { HALLink } from '../../../shared/hal-link.model';
|
import { HALLink } from '../../shared/hal-link.model';
|
||||||
import { typedObject } from '../../../cache/builders/build-decorators';
|
import { typedObject } from '../../cache/builders/build-decorators';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The interface representing the Suggestion Target model
|
* The interface representing the Suggestion Target model
|
@@ -1,13 +1,16 @@
|
|||||||
import { autoserialize, autoserializeAs, deserialize } from 'cerialize';
|
import { autoserialize, autoserializeAs, deserialize } from 'cerialize';
|
||||||
|
|
||||||
import { SUGGESTION } from './suggestion-objects.resource-type';
|
import { SUGGESTION } from './suggestion-objects.resource-type';
|
||||||
import { excludeFromEquals } from '../../../utilities/equals.decorators';
|
import { excludeFromEquals } from '../../utilities/equals.decorators';
|
||||||
import { ResourceType } from '../../../shared/resource-type';
|
import { ResourceType } from '../../shared/resource-type';
|
||||||
import { HALLink } from '../../../shared/hal-link.model';
|
import { HALLink } from '../../shared/hal-link.model';
|
||||||
import { typedObject } from '../../../cache/builders/build-decorators';
|
import { typedObject } from '../../cache/builders/build-decorators';
|
||||||
import { MetadataMap, MetadataMapSerializer } from '../../../shared/metadata.models';
|
import { MetadataMap, MetadataMapSerializer } from '../../shared/metadata.models';
|
||||||
import {CacheableObject} from '../../../cache/cacheable-object.model';
|
import {CacheableObject} from '../../cache/cacheable-object.model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The interface representing Suggestion Evidences such as scores (authorScore, datescore)
|
||||||
|
*/
|
||||||
export interface SuggestionEvidences {
|
export interface SuggestionEvidences {
|
||||||
[sectionId: string]: {
|
[sectionId: string]: {
|
||||||
score: string;
|
score: string;
|
@@ -1,24 +1,27 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { dataService } from '../../../data/base/data-service.decorator';
|
import { dataService } from '../../data/base/data-service.decorator';
|
||||||
import { SUGGESTION_SOURCE } from '../models/suggestion-source-object.resource-type';
|
import { SUGGESTION_SOURCE } from '../models/suggestion-source-object.resource-type';
|
||||||
import { IdentifiableDataService } from '../../../data/base/identifiable-data.service';
|
import { IdentifiableDataService } from '../../data/base/identifiable-data.service';
|
||||||
import { SuggestionSource } from '../models/suggestion-source.model';
|
import { SuggestionSource } from '../models/suggestion-source.model';
|
||||||
import { FindAllData, FindAllDataImpl } from '../../../data/base/find-all-data';
|
import { FindAllData, FindAllDataImpl } from '../../data/base/find-all-data';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { RequestService } from '../../../data/request.service';
|
import { RequestService } from '../../data/request.service';
|
||||||
import { RemoteDataBuildService } from '../../../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../../cache/builders/remote-data-build.service';
|
||||||
import { CoreState } from '../../../core-state.model';
|
import { CoreState } from '../../core-state.model';
|
||||||
import { ObjectCacheService } from '../../../cache/object-cache.service';
|
import { ObjectCacheService } from '../../cache/object-cache.service';
|
||||||
import { HALEndpointService } from '../../../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../../shared/hal-endpoint.service';
|
||||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { FindListOptions } from '../../../data/find-list-options.model';
|
import { FindListOptions } from '../../data/find-list-options.model';
|
||||||
import { FollowLinkConfig } from '../../../../shared/utils/follow-link-config.model';
|
import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model';
|
||||||
import { PaginatedList } from '../../../data/paginated-list.model';
|
import { PaginatedList } from '../../data/paginated-list.model';
|
||||||
import { RemoteData } from '../../../data/remote-data';
|
import { RemoteData } from '../../data/remote-data';
|
||||||
import { Observable } from 'rxjs/internal/Observable';
|
import { Observable } from 'rxjs/internal/Observable';
|
||||||
import { DefaultChangeAnalyzer } from '../../../data/default-change-analyzer.service';
|
import { DefaultChangeAnalyzer } from '../../data/default-change-analyzer.service';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Service that retrieves Suggestion Source data
|
||||||
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@dataService(SUGGESTION_SOURCE)
|
@dataService(SUGGESTION_SOURCE)
|
||||||
export class SuggestionSourceDataService extends IdentifiableDataService<SuggestionSource> {
|
export class SuggestionSourceDataService extends IdentifiableDataService<SuggestionSource> {
|
@@ -1,25 +1,25 @@
|
|||||||
import { TestScheduler } from 'rxjs/testing';
|
import { TestScheduler } from 'rxjs/testing';
|
||||||
import { RequestService } from '../../../data/request.service';
|
import { RequestService } from '../../data/request.service';
|
||||||
import { RemoteDataBuildService } from '../../../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../../cache/builders/remote-data-build.service';
|
||||||
import { ObjectCacheService } from '../../../cache/object-cache.service';
|
import { ObjectCacheService } from '../../cache/object-cache.service';
|
||||||
import { HALEndpointService } from '../../../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../../shared/hal-endpoint.service';
|
||||||
import { RequestEntry } from '../../../data/request-entry.model';
|
import { RequestEntry } from '../../data/request-entry.model';
|
||||||
import { cold, getTestScheduler } from 'jasmine-marbles';
|
import { cold, getTestScheduler } from 'jasmine-marbles';
|
||||||
import { RestResponse } from '../../../cache/response.models';
|
import { RestResponse } from '../../cache/response.models';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { CoreState } from '../../../core-state.model';
|
import { CoreState } from '../../core-state.model';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { DefaultChangeAnalyzer } from '../../../data/default-change-analyzer.service';
|
import { DefaultChangeAnalyzer } from '../../data/default-change-analyzer.service';
|
||||||
import { testFindAllDataImplementation } from '../../../data/base/find-all-data.spec';
|
import { testFindAllDataImplementation } from '../../data/base/find-all-data.spec';
|
||||||
import { FindAllData } from '../../../data/base/find-all-data';
|
import { FindAllData } from '../../data/base/find-all-data';
|
||||||
import { GetRequest } from '../../../data/request.models';
|
import { GetRequest } from '../../data/request.models';
|
||||||
import {
|
import {
|
||||||
createSuccessfulRemoteDataObject$
|
createSuccessfulRemoteDataObject$
|
||||||
} from '../../../../shared/remote-data.utils';
|
} from '../../../shared/remote-data.utils';
|
||||||
import { RemoteData } from '../../../data/remote-data';
|
import { RemoteData } from '../../data/remote-data';
|
||||||
import { RequestEntryState } from '../../../data/request-entry-state.model';
|
import { RequestEntryState } from '../../data/request-entry-state.model';
|
||||||
import { SuggestionSourceDataService } from './suggestion-source-data.service';
|
import { SuggestionSourceDataService } from './suggestion-source-data.service';
|
||||||
import { SuggestionSource } from '../models/suggestion-source.model';
|
import { SuggestionSource } from '../models/suggestion-source.model';
|
||||||
|
|
@@ -1,25 +1,25 @@
|
|||||||
import { TestScheduler } from 'rxjs/testing';
|
import { TestScheduler } from 'rxjs/testing';
|
||||||
import { SuggestionDataServiceImpl, SuggestionsDataService } from './suggestions-data.service';
|
import { SuggestionDataServiceImpl, SuggestionsDataService } from './suggestions-data.service';
|
||||||
import { RequestService } from '../../data/request.service';
|
import { RequestService } from '../data/request.service';
|
||||||
import { RemoteDataBuildService } from '../../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||||
import { ObjectCacheService } from '../../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
import { HALEndpointService } from '../../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { DefaultChangeAnalyzer } from '../../data/default-change-analyzer.service';
|
import { DefaultChangeAnalyzer } from '../data/default-change-analyzer.service';
|
||||||
import { Suggestion } from './models/suggestion.model';
|
import { Suggestion } from './models/suggestion.model';
|
||||||
import { cold, getTestScheduler } from 'jasmine-marbles';
|
import { cold, getTestScheduler } from 'jasmine-marbles';
|
||||||
import { RequestEntry } from '../../data/request-entry.model';
|
import { RequestEntry } from '../data/request-entry.model';
|
||||||
import { RestResponse } from '../../cache/response.models';
|
import { RestResponse } from '../cache/response.models';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||||
import { RemoteData } from '../../data/remote-data';
|
import { RemoteData } from '../data/remote-data';
|
||||||
import { RequestEntryState } from '../../data/request-entry-state.model';
|
import { RequestEntryState } from '../data/request-entry-state.model';
|
||||||
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';
|
||||||
import { SuggestionTargetDataService } from './target/suggestion-target-data.service';
|
import { SuggestionTargetDataService } from './target/suggestion-target-data.service';
|
||||||
import { RequestParam } from '../../cache/models/request-param.model';
|
import { RequestParam } from '../cache/models/request-param.model';
|
||||||
|
|
||||||
describe('SuggestionDataService test', () => {
|
describe('SuggestionDataService test', () => {
|
||||||
let scheduler: TestScheduler;
|
let scheduler: TestScheduler;
|
@@ -5,26 +5,26 @@ import { Store } from '@ngrx/store';
|
|||||||
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
import { HALEndpointService } from '../../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { RemoteDataBuildService } from '../../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||||
import { ObjectCacheService } from '../../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
import { dataService } from '../../cache/builders/build-decorators';
|
import { dataService } from '../cache/builders/build-decorators';
|
||||||
import { RequestService } from '../../data/request.service';
|
import { RequestService } from '../data/request.service';
|
||||||
import { DataService } from '../../data/data.service';
|
import { DataService } from '../data/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 { RemoteData } from '../../data/remote-data';
|
import { RemoteData } from '../data/remote-data';
|
||||||
import { SUGGESTION } from './models/suggestion-objects.resource-type';
|
import { SUGGESTION } from './models/suggestion-objects.resource-type';
|
||||||
import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model';
|
import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
||||||
import { PaginatedList } from '../../data/paginated-list.model';
|
import { PaginatedList } from '../data/paginated-list.model';
|
||||||
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 { Suggestion } from './models/suggestion.model';
|
import { Suggestion } from './models/suggestion.model';
|
||||||
import { RequestParam } from '../../cache/models/request-param.model';
|
import { RequestParam } from '../cache/models/request-param.model';
|
||||||
import { NoContent } from '../../shared/NoContent.model';
|
import { NoContent } from '../shared/NoContent.model';
|
||||||
import {CoreState} from '../../core-state.model';
|
import {CoreState} from '../core-state.model';
|
||||||
import {FindListOptions} from '../../data/find-list-options.model';
|
import {FindListOptions} from '../data/find-list-options.model';
|
||||||
import { SuggestionSourceDataService } from './source/suggestion-source-data.service';
|
import { SuggestionSourceDataService } from './source/suggestion-source-data.service';
|
||||||
import { SuggestionTargetDataService } from './target/suggestion-target-data.service';
|
import { SuggestionTargetDataService } from './target/suggestion-target-data.service';
|
||||||
|
|
@@ -1,25 +1,25 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { dataService } from '../../../data/base/data-service.decorator';
|
import { dataService } from '../../data/base/data-service.decorator';
|
||||||
|
|
||||||
import { IdentifiableDataService } from '../../../data/base/identifiable-data.service';
|
import { IdentifiableDataService } from '../../data/base/identifiable-data.service';
|
||||||
import { SuggestionTarget } from '../models/suggestion-target.model';
|
import { SuggestionTarget } from '../models/suggestion-target.model';
|
||||||
import { FindAllData, FindAllDataImpl } from '../../../data/base/find-all-data';
|
import { FindAllData, FindAllDataImpl } from '../../data/base/find-all-data';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { RequestService } from '../../../data/request.service';
|
import { RequestService } from '../../data/request.service';
|
||||||
import { RemoteDataBuildService } from '../../../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../../cache/builders/remote-data-build.service';
|
||||||
import { CoreState } from '../../../core-state.model';
|
import { CoreState } from '../../core-state.model';
|
||||||
import { ObjectCacheService } from '../../../cache/object-cache.service';
|
import { ObjectCacheService } from '../../cache/object-cache.service';
|
||||||
import { HALEndpointService } from '../../../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../../shared/hal-endpoint.service';
|
||||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { FindListOptions } from '../../../data/find-list-options.model';
|
import { FindListOptions } from '../../data/find-list-options.model';
|
||||||
import { FollowLinkConfig } from '../../../../shared/utils/follow-link-config.model';
|
import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model';
|
||||||
import { PaginatedList } from '../../../data/paginated-list.model';
|
import { PaginatedList } from '../../data/paginated-list.model';
|
||||||
import { RemoteData } from '../../../data/remote-data';
|
import { RemoteData } from '../../data/remote-data';
|
||||||
import { Observable } from 'rxjs/internal/Observable';
|
import { Observable } from 'rxjs/internal/Observable';
|
||||||
import { RequestParam } from '../../../cache/models/request-param.model';
|
import { RequestParam } from '../../cache/models/request-param.model';
|
||||||
import { SearchData, SearchDataImpl } from '../../../data/base/search-data';
|
import { SearchData, SearchDataImpl } from '../../data/base/search-data';
|
||||||
import { DefaultChangeAnalyzer } from '../../../data/default-change-analyzer.service';
|
import { DefaultChangeAnalyzer } from '../../data/default-change-analyzer.service';
|
||||||
import { SUGGESTION_TARGET } from '../models/suggestion-target-object.resource-type';
|
import { SUGGESTION_TARGET } from '../models/suggestion-target-object.resource-type';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
@@ -1,30 +1,30 @@
|
|||||||
import { TestScheduler } from 'rxjs/testing';
|
import { TestScheduler } from 'rxjs/testing';
|
||||||
import { RequestService } from '../../../data/request.service';
|
import { RequestService } from '../../data/request.service';
|
||||||
import { RemoteDataBuildService } from '../../../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../../cache/builders/remote-data-build.service';
|
||||||
import { ObjectCacheService } from '../../../cache/object-cache.service';
|
import { ObjectCacheService } from '../../cache/object-cache.service';
|
||||||
import { HALEndpointService } from '../../../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../../shared/hal-endpoint.service';
|
||||||
import { RequestEntry } from '../../../data/request-entry.model';
|
import { RequestEntry } from '../../data/request-entry.model';
|
||||||
import { cold, getTestScheduler } from 'jasmine-marbles';
|
import { cold, getTestScheduler } from 'jasmine-marbles';
|
||||||
import { RestResponse } from '../../../cache/response.models';
|
import { RestResponse } from '../../cache/response.models';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { CoreState } from '../../../core-state.model';
|
import { CoreState } from '../../core-state.model';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { SearchData } from '../../../data/base/search-data';
|
import { SearchData } from '../../data/base/search-data';
|
||||||
import { testSearchDataImplementation } from '../../../data/base/search-data.spec';
|
import { testSearchDataImplementation } from '../../data/base/search-data.spec';
|
||||||
import { SuggestionTargetDataService } from './suggestion-target-data.service';
|
import { SuggestionTargetDataService } from './suggestion-target-data.service';
|
||||||
import { DefaultChangeAnalyzer } from '../../../data/default-change-analyzer.service';
|
import { DefaultChangeAnalyzer } from '../../data/default-change-analyzer.service';
|
||||||
import { SuggestionTarget } from '../models/suggestion-target.model';
|
import { SuggestionTarget } from '../models/suggestion-target.model';
|
||||||
import { testFindAllDataImplementation } from '../../../data/base/find-all-data.spec';
|
import { testFindAllDataImplementation } from '../../data/base/find-all-data.spec';
|
||||||
import { FindAllData } from '../../../data/base/find-all-data';
|
import { FindAllData } from '../../data/base/find-all-data';
|
||||||
import { GetRequest } from '../../../data/request.models';
|
import { GetRequest } from '../../data/request.models';
|
||||||
import {
|
import {
|
||||||
createSuccessfulRemoteDataObject$
|
createSuccessfulRemoteDataObject$
|
||||||
} from '../../../../shared/remote-data.utils';
|
} from '../../../shared/remote-data.utils';
|
||||||
import { RequestParam } from '../../../cache/models/request-param.model';
|
import { RequestParam } from '../../cache/models/request-param.model';
|
||||||
import { RemoteData } from '../../../data/remote-data';
|
import { RemoteData } from '../../data/remote-data';
|
||||||
import { RequestEntryState } from '../../../data/request-entry-state.model';
|
import { RequestEntryState } from '../../data/request-entry-state.model';
|
||||||
|
|
||||||
describe('SuggestionTargetDataService test', () => {
|
describe('SuggestionTargetDataService test', () => {
|
||||||
let scheduler: TestScheduler;
|
let scheduler: TestScheduler;
|
@@ -561,13 +561,13 @@ export class MenuResolver implements Resolve<boolean> {
|
|||||||
} as LinkMenuItemModel,
|
} as LinkMenuItemModel,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'notifications_reciter',
|
id: 'notifications_publication-claim',
|
||||||
parentID: 'notifications',
|
parentID: 'notifications',
|
||||||
active: false,
|
active: false,
|
||||||
visible: authorized,
|
visible: authorized,
|
||||||
model: {
|
model: {
|
||||||
type: MenuItemType.LINK,
|
type: MenuItemType.LINK,
|
||||||
text: 'menu.section.notifications_reciter',
|
text: 'menu.section.notifications_publication-claim',
|
||||||
link: '/admin/notifications/' + PUBLICATION_CLAIMS_PATH
|
link: '/admin/notifications/' + PUBLICATION_CLAIMS_PATH
|
||||||
} as LinkMenuItemModel,
|
} as LinkMenuItemModel,
|
||||||
},
|
},
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { QualityAssuranceSourceEffects } from './qa/source/quality-assurance-source.effects';
|
import { QualityAssuranceSourceEffects } from './qa/source/quality-assurance-source.effects';
|
||||||
import { QualityAssuranceTopicsEffects } from './qa/topics/quality-assurance-topics.effects';
|
import { QualityAssuranceTopicsEffects } from './qa/topics/quality-assurance-topics.effects';
|
||||||
import { SuggestionTargetsEffects } from '../suggestion-notifications/reciter-suggestions/suggestion-targets/suggestion-targets.effects';
|
import { SuggestionTargetsEffects } from '../suggestion-notifications/suggestion-targets/suggestion-targets.effects';
|
||||||
|
|
||||||
export const notificationsEffects = [
|
export const notificationsEffects = [
|
||||||
QualityAssuranceTopicsEffects,
|
QualityAssuranceTopicsEffects,
|
||||||
|
@@ -26,29 +26,29 @@ import { QualityAssuranceSourceService } from './qa/source/quality-assurance-sou
|
|||||||
import {
|
import {
|
||||||
QualityAssuranceSourceDataService
|
QualityAssuranceSourceDataService
|
||||||
} from '../core/notifications/qa/source/quality-assurance-source-data.service';
|
} from '../core/notifications/qa/source/quality-assurance-source-data.service';
|
||||||
import { SuggestionTargetsComponent } from '../suggestion-notifications/reciter-suggestions/suggestion-targets/suggestion-targets.component';
|
import { SuggestionTargetsComponent } from '../suggestion-notifications/suggestion-targets/suggestion-targets.component';
|
||||||
import { SuggestionActionsComponent } from '../suggestion-notifications/reciter-suggestions/suggestion-actions/suggestion-actions.component';
|
import { SuggestionActionsComponent } from '../suggestion-notifications/suggestion-actions/suggestion-actions.component';
|
||||||
import {
|
import {
|
||||||
SuggestionListElementComponent
|
SuggestionListElementComponent
|
||||||
} from '../suggestion-notifications/reciter-suggestions/suggestion-list-element/suggestion-list-element.component';
|
} from '../suggestion-notifications/suggestion-list-element/suggestion-list-element.component';
|
||||||
import {
|
import {
|
||||||
SuggestionEvidencesComponent
|
SuggestionEvidencesComponent
|
||||||
} from '../suggestion-notifications/reciter-suggestions/suggestion-list-element/suggestion-evidences/suggestion-evidences.component';
|
} from '../suggestion-notifications/suggestion-list-element/suggestion-evidences/suggestion-evidences.component';
|
||||||
import { SuggestionsPopupComponent } from '../suggestion-notifications/reciter-suggestions/suggestions-popup/suggestions-popup.component';
|
import { SuggestionsPopupComponent } from '../suggestion-notifications/suggestions-popup/suggestions-popup.component';
|
||||||
import {
|
import {
|
||||||
SuggestionsNotificationComponent
|
SuggestionsNotificationComponent
|
||||||
} from '../suggestion-notifications/reciter-suggestions/suggestions-notification/suggestions-notification.component';
|
} from '../suggestion-notifications/suggestions-notification/suggestions-notification.component';
|
||||||
import { SuggestionsService } from '../suggestion-notifications/reciter-suggestions/suggestions.service';
|
import { SuggestionsService } from '../suggestion-notifications/suggestions.service';
|
||||||
import { SuggestionsDataService } from '../core/suggestion-notifications/reciter-suggestions/suggestions-data.service';
|
import { SuggestionsDataService } from '../core/suggestion-notifications/suggestions-data.service';
|
||||||
import {
|
import {
|
||||||
SuggestionSourceDataService
|
SuggestionSourceDataService
|
||||||
} from '../core/suggestion-notifications/reciter-suggestions/source/suggestion-source-data.service';
|
} from '../core/suggestion-notifications/source/suggestion-source-data.service';
|
||||||
import {
|
import {
|
||||||
SuggestionTargetDataService
|
SuggestionTargetDataService
|
||||||
} from '../core/suggestion-notifications/reciter-suggestions/target/suggestion-target-data.service';
|
} from '../core/suggestion-notifications/target/suggestion-target-data.service';
|
||||||
import {
|
import {
|
||||||
SuggestionTargetsStateService
|
SuggestionTargetsStateService
|
||||||
} from '../suggestion-notifications/reciter-suggestions/suggestion-targets/suggestion-targets.state.service';
|
} from '../suggestion-notifications/suggestion-targets/suggestion-targets.state.service';
|
||||||
|
|
||||||
|
|
||||||
const MODULES = [
|
const MODULES = [
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { ActionReducerMap, createFeatureSelector } from '@ngrx/store';
|
import { ActionReducerMap, createFeatureSelector } from '@ngrx/store';
|
||||||
import { qualityAssuranceSourceReducer, QualityAssuranceSourceState } from './qa/source/quality-assurance-source.reducer';
|
import { qualityAssuranceSourceReducer, QualityAssuranceSourceState } from './qa/source/quality-assurance-source.reducer';
|
||||||
import { qualityAssuranceTopicsReducer, QualityAssuranceTopicState, } from './qa/topics/quality-assurance-topics.reducer';
|
import { qualityAssuranceTopicsReducer, QualityAssuranceTopicState, } from './qa/topics/quality-assurance-topics.reducer';
|
||||||
import { SuggestionTargetsReducer, SuggestionTargetState } from '../suggestion-notifications/reciter-suggestions/suggestion-targets/suggestion-targets.reducer';
|
import { SuggestionTargetsReducer, SuggestionTargetState } from '../suggestion-notifications/suggestion-targets/suggestion-targets.reducer';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The OpenAIRE State
|
* The OpenAIRE State
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { ResourceType } from '../../core/shared/resource-type';
|
import { ResourceType } from '../../core/shared/resource-type';
|
||||||
import { SuggestionTarget } from '../../core/suggestion-notifications/reciter-suggestions/models/suggestion-target.model';
|
import { SuggestionTarget } from '../../core/suggestion-notifications/models/suggestion-target.model';
|
||||||
|
|
||||||
// REST Mock ---------------------------------------------------------------------
|
// REST Mock ---------------------------------------------------------------------
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
@@ -2,8 +2,8 @@
|
|||||||
// REST Mock ---------------------------------------------------------------------
|
// REST Mock ---------------------------------------------------------------------
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
|
|
||||||
import { Suggestion } from '../../core/suggestion-notifications/reciter-suggestions/models/suggestion.model';
|
import { Suggestion } from '../../core/suggestion-notifications/models/suggestion.model';
|
||||||
import { SUGGESTION } from '../../core/suggestion-notifications/reciter-suggestions/models/suggestion-objects.resource-type';
|
import { SUGGESTION } from '../../core/suggestion-notifications/models/suggestion-objects.resource-type';
|
||||||
|
|
||||||
export const mockSuggestionPublicationOne: Suggestion = {
|
export const mockSuggestionPublicationOne: Suggestion = {
|
||||||
id: '24694773',
|
id: '24694773',
|
@@ -1349,8 +1349,8 @@ export function getMockSuggestionsService(): any {
|
|||||||
deleteReviewedSuggestion: jasmine.createSpy('deleteReviewedSuggestion'),
|
deleteReviewedSuggestion: jasmine.createSpy('deleteReviewedSuggestion'),
|
||||||
retrieveCurrentUserSuggestions: jasmine.createSpy('retrieveCurrentUserSuggestions'),
|
retrieveCurrentUserSuggestions: jasmine.createSpy('retrieveCurrentUserSuggestions'),
|
||||||
getTargetUuid: jasmine.createSpy('getTargetUuid'),
|
getTargetUuid: jasmine.createSpy('getTargetUuid'),
|
||||||
notMine: observableOf(null),
|
ignoreSuggestion: observableOf(null),
|
||||||
notMineMultiple: observableOf({success: 1, fails: 0}),
|
ignoreSuggestionMultiple: observableOf({success: 1, fails: 0}),
|
||||||
approveAndImportMultiple: observableOf({success: 1, fails: 0}),
|
approveAndImportMultiple: observableOf({success: 1, fails: 0}),
|
||||||
approveAndImport: observableOf({id: '1234'}),
|
approveAndImport: observableOf({id: '1234'}),
|
||||||
isCollectionFixed: false,
|
isCollectionFixed: false,
|
||||||
|
@@ -1,44 +1,44 @@
|
|||||||
import {createFeatureSelector, createSelector, MemoizedSelector} from '@ngrx/store';
|
import {createFeatureSelector, createSelector, MemoizedSelector} from '@ngrx/store';
|
||||||
import { suggestionNotificationsSelector, SuggestionNotificationsState } from '../../notifications/notifications.reducer';
|
import { suggestionNotificationsSelector, SuggestionNotificationsState } from '../notifications/notifications.reducer';
|
||||||
import { SuggestionTarget } from '../../core/suggestion-notifications/reciter-suggestions/models/suggestion-target.model';
|
import { SuggestionTarget } from '../core/suggestion-notifications/models/suggestion-target.model';
|
||||||
import { SuggestionTargetState } from './suggestion-targets/suggestion-targets.reducer';
|
import { SuggestionTargetState } from './suggestion-targets/suggestion-targets.reducer';
|
||||||
import {subStateSelector} from '../../submission/selectors';
|
import {subStateSelector} from '../submission/selectors';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the Reciter Suggestion Target state.
|
* Returns the Reciter Suggestion Target state.
|
||||||
* @function _getReciterSuggestionTargetState
|
* @function _getSuggestionTargetState
|
||||||
* @param {AppState} state Top level state.
|
* @param {AppState} state Top level state.
|
||||||
* @return {SuggestionNotificationsState}
|
* @return {SuggestionNotificationsState}
|
||||||
*/
|
*/
|
||||||
const _getReciterSuggestionTargetState = createFeatureSelector<SuggestionNotificationsState>('suggestionNotifications');
|
const _getSuggestionTargetState = createFeatureSelector<SuggestionNotificationsState>('suggestionNotifications');
|
||||||
|
|
||||||
// Reciter Suggestion Targets
|
// Reciter Suggestion Targets
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the Reciter Suggestion Targets State.
|
* Returns the Suggestion Targets State.
|
||||||
* @function reciterSuggestionTargetStateSelector
|
* @function suggestionTargetStateSelector
|
||||||
* @return {SuggestionNotificationsState}
|
* @return {SuggestionNotificationsState}
|
||||||
*/
|
*/
|
||||||
export function reciterSuggestionTargetStateSelector(): MemoizedSelector<SuggestionNotificationsState, SuggestionTargetState> {
|
export function suggestionTargetStateSelector(): MemoizedSelector<SuggestionNotificationsState, SuggestionTargetState> {
|
||||||
return subStateSelector<SuggestionNotificationsState, SuggestionTargetState>(suggestionNotificationsSelector, 'suggestionTarget');
|
return subStateSelector<SuggestionNotificationsState, SuggestionTargetState>(suggestionNotificationsSelector, 'suggestionTarget');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the Reciter Suggestion Targets list.
|
* Returns the Suggestion Targets list.
|
||||||
* @function reciterSuggestionTargetObjectSelector
|
* @function suggestionTargetObjectSelector
|
||||||
* @return {SuggestionTarget[]}
|
* @return {SuggestionTarget[]}
|
||||||
*/
|
*/
|
||||||
export function reciterSuggestionTargetObjectSelector(): MemoizedSelector<SuggestionNotificationsState, SuggestionTarget[]> {
|
export function suggestionTargetObjectSelector(): MemoizedSelector<SuggestionNotificationsState, SuggestionTarget[]> {
|
||||||
return subStateSelector<SuggestionNotificationsState, SuggestionTarget[]>(reciterSuggestionTargetStateSelector(), 'targets');
|
return subStateSelector<SuggestionNotificationsState, SuggestionTarget[]>(suggestionTargetStateSelector(), 'targets');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the Reciter Suggestion Targets are loaded.
|
* Returns true if the Suggestion Targets are loaded.
|
||||||
* @function isReciterSuggestionTargetLoadedSelector
|
* @function isSuggestionTargetLoadedSelector
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
*/
|
*/
|
||||||
export const isReciterSuggestionTargetLoadedSelector = createSelector(_getReciterSuggestionTargetState,
|
export const isSuggestionTargetLoadedSelector = createSelector(_getSuggestionTargetState,
|
||||||
(state: SuggestionNotificationsState) => state.suggestionTarget.loaded
|
(state: SuggestionNotificationsState) => state.suggestionTarget.loaded
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -47,51 +47,51 @@ export const isReciterSuggestionTargetLoadedSelector = createSelector(_getRecite
|
|||||||
* @function isDeduplicationSetsProcessingSelector
|
* @function isDeduplicationSetsProcessingSelector
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
*/
|
*/
|
||||||
export const isReciterSuggestionTargetProcessingSelector = createSelector(_getReciterSuggestionTargetState,
|
export const isReciterSuggestionTargetProcessingSelector = createSelector(_getSuggestionTargetState,
|
||||||
(state: SuggestionNotificationsState) => state.suggestionTarget.processing
|
(state: SuggestionNotificationsState) => state.suggestionTarget.processing
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the total available pages of Reciter Suggestion Targets.
|
* Returns the total available pages of Reciter Suggestion Targets.
|
||||||
* @function getreciterSuggestionTargetTotalPagesSelector
|
* @function getSuggestionTargetTotalPagesSelector
|
||||||
* @return {number}
|
* @return {number}
|
||||||
*/
|
*/
|
||||||
export const getReciterSuggestionTargetTotalPagesSelector = createSelector(_getReciterSuggestionTargetState,
|
export const getSuggestionTargetTotalPagesSelector = createSelector(_getSuggestionTargetState,
|
||||||
(state: SuggestionNotificationsState) => state.suggestionTarget.totalPages
|
(state: SuggestionNotificationsState) => state.suggestionTarget.totalPages
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the current page of Reciter Suggestion Targets.
|
* Returns the current page of Suggestion Targets.
|
||||||
* @function getreciterSuggestionTargetCurrentPageSelector
|
* @function getSuggestionTargetCurrentPageSelector
|
||||||
* @return {number}
|
* @return {number}
|
||||||
*/
|
*/
|
||||||
export const getReciterSuggestionTargetCurrentPageSelector = createSelector(_getReciterSuggestionTargetState,
|
export const getSuggestionTargetCurrentPageSelector = createSelector(_getSuggestionTargetState,
|
||||||
(state: SuggestionNotificationsState) => state.suggestionTarget.currentPage
|
(state: SuggestionNotificationsState) => state.suggestionTarget.currentPage
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the total number of Reciter Suggestion Targets.
|
* Returns the total number of Suggestion Targets.
|
||||||
* @function getreciterSuggestionTargetTotalsSelector
|
* @function getSuggestionTargetTotalsSelector
|
||||||
* @return {number}
|
* @return {number}
|
||||||
*/
|
*/
|
||||||
export const getReciterSuggestionTargetTotalsSelector = createSelector(_getReciterSuggestionTargetState,
|
export const getSuggestionTargetTotalsSelector = createSelector(_getSuggestionTargetState,
|
||||||
(state: SuggestionNotificationsState) => state.suggestionTarget.totalElements
|
(state: SuggestionNotificationsState) => state.suggestionTarget.totalElements
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns Suggestion Targets for the current user.
|
* Returns Suggestion Targets for the current user.
|
||||||
* @function getCurrentUserReciterSuggestionTargetSelector
|
* @function getCurrentUserSuggestionTargetSelector
|
||||||
* @return {SuggestionTarget[]}
|
* @return {SuggestionTarget[]}
|
||||||
*/
|
*/
|
||||||
export const getCurrentUserSuggestionTargetsSelector = createSelector(_getReciterSuggestionTargetState,
|
export const getCurrentUserSuggestionTargetsSelector = createSelector(_getSuggestionTargetState,
|
||||||
(state: SuggestionNotificationsState) => state.suggestionTarget.currentUserTargets
|
(state: SuggestionNotificationsState) => state.suggestionTarget.currentUserTargets
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether or not the user has consulted their suggestions
|
* Returns whether or not the user has consulted their suggestions
|
||||||
* @function getCurrentUserReciterSuggestionTargetSelector
|
* @function getCurrentUserSuggestionTargetSelector
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
*/
|
*/
|
||||||
export const getCurrentUserSuggestionTargetsVisitedSelector = createSelector(_getReciterSuggestionTargetState,
|
export const getCurrentUserSuggestionTargetsVisitedSelector = createSelector(_getSuggestionTargetState,
|
||||||
(state: SuggestionNotificationsState) => state.suggestionTarget.currentUserTargetsVisited
|
(state: SuggestionNotificationsState) => state.suggestionTarget.currentUserTargetsVisited
|
||||||
);
|
);
|
@@ -19,8 +19,8 @@
|
|||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<button (click)="notMine()" class="btn btn-danger ml-2"><i class="fa fa-ban"></i>
|
<button (click)="ignoreSuggestion()" class="btn btn-danger ml-2"><i class="fa fa-ban"></i>
|
||||||
{{ notMineLabel() | translate}}</button>
|
{{ ignoreSuggestionLabel() | translate}}</button>
|
||||||
<button *ngIf="!isBulk" (click)="toggleSeeEvidences()" [disabled]="!hasEvidence" class="btn btn-info ml-2">
|
<button *ngIf="!isBulk" (click)="toggleSeeEvidences()" [disabled]="!hasEvidence" class="btn btn-info ml-2">
|
||||||
<i class="fa fa-eye"></i>
|
<i class="fa fa-eye"></i>
|
||||||
<ng-container *ngIf="!seeEvidence"> {{ 'reciter.suggestion.seeEvidence' | translate}}</ng-container>
|
<ng-container *ngIf="!seeEvidence"> {{ 'reciter.suggestion.seeEvidence' | translate}}</ng-container>
|
@@ -1,12 +1,15 @@
|
|||||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||||
import { ItemType } from '../../../core/shared/item-relationships/item-type.model';
|
import { ItemType } from '../../core/shared/item-relationships/item-type.model';
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { Suggestion } from '../../../core/suggestion-notifications/reciter-suggestions/models/suggestion.model';
|
import { Suggestion } from '../../core/suggestion-notifications/models/suggestion.model';
|
||||||
import { SuggestionApproveAndImport } from '../suggestion-list-element/suggestion-list-element.component';
|
import { SuggestionApproveAndImport } from '../suggestion-list-element/suggestion-list-element.component';
|
||||||
import { Collection } from '../../../core/shared/collection.model';
|
import { Collection } from '../../core/shared/collection.model';
|
||||||
import { take } from 'rxjs/operators';
|
import { take } from 'rxjs/operators';
|
||||||
import { CreateItemParentSelectorComponent } from '../../../shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component';
|
import { CreateItemParentSelectorComponent } from '../../shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show and trigger the actions to submit for a suggestion
|
||||||
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-suggestion-actions',
|
selector: 'ds-suggestion-actions',
|
||||||
styleUrls: [ './suggestion-actions.component.scss' ],
|
styleUrls: [ './suggestion-actions.component.scss' ],
|
||||||
@@ -27,7 +30,7 @@ export class SuggestionActionsComponent {
|
|||||||
/**
|
/**
|
||||||
* The component is used to Delete suggestion
|
* The component is used to Delete suggestion
|
||||||
*/
|
*/
|
||||||
@Output() notMineClicked = new EventEmitter<string>();
|
@Output() ignoreSuggestionClicked = new EventEmitter<string>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The component is used to approve & import
|
* The component is used to approve & import
|
||||||
@@ -71,8 +74,8 @@ export class SuggestionActionsComponent {
|
|||||||
/**
|
/**
|
||||||
* Delete the suggestion
|
* Delete the suggestion
|
||||||
*/
|
*/
|
||||||
notMine() {
|
ignoreSuggestion() {
|
||||||
this.notMineClicked.emit(this.isBulk ? undefined : this.object.id);
|
this.ignoreSuggestionClicked.emit(this.isBulk ? undefined : this.object.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -82,8 +85,8 @@ export class SuggestionActionsComponent {
|
|||||||
this.seeEvidences.emit(!this.seeEvidence);
|
this.seeEvidences.emit(!this.seeEvidence);
|
||||||
}
|
}
|
||||||
|
|
||||||
notMineLabel(): string {
|
ignoreSuggestionLabel(): string {
|
||||||
return this.isBulk ? 'reciter.suggestion.notMine.bulk' : 'reciter.suggestion.notMine' ;
|
return this.isBulk ? 'reciter.suggestion.ignoreSuggestion.bulk' : 'reciter.suggestion.ignoreSuggestion' ;
|
||||||
}
|
}
|
||||||
|
|
||||||
approveAndImportLabel(): string {
|
approveAndImportLabel(): string {
|
@@ -1,7 +1,10 @@
|
|||||||
import { Component, Input } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
import { fadeIn } from '../../../../shared/animations/fade';
|
import { fadeIn } from '../../../shared/animations/fade';
|
||||||
import { SuggestionEvidences } from '../../../../core/suggestion-notifications/reciter-suggestions/models/suggestion.model';
|
import { SuggestionEvidences } from '../../../core/suggestion-notifications/models/suggestion.model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show suggestion evidences such as score (authorScore, dateScore)
|
||||||
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-suggestion-evidences',
|
selector: 'ds-suggestion-evidences',
|
||||||
styleUrls: [ './suggestion-evidences.component.scss' ],
|
styleUrls: [ './suggestion-evidences.component.scss' ],
|
@@ -31,7 +31,7 @@
|
|||||||
[isCollectionFixed]="isCollectionFixed"
|
[isCollectionFixed]="isCollectionFixed"
|
||||||
(approveAndImport)="onApproveAndImport($event)"
|
(approveAndImport)="onApproveAndImport($event)"
|
||||||
(seeEvidences)="onSeeEvidences($event)"
|
(seeEvidences)="onSeeEvidences($event)"
|
||||||
(notMineClicked)="onNotMine($event)"
|
(ignoreSuggestionClicked)="onIgnoreSuggestion($event)"
|
||||||
></ds-suggestion-actions>
|
></ds-suggestion-actions>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@@ -5,8 +5,8 @@ import { NO_ERRORS_SCHEMA } from '@angular/core';
|
|||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TestScheduler } from 'rxjs/testing';
|
import { TestScheduler } from 'rxjs/testing';
|
||||||
import { getTestScheduler } from 'jasmine-marbles';
|
import { getTestScheduler } from 'jasmine-marbles';
|
||||||
import { mockSuggestionPublicationOne } from '../../../shared/mocks/reciter-suggestion.mock';
|
import { mockSuggestionPublicationOne } from '../../shared/mocks/publication-claim.mock';
|
||||||
import { Item } from '../../../core/shared/item.model';
|
import { Item } from '../../core/shared/item.model';
|
||||||
|
|
||||||
|
|
||||||
describe('SuggestionListElementComponent', () => {
|
describe('SuggestionListElementComponent', () => {
|
||||||
@@ -66,9 +66,9 @@ describe('SuggestionListElementComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should emit for deletion', () => {
|
it('should emit for deletion', () => {
|
||||||
spyOn(component.notMineClicked, 'emit');
|
spyOn(component.ignoreSuggestionClicked, 'emit');
|
||||||
component.onNotMine('1234');
|
component.onIgnoreSuggestion('1234');
|
||||||
expect(component.notMineClicked.emit).toHaveBeenCalledWith('1234');
|
expect(component.ignoreSuggestionClicked.emit).toHaveBeenCalledWith('1234');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should emit for approve and import', () => {
|
it('should emit for approve and import', () => {
|
@@ -2,16 +2,22 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
|||||||
|
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
|
||||||
import { fadeIn } from '../../../shared/animations/fade';
|
import { fadeIn } from '../../shared/animations/fade';
|
||||||
import { Suggestion } from '../../../core/suggestion-notifications/reciter-suggestions/models/suggestion.model';
|
import { Suggestion } from '../../core/suggestion-notifications/models/suggestion.model';
|
||||||
import { Item } from '../../../core/shared/item.model';
|
import { Item } from '../../core/shared/item.model';
|
||||||
import { isNotEmpty } from '../../../shared/empty.util';
|
import { isNotEmpty } from '../../shared/empty.util';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A simple interface to unite a specific suggestion and the id of the chosen collection
|
||||||
|
*/
|
||||||
export interface SuggestionApproveAndImport {
|
export interface SuggestionApproveAndImport {
|
||||||
suggestion: Suggestion;
|
suggestion: Suggestion;
|
||||||
collectionId: string;
|
collectionId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show all the suggestions by researcher
|
||||||
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-suggestion-list-item',
|
selector: 'ds-suggestion-list-item',
|
||||||
styleUrls: ['./suggestion-list-element.component.scss'],
|
styleUrls: ['./suggestion-list-element.component.scss'],
|
||||||
@@ -33,7 +39,7 @@ export class SuggestionListElementComponent implements OnInit {
|
|||||||
/**
|
/**
|
||||||
* The component is used to Delete suggestion
|
* The component is used to Delete suggestion
|
||||||
*/
|
*/
|
||||||
@Output() notMineClicked = new EventEmitter();
|
@Output() ignoreSuggestionClicked = new EventEmitter();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The component is used to approve & import
|
* The component is used to approve & import
|
||||||
@@ -69,8 +75,8 @@ export class SuggestionListElementComponent implements OnInit {
|
|||||||
/**
|
/**
|
||||||
* Delete the suggestion
|
* Delete the suggestion
|
||||||
*/
|
*/
|
||||||
onNotMine(suggestionId: string) {
|
onIgnoreSuggestion(suggestionId: string) {
|
||||||
this.notMineClicked.emit(suggestionId);
|
this.ignoreSuggestionClicked.emit(suggestionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
@@ -1,7 +1,7 @@
|
|||||||
/* eslint-disable max-classes-per-file */
|
/* eslint-disable max-classes-per-file */
|
||||||
import { Action } from '@ngrx/store';
|
import { Action } from '@ngrx/store';
|
||||||
import { type } from '../../../shared/ngrx/type';
|
import { type } from '../../shared/ngrx/type';
|
||||||
import { SuggestionTarget } from '../../../core/suggestion-notifications/reciter-suggestions/models/suggestion-target.model';
|
import { SuggestionTarget } from '../../core/suggestion-notifications/models/suggestion-target.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For each action type in an action group, make a simple
|
* For each action type in an action group, make a simple
|
@@ -33,8 +33,9 @@
|
|||||||
<div class="btn-group edit-field">
|
<div class="btn-group edit-field">
|
||||||
<button (click)="redirectToSuggestions(targetElement.id, targetElement.display)"
|
<button (click)="redirectToSuggestions(targetElement.id, targetElement.display)"
|
||||||
class="btn btn-outline-primary btn-sm"
|
class="btn btn-outline-primary btn-sm"
|
||||||
title="{{'reciter.suggestion.button.review' | translate }}">
|
title="{{('reciter.suggestion.button.review.title' | translate: { total: targetElement.total.toString() }) +
|
||||||
<span >{{'reciter.suggestion.button.review' | translate: { total: targetElement.total.toString() } }} </span>
|
targetElement.display}}">
|
||||||
|
<span>{{'reciter.suggestion.button.review' | translate: { total: targetElement.total.toString() } }} </span>
|
||||||
<i class="fas fa-lightbulb"></i>
|
<i class="fas fa-lightbulb"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
@@ -4,13 +4,13 @@ import { Router } from '@angular/router';
|
|||||||
import { Observable, Subscription } from 'rxjs';
|
import { Observable, Subscription } from 'rxjs';
|
||||||
import { distinctUntilChanged, take } from 'rxjs/operators';
|
import { distinctUntilChanged, take } from 'rxjs/operators';
|
||||||
|
|
||||||
import { SuggestionTarget } from '../../../core/suggestion-notifications/reciter-suggestions/models/suggestion-target.model';
|
import { SuggestionTarget } from '../../core/suggestion-notifications/models/suggestion-target.model';
|
||||||
import { hasValue } from '../../../shared/empty.util';
|
import { hasValue } from '../../shared/empty.util';
|
||||||
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
|
||||||
import { SuggestionTargetsStateService } from './suggestion-targets.state.service';
|
import { SuggestionTargetsStateService } from './suggestion-targets.state.service';
|
||||||
import { getSuggestionPageRoute } from '../../../suggestions-page/suggestions-page-routing-paths';
|
import { getSuggestionPageRoute } from '../../suggestions-page/suggestions-page-routing-paths';
|
||||||
import { SuggestionsService } from '../suggestions.service';
|
import { SuggestionsService } from '../suggestions.service';
|
||||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
import { PaginationService } from '../../core/pagination/pagination.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component to display the Suggestion Target list.
|
* Component to display the Suggestion Target list.
|
||||||
@@ -69,8 +69,8 @@ export class SuggestionTargetsComponent implements OnInit {
|
|||||||
* Component initialization.
|
* Component initialization.
|
||||||
*/
|
*/
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.targets$ = this.suggestionTargetsStateService.getReciterSuggestionTargets();
|
this.targets$ = this.suggestionTargetsStateService.getSuggestionTargets();
|
||||||
this.totalElements$ = this.suggestionTargetsStateService.getReciterSuggestionTargetsTotals();
|
this.totalElements$ = this.suggestionTargetsStateService.getSuggestionTargetsTotals();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -78,7 +78,7 @@ export class SuggestionTargetsComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
ngAfterViewInit(): void {
|
ngAfterViewInit(): void {
|
||||||
this.subs.push(
|
this.subs.push(
|
||||||
this.suggestionTargetsStateService.isReciterSuggestionTargetsLoaded().pipe(
|
this.suggestionTargetsStateService.isSuggestionTargetsLoaded().pipe(
|
||||||
take(1)
|
take(1)
|
||||||
).subscribe(() => {
|
).subscribe(() => {
|
||||||
this.getSuggestionTargets();
|
this.getSuggestionTargets();
|
||||||
@@ -93,7 +93,7 @@ export class SuggestionTargetsComponent implements OnInit {
|
|||||||
* 'true' if the targets are loading, 'false' otherwise.
|
* 'true' if the targets are loading, 'false' otherwise.
|
||||||
*/
|
*/
|
||||||
public isTargetsLoading(): Observable<boolean> {
|
public isTargetsLoading(): Observable<boolean> {
|
||||||
return this.suggestionTargetsStateService.isReciterSuggestionTargetsLoading();
|
return this.suggestionTargetsStateService.isSuggestionTargetsLoading();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -103,7 +103,7 @@ export class SuggestionTargetsComponent implements OnInit {
|
|||||||
* 'true' if there are operations running on the targets (ex.: a REST call), 'false' otherwise.
|
* 'true' if there are operations running on the targets (ex.: a REST call), 'false' otherwise.
|
||||||
*/
|
*/
|
||||||
public isTargetsProcessing(): Observable<boolean> {
|
public isTargetsProcessing(): Observable<boolean> {
|
||||||
return this.suggestionTargetsStateService.isReciterSuggestionTargetsProcessing();
|
return this.suggestionTargetsStateService.isSuggestionTargetsProcessing();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -136,7 +136,7 @@ export class SuggestionTargetsComponent implements OnInit {
|
|||||||
distinctUntilChanged(),
|
distinctUntilChanged(),
|
||||||
take(1)
|
take(1)
|
||||||
).subscribe((options: PaginationComponentOptions) => {
|
).subscribe((options: PaginationComponentOptions) => {
|
||||||
this.suggestionTargetsStateService.dispatchRetrieveReciterSuggestionTargets(
|
this.suggestionTargetsStateService.dispatchRetrieveSuggestionTargets(
|
||||||
this.source,
|
this.source,
|
||||||
options.pageSize,
|
options.pageSize,
|
||||||
options.currentPage
|
options.currentPage
|
@@ -14,10 +14,10 @@ import {
|
|||||||
RetrieveTargetsBySourceAction,
|
RetrieveTargetsBySourceAction,
|
||||||
SuggestionTargetActionTypes,
|
SuggestionTargetActionTypes,
|
||||||
} from './suggestion-targets.actions';
|
} from './suggestion-targets.actions';
|
||||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
import { PaginatedList } from '../../core/data/paginated-list.model';
|
||||||
import { SuggestionsService } from '../suggestions.service';
|
import { SuggestionsService } from '../suggestions.service';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { SuggestionTarget } from '../../../core/suggestion-notifications/reciter-suggestions/models/suggestion-target.model';
|
import { SuggestionTarget } from '../../core/suggestion-notifications/models/suggestion-target.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides effect methods for the Suggestion Targets actions.
|
* Provides effect methods for the Suggestion Targets actions.
|
@@ -1,5 +1,5 @@
|
|||||||
import { SuggestionTargetActionTypes, SuggestionTargetsActions } from './suggestion-targets.actions';
|
import { SuggestionTargetActionTypes, SuggestionTargetsActions } from './suggestion-targets.actions';
|
||||||
import { SuggestionTarget } from '../../../core/suggestion-notifications/reciter-suggestions/models/suggestion-target.model';
|
import { SuggestionTarget } from '../../core/suggestion-notifications/models/suggestion-target.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The interface representing the OpenAIRE suggestion targets state.
|
* The interface representing the OpenAIRE suggestion targets state.
|
@@ -7,20 +7,20 @@ import { map } from 'rxjs/operators';
|
|||||||
import {
|
import {
|
||||||
getCurrentUserSuggestionTargetsSelector,
|
getCurrentUserSuggestionTargetsSelector,
|
||||||
getCurrentUserSuggestionTargetsVisitedSelector,
|
getCurrentUserSuggestionTargetsVisitedSelector,
|
||||||
getReciterSuggestionTargetCurrentPageSelector,
|
getSuggestionTargetCurrentPageSelector,
|
||||||
getReciterSuggestionTargetTotalsSelector,
|
getSuggestionTargetTotalsSelector,
|
||||||
isReciterSuggestionTargetLoadedSelector,
|
isSuggestionTargetLoadedSelector,
|
||||||
isReciterSuggestionTargetProcessingSelector,
|
isReciterSuggestionTargetProcessingSelector,
|
||||||
reciterSuggestionTargetObjectSelector
|
suggestionTargetObjectSelector
|
||||||
} from '../selectors';
|
} from '../selectors';
|
||||||
import { SuggestionTarget } from '../../../core/suggestion-notifications/reciter-suggestions/models/suggestion-target.model';
|
import { SuggestionTarget } from '../../core/suggestion-notifications/models/suggestion-target.model';
|
||||||
import {
|
import {
|
||||||
ClearSuggestionTargetsAction,
|
ClearSuggestionTargetsAction,
|
||||||
MarkUserSuggestionsAsVisitedAction,
|
MarkUserSuggestionsAsVisitedAction,
|
||||||
RefreshUserSuggestionsAction,
|
RefreshUserSuggestionsAction,
|
||||||
RetrieveTargetsBySourceAction
|
RetrieveTargetsBySourceAction
|
||||||
} from './suggestion-targets.actions';
|
} from './suggestion-targets.actions';
|
||||||
import { SuggestionNotificationsState } from '../../../notifications/notifications.reducer';
|
import { SuggestionNotificationsState } from '../../notifications/notifications.reducer';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The service handling the Suggestion targets State.
|
* The service handling the Suggestion targets State.
|
||||||
@@ -35,80 +35,80 @@ export class SuggestionTargetsStateService {
|
|||||||
constructor(private store: Store<SuggestionNotificationsState>) { }
|
constructor(private store: Store<SuggestionNotificationsState>) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the list of Reciter Suggestion Targets from the state.
|
* Returns the list of Suggestion Targets from the state.
|
||||||
*
|
*
|
||||||
* @return Observable<OpenaireReciterSuggestionTarget>
|
* @return Observable<SuggestionTarget>
|
||||||
* The list of Reciter Suggestion Targets.
|
* The list of Suggestion Targets.
|
||||||
*/
|
*/
|
||||||
public getReciterSuggestionTargets(): Observable<SuggestionTarget[]> {
|
public getSuggestionTargets(): Observable<SuggestionTarget[]> {
|
||||||
return this.store.pipe(select(reciterSuggestionTargetObjectSelector()));
|
return this.store.pipe(select(suggestionTargetObjectSelector()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the information about the loading status of the Reciter Suggestion Targets (if it's running or not).
|
* Returns the information about the loading status of the Suggestion Targets (if it's running or not).
|
||||||
*
|
*
|
||||||
* @return Observable<boolean>
|
* @return Observable<boolean>
|
||||||
* 'true' if the targets are loading, 'false' otherwise.
|
* 'true' if the targets are loading, 'false' otherwise.
|
||||||
*/
|
*/
|
||||||
public isReciterSuggestionTargetsLoading(): Observable<boolean> {
|
public isSuggestionTargetsLoading(): Observable<boolean> {
|
||||||
return this.store.pipe(
|
return this.store.pipe(
|
||||||
select(isReciterSuggestionTargetLoadedSelector),
|
select(isSuggestionTargetLoadedSelector),
|
||||||
map((loaded: boolean) => !loaded)
|
map((loaded: boolean) => !loaded)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the information about the loading status of the Reciter Suggestion Targets (whether or not they were loaded).
|
* Returns the information about the loading status of the Suggestion Targets (whether or not they were loaded).
|
||||||
*
|
*
|
||||||
* @return Observable<boolean>
|
* @return Observable<boolean>
|
||||||
* 'true' if the targets are loaded, 'false' otherwise.
|
* 'true' if the targets are loaded, 'false' otherwise.
|
||||||
*/
|
*/
|
||||||
public isReciterSuggestionTargetsLoaded(): Observable<boolean> {
|
public isSuggestionTargetsLoaded(): Observable<boolean> {
|
||||||
return this.store.pipe(select(isReciterSuggestionTargetLoadedSelector));
|
return this.store.pipe(select(isSuggestionTargetLoadedSelector));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the information about the processing status of the Reciter Suggestion Targets (if it's running or not).
|
* Returns the information about the processing status of the Suggestion Targets (if it's running or not).
|
||||||
*
|
*
|
||||||
* @return Observable<boolean>
|
* @return Observable<boolean>
|
||||||
* 'true' if there are operations running on the targets (ex.: a REST call), 'false' otherwise.
|
* 'true' if there are operations running on the targets (ex.: a REST call), 'false' otherwise.
|
||||||
*/
|
*/
|
||||||
public isReciterSuggestionTargetsProcessing(): Observable<boolean> {
|
public isSuggestionTargetsProcessing(): Observable<boolean> {
|
||||||
return this.store.pipe(select(isReciterSuggestionTargetProcessingSelector));
|
return this.store.pipe(select(isReciterSuggestionTargetProcessingSelector));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns, from the state, the total available pages of the Reciter Suggestion Targets.
|
* Returns, from the state, the total available pages of the Suggestion Targets.
|
||||||
*
|
*
|
||||||
* @return Observable<number>
|
* @return Observable<number>
|
||||||
* The number of the Reciter Suggestion Targets pages.
|
* The number of the Suggestion Targets pages.
|
||||||
*/
|
*/
|
||||||
public getReciterSuggestionTargetsTotalPages(): Observable<number> {
|
public getSuggestionTargetsTotalPages(): Observable<number> {
|
||||||
return this.store.pipe(select(getReciterSuggestionTargetTotalsSelector));
|
return this.store.pipe(select(getSuggestionTargetTotalsSelector));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the current page of the Reciter Suggestion Targets, from the state.
|
* Returns the current page of the Suggestion Targets, from the state.
|
||||||
*
|
*
|
||||||
* @return Observable<number>
|
* @return Observable<number>
|
||||||
* The number of the current Reciter Suggestion Targets page.
|
* The number of the current Suggestion Targets page.
|
||||||
*/
|
*/
|
||||||
public getReciterSuggestionTargetsCurrentPage(): Observable<number> {
|
public getSuggestionTargetsCurrentPage(): Observable<number> {
|
||||||
return this.store.pipe(select(getReciterSuggestionTargetCurrentPageSelector));
|
return this.store.pipe(select(getSuggestionTargetCurrentPageSelector));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the total number of the Reciter Suggestion Targets.
|
* Returns the total number of the Suggestion Targets.
|
||||||
*
|
*
|
||||||
* @return Observable<number>
|
* @return Observable<number>
|
||||||
* The number of the Reciter Suggestion Targets.
|
* The number of the Suggestion Targets.
|
||||||
*/
|
*/
|
||||||
public getReciterSuggestionTargetsTotals(): Observable<number> {
|
public getSuggestionTargetsTotals(): Observable<number> {
|
||||||
return this.store.pipe(select(getReciterSuggestionTargetTotalsSelector));
|
return this.store.pipe(select(getSuggestionTargetTotalsSelector));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dispatch a request to change the Reciter Suggestion Targets state, retrieving the targets from the server.
|
* Dispatch a request to change the Suggestion Targets state, retrieving the targets from the server.
|
||||||
*
|
*
|
||||||
* @param source
|
* @param source
|
||||||
* the source for which to retrieve suggestion targets
|
* the source for which to retrieve suggestion targets
|
||||||
@@ -117,15 +117,15 @@ export class SuggestionTargetsStateService {
|
|||||||
* @param currentPage
|
* @param currentPage
|
||||||
* The number of the current page.
|
* The number of the current page.
|
||||||
*/
|
*/
|
||||||
public dispatchRetrieveReciterSuggestionTargets(source: string, elementsPerPage: number, currentPage: number): void {
|
public dispatchRetrieveSuggestionTargets(source: string, elementsPerPage: number, currentPage: number): void {
|
||||||
this.store.dispatch(new RetrieveTargetsBySourceAction(source, elementsPerPage, currentPage));
|
this.store.dispatch(new RetrieveTargetsBySourceAction(source, elementsPerPage, currentPage));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns, from the state, the reciter suggestion targets for the current user.
|
* Returns, from the state, the suggestion targets for the current user.
|
||||||
*
|
*
|
||||||
* @return Observable<OpenaireReciterSuggestionTarget>
|
* @return Observable<OpenaireReciterSuggestionTarget>
|
||||||
* The Reciter Suggestion Targets object.
|
* The Suggestion Targets object.
|
||||||
*/
|
*/
|
||||||
public getCurrentUserSuggestionTargets(): Observable<SuggestionTarget[]> {
|
public getCurrentUserSuggestionTargets(): Observable<SuggestionTarget[]> {
|
||||||
return this.store.pipe(select(getCurrentUserSuggestionTargetsSelector));
|
return this.store.pipe(select(getCurrentUserSuggestionTargetsSelector));
|
@@ -1,30 +1,30 @@
|
|||||||
import { SuggestionsService } from './suggestions.service';
|
import { SuggestionsService } from './suggestions.service';
|
||||||
import { AuthService } from '../../core/auth/auth.service';
|
import { AuthService } from '../core/auth/auth.service';
|
||||||
import { ResearcherProfileDataService } from '../../core/profile/researcher-profile-data.service';
|
import { ResearcherProfileDataService } from '../core/profile/researcher-profile-data.service';
|
||||||
import {
|
import {
|
||||||
SuggestionsDataService
|
SuggestionsDataService
|
||||||
} from '../../core/suggestion-notifications/reciter-suggestions/suggestions-data.service';
|
} from '../core/suggestion-notifications/suggestions-data.service';
|
||||||
import {
|
import {
|
||||||
SuggestionSourceDataService
|
SuggestionSourceDataService
|
||||||
} from '../../core/suggestion-notifications/reciter-suggestions/source/suggestion-source-data.service';
|
} from '../core/suggestion-notifications/source/suggestion-source-data.service';
|
||||||
import {
|
import {
|
||||||
SuggestionTargetDataService
|
SuggestionTargetDataService
|
||||||
} from '../../core/suggestion-notifications/reciter-suggestions/target/suggestion-target-data.service';
|
} from '../core/suggestion-notifications/target/suggestion-target-data.service';
|
||||||
import { TestScheduler } from 'rxjs/testing';
|
import { TestScheduler } from 'rxjs/testing';
|
||||||
import { getTestScheduler } from 'jasmine-marbles';
|
import { getTestScheduler } from 'jasmine-marbles';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
import { FindListOptions } from '../../core/data/find-list-options.model';
|
import { FindListOptions } from '../core/data/find-list-options.model';
|
||||||
import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model';
|
import { SortDirection, SortOptions } from '../core/cache/models/sort-options.model';
|
||||||
import { ResearcherProfile } from '../../core/profile/model/researcher-profile.model';
|
import { ResearcherProfile } from '../core/profile/model/researcher-profile.model';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
import { createSuccessfulRemoteDataObject$ } from '../shared/remote-data.utils';
|
||||||
import { WorkspaceitemDataService } from '../../core/submission/workspaceitem-data.service';
|
import { WorkspaceitemDataService } from '../core/submission/workspaceitem-data.service';
|
||||||
import { mockSuggestionPublicationOne } from '../../shared/mocks/reciter-suggestion.mock';
|
import { mockSuggestionPublicationOne } from '../shared/mocks/publication-claim.mock';
|
||||||
import { ResourceType } from '../../core/shared/resource-type';
|
import { ResourceType } from '../core/shared/resource-type';
|
||||||
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
SuggestionTarget
|
SuggestionTarget
|
||||||
} from '../../core/suggestion-notifications/reciter-suggestions/models/suggestion-target.model';
|
} from '../core/suggestion-notifications/models/suggestion-target.model';
|
||||||
|
|
||||||
describe('SuggestionsService test', () => {
|
describe('SuggestionsService test', () => {
|
||||||
let scheduler: TestScheduler;
|
let scheduler: TestScheduler;
|
||||||
@@ -151,14 +151,14 @@ describe('SuggestionsService test', () => {
|
|||||||
|
|
||||||
it('should delete suggestion', () => {
|
it('should delete suggestion', () => {
|
||||||
spyOn(service, 'deleteReviewedSuggestion').and.returnValue(createSuccessfulRemoteDataObject$({}));
|
spyOn(service, 'deleteReviewedSuggestion').and.returnValue(createSuccessfulRemoteDataObject$({}));
|
||||||
service.notMine('1234');
|
service.ignoreSuggestion('1234');
|
||||||
expect(service.deleteReviewedSuggestion).toHaveBeenCalledWith('1234');
|
expect(service.deleteReviewedSuggestion).toHaveBeenCalledWith('1234');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should delete suggestions', () => {
|
it('should delete suggestions', () => {
|
||||||
spyOn(service, 'notMine');
|
spyOn(service, 'notMine');
|
||||||
service.notMineMultiple([mockSuggestionPublicationOne]);
|
service.ignoreSuggestionMultiple([mockSuggestionPublicationOne]);
|
||||||
expect(service.notMine).toHaveBeenCalledWith(mockSuggestionPublicationOne.id);
|
expect(service.ignoreSuggestion).toHaveBeenCalledWith(mockSuggestionPublicationOne.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should get target Uuid', () => {
|
it('should get target Uuid', () => {
|
@@ -1,11 +1,14 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { SuggestionTarget } from '../../../core/suggestion-notifications/reciter-suggestions/models/suggestion-target.model';
|
import { SuggestionTarget } from '../../core/suggestion-notifications/models/suggestion-target.model';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { SuggestionTargetsStateService } from '../suggestion-targets/suggestion-targets.state.service';
|
import { SuggestionTargetsStateService } from '../suggestion-targets/suggestion-targets.state.service';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { SuggestionsService } from '../suggestions.service';
|
import { SuggestionsService } from '../suggestions.service';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show suggestions notification, used on myDSpace and Profile pages
|
||||||
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-suggestions-notification',
|
selector: 'ds-suggestions-notification',
|
||||||
templateUrl: './suggestions-notification.component.html',
|
templateUrl: './suggestions-notification.component.html',
|
||||||
@@ -22,13 +25,13 @@ export class SuggestionsNotificationComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private translateService: TranslateService,
|
private translateService: TranslateService,
|
||||||
private reciterSuggestionStateService: SuggestionTargetsStateService,
|
private suggestionTargetsStateService: SuggestionTargetsStateService,
|
||||||
private notificationsService: NotificationsService,
|
private notificationsService: NotificationsService,
|
||||||
private suggestionsService: SuggestionsService
|
private suggestionsService: SuggestionsService
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.suggestionsRD$ = this.reciterSuggestionStateService.getCurrentUserSuggestionTargets();
|
this.suggestionsRD$ = this.suggestionTargetsStateService.getCurrentUserSuggestionTargets();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
@@ -3,11 +3,11 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|||||||
import { SuggestionsPopupComponent } from './suggestions-popup.component';
|
import { SuggestionsPopupComponent } from './suggestions-popup.component';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { SuggestionTargetsStateService } from '../suggestion-targets/suggestion-targets.state.service';
|
import { SuggestionTargetsStateService } from '../suggestion-targets/suggestion-targets.state.service';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
import { mockSuggestionTargetsObjectOne } from '../../../shared/mocks/reciter-suggestion-targets.mock';
|
import { mockSuggestionTargetsObjectOne } from '../../shared/mocks/publication-claim-targets.mock';
|
||||||
import { SuggestionsService } from '../suggestions.service';
|
import { SuggestionsService } from '../suggestions.service';
|
||||||
|
|
||||||
describe('SuggestionsPopupComponent', () => {
|
describe('SuggestionsPopupComponent', () => {
|
@@ -1,13 +1,16 @@
|
|||||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { SuggestionTargetsStateService } from '../suggestion-targets/suggestion-targets.state.service';
|
import { SuggestionTargetsStateService } from '../suggestion-targets/suggestion-targets.state.service';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { SuggestionsService } from '../suggestions.service';
|
import { SuggestionsService } from '../suggestions.service';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
import { SuggestionTarget } from '../../../core/suggestion-notifications/reciter-suggestions/models/suggestion-target.model';
|
import { SuggestionTarget } from '../../core/suggestion-notifications/models/suggestion-target.model';
|
||||||
import { isNotEmpty } from '../../../shared/empty.util';
|
import { isNotEmpty } from '../../shared/empty.util';
|
||||||
import { combineLatest, Subject } from 'rxjs';
|
import { combineLatest, Subject } from 'rxjs';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show suggestions on a popover window, used on the homepage
|
||||||
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-suggestions-popup',
|
selector: 'ds-suggestions-popup',
|
||||||
templateUrl: './suggestions-popup.component.html',
|
templateUrl: './suggestions-popup.component.html',
|
||||||
@@ -21,7 +24,7 @@ export class SuggestionsPopupComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private translateService: TranslateService,
|
private translateService: TranslateService,
|
||||||
private reciterSuggestionStateService: SuggestionTargetsStateService,
|
private suggestionTargetsStateService: SuggestionTargetsStateService,
|
||||||
private notificationsService: NotificationsService,
|
private notificationsService: NotificationsService,
|
||||||
private suggestionsService: SuggestionsService
|
private suggestionsService: SuggestionsService
|
||||||
) { }
|
) { }
|
||||||
@@ -33,14 +36,14 @@ export class SuggestionsPopupComponent implements OnInit, OnDestroy {
|
|||||||
public initializePopup() {
|
public initializePopup() {
|
||||||
const notifier = new Subject();
|
const notifier = new Subject();
|
||||||
this.subscription = combineLatest([
|
this.subscription = combineLatest([
|
||||||
this.reciterSuggestionStateService.getCurrentUserSuggestionTargets(),
|
this.suggestionTargetsStateService.getCurrentUserSuggestionTargets(),
|
||||||
this.reciterSuggestionStateService.hasUserVisitedSuggestions()
|
this.suggestionTargetsStateService.hasUserVisitedSuggestions()
|
||||||
]).pipe(takeUntil(notifier)).subscribe(([suggestions, visited]) => {
|
]).pipe(takeUntil(notifier)).subscribe(([suggestions, visited]) => {
|
||||||
this.reciterSuggestionStateService.dispatchRefreshUserSuggestionsAction();
|
this.suggestionTargetsStateService.dispatchRefreshUserSuggestionsAction();
|
||||||
if (isNotEmpty(suggestions)) {
|
if (isNotEmpty(suggestions)) {
|
||||||
if (!visited) {
|
if (!visited) {
|
||||||
suggestions.forEach((suggestionTarget: SuggestionTarget) => this.showNotificationForNewSuggestions(suggestionTarget));
|
suggestions.forEach((suggestionTarget: SuggestionTarget) => this.showNotificationForNewSuggestions(suggestionTarget));
|
||||||
this.reciterSuggestionStateService.dispatchMarkUserSuggestionsAsVisitedAction();
|
this.suggestionTargetsStateService.dispatchMarkUserSuggestionsAsVisitedAction();
|
||||||
notifier.next(null);
|
notifier.next(null);
|
||||||
notifier.complete();
|
notifier.complete();
|
||||||
}
|
}
|
@@ -3,38 +3,41 @@ import { Injectable } from '@angular/core';
|
|||||||
import { of, forkJoin, Observable } from 'rxjs';
|
import { of, forkJoin, Observable } from 'rxjs';
|
||||||
import { catchError, map, mergeMap, take } from 'rxjs/operators';
|
import { catchError, map, mergeMap, take } from 'rxjs/operators';
|
||||||
|
|
||||||
import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model';
|
import { SortDirection, SortOptions } from '../core/cache/models/sort-options.model';
|
||||||
import { RemoteData } from '../../core/data/remote-data';
|
import { RemoteData } from '../core/data/remote-data';
|
||||||
import { PaginatedList } from '../../core/data/paginated-list.model';
|
import { PaginatedList } from '../core/data/paginated-list.model';
|
||||||
import { SuggestionTarget } from '../../core/suggestion-notifications/reciter-suggestions/models/suggestion-target.model';
|
import { SuggestionTarget } from '../core/suggestion-notifications/models/suggestion-target.model';
|
||||||
import { AuthService } from '../../core/auth/auth.service';
|
import { AuthService } from '../core/auth/auth.service';
|
||||||
import { hasValue, isNotEmpty } from '../../shared/empty.util';
|
import { hasValue, isNotEmpty } from '../shared/empty.util';
|
||||||
import { ResearcherProfile } from '../../core/profile/model/researcher-profile.model';
|
import { ResearcherProfile } from '../core/profile/model/researcher-profile.model';
|
||||||
import {
|
import {
|
||||||
getAllSucceededRemoteDataPayload,
|
getAllSucceededRemoteDataPayload,
|
||||||
getFinishedRemoteData,
|
getFinishedRemoteData,
|
||||||
getFirstSucceededRemoteDataPayload,
|
getFirstSucceededRemoteDataPayload,
|
||||||
getFirstSucceededRemoteListPayload
|
getFirstSucceededRemoteListPayload
|
||||||
} from '../../core/shared/operators';
|
} from '../core/shared/operators';
|
||||||
import { Suggestion } from '../../core/suggestion-notifications/reciter-suggestions/models/suggestion.model';
|
import { Suggestion } from '../core/suggestion-notifications/models/suggestion.model';
|
||||||
import { WorkspaceitemDataService } from '../../core/submission/workspaceitem-data.service';
|
import { WorkspaceitemDataService } from '../core/submission/workspaceitem-data.service';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { NoContent } from '../../core/shared/NoContent.model';
|
import { NoContent } from '../core/shared/NoContent.model';
|
||||||
import { environment } from '../../../environments/environment';
|
import { environment } from '../../environments/environment';
|
||||||
import { WorkspaceItem } from '../../core/submission/models/workspaceitem.model';
|
import { WorkspaceItem } from '../core/submission/models/workspaceitem.model';
|
||||||
import {FindListOptions} from '../../core/data/find-list-options.model';
|
import {FindListOptions} from '../core/data/find-list-options.model';
|
||||||
import {SuggestionConfig} from '../../../config/layout-config.interfaces';
|
import {SuggestionConfig} from '../../config/layout-config.interfaces';
|
||||||
import { ResearcherProfileDataService } from '../../core/profile/researcher-profile-data.service';
|
import { ResearcherProfileDataService } from '../core/profile/researcher-profile-data.service';
|
||||||
import {
|
import {
|
||||||
SuggestionSourceDataService
|
SuggestionSourceDataService
|
||||||
} from '../../core/suggestion-notifications/reciter-suggestions/source/suggestion-source-data.service';
|
} from '../core/suggestion-notifications/source/suggestion-source-data.service';
|
||||||
import {
|
import {
|
||||||
SuggestionTargetDataService
|
SuggestionTargetDataService
|
||||||
} from '../../core/suggestion-notifications/reciter-suggestions/target/suggestion-target-data.service';
|
} from '../core/suggestion-notifications/target/suggestion-target-data.service';
|
||||||
import {
|
import {
|
||||||
SuggestionsDataService
|
SuggestionsDataService
|
||||||
} from '../../core/suggestion-notifications/reciter-suggestions/suggestions-data.service';
|
} from '../core/suggestion-notifications/suggestions-data.service';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* useful for multiple approvals and ignores operation
|
||||||
|
* */
|
||||||
export interface SuggestionBulkResult {
|
export interface SuggestionBulkResult {
|
||||||
success: number;
|
success: number;
|
||||||
fails: number;
|
fails: number;
|
||||||
@@ -199,7 +202,7 @@ export class SuggestionsService {
|
|||||||
* Perform the delete operation over a single suggestion.
|
* Perform the delete operation over a single suggestion.
|
||||||
* @param suggestionId
|
* @param suggestionId
|
||||||
*/
|
*/
|
||||||
public notMine(suggestionId): Observable<RemoteData<NoContent>> {
|
public ignoreSuggestion(suggestionId): Observable<RemoteData<NoContent>> {
|
||||||
return this.deleteReviewedSuggestion(suggestionId).pipe(
|
return this.deleteReviewedSuggestion(suggestionId).pipe(
|
||||||
catchError((error) => of(null))
|
catchError((error) => of(null))
|
||||||
);
|
);
|
||||||
@@ -229,8 +232,8 @@ export class SuggestionsService {
|
|||||||
* Perform a bulk notMine operation.
|
* Perform a bulk notMine operation.
|
||||||
* @param suggestions the array containing the suggestions
|
* @param suggestions the array containing the suggestions
|
||||||
*/
|
*/
|
||||||
public notMineMultiple(suggestions: Suggestion[]): Observable<SuggestionBulkResult> {
|
public ignoreSuggestionMultiple(suggestions: Suggestion[]): Observable<SuggestionBulkResult> {
|
||||||
return forkJoin(suggestions.map((suggestion: Suggestion) => this.notMine(suggestion.id)))
|
return forkJoin(suggestions.map((suggestion: Suggestion) => this.ignoreSuggestion(suggestion.id)))
|
||||||
.pipe(map((results: RemoteData<NoContent>[]) => {
|
.pipe(map((results: RemoteData<NoContent>[]) => {
|
||||||
return {
|
return {
|
||||||
success: results.filter((result) => result != null).length,
|
success: results.filter((result) => result != null).length,
|
@@ -4,7 +4,7 @@ import { RouterModule } from '@angular/router';
|
|||||||
import { SuggestionsPageResolver } from './suggestions-page.resolver';
|
import { SuggestionsPageResolver } from './suggestions-page.resolver';
|
||||||
import { SuggestionsPageComponent } from './suggestions-page.component';
|
import { SuggestionsPageComponent } from './suggestions-page.component';
|
||||||
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
|
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
|
||||||
import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
|
import { ItemBreadcrumbResolver } from '../core/breadcrumbs/item-breadcrumb.resolver';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -13,11 +13,11 @@ import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.reso
|
|||||||
path: ':targetId',
|
path: ':targetId',
|
||||||
resolve: {
|
resolve: {
|
||||||
suggestionTargets: SuggestionsPageResolver,
|
suggestionTargets: SuggestionsPageResolver,
|
||||||
breadcrumb: I18nBreadcrumbResolver
|
breadcrumb: ItemBreadcrumbResolver//I18nBreadcrumbResolver
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
title: 'admin.notifications.recitersuggestion.page.title',
|
title: 'admin.notifications.publicationclaim.page.title',
|
||||||
breadcrumbKey: 'admin.notifications.recitersuggestion',
|
breadcrumbKey: 'admin.notifications.publicationclaim',
|
||||||
showBreadcrumbsFluid: false
|
showBreadcrumbsFluid: false
|
||||||
},
|
},
|
||||||
canActivate: [AuthenticatedGuard],
|
canActivate: [AuthenticatedGuard],
|
||||||
@@ -27,7 +27,8 @@ import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.reso
|
|||||||
])
|
])
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
SuggestionsPageResolver
|
SuggestionsPageResolver,
|
||||||
|
ItemBreadcrumbResolver
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class SuggestionsPageRoutingModule {
|
export class SuggestionsPageRoutingModule {
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
[isBulk]="true"
|
[isBulk]="true"
|
||||||
[isCollectionFixed]="isCollectionFixed(suggestionsRD.page)"
|
[isCollectionFixed]="isCollectionFixed(suggestionsRD.page)"
|
||||||
(approveAndImport)="approveAndImportAllSelected($event)"
|
(approveAndImport)="approveAndImportAllSelected($event)"
|
||||||
(notMineClicked)="notMineAllSelected()"></ds-suggestion-actions>
|
(ignoreSuggestionClicked)="ignoreSuggestionAllSelected()"></ds-suggestion-actions>
|
||||||
<i class='fas fa-circle-notch fa-spin' *ngIf="isBulkOperationPending"></i>
|
<i class='fas fa-circle-notch fa-spin' *ngIf="isBulkOperationPending"></i>
|
||||||
</div>
|
</div>
|
||||||
<ds-loading *ngIf="(processing$ | async)"></ds-loading>
|
<ds-loading *ngIf="(processing$ | async)"></ds-loading>
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
[object]="object"
|
[object]="object"
|
||||||
[isSelected]="selectedSuggestions[object.id]"
|
[isSelected]="selectedSuggestions[object.id]"
|
||||||
[isCollectionFixed]="isCollectionFixed([object])"
|
[isCollectionFixed]="isCollectionFixed([object])"
|
||||||
(notMineClicked)="notMine($event)"
|
(ignoreSuggestionClicked)="ignoreSuggestion($event)"
|
||||||
(selected)="onSelected(object, $event)"
|
(selected)="onSelected(object, $event)"
|
||||||
(approveAndImport)="approveAndImport($event)"></ds-suggestion-list-item>
|
(approveAndImport)="approveAndImport($event)"></ds-suggestion-list-item>
|
||||||
</li>
|
</li>
|
||||||
|
@@ -10,23 +10,23 @@ import { SuggestionsPageComponent } from './suggestions-page.component';
|
|||||||
import {
|
import {
|
||||||
SuggestionApproveAndImport,
|
SuggestionApproveAndImport,
|
||||||
SuggestionListElementComponent
|
SuggestionListElementComponent
|
||||||
} from '../suggestion-notifications/reciter-suggestions/suggestion-list-element/suggestion-list-element.component';
|
} from '../suggestion-notifications/suggestion-list-element/suggestion-list-element.component';
|
||||||
import { SuggestionsService } from '../suggestion-notifications/reciter-suggestions/suggestions.service';
|
import { SuggestionsService } from '../suggestion-notifications/suggestions.service';
|
||||||
import { getMockSuggestionNotificationsStateService, getMockSuggestionsService } from '../shared/mocks/suggestion.mock';
|
import { getMockSuggestionNotificationsStateService, getMockSuggestionsService } from '../shared/mocks/suggestion.mock';
|
||||||
import { buildPaginatedList, PaginatedList } from '../core/data/paginated-list.model';
|
import { buildPaginatedList, PaginatedList } from '../core/data/paginated-list.model';
|
||||||
import { Suggestion } from '../core/suggestion-notifications/reciter-suggestions/models/suggestion.model';
|
import { Suggestion } from '../core/suggestion-notifications/models/suggestion.model';
|
||||||
import { mockSuggestionPublicationOne, mockSuggestionPublicationTwo } from '../shared/mocks/reciter-suggestion.mock';
|
import { mockSuggestionPublicationOne, mockSuggestionPublicationTwo } from '../shared/mocks/publication-claim.mock';
|
||||||
import { SuggestionEvidencesComponent } from '../suggestion-notifications/reciter-suggestions/suggestion-list-element/suggestion-evidences/suggestion-evidences.component';
|
import { SuggestionEvidencesComponent } from '../suggestion-notifications/suggestion-list-element/suggestion-evidences/suggestion-evidences.component';
|
||||||
import { ObjectKeysPipe } from '../shared/utils/object-keys-pipe';
|
import { ObjectKeysPipe } from '../shared/utils/object-keys-pipe';
|
||||||
import { VarDirective } from '../shared/utils/var.directive';
|
import { VarDirective } from '../shared/utils/var.directive';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { RouterStub } from '../shared/testing/router.stub';
|
import { RouterStub } from '../shared/testing/router.stub';
|
||||||
import { mockSuggestionTargetsObjectOne } from '../shared/mocks/reciter-suggestion-targets.mock';
|
import { mockSuggestionTargetsObjectOne } from '../shared/mocks/publication-claim-targets.mock';
|
||||||
import { AuthService } from '../core/auth/auth.service';
|
import { AuthService } from '../core/auth/auth.service';
|
||||||
import { NotificationsService } from '../shared/notifications/notifications.service';
|
import { NotificationsService } from '../shared/notifications/notifications.service';
|
||||||
import { NotificationsServiceStub } from '../shared/testing/notifications-service.stub';
|
import { NotificationsServiceStub } from '../shared/testing/notifications-service.stub';
|
||||||
import { getMockTranslateService } from '../shared/mocks/translate.service.mock';
|
import { getMockTranslateService } from '../shared/mocks/translate.service.mock';
|
||||||
import { SuggestionTargetsStateService } from '../suggestion-notifications/reciter-suggestions/suggestion-targets/suggestion-targets.state.service';
|
import { SuggestionTargetsStateService } from '../suggestion-notifications/suggestion-targets/suggestion-targets.state.service';
|
||||||
import { WorkspaceitemDataService } from '../core/submission/workspaceitem-data.service';
|
import { WorkspaceitemDataService } from '../core/submission/workspaceitem-data.service';
|
||||||
import { createSuccessfulRemoteDataObject } from '../shared/remote-data.utils';
|
import { createSuccessfulRemoteDataObject } from '../shared/remote-data.utils';
|
||||||
import { PageInfo } from '../core/shared/page-info.model';
|
import { PageInfo } from '../core/shared/page-info.model';
|
||||||
@@ -138,7 +138,7 @@ describe('SuggestionPageComponent', () => {
|
|||||||
|
|
||||||
scheduler.schedule(() => fixture.detectChanges());
|
scheduler.schedule(() => fixture.detectChanges());
|
||||||
scheduler.flush();
|
scheduler.flush();
|
||||||
component.notMine('1');
|
component.ignoreSuggestion('1');
|
||||||
expect(mockSuggestionsService.notMine).toHaveBeenCalledWith('1');
|
expect(mockSuggestionsService.notMine).toHaveBeenCalledWith('1');
|
||||||
expect(mockSuggestionsTargetStateService.dispatchRefreshUserSuggestionsAction).toHaveBeenCalled();
|
expect(mockSuggestionsTargetStateService.dispatchRefreshUserSuggestionsAction).toHaveBeenCalled();
|
||||||
expect(component.updatePage).toHaveBeenCalled();
|
expect(component.updatePage).toHaveBeenCalled();
|
||||||
@@ -149,7 +149,7 @@ describe('SuggestionPageComponent', () => {
|
|||||||
|
|
||||||
scheduler.schedule(() => fixture.detectChanges());
|
scheduler.schedule(() => fixture.detectChanges());
|
||||||
scheduler.flush();
|
scheduler.flush();
|
||||||
component.notMineAllSelected();
|
component.ignoreSuggestionAllSelected();
|
||||||
expect(mockSuggestionsService.notMineMultiple).toHaveBeenCalled();
|
expect(mockSuggestionsService.notMineMultiple).toHaveBeenCalled();
|
||||||
expect(mockSuggestionsTargetStateService.dispatchRefreshUserSuggestionsAction).toHaveBeenCalled();
|
expect(mockSuggestionsTargetStateService.dispatchRefreshUserSuggestionsAction).toHaveBeenCalled();
|
||||||
expect(component.updatePage).toHaveBeenCalled();
|
expect(component.updatePage).toHaveBeenCalled();
|
||||||
|
@@ -9,14 +9,14 @@ import { SortDirection, SortOptions, } from '../core/cache/models/sort-options.m
|
|||||||
import { PaginatedList } from '../core/data/paginated-list.model';
|
import { PaginatedList } from '../core/data/paginated-list.model';
|
||||||
import { RemoteData } from '../core/data/remote-data';
|
import { RemoteData } from '../core/data/remote-data';
|
||||||
import { getFirstSucceededRemoteDataPayload } from '../core/shared/operators';
|
import { getFirstSucceededRemoteDataPayload } from '../core/shared/operators';
|
||||||
import { SuggestionBulkResult, SuggestionsService } from '../suggestion-notifications/reciter-suggestions/suggestions.service';
|
import { SuggestionBulkResult, SuggestionsService } from '../suggestion-notifications/suggestions.service';
|
||||||
import { PaginationComponentOptions } from '../shared/pagination/pagination-component-options.model';
|
import { PaginationComponentOptions } from '../shared/pagination/pagination-component-options.model';
|
||||||
import { Suggestion } from '../core/suggestion-notifications/reciter-suggestions/models/suggestion.model';
|
import { Suggestion } from '../core/suggestion-notifications/models/suggestion.model';
|
||||||
import { SuggestionTarget } from '../core/suggestion-notifications/reciter-suggestions/models/suggestion-target.model';
|
import { SuggestionTarget } from '../core/suggestion-notifications/models/suggestion-target.model';
|
||||||
import { AuthService } from '../core/auth/auth.service';
|
import { AuthService } from '../core/auth/auth.service';
|
||||||
import { SuggestionApproveAndImport } from '../suggestion-notifications/reciter-suggestions/suggestion-list-element/suggestion-list-element.component';
|
import { SuggestionApproveAndImport } from '../suggestion-notifications/suggestion-list-element/suggestion-list-element.component';
|
||||||
import { NotificationsService } from '../shared/notifications/notifications.service';
|
import { NotificationsService } from '../shared/notifications/notifications.service';
|
||||||
import { SuggestionTargetsStateService } from '../suggestion-notifications/reciter-suggestions/suggestion-targets/suggestion-targets.state.service';
|
import { SuggestionTargetsStateService } from '../suggestion-notifications/suggestion-targets/suggestion-targets.state.service';
|
||||||
import { WorkspaceitemDataService } from '../core/submission/workspaceitem-data.service';
|
import { WorkspaceitemDataService } from '../core/submission/workspaceitem-data.service';
|
||||||
import { PaginationService } from '../core/pagination/pagination.service';
|
import { PaginationService } from '../core/pagination/pagination.service';
|
||||||
import { WorkspaceItem } from '../core/submission/models/workspaceitem.model';
|
import { WorkspaceItem } from '../core/submission/models/workspaceitem.model';
|
||||||
@@ -155,8 +155,8 @@ export class SuggestionsPageComponent implements OnInit {
|
|||||||
* Used to delete a suggestion.
|
* Used to delete a suggestion.
|
||||||
* @suggestionId
|
* @suggestionId
|
||||||
*/
|
*/
|
||||||
notMine(suggestionId) {
|
ignoreSuggestion(suggestionId) {
|
||||||
this.suggestionService.notMine(suggestionId).subscribe((res) => {
|
this.suggestionService.ignoreSuggestion(suggestionId).subscribe((res) => {
|
||||||
this.suggestionTargetsStateService.dispatchRefreshUserSuggestionsAction();
|
this.suggestionTargetsStateService.dispatchRefreshUserSuggestionsAction();
|
||||||
this.updatePage();
|
this.updatePage();
|
||||||
});
|
});
|
||||||
@@ -165,10 +165,10 @@ export class SuggestionsPageComponent implements OnInit {
|
|||||||
/**
|
/**
|
||||||
* Used to delete all selected suggestions.
|
* Used to delete all selected suggestions.
|
||||||
*/
|
*/
|
||||||
notMineAllSelected() {
|
ignoreSuggestionAllSelected() {
|
||||||
this.isBulkOperationPending = true;
|
this.isBulkOperationPending = true;
|
||||||
this.suggestionService
|
this.suggestionService
|
||||||
.notMineMultiple(Object.values(this.selectedSuggestions))
|
.ignoreSuggestionMultiple(Object.values(this.selectedSuggestions))
|
||||||
.subscribe((results: SuggestionBulkResult) => {
|
.subscribe((results: SuggestionBulkResult) => {
|
||||||
this.suggestionTargetsStateService.dispatchRefreshUserSuggestionsAction();
|
this.suggestionTargetsStateService.dispatchRefreshUserSuggestionsAction();
|
||||||
this.updatePage();
|
this.updatePage();
|
||||||
|
@@ -4,8 +4,8 @@ import { CommonModule } from '@angular/common';
|
|||||||
import { SuggestionsPageComponent } from './suggestions-page.component';
|
import { SuggestionsPageComponent } from './suggestions-page.component';
|
||||||
import { SharedModule } from '../shared/shared.module';
|
import { SharedModule } from '../shared/shared.module';
|
||||||
import { SuggestionsPageRoutingModule } from './suggestions-page-routing.module';
|
import { SuggestionsPageRoutingModule } from './suggestions-page-routing.module';
|
||||||
import { SuggestionsService } from '../suggestion-notifications/reciter-suggestions/suggestions.service';
|
import { SuggestionsService } from '../suggestion-notifications/suggestions.service';
|
||||||
import { SuggestionsDataService } from '../core/suggestion-notifications/reciter-suggestions/suggestions-data.service';
|
import { SuggestionsDataService } from '../core/suggestion-notifications/suggestions-data.service';
|
||||||
import { NotificationsModule } from '../notifications/notifications.module';
|
import { NotificationsModule } from '../notifications/notifications.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
@@ -6,10 +6,10 @@ import { find } from 'rxjs/operators';
|
|||||||
|
|
||||||
import { RemoteData } from '../core/data/remote-data';
|
import { RemoteData } from '../core/data/remote-data';
|
||||||
import { hasValue } from '../shared/empty.util';
|
import { hasValue } from '../shared/empty.util';
|
||||||
import { SuggestionTarget } from '../core/suggestion-notifications/reciter-suggestions/models/suggestion-target.model';
|
import { SuggestionTarget } from '../core/suggestion-notifications/models/suggestion-target.model';
|
||||||
import {
|
import {
|
||||||
SuggestionTargetDataService
|
SuggestionTargetDataService
|
||||||
} from '../core/suggestion-notifications/reciter-suggestions/target/suggestion-target-data.service';
|
} from '../core/suggestion-notifications/target/suggestion-target-data.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represents a resolver that requests a specific collection before the route is activated
|
* This class represents a resolver that requests a specific collection before the route is activated
|
||||||
|
@@ -24,9 +24,9 @@
|
|||||||
|
|
||||||
"404.page-not-found": "page not found",
|
"404.page-not-found": "page not found",
|
||||||
|
|
||||||
"admin.notifications.recitersuggestion.breadcrumbs": "Suggestions",
|
"admin.notifications.publicationclaim.breadcrumbs": "Suggestions",
|
||||||
|
|
||||||
"admin.notifications.recitersuggestion.page.title": "Suggestions",
|
"admin.notifications.publicationclaim.page.title": "Suggestions",
|
||||||
|
|
||||||
"error-page.description.401": "unauthorized",
|
"error-page.description.401": "unauthorized",
|
||||||
|
|
||||||
@@ -2950,7 +2950,7 @@
|
|||||||
|
|
||||||
"menu.section.quality-assurance": "Quality Assurance",
|
"menu.section.quality-assurance": "Quality Assurance",
|
||||||
|
|
||||||
"menu.section.notifications_reciter": "Publication Claim",
|
"menu.section.notifications_publication-claim": "Publication Claim",
|
||||||
|
|
||||||
"menu.section.pin": "Pin sidebar",
|
"menu.section.pin": "Pin sidebar",
|
||||||
|
|
||||||
@@ -3562,63 +3562,67 @@
|
|||||||
|
|
||||||
"media-viewer.playlist": "Playlist",
|
"media-viewer.playlist": "Playlist",
|
||||||
|
|
||||||
"reciter.suggestion.loading": "Loading ...",
|
"suggestion.loading": "Loading ...",
|
||||||
|
|
||||||
"reciter.suggestion.title": "Suggestions",
|
"suggestion.title": "Publication Claims",
|
||||||
|
|
||||||
"reciter.suggestion.targets.description": "Below you can see all the suggestions ",
|
"suggestion.title.breadcrumbs": "Publication Claims",
|
||||||
|
|
||||||
"reciter.suggestion.targets": "Current Suggestions",
|
"suggestion.targets.description": "Below you can see all the suggestions ",
|
||||||
|
|
||||||
"reciter.suggestion.table.name": "Researcher Name",
|
"suggestion.targets": "Current Suggestions",
|
||||||
|
|
||||||
"reciter.suggestion.table.actions": "Actions",
|
"suggestion.table.name": "Researcher Name",
|
||||||
|
|
||||||
"reciter.suggestion.button.review": "Review {{ total }} suggestion(s)",
|
"suggestion.table.actions": "Actions",
|
||||||
|
|
||||||
"reciter.suggestion.noTargets": "No target found.",
|
"suggestion.button.review": "Review {{ total }} suggestion(s)",
|
||||||
|
|
||||||
"reciter.suggestion.target.error.service.retrieve": "An error occurred while loading the Suggestion targets",
|
"suggestion.button.review.title": "Review {{ total }} suggestion(s) for ",
|
||||||
|
|
||||||
"reciter.suggestion.evidence.type": "Type",
|
"suggestion.noTargets": "No target found.",
|
||||||
|
|
||||||
"reciter.suggestion.evidence.score": "Score",
|
"suggestion.target.error.service.retrieve": "An error occurred while loading the Suggestion targets",
|
||||||
|
|
||||||
"reciter.suggestion.evidence.notes": "Notes",
|
"suggestion.evidence.type": "Type",
|
||||||
|
|
||||||
"reciter.suggestion.approveAndImport": "Approve & import",
|
"suggestion.evidence.score": "Score",
|
||||||
|
|
||||||
"reciter.suggestion.approveAndImport.success": "The suggestion has been imported successfully. <a href='/workspaceitems/{{workspaceItemId}}/edit'>View.</a>",
|
"suggestion.evidence.notes": "Notes",
|
||||||
|
|
||||||
"reciter.suggestion.approveAndImport.bulk": "Approve & import Selected",
|
"suggestion.approveAndImport": "Approve & import",
|
||||||
|
|
||||||
"reciter.suggestion.approveAndImport.bulk.success": "{{ count }} suggestions have been imported successfully ",
|
"suggestion.approveAndImport.success": "The suggestion has been imported successfully. <a href='/workspaceitems/{{workspaceItemId}}/edit'>View.</a>",
|
||||||
|
|
||||||
"reciter.suggestion.approveAndImport.bulk.error": "{{ count }} suggestions haven't been imported due to unexpected server errors",
|
"suggestion.approveAndImport.bulk": "Approve & import Selected",
|
||||||
|
|
||||||
"reciter.suggestion.notMine": "Not mine",
|
".suggestion.approveAndImport.bulk.success": "{{ count }} suggestions have been imported successfully ",
|
||||||
|
|
||||||
"reciter.suggestion.notMine.success": "The suggestion has been discarded",
|
"suggestion.approveAndImport.bulk.error": "{{ count }} suggestions haven't been imported due to unexpected server errors",
|
||||||
|
|
||||||
"reciter.suggestion.notMine.bulk": "Not mine Selected",
|
"suggestion.ignoreSuggestion": "Ignore Suggestion",
|
||||||
|
|
||||||
"reciter.suggestion.notMine.bulk.success": "{{ count }} suggestions have been discarded ",
|
"suggestion.ignoreSuggestion.success": "The suggestion has been discarded",
|
||||||
|
|
||||||
"reciter.suggestion.notMine.bulk.error": "{{ count }} suggestions haven't been discarded due to unexpected server errors",
|
"suggestion.ignoreSuggestion.bulk": "Ignore Suggestion Selected",
|
||||||
|
|
||||||
"reciter.suggestion.seeEvidence": "See evidence",
|
"suggestion.ignoreSuggestion.bulk.success": "{{ count }} suggestions have been discarded ",
|
||||||
|
|
||||||
"reciter.suggestion.hideEvidence": "Hide evidence",
|
"suggestion.ignoreSuggestion.bulk.error": "{{ count }} suggestions haven't been discarded due to unexpected server errors",
|
||||||
|
|
||||||
"reciter.suggestion.suggestionFor": "Suggestion for",
|
"suggestion.seeEvidence": "See evidence",
|
||||||
|
|
||||||
"reciter.suggestion.source.openaire": "OpenAIRE Graph",
|
"suggestion.hideEvidence": "Hide evidence",
|
||||||
|
|
||||||
"reciter.suggestion.from.source": "from the ",
|
"suggestion.suggestionFor": "Suggestion for",
|
||||||
|
|
||||||
"reciter.suggestion.totalScore": "Total Score",
|
"suggestion.source.openaire": "OpenAIRE Graph",
|
||||||
|
|
||||||
"reciter.suggestion.type.openaire": "OpenAIRE",
|
"suggestion.from.source": "from the ",
|
||||||
|
|
||||||
|
"suggestion.totalScore": "Total Score",
|
||||||
|
|
||||||
|
"suggestion.type.openaire": "OpenAIRE",
|
||||||
|
|
||||||
"register-email.title": "New user registration",
|
"register-email.title": "New user registration",
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user