fix routing, update issue, adapt labels

This commit is contained in:
FrancescoMolinaro
2024-02-05 12:48:23 +01:00
parent 2da613bff1
commit 937687c414
6 changed files with 13 additions and 7 deletions

View File

@@ -29,6 +29,7 @@ export class SuggestionsNotificationComponent implements OnInit {
) { } ) { }
ngOnInit() { ngOnInit() {
this.suggestionTargetsStateService.dispatchRefreshUserSuggestionsAction();
this.suggestionsRD$ = this.suggestionTargetsStateService.getCurrentUserSuggestionTargets(); this.suggestionsRD$ = this.suggestionTargetsStateService.getCurrentUserSuggestionTargets();
} }

View File

@@ -3,7 +3,7 @@ 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 { take, takeUntil } from 'rxjs/operators';
import { SuggestionTarget } from '../../core/suggestion-notifications/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';
@@ -36,7 +36,7 @@ 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.suggestionTargetsStateService.getCurrentUserSuggestionTargets(), this.suggestionTargetsStateService.getCurrentUserSuggestionTargets().pipe(take(2)),
this.suggestionTargetsStateService.hasUserVisitedSuggestions() this.suggestionTargetsStateService.hasUserVisitedSuggestions()
]).pipe(takeUntil(notifier)).subscribe(([suggestions, visited]) => { ]).pipe(takeUntil(notifier)).subscribe(([suggestions, visited]) => {
this.suggestionTargetsStateService.dispatchRefreshUserSuggestionsAction(); this.suggestionTargetsStateService.dispatchRefreshUserSuggestionsAction();

View File

@@ -154,7 +154,7 @@ export class SuggestionsService {
* The EPerson id for which to retrieve suggestion targets * The EPerson id for which to retrieve suggestion targets
*/ */
public retrieveCurrentUserSuggestions(userUuid: string): Observable<SuggestionTarget[]> { public retrieveCurrentUserSuggestions(userUuid: string): Observable<SuggestionTarget[]> {
return this.researcherProfileService.findById(userUuid).pipe( return this.researcherProfileService.findById(userUuid, true).pipe(
getFirstSucceededRemoteDataPayload(), getFirstSucceededRemoteDataPayload(),
mergeMap((profile: ResearcherProfile) => { mergeMap((profile: ResearcherProfile) => {
if (isNotEmpty(profile)) { if (isNotEmpty(profile)) {

View File

@@ -23,7 +23,7 @@ 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 {redirectOn4xx} from '../core/shared/authorized.operators'; import {redirectOn4xx} from '../core/shared/authorized.operators';
import { import {
getWorkflowItemEditRoute getWorkspaceItemEditRoute
} from '../workflowitems-edit-page/workflowitems-edit-page-routing-paths'; } from '../workflowitems-edit-page/workflowitems-edit-page-routing-paths';
@Component({ @Component({
@@ -193,7 +193,7 @@ export class SuggestionsPageComponent implements OnInit {
approveAndImport(event: SuggestionApproveAndImport) { approveAndImport(event: SuggestionApproveAndImport) {
this.suggestionService.approveAndImport(this.workspaceItemService, event.suggestion, event.collectionId) this.suggestionService.approveAndImport(this.workspaceItemService, event.suggestion, event.collectionId)
.subscribe((workspaceitem: WorkspaceItem) => { .subscribe((workspaceitem: WorkspaceItem) => {
const content = this.translateService.instant('suggestion.approveAndImport.success', { url: getWorkflowItemEditRoute(workspaceitem.id) }); const content = this.translateService.instant('suggestion.approveAndImport.success', { url: getWorkspaceItemEditRoute(workspaceitem.id) });
this.notificationService.success('', content, {timeOut:0}, true); this.notificationService.success('', content, {timeOut:0}, true);
this.suggestionTargetsStateService.dispatchRefreshUserSuggestionsAction(); this.suggestionTargetsStateService.dispatchRefreshUserSuggestionsAction();
this.updatePage(); this.updatePage();

View File

@@ -28,9 +28,14 @@ export function getWorkspaceItemDeleteRoute(wsiId: string) {
return new URLCombiner(getWorkspaceItemModuleRoute(), wsiId, WORKSPACE_ITEM_DELETE_PATH).toString(); return new URLCombiner(getWorkspaceItemModuleRoute(), wsiId, WORKSPACE_ITEM_DELETE_PATH).toString();
} }
export function getWorkspaceItemEditRoute(wsiId: string) {
return new URLCombiner(getWorkspaceItemModuleRoute(), wsiId, WORKSPACE_ITEM_EDIT_PATH).toString();
}
export const WORKFLOW_ITEM_EDIT_PATH = 'edit'; export const WORKFLOW_ITEM_EDIT_PATH = 'edit';
export const WORKFLOW_ITEM_DELETE_PATH = 'delete'; export const WORKFLOW_ITEM_DELETE_PATH = 'delete';
export const WORKFLOW_ITEM_VIEW_PATH = 'view'; export const WORKFLOW_ITEM_VIEW_PATH = 'view';
export const WORKFLOW_ITEM_SEND_BACK_PATH = 'sendback'; export const WORKFLOW_ITEM_SEND_BACK_PATH = 'sendback';
export const ADVANCED_WORKFLOW_PATH = 'advanced'; export const ADVANCED_WORKFLOW_PATH = 'advanced';
export const WORKSPACE_ITEM_DELETE_PATH = 'delete'; export const WORKSPACE_ITEM_DELETE_PATH = 'delete';
export const WORKSPACE_ITEM_EDIT_PATH = 'edit';

View File

@@ -24,9 +24,9 @@
"404.page-not-found": "page not found", "404.page-not-found": "page not found",
"admin.notifications.publicationclaim.breadcrumbs": "Suggestions", "admin.notifications.publicationclaim.breadcrumbs": "Publication Claim",
"admin.notifications.publicationclaim.page.title": "Suggestions", "admin.notifications.publicationclaim.page.title": "Publication Claim",
"error-page.description.401": "unauthorized", "error-page.description.401": "unauthorized",