forked from rero/rero-ils-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds menu entry with default filters. * Adds indicator to the stat config brief view. * Replaces the organisation by library. * Adds facets to the stat config search view. * Adds updated and created date. * Adds filter by libraries. * Adds live values. * Adds report list. * Exposes settings service into the route tools service. * Fixes delete messsages by adding missing resources in the record permission service. Co-Authored-by: Johnny Mariéthoz <[email protected]>
- Loading branch information
Showing
12 changed files
with
795 additions
and
367 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
.../app/record/detail-view/statistics-cfg-detail-view/report-data/report-data.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!-- | ||
RERO ILS UI | ||
Copyright (C) 2023 RERO | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, version 3 of the License. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
--> | ||
|
||
<p-table *ngIf="data && data.length > 0; else noResult" [value]="data" [tableStyle]="{ 'min-width': '50rem' }"> | ||
<ng-template pTemplate="body" let-line> | ||
<tr> | ||
<td *ngFor="let value of line">{{ value }}</td> | ||
</tr> | ||
</ng-template> | ||
</p-table> | ||
|
||
<ng-template #noResult> | ||
<p class="m-0 px-4 py-2 text-muted" translate>No result</p> | ||
</ng-template> |
28 changes: 28 additions & 0 deletions
28
...rc/app/record/detail-view/statistics-cfg-detail-view/report-data/report-data.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* RERO ILS UI | ||
* Copyright (C) 2023 RERO | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, version 3 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import { Component, Input } from "@angular/core"; | ||
|
||
@Component({ | ||
selector: "admin-report-data", | ||
templateUrl: "./report-data.component.html", | ||
}) | ||
export class ReportDataComponent { | ||
|
||
// the report data to display | ||
@Input() data: any; | ||
} |
37 changes: 37 additions & 0 deletions
37
...pp/record/detail-view/statistics-cfg-detail-view/reports-list/reports-list.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!-- | ||
RERO ILS UI | ||
Copyright (C) 2023 RERO | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, version 3 of the License. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
--> | ||
|
||
<table *ngIf="reports?.length; else noResult" class="mt-4 table table-striped"> | ||
<tbody> | ||
<tr *ngFor="let report of reports"> | ||
<th> | ||
<a class="pl-2" target="_blank" [href]="getReportUrl(report.metadata.pid)"> | ||
{{ report.created | dateTranslate: 'longDate' }} | ||
<i class="pl-1 fa fa-external-link"></i> | ||
</a> | ||
</th> | ||
<td class="text-right"> | ||
<a class="btn btn-link btn-outline-primary" [href]="getReportUrl(report.metadata.pid)+'?format=csv'"> | ||
<i class="fa fa-download"></i> | ||
</a> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<ng-template #noResult> | ||
<p class="m-0 px-4 py-2 text-muted" translate>No result</p> | ||
</ng-template> |
65 changes: 65 additions & 0 deletions
65
.../app/record/detail-view/statistics-cfg-detail-view/reports-list/reports-list.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* RERO ILS UI | ||
* Copyright (C) 2023 RERO | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, version 3 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import { Component, Input, OnInit } from "@angular/core"; | ||
import { ApiService, Record, RecordService } from "@rero/ng-core"; | ||
import { map } from "rxjs/operators"; | ||
|
||
@Component({ | ||
selector: "admin-reports-list", | ||
templateUrl: "./reports-list.component.html", | ||
}) | ||
export class ReportsListComponent implements OnInit { | ||
// persistent identifier of the current stat report configuration | ||
@Input() pid: any; | ||
|
||
// list of the corresponding reports from elasticsearch | ||
reports: Array<any>; | ||
|
||
/** | ||
* Constructor | ||
* @param _recordService - RecordService | ||
* @param _apiService - ApiService | ||
*/ | ||
constructor( | ||
private _recordService: RecordService, | ||
private _apiService: ApiService | ||
) {} | ||
|
||
/** | ||
* Get the report item URL | ||
* | ||
* @param pid - Persistent Identifier value. | ||
* @returns the URL as string. | ||
*/ | ||
getReportUrl(pid: string): string { | ||
return `${this._apiService.getEndpointByType("stats")}/${pid}`; | ||
} | ||
|
||
/** OnInit hook */ | ||
ngOnInit(): void { | ||
this._recordService | ||
.getRecords("stats", `config.pid:${this.pid}`, 1, 100) | ||
.pipe( | ||
map((result: Record) => | ||
this._recordService.totalHits(result.hits.total) === 0 | ||
? [] | ||
: result.hits.hits | ||
) | ||
).subscribe((res: any) => (this.reports = res)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.