Skip to content

Commit

Permalink
CST-5249_suggestion community first code review
Browse files Browse the repository at this point in the history
  • Loading branch information
frabacche committed Jan 23, 2024
1 parent 956d661 commit 2bb421c
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { URLCombiner } from '../../core/url-combiner/url-combiner';
import { getNotificationsModuleRoute } from '../admin-routing-paths';

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) {
return new URLCombiner(getNotificationsModuleRoute(), QUALITY_ASSURANCE_EDIT_PATH, id).toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { RouterModule } from '@angular/router';
import { AuthenticatedGuard } from '../../core/auth/authenticated.guard';
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
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 { AdminNotificationsSuggestionTargetsPageResolver } from './admin-notifications-suggestion-targets-page/admin-notifications-suggestion-targets-page-resolver.service';
import { QUALITY_ASSURANCE_EDIT_PATH } from './admin-notifications-routing-paths';
Expand All @@ -25,7 +25,7 @@ import {
RouterModule.forChild([
{
canActivate: [ AuthenticatedGuard ],
path: `${NOTIFICATIONS_RECITER_SUGGESTION_PATH}`,
path: `${PUBLICATION_CLAIMS_PATH}`,
component: AdminNotificationsSuggestionTargetsPageComponent,
pathMatch: 'full',
resolve: {
Expand Down
4 changes: 2 additions & 2 deletions src/app/menu.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import {
import {
ExportBatchSelectorComponent
} 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
Expand Down Expand Up @@ -568,7 +568,7 @@ export class MenuResolver implements Resolve<boolean> {
model: {
type: MenuItemType.LINK,
text: 'menu.section.notifications_reciter',
link: '/admin/notifications/' + NOTIFICATIONS_RECITER_SUGGESTION_PATH
link: '/admin/notifications/' + PUBLICATION_CLAIMS_PATH
} as LinkMenuItemModel,
},
/* Admin Search */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
</div>
<button (click)="notMine()" class="btn btn-danger ml-2"><i class="fa fa-ban"></i>
{{ notMineLabel() | translate}}</button>
<button *ngIf="!isBulk" (click)="toggleSeeEvidences()" [disabled]="!hasEvidence" class="btn btn-info mt-1 ml-2"><i class="fa fa-eye"></i>
<ng-container *ngIf="!seeEvidence">{{'reciter.suggestion.seeEvidence' | translate}}</ng-container>
<ng-container *ngIf="seeEvidence">{{'reciter.suggestion.hideEvidence' | translate}}</ng-container>
<button *ngIf="!isBulk" (click)="toggleSeeEvidences()" [disabled]="!hasEvidence" class="btn btn-info ml-2">
<i class="fa fa-eye"></i>
<ng-container *ngIf="!seeEvidence"> {{ 'reciter.suggestion.seeEvidence' | translate}}</ng-container>
<ng-container *ngIf="seeEvidence"> {{ 'reciter.suggestion.hideEvidence' | translate}}</ng-container>
</button>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<div class="col-1 text-center align-self-center">
<div class="">
<input type="checkbox" class="form-check-input"
[checked]="isSelected" (change)="changeSelected($event)"/>
[checked]="isSelected" (change)="changeSelected($event)"
[attr.aria-label]="object.display"/>
</div>
</div>
<!-- Total Score Panel -->
Expand All @@ -19,6 +20,7 @@
<!-- Object Preview -->
<ds-item-search-result-list-element
[showLabel]="false"
[showThumbnails]="false"
[object]="listableObject"
[linkType]="0"
></ds-item-search-result-list-element>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="container">
<div class="row">
<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-pagination *ngIf="!(isTargetsLoading() | async)"
Expand All @@ -27,7 +27,7 @@ <h3 id="header" class="border-bottom pb-2">{{'reciter.suggestion.title'| transla
<tbody>
<tr *ngFor="let targetElement of (targets$ | async); let i = index" class="text-center">
<td>
<a target="_blank" [routerLink]="['/items', getTargetUuid(targetElement)]">{{targetElement.display}}</a>
<a target="_blank" [routerLink]="['/entities/person/', getTargetUuid(targetElement)]">{{targetElement.display}}</a>
</td>
<td>
<div class="btn-group edit-field">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ export class SuggestionTargetsComponent implements OnInit {
distinctUntilChanged(),
take(1)
).subscribe((options: PaginationComponentOptions) => {
console.log('HELLO suggestion called!', options);
this.suggestionTargetsStateService.dispatchRetrieveReciterSuggestionTargets(
this.source,
options.pageSize,
Expand Down
6 changes: 3 additions & 3 deletions src/app/suggestions-page/suggestions-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<ng-container *ngVar="(suggestionsRD$ | async) as suggestionsRD">
<div *ngIf="suggestionsRD?.pageInfo?.totalElements > 0">

<h2>
<h1>
{{ translateSuggestionType() | 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 }}
</h2>
</h1>

<div class="mb-3 mt-3">
<button class="btn btn-light" (click)="onToggleSelectAll(suggestionsRD.page)">Select / Deselect All</button>
Expand Down
4 changes: 0 additions & 4 deletions src/assets/i18n/en.json5
Original file line number Diff line number Diff line change
Expand Up @@ -1774,10 +1774,6 @@

"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.email.back": "Back",
Expand Down
33 changes: 18 additions & 15 deletions src/themes/custom/eager-theme.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,24 @@ const DECLARATIONS = [
];

@NgModule({
imports: [
CommonModule,
SharedModule,
RootModule,
NavbarModule,
SharedBrowseByModule,
ResultsBackButtonModule,
ItemPageModule,
ItemSharedModule,
DsoPageModule,
],
declarations: DECLARATIONS,
providers: [
...ENTRY_COMPONENTS.map((component) => ({provide: component}))
],
imports: [
CommonModule,
SharedModule,
RootModule,
NavbarModule,
SharedBrowseByModule,
ResultsBackButtonModule,
ItemPageModule,
ItemSharedModule,
DsoPageModule,
],
declarations: DECLARATIONS,
providers: [
...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
Expand Down

0 comments on commit 2bb421c

Please sign in to comment.