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.
* Closes rero/rero-ils#3618. Co-Authored-by: Bertrand Zuchuat <[email protected]>
- Loading branch information
1 parent
43f0fca
commit 69423cc
Showing
28 changed files
with
671 additions
and
292 deletions.
There are no files selected for viewing
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
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
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
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
46 changes: 46 additions & 0 deletions
46
...detail-view/entities-detail-view/local/local-page-detail/local-page-detail.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,46 @@ | ||
<!-- | ||
RERO ILS UI | ||
Copyright (C) 2020-2024 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/>. | ||
--> | ||
<div class="main-content"> | ||
@if (record) { | ||
<ng-core-detail-button | ||
[record]="record" | ||
[type]="type" | ||
[adminMode]="adminMode" | ||
[useStatus]="useStatus" | ||
[updateStatus]="updateStatus" | ||
[deleteStatus]="deleteStatus" | ||
(recordEvent)="recordEvent($event)" | ||
(deleteMessageEvent)="showDeleteMessage($event)" | ||
> | ||
<ng-container beforeButton> | ||
<button (click)="search(record)" class="btn btn-sm btn-outline-primary mr-1"> | ||
<i class="fa fa-search" aria-hidden="true"></i> | ||
{{ 'Search documents' | translate }} | ||
</button> | ||
@if (record) { | ||
@if (isEnabledOperationLog && record.metadata.pid) { | ||
<admin-operation-logs-dialog resourceType="local_entities" [resourcePid]="record.metadata.pid"></admin-operation-logs-dialog> | ||
} | ||
} | ||
</ng-container> | ||
</ng-core-detail-button> | ||
} | ||
@if (error) { | ||
<ng-core-error [error]="error"></ng-core-error> | ||
} | ||
<ng-template ngCoreRecordDetail></ng-template> | ||
</div> |
86 changes: 86 additions & 0 deletions
86
...d/detail-view/entities-detail-view/local/local-page-detail/local-page-detail.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,86 @@ | ||
/* | ||
* RERO ILS UI | ||
* Copyright (C) 2019-2024 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 { Location } from '@angular/common'; | ||
import { Component, ComponentFactoryResolver } from '@angular/core'; | ||
import { ActivatedRoute, Router } from '@angular/router'; | ||
import { OperationLogsService } from '@app/admin/service/operation-logs.service'; | ||
import { TranslateService } from '@ngx-translate/core'; | ||
import { DetailComponent, RecordService, RecordUiService } from '@rero/ng-core'; | ||
import { Entity } from '@rero/shared'; | ||
import { BsModalService } from 'ngx-bootstrap/modal'; | ||
import { NgxSpinnerService } from 'ngx-spinner'; | ||
import { ToastrService } from 'ngx-toastr'; | ||
|
||
@Component({ | ||
selector: 'admin-local-page-detail', | ||
templateUrl: './local-page-detail.component.html' | ||
}) | ||
export class LocalPageDetailComponent extends DetailComponent { | ||
|
||
/** | ||
* Is operation log enabled | ||
* @return boolean | ||
*/ | ||
get isEnabledOperationLog(): boolean { | ||
return this.operationLogsService.isLogVisible('local_entities'); | ||
} | ||
|
||
/** | ||
* Constructor | ||
* @param route - ActivatedRoute | ||
* @param router - Router | ||
* @param location - Location | ||
* @param componentFactoryResolver - ComponentFactoryResolver | ||
* @param recordService - RecordService | ||
* @param recordUiService - RecordUiService | ||
* @param toastrService - ToastrService | ||
* @param translate - TranslateService | ||
* @param spinner - NgxSpinnerService | ||
* @param bsModalService - BsModalService | ||
* @param operationLogsService - OperationLogsService | ||
*/ | ||
constructor( | ||
protected route: ActivatedRoute, | ||
protected router: Router, | ||
protected location: Location, | ||
protected componentFactoryResolver: ComponentFactoryResolver, | ||
protected recordService: RecordService, | ||
protected recordUiService: RecordUiService, | ||
protected toastrService: ToastrService, | ||
protected translate: TranslateService, | ||
protected spinner: NgxSpinnerService, | ||
protected bsModalService: BsModalService, | ||
private operationLogsService: OperationLogsService, | ||
) { | ||
super(route, router, location, componentFactoryResolver, recordService, recordUiService, toastrService, translate, spinner); | ||
} | ||
|
||
/** | ||
* Launch an expert search on the document view. | ||
* @param record - the record | ||
*/ | ||
search(record: any): void | ||
{ | ||
this.router.navigate( | ||
['/records', 'documents'], | ||
{ | ||
queryParams: { q: Entity.generateSearchQuery(record.metadata.type, 'local', record.metadata.pid), simple: '0' }, | ||
skipLocationChange: true | ||
}, | ||
); | ||
} | ||
} |
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.