Skip to content

Commit

Permalink
Requested changes and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-François Morin committed Feb 27, 2024
1 parent 91d97f8 commit 92553e0
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="metadata-registry row">
<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">
<ngb-accordion [closeOthers]="true" activeIds="filters" #acc="ngbAccordion">
Expand Down Expand Up @@ -46,8 +46,8 @@ <h2 id="header" class="border-bottom pb-2">{{ "admin.reports.collections.head" |
</thead>
<tbody>
<tr *ngFor="let coll of results.collections">
<td><a href="{{ coll.communityHandle }}" target="_blank">{{ coll.communityLabel }}</a></td>
<td><a href="{{ coll.handle }}" target="_blank">{{ coll.label }}</a></td>
<td><a href="/handle/{{ coll.communityHandle }}" rel="noopener noreferrer" target="_blank">{{ coll.communityLabel }}</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.allFiltersValue }}</td>
<td class="num" *ngFor="let filter of results.summary.values | keyvalue">{{ coll.values[filter.key] || 0 }}</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import { environment } from 'src/environments/environment';
import { FiltersComponent } from '../filters-section/filters-section.component';
import { FilteredCollections } from './filtered-collections.model';

/**
* Component representing the Filtered Collections content report
*/
@Component({
selector: 'ds-report-filtered-collections',
templateUrl: './filtered-collections.component.html',
Expand Down Expand Up @@ -64,27 +67,4 @@ export class FilteredCollectionsComponent {
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);
}
*/

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="metadata-registry row">
<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">
<ngb-accordion [closeOthers]="true" activeIds="collectionSelector" #acc="ngbAccordion">
Expand Down Expand Up @@ -143,8 +143,8 @@ <h2 id="header" class="border-bottom pb-2">{{'admin.reports.items.head' | transl
<tr *ngFor="let item of results$ | async">
<td class="num">{{ item.index }}</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.handle" href="/handle/{{ item.handle }}" target="_blank">{{ item.handle }}</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 }}" rel="noopener noreferrer" target="_blank">{{ item.handle }}</a></td>
<td>{{ item.name }}</td>
<td class="num" *ngFor="let field of queryForm.value['additionalFields']">
<span *ngFor="let mdvalue of item.metadata[field]">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ import { OptionVO } from './option-vo.model';
import { PresetQuery } from './preset-query.model';
import { QueryPredicate } from './query-predicate.model';

/**
* Component representing the Filtered Items content report.
*/
@Component({
selector: 'ds-report-filtered-items',
templateUrl: './filtered-items.component.html',
Expand Down Expand Up @@ -301,7 +304,7 @@ export class FilteredItemsComponent {
}

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;
for (let i = 0; i < colls.length; i++) {
Expand Down
4 changes: 4 additions & 0 deletions src/app/admin/admin-reports/filtered-items/option-vo.model.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
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 {

id: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { FilterGroup } from './filter-group.model';
import { Filter } from './filter.model';

/**
* Component representing the Query Filters section used in both
* Filtered Collections and Filtered Items content reports
*/
@Component({
selector: 'ds-filters',
templateUrl: './filters-section.component.html',
Expand Down

0 comments on commit 92553e0

Please sign in to comment.