@@ -33,9 +33,9 @@
diff --git a/src/app/suggestion-notifications/suggestion-targets/suggestion-targets.component.scss b/src/app/suggestion-notifications/suggestion-targets/publication-claim/publication-claim.component.scss
similarity index 100%
rename from src/app/suggestion-notifications/suggestion-targets/suggestion-targets.component.scss
rename to src/app/suggestion-notifications/suggestion-targets/publication-claim/publication-claim.component.scss
diff --git a/src/app/suggestion-notifications/suggestion-targets/suggestion-targets.component.ts b/src/app/suggestion-notifications/suggestion-targets/publication-claim/publication-claim.component.ts
similarity index 83%
rename from src/app/suggestion-notifications/suggestion-targets/suggestion-targets.component.ts
rename to src/app/suggestion-notifications/suggestion-targets/publication-claim/publication-claim.component.ts
index e469ac1386..aef25f4075 100644
--- a/src/app/suggestion-notifications/suggestion-targets/suggestion-targets.component.ts
+++ b/src/app/suggestion-notifications/suggestion-targets/publication-claim/publication-claim.component.ts
@@ -4,23 +4,23 @@ import { Router } from '@angular/router';
import { Observable, Subscription } from 'rxjs';
import { distinctUntilChanged, take } from 'rxjs/operators';
-import { SuggestionTarget } from '../../core/suggestion-notifications/models/suggestion-target.model';
-import { hasValue } from '../../shared/empty.util';
-import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
-import { SuggestionTargetsStateService } from './suggestion-targets.state.service';
-import { getSuggestionPageRoute } from '../../suggestions-page/suggestions-page-routing-paths';
-import { SuggestionsService } from '../suggestions.service';
-import { PaginationService } from '../../core/pagination/pagination.service';
+import { SuggestionTarget } from '../../../core/suggestion-notifications/models/suggestion-target.model';
+import { hasValue } from '../../../shared/empty.util';
+import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
+import { SuggestionTargetsStateService } from '../suggestion-targets.state.service';
+import { getSuggestionPageRoute } from '../../../suggestions-page/suggestions-page-routing-paths';
+import { SuggestionsService } from '../../suggestions.service';
+import { PaginationService } from '../../../core/pagination/pagination.service';
/**
* Component to display the Suggestion Target list.
*/
@Component({
- selector: 'ds-suggestion-target',
- templateUrl: './suggestion-targets.component.html',
- styleUrls: ['./suggestion-targets.component.scss'],
+ selector: 'ds-publication-claim',
+ templateUrl: './publication-claim.component.html',
+ styleUrls: ['./publication-claim.component.scss'],
})
-export class SuggestionTargetsComponent implements OnInit {
+export class PublicationClaimComponent implements OnInit {
/**
* The source for which to list targets
diff --git a/src/app/suggestion-notifications/suggestion.service.spec.ts b/src/app/suggestion-notifications/suggestion.service.spec.ts
index c7d0c7a4bf..e6ca83d5fe 100644
--- a/src/app/suggestion-notifications/suggestion.service.spec.ts
+++ b/src/app/suggestion-notifications/suggestion.service.spec.ts
@@ -156,7 +156,7 @@ describe('SuggestionsService test', () => {
});
it('should delete suggestions', () => {
- spyOn(service, 'notMine');
+ spyOn(service, 'ignoreSuggestion');
service.ignoreSuggestionMultiple([mockSuggestionPublicationOne]);
expect(service.ignoreSuggestion).toHaveBeenCalledWith(mockSuggestionPublicationOne.id);
});
diff --git a/src/app/suggestion-notifications/suggestions-popup/suggestions-popup.component.ts b/src/app/suggestion-notifications/suggestions-popup/suggestions-popup.component.ts
index 2eb5cec6da..762f80085a 100644
--- a/src/app/suggestion-notifications/suggestions-popup/suggestions-popup.component.ts
+++ b/src/app/suggestion-notifications/suggestions-popup/suggestions-popup.component.ts
@@ -18,7 +18,7 @@ import { combineLatest, Subject } from 'rxjs';
})
export class SuggestionsPopupComponent implements OnInit, OnDestroy {
- labelPrefix = 'mydspace.';
+ labelPrefix = 'notification.';
subscription;
@@ -57,7 +57,7 @@ export class SuggestionsPopupComponent implements OnInit, OnDestroy {
* @private
*/
private showNotificationForNewSuggestions(suggestionTarget: SuggestionTarget): void {
- const content = this.translateService.instant(this.labelPrefix + 'notification.suggestion',
+ const content = this.translateService.instant(this.labelPrefix + 'suggestion',
this.suggestionsService.getNotificationSuggestionInterpolation(suggestionTarget));
this.notificationsService.success('', content, {timeOut:0}, true);
}
diff --git a/src/app/suggestion-notifications/suggestions.service.ts b/src/app/suggestion-notifications/suggestions.service.ts
index d4e8825f63..47d4124a47 100644
--- a/src/app/suggestion-notifications/suggestions.service.ts
+++ b/src/app/suggestion-notifications/suggestions.service.ts
@@ -23,7 +23,7 @@ import { NoContent } from '../core/shared/NoContent.model';
import { environment } from '../../environments/environment';
import { WorkspaceItem } from '../core/submission/models/workspaceitem.model';
import {FindListOptions} from '../core/data/find-list-options.model';
-import {SuggestionConfig} from '../../config/layout-config.interfaces';
+import {SuggestionConfig} from '../../config/suggestion-config.interfaces';
import { ResearcherProfileDataService } from '../core/profile/researcher-profile-data.service';
import {
SuggestionSourceDataService
@@ -229,7 +229,7 @@ export class SuggestionsService {
}
/**
- * Perform a bulk notMine operation.
+ * Perform a bulk ignoreSuggestion operation.
* @param suggestions the array containing the suggestions
*/
public ignoreSuggestionMultiple(suggestions: Suggestion[]): Observable {
diff --git a/src/app/suggestions-page/suggestions-page.component.spec.ts b/src/app/suggestions-page/suggestions-page.component.spec.ts
index 78cf087362..2f6cfb7278 100644
--- a/src/app/suggestions-page/suggestions-page.component.spec.ts
+++ b/src/app/suggestions-page/suggestions-page.component.spec.ts
@@ -41,7 +41,6 @@ describe('SuggestionPageComponent', () => {
let scheduler: TestScheduler;
const mockSuggestionsService = getMockSuggestionsService();
const mockSuggestionsTargetStateService = getMockSuggestionNotificationsStateService();
- const suggestionTargetsList: PaginatedList = buildPaginatedList(new PageInfo(), [mockSuggestionPublicationOne, mockSuggestionPublicationTwo]);
const router = new RouterStub();
const routeStub = {
data: observableOf({
@@ -139,7 +138,7 @@ describe('SuggestionPageComponent', () => {
scheduler.schedule(() => fixture.detectChanges());
scheduler.flush();
component.ignoreSuggestion('1');
- expect(mockSuggestionsService.notMine).toHaveBeenCalledWith('1');
+ expect(mockSuggestionsService.ignoreSuggestion).toHaveBeenCalledWith('1');
expect(mockSuggestionsTargetStateService.dispatchRefreshUserSuggestionsAction).toHaveBeenCalled();
expect(component.updatePage).toHaveBeenCalled();
});
@@ -150,7 +149,7 @@ describe('SuggestionPageComponent', () => {
scheduler.schedule(() => fixture.detectChanges());
scheduler.flush();
component.ignoreSuggestionAllSelected();
- expect(mockSuggestionsService.notMineMultiple).toHaveBeenCalled();
+ expect(mockSuggestionsService.ignoreSuggestionMultiple).toHaveBeenCalled();
expect(mockSuggestionsTargetStateService.dispatchRefreshUserSuggestionsAction).toHaveBeenCalled();
expect(component.updatePage).toHaveBeenCalled();
});
diff --git a/src/app/suggestions-page/suggestions-page.component.ts b/src/app/suggestions-page/suggestions-page.component.ts
index 4883ed8406..09051441f4 100644
--- a/src/app/suggestions-page/suggestions-page.component.ts
+++ b/src/app/suggestions-page/suggestions-page.component.ts
@@ -28,6 +28,11 @@ import {redirectOn4xx} from '../core/shared/authorized.operators';
templateUrl: './suggestions-page.component.html',
styleUrls: ['./suggestions-page.component.scss'],
})
+
+/**
+ * Component used to visualize one of the suggestions from the publication claim page or from the notification pop up
+ */
+
export class SuggestionsPageComponent implements OnInit {
/**
@@ -139,15 +144,6 @@ export class SuggestionsPageComponent implements OnInit {
this.processing$.next(false);
this.suggestionsRD$.next(results);
this.suggestionService.clearSuggestionRequests();
- // navigate to the mydspace if no suggestions remains
-
- // if (results.totalElements === 0) {
- // const content = this.translateService.instant('reciter.suggestion.empty',
- // this.suggestionService.getNotificationSuggestionInterpolation(this.suggestionTarget));
- // this.notificationService.success('', content, {timeOut:0}, true);
- // TODO if the target is not the current use route to the suggestion target page
- // this.router.navigate(['/mydspace']);
- // }
});
}
diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5
index 989d2ea9fb..006fbdb5d4 100644
--- a/src/assets/i18n/en.json5
+++ b/src/assets/i18n/en.json5
@@ -3084,9 +3084,9 @@
"mydspace.import": "Import",
- "mydspace.notification.suggestion": "We found {{count}} publications
in the {{source}} that seems to be related to your profile.
Please review the suggestions",
+ "notification.suggestion": "We found {{count}} publications
in the {{source}} that seems to be related to your profile.
Please review the suggestions",
- "mydspace.notification.suggestion.page": "We found {{count}} {{type}} in the {{source}} that seems to be related to your profile. Please review the suggestions.",
+ "notification.suggestion.page": "We found {{count}} {{type}} in the {{source}} that seems to be related to your profile. Please review the suggestions.",
"nav.browse.header": "All of DSpace",
diff --git a/src/config/app-config.interface.ts b/src/config/app-config.interface.ts
index f89623e018..6c4b99cb0f 100644
--- a/src/config/app-config.interface.ts
+++ b/src/config/app-config.interface.ts
@@ -14,7 +14,7 @@ import { AuthConfig } from './auth-config.interfaces';
import { UIServerConfig } from './ui-server-config.interface';
import { MediaViewerConfig } from './media-viewer-config.interface';
import { BrowseByConfig } from './browse-by-config.interface';
-import { SuggestionConfig } from './layout-config.interfaces';
+import { SuggestionConfig } from './suggestion-config.interfaces';
import { BundleConfig } from './bundle-config.interface';
import { ActuatorsConfig } from './actuators.config';
import { InfoConfig } from './info-config.interface';
@@ -23,7 +23,7 @@ import { HomeConfig } from './homepage-config.interface';
import { MarkdownConfig } from './markdown-config.interface';
import { FilterVocabularyConfig } from './filter-vocabulary-config';
import { DiscoverySortConfig } from './discovery-sort.config';
-import {QualityAssuranceConfig} from './quality-assurance.config';
+import { QualityAssuranceConfig } from './quality-assurance.config';
interface AppConfig extends Config {
ui: UIServerConfig;
diff --git a/src/config/default-app-config.ts b/src/config/default-app-config.ts
index 902ab68dc3..be9306c893 100644
--- a/src/config/default-app-config.ts
+++ b/src/config/default-app-config.ts
@@ -14,7 +14,7 @@ import { ServerConfig } from './server-config.interface';
import { SubmissionConfig } from './submission-config.interface';
import { ThemeConfig } from './theme.config';
import { UIServerConfig } from './ui-server-config.interface';
-import {SuggestionConfig} from './layout-config.interfaces';
+import {SuggestionConfig} from './suggestion-config.interfaces';
import { BundleConfig } from './bundle-config.interface';
import { ActuatorsConfig } from './actuators.config';
import { InfoConfig } from './info-config.interface';
@@ -304,6 +304,8 @@ export class DefaultAppConfig implements AppConfig {
// source: 'suggestionSource',
// collectionId: 'collectionUUID'
// }
+ // If not mapped the suggestion service won't be able to approve and import the related suggestion
+ // or load the fixed suggestions collections that can be configured here adding the source and the UUID of the collection
];
// Theme Config
diff --git a/src/config/layout-config.interfaces.ts b/src/config/layout-config.interfaces.ts
deleted file mode 100644
index 0b15a06aa9..0000000000
--- a/src/config/layout-config.interfaces.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-import { Config } from './config.interface';
-
-export interface UrnConfig extends Config {
- name: string;
- baseUrl: string;
-}
-
-export interface CrisRefConfig extends Config {
- entityType: string;
- icon: string;
-}
-
-export interface CrisLayoutMetadataBoxConfig extends Config {
- defaultMetadataLabelColStyle: string;
- defaultMetadataValueColStyle: string;
-}
-
-export interface CrisLayoutTypeConfig {
- orientation: string;
-}
-
-export interface NavbarConfig extends Config {
- showCommunityCollection: boolean;
-}
-
-export interface CrisItemPageConfig extends Config {
- [entity: string]: CrisLayoutTypeConfig;
- default: CrisLayoutTypeConfig;
-}
-
-
-export interface CrisLayoutConfig extends Config {
- urn: UrnConfig[];
- crisRef: CrisRefConfig[];
- itemPage: CrisItemPageConfig;
- metadataBox: CrisLayoutMetadataBoxConfig;
-}
-
-export interface LayoutConfig extends Config {
- navbar: NavbarConfig;
-}
-
-export interface SuggestionConfig extends Config {
- source: string;
- collectionId: string;
-}
diff --git a/src/config/suggestion-config.interfaces.ts b/src/config/suggestion-config.interfaces.ts
new file mode 100644
index 0000000000..e99ffa25f7
--- /dev/null
+++ b/src/config/suggestion-config.interfaces.ts
@@ -0,0 +1,6 @@
+import { Config } from "./config.interface";
+
+export interface SuggestionConfig extends Config {
+ source: string;
+ collectionId: string;
+}