Requested changes and fixes

This commit is contained in:
Jean-François Morin
2024-02-27 11:34:37 -05:00
parent 91d97f8af0
commit 92553e04cd
6 changed files with 21 additions and 30 deletions

View File

@@ -2,7 +2,7 @@
<div class="metadata-registry row"> <div class="metadata-registry row">
<div class="col-12"> <div class="col-12">
<h2 id="header" class="border-bottom pb-2">{{ "admin.reports.collections.head" | translate }}</h2> <h1 id="header" class="border-bottom pb-2">{{ "admin.reports.collections.head" | translate }}</h1>
<div id="metadatadiv"> <div id="metadatadiv">
<ngb-accordion [closeOthers]="true" activeIds="filters" #acc="ngbAccordion"> <ngb-accordion [closeOthers]="true" activeIds="filters" #acc="ngbAccordion">
@@ -46,8 +46,8 @@
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let coll of results.collections"> <tr *ngFor="let coll of results.collections">
<td><a href="{{ coll.communityHandle }}" target="_blank">{{ coll.communityLabel }}</a></td> <td><a href="/handle/{{ coll.communityHandle }}" rel="noopener noreferrer" target="_blank">{{ coll.communityLabel }}</a></td>
<td><a href="{{ coll.handle }}" target="_blank">{{ coll.label }}</a></td> <td><a href="/handle/{{ coll.handle }}" rel="noopener noreferrer" target="_blank">{{ coll.label }}</a></td>
<td class="num">{{ coll.nbTotalItems }}</td> <td class="num">{{ coll.nbTotalItems }}</td>
<td class="num">{{ coll.allFiltersValue }}</td> <td class="num">{{ coll.allFiltersValue }}</td>
<td class="num" *ngFor="let filter of results.summary.values | keyvalue">{{ coll.values[filter.key] || 0 }}</td> <td class="num" *ngFor="let filter of results.summary.values | keyvalue">{{ coll.values[filter.key] || 0 }}</td>

View File

@@ -9,6 +9,9 @@ import { environment } from 'src/environments/environment';
import { FiltersComponent } from '../filters-section/filters-section.component'; import { FiltersComponent } from '../filters-section/filters-section.component';
import { FilteredCollections } from './filtered-collections.model'; import { FilteredCollections } from './filtered-collections.model';
/**
* Component representing the Filtered Collections content report
*/
@Component({ @Component({
selector: 'ds-report-filtered-collections', selector: 'ds-report-filtered-collections',
templateUrl: './filtered-collections.component.html', templateUrl: './filtered-collections.component.html',
@@ -64,27 +67,4 @@ export class FilteredCollectionsComponent {
return params; return params;
} }
/*
downloadCsv() {
this
.postDownloadCsv()
.subscribe(
response => {
// TODO: Ne fonctionne pas, le restService de DSpace attend un document JSON.
const csv: any = response.payload;
const blob = new Blob([csv], { type: 'text/csv' });
const url = window.URL.createObjectURL(blob);
window.open(url);
}
);
}
postDownloadCsv(): Observable<RawRestResponse> {
let form = this.queryForm.value;
let scheme = environment.rest.ssl ? 'https' : 'http';
let urlRestApp = `${scheme}://${environment.rest.host}:${environment.rest.port}${environment.rest.nameSpace}`;
return this.restService.request(RestRequestMethod.POST, `${urlRestApp}/api/contentreport/filteredcollections/csv`, form);
}
*/
} }

View File

@@ -2,7 +2,7 @@
<div class="metadata-registry row"> <div class="metadata-registry row">
<div class="col-12"> <div class="col-12">
<h2 id="header" class="border-bottom pb-2">{{'admin.reports.items.head' | translate}}</h2> <h1 id="header" class="border-bottom pb-2">{{'admin.reports.items.head' | translate}}</h1>
<div id="querydiv" [formGroup]="queryForm"> <div id="querydiv" [formGroup]="queryForm">
<ngb-accordion [closeOthers]="true" activeIds="collectionSelector" #acc="ngbAccordion"> <ngb-accordion [closeOthers]="true" activeIds="collectionSelector" #acc="ngbAccordion">
@@ -143,8 +143,8 @@
<tr *ngFor="let item of results$ | async"> <tr *ngFor="let item of results$ | async">
<td class="num">{{ item.index }}</td> <td class="num">{{ item.index }}</td>
<td>{{ item.uuid }}</td> <td>{{ item.uuid }}</td>
<td><a *ngIf="item.owningCollection" href="/handle/{{ item.owningCollection.handle }}" target="_blank">{{ item.owningCollection.name }}</a></td> <td><a *ngIf="item.owningCollection" href="/handle/{{ item.owningCollection.handle }}" rel="noopener noreferrer" target="_blank">{{ item.owningCollection.name }}</a></td>
<td><a *ngIf="item.handle" href="/handle/{{ item.handle }}" target="_blank">{{ item.handle }}</a></td> <td><a *ngIf="item.handle" href="/handle/{{ item.handle }}" rel="noopener noreferrer" target="_blank">{{ item.handle }}</a></td>
<td>{{ item.name }}</td> <td>{{ item.name }}</td>
<td class="num" *ngFor="let field of queryForm.value['additionalFields']"> <td class="num" *ngFor="let field of queryForm.value['additionalFields']">
<span *ngFor="let mdvalue of item.metadata[field]"> <span *ngFor="let mdvalue of item.metadata[field]">

View File

@@ -24,6 +24,9 @@ import { OptionVO } from './option-vo.model';
import { PresetQuery } from './preset-query.model'; import { PresetQuery } from './preset-query.model';
import { QueryPredicate } from './query-predicate.model'; import { QueryPredicate } from './query-predicate.model';
/**
* Component representing the Filtered Items content report.
*/
@Component({ @Component({
selector: 'ds-report-filtered-items', selector: 'ds-report-filtered-items',
templateUrl: './filtered-items.component.html', templateUrl: './filtered-items.component.html',
@@ -301,7 +304,7 @@ export class FilteredItemsComponent {
} }
private toQueryString(): string { private toQueryString(): string {
let params = `page=${this.currentPage}&size=${this.pageSize()}`; let params = `pageNumber=${this.currentPage}&pageLimit=${this.pageSize()}`;
let colls = this.queryForm.value.collections; let colls = this.queryForm.value.collections;
for (let i = 0; i < colls.length; i++) { for (let i = 0; i < colls.length; i++) {

View File

@@ -1,5 +1,9 @@
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
/**
* Component representing an option in each selectable list of values
* used in the Filtered Items report query interface
*/
export class OptionVO { export class OptionVO {
id: string; id: string;

View File

@@ -3,6 +3,10 @@ import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { FilterGroup } from './filter-group.model'; import { FilterGroup } from './filter-group.model';
import { Filter } from './filter.model'; import { Filter } from './filter.model';
/**
* Component representing the Query Filters section used in both
* Filtered Collections and Filtered Items content reports
*/
@Component({ @Component({
selector: 'ds-filters', selector: 'ds-filters',
templateUrl: './filters-section.component.html', templateUrl: './filters-section.component.html',