CST-5249_suggestion community first code review

This commit is contained in:
frabacche
2024-01-23 17:44:49 +01:00
parent 956d661e62
commit 2bb421c7cf
10 changed files with 35 additions and 34 deletions

View File

@@ -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 NOTIFICATIONS_RECITER_SUGGESTION_PATH = 'suggestion-targets'; export const PUBLICATION_CLAIMS_PATH = 'publication-claims';
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();

View File

@@ -4,7 +4,7 @@ import { RouterModule } from '@angular/router';
import { AuthenticatedGuard } from '../../core/auth/authenticated.guard'; 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 { NOTIFICATIONS_RECITER_SUGGESTION_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-suggestion-targets-page/admin-notifications-suggestion-targets-page.component';
import { AdminNotificationsSuggestionTargetsPageResolver } from './admin-notifications-suggestion-targets-page/admin-notifications-suggestion-targets-page-resolver.service'; import { AdminNotificationsSuggestionTargetsPageResolver } from './admin-notifications-suggestion-targets-page/admin-notifications-suggestion-targets-page-resolver.service';
import { QUALITY_ASSURANCE_EDIT_PATH } from './admin-notifications-routing-paths'; import { QUALITY_ASSURANCE_EDIT_PATH } from './admin-notifications-routing-paths';
@@ -25,7 +25,7 @@ import {
RouterModule.forChild([ RouterModule.forChild([
{ {
canActivate: [ AuthenticatedGuard ], canActivate: [ AuthenticatedGuard ],
path: `${NOTIFICATIONS_RECITER_SUGGESTION_PATH}`, path: `${PUBLICATION_CLAIMS_PATH}`,
component: AdminNotificationsSuggestionTargetsPageComponent, component: AdminNotificationsSuggestionTargetsPageComponent,
pathMatch: 'full', pathMatch: 'full',
resolve: { resolve: {

View File

@@ -47,7 +47,7 @@ import {
import { import {
ExportBatchSelectorComponent ExportBatchSelectorComponent
} from './shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component'; } from './shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component';
import { NOTIFICATIONS_RECITER_SUGGESTION_PATH } from './admin/admin-notifications/admin-notifications-routing-paths'; import { PUBLICATION_CLAIMS_PATH } from './admin/admin-notifications/admin-notifications-routing-paths';
/** /**
* Creates all of the app's menus * Creates all of the app's menus
@@ -568,7 +568,7 @@ export class MenuResolver implements Resolve<boolean> {
model: { model: {
type: MenuItemType.LINK, type: MenuItemType.LINK,
text: 'menu.section.notifications_reciter', text: 'menu.section.notifications_reciter',
link: '/admin/notifications/' + NOTIFICATIONS_RECITER_SUGGESTION_PATH link: '/admin/notifications/' + PUBLICATION_CLAIMS_PATH
} as LinkMenuItemModel, } as LinkMenuItemModel,
}, },
/* Admin Search */ /* Admin Search */

View File

@@ -21,8 +21,9 @@
</div> </div>
<button (click)="notMine()" class="btn btn-danger ml-2"><i class="fa fa-ban"></i> <button (click)="notMine()" class="btn btn-danger ml-2"><i class="fa fa-ban"></i>
{{ notMineLabel() | translate}}</button> {{ notMineLabel() | translate}}</button>
<button *ngIf="!isBulk" (click)="toggleSeeEvidences()" [disabled]="!hasEvidence" class="btn btn-info mt-1 ml-2"><i class="fa fa-eye"></i> <button *ngIf="!isBulk" (click)="toggleSeeEvidences()" [disabled]="!hasEvidence" class="btn btn-info ml-2">
<ng-container *ngIf="!seeEvidence">{{'reciter.suggestion.seeEvidence' | translate}}</ng-container> <i class="fa fa-eye"></i>
<ng-container *ngIf="seeEvidence">{{'reciter.suggestion.hideEvidence' | translate}}</ng-container> <ng-container *ngIf="!seeEvidence"> {{ 'reciter.suggestion.seeEvidence' | translate}}</ng-container>
<ng-container *ngIf="seeEvidence"> {{ 'reciter.suggestion.hideEvidence' | translate}}</ng-container>
</button> </button>
</div> </div>

View File

@@ -4,7 +4,8 @@
<div class="col-1 text-center align-self-center"> <div class="col-1 text-center align-self-center">
<div class=""> <div class="">
<input type="checkbox" class="form-check-input" <input type="checkbox" class="form-check-input"
[checked]="isSelected" (change)="changeSelected($event)"/> [checked]="isSelected" (change)="changeSelected($event)"
[attr.aria-label]="object.display"/>
</div> </div>
</div> </div>
<!-- Total Score Panel --> <!-- Total Score Panel -->
@@ -19,6 +20,7 @@
<!-- Object Preview --> <!-- Object Preview -->
<ds-item-search-result-list-element <ds-item-search-result-list-element
[showLabel]="false" [showLabel]="false"
[showThumbnails]="false"
[object]="listableObject" [object]="listableObject"
[linkType]="0" [linkType]="0"
></ds-item-search-result-list-element> ></ds-item-search-result-list-element>

View File

@@ -1,7 +1,7 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<h3 id="header" class="border-bottom pb-2">{{'reciter.suggestion.title'| translate}}</h3> <h1 id="header" class="border-bottom pb-2">{{'reciter.suggestion.title'| translate}}</h1>
<ds-loading class="container" *ngIf="(isTargetsLoading() | async)" message="{{'reciter.suggestion.loading' | translate}}"></ds-loading> <ds-loading class="container" *ngIf="(isTargetsLoading() | async)" message="{{'reciter.suggestion.loading' | translate}}"></ds-loading>
<ds-pagination *ngIf="!(isTargetsLoading() | async)" <ds-pagination *ngIf="!(isTargetsLoading() | async)"
@@ -27,7 +27,7 @@
<tbody> <tbody>
<tr *ngFor="let targetElement of (targets$ | async); let i = index" class="text-center"> <tr *ngFor="let targetElement of (targets$ | async); let i = index" class="text-center">
<td> <td>
<a target="_blank" [routerLink]="['/items', getTargetUuid(targetElement)]">{{targetElement.display}}</a> <a target="_blank" [routerLink]="['/entities/person/', getTargetUuid(targetElement)]">{{targetElement.display}}</a>
</td> </td>
<td> <td>
<div class="btn-group edit-field"> <div class="btn-group edit-field">

View File

@@ -136,7 +136,6 @@ export class SuggestionTargetsComponent implements OnInit {
distinctUntilChanged(), distinctUntilChanged(),
take(1) take(1)
).subscribe((options: PaginationComponentOptions) => { ).subscribe((options: PaginationComponentOptions) => {
console.log('HELLO suggestion called!', options);
this.suggestionTargetsStateService.dispatchRetrieveReciterSuggestionTargets( this.suggestionTargetsStateService.dispatchRetrieveReciterSuggestionTargets(
this.source, this.source,
options.pageSize, options.pageSize,

View File

@@ -4,12 +4,12 @@
<ng-container *ngVar="(suggestionsRD$ | async) as suggestionsRD"> <ng-container *ngVar="(suggestionsRD$ | async) as suggestionsRD">
<div *ngIf="suggestionsRD?.pageInfo?.totalElements > 0"> <div *ngIf="suggestionsRD?.pageInfo?.totalElements > 0">
<h2> <h1>
{{ translateSuggestionType() | translate }} {{ translateSuggestionType() | translate }}
{{'reciter.suggestion.suggestionFor' | translate}} {{'reciter.suggestion.suggestionFor' | translate}}
<a target="_blank" [routerLink]="['/items', researcherUuid]">{{researcherName}}</a> <a target="_blank" [routerLink]="['/entities/person/', researcherUuid]">{{researcherName}}</a>
{{'reciter.suggestion.from.source' | translate}} {{ translateSuggestionSource() | translate }} {{'reciter.suggestion.from.source' | translate}} {{ translateSuggestionSource() | translate }}
</h2> </h1>
<div class="mb-3 mt-3"> <div class="mb-3 mt-3">
<button class="btn btn-light" (click)="onToggleSelectAll(suggestionsRD.page)">Select / Deselect All</button> <button class="btn btn-light" (click)="onToggleSelectAll(suggestionsRD.page)">Select / Deselect All</button>

View File

@@ -1774,10 +1774,6 @@
"form.repeatable.sort.tip": "Drop the item in the new position", "form.repeatable.sort.tip": "Drop the item in the new position",
"form.number-picker.decrement": "Decrement {{field}}",
"form.number-picker.increment": "Increment {{field}}",
"grant-deny-request-copy.deny": "Don't send copy", "grant-deny-request-copy.deny": "Don't send copy",
"grant-deny-request-copy.email.back": "Back", "grant-deny-request-copy.email.back": "Back",

View File

@@ -102,21 +102,24 @@ const DECLARATIONS = [
]; ];
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, CommonModule,
SharedModule, SharedModule,
RootModule, RootModule,
NavbarModule, NavbarModule,
SharedBrowseByModule, SharedBrowseByModule,
ResultsBackButtonModule, ResultsBackButtonModule,
ItemPageModule, ItemPageModule,
ItemSharedModule, ItemSharedModule,
DsoPageModule, DsoPageModule,
], ],
declarations: DECLARATIONS, declarations: DECLARATIONS,
providers: [ providers: [
...ENTRY_COMPONENTS.map((component) => ({provide: component})) ...ENTRY_COMPONENTS.map((component) => ({ provide: component }))
], ],
exports: [
ItemSearchResultListElementComponent
]
}) })
/** /**
* This module is included in the main bundle that gets downloaded at first page load. So it should * This module is included in the main bundle that gets downloaded at first page load. So it should