Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

primeng: admin inventories #1233

Open
wants to merge 2 commits into
base: next-version
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 39 additions & 49 deletions projects/admin/src/app/app.component.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions projects/admin/src/app/menu/menu-app/menu-app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
@if (item.icon) {
<span [class]="item.icon" class="p-menuitem-icon"></span>
}
<span class="ml-1">{{ item.label }}</span>
<span>{{ item.label }}</span>
@if (item.shortcut) {
<span class="ml-auto border-1 surface-border border-round surface-100 text-sm px-2 py-1">
{{ item.shortcut }}
</span>
</span>
}
@if (item.items) {
<i [ngClass]="['pi', root ? 'pi-angle-down ml-2' : 'pi-angle-right ml-auto']"></i>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,19 @@
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="flex flex-wrap justify-content-center mt-2">
<div class="grid justify-content-center">
@for (item of items; track item) {
<div class="col mx-1">
<p-card>
<p-card class="col">
<ng-template pTemplate="header">
<div class="md:flex grid grid-nogutter bg-blue-900 text-white p-3 text-xl font-bold border-round-top">
<div class="bg-blue-900 text-white gap-1 flex align-items-center p-3 font-bold border-round-top">
@if (item.icon) {
<i class="mr-2" [class]="item.icon"></i>
<i [class]="item.icon"></i>
}
{{ item.label }}
<span>{{ item.label }}</span>
</div>
</ng-template>
@for (menuItem of item.items; track menuItem) {
<p-tieredMenu [model]="[menuItem]" styleClass="w-full">
<p-tieredMenu [model]="[menuItem]" styleClass="w-full p-0">
<ng-template pTemplate="item" let-item>
<a
pRipple
Expand All @@ -40,7 +39,7 @@
@if (item.icon) {
<span [class]="item.icon" class="p-menuitem-icon"></span>
}
<span class="ml-1">{{ item.label }}</span>
<span>{{ item.label }}</span>
@if (item.shortcut) {
<span class="ml-auto border-1 surface-border border-round surface-100 text-sm px-2 py-1">
{{ item.shortcut }}
Expand All @@ -54,6 +53,5 @@
</p-tieredMenu>
}
</p-card>
</div>
}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { ResultItem } from '@rero/ng-core';
import { IssueItemStatus } from '@rero/shared';

@Component({
selector: 'admin-inventory-brief-view',
selector: 'admin-issues-brief-view',
templateUrl: './issues-brief-view.component.html',
})
export class IssuesBriefViewComponent implements ResultItem, OnInit {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,30 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

<h5 class="mb-0">
<h5>
<a [routerLink]="['/records', 'items', 'detail', record.metadata.pid]">
{{ record.metadata.ui_title_text }}
</a>
</h5>
<dl class="row mb-0 ml-1">
<dl class="metadata">
<!-- INHERITED CALL NUMBER -->
@if (record | itemHoldingsCallNumber | async; as callNumber) {
@if ((callNumber.first | json) !== '{}' || (callNumber.second | json) !== '{}') {
<dt class="col-sm-3 offset-sm-2 offset-md-0 label-title" translate>Call number</dt>
<dd class="col-sm-7 col-md-8 mb-0">
<shared-inherited-call-number [item]="record" context="first"></shared-inherited-call-number>
<dt translate>Call number</dt>
<dd>
<shared-inherited-call-number [item]="record" context="first" />
@if (record.metadata.second_call_number) {
| {{ record.metadata.second_call_number }}
}
</dd>
}
}
@if (record.metadata.barcode) {
<dt class="col-sm-3 offset-sm-2 offset-md-0 label-title" translate>Barcode</dt>
<dd class="col-sm-7 col-md-8 mb-0">{{ record.metadata.barcode }}</dd>
<dt translate>Barcode</dt>
<dd>{{ record.metadata.barcode }}</dd>
}
@if (record.metadata.current_pending_requests > 0) {
<dt class="col-sm-3 offset-sm-2 offset-md-0 label-title" translate>Current requests</dt>
<dd class="col-sm-7 col-md-8 mb-0">{{ record.metadata.current_pending_requests }}</dd>
<dt translate>Current requests</dt>
<dd>{{ record.metadata.current_pending_requests }}</dd>
}
</dl>
Original file line number Diff line number Diff line change
Expand Up @@ -16,43 +16,45 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
@if (record$ | async; as record) {
<h1 class="mb-0" *ngVar="icon($any(record).metadata.type) as icon">
<i class="fa {{ icon.class }}" title="{{ icon.title }}" aria-hidden="true"></i>
<h1 *ngVar="icon($any(record).metadata.type) as icon">
<i class="fa {{ icon.class }}" [title]="icon.title" aria-hidden="true"></i>
{{ $any(record).metadata.authorized_access_point }}</h1>
<small>
{{ 'Local ID' | translate }}: {{ $any(record).metadata.pid }}
</small>
<span class="badge badge-info" translate>Local</span>
<p-tag severity="info" [value]="'Local' | translate" />

<article class="card my-2">
<header class="card-header">
<b class="card-title mb-0">{{ 'local' | translate | uppercase }}</b>
</header>
<article class="card-body collapse show">
<p-accordion styleClass="mt-2" [multiple]="true">
<p-accordionTab [selected]="true">
<ng-template pTemplate="header">
<h5>{{ 'local' | translate | uppercase }}</h5>
</ng-template>
<div class="pt-2">
@switch ($any(record).metadata.type) {
@case (entityType.ORGANISATION) {
<admin-local-organisation-detail-view [record]="$any(record).metadata"></admin-local-organisation-detail-view>
<admin-local-organisation-detail-view [record]="$any(record).metadata" />
}
@case (entityType.PERSON) {
<admin-local-person-detail-view [record]="$any(record).metadata"></admin-local-person-detail-view>
<admin-local-person-detail-view [record]="$any(record).metadata" />
}
@case (entityType.PLACE) {
<admin-local-place-detail-view [record]="$any(record).metadata"></admin-local-place-detail-view>
<admin-local-place-detail-view [record]="$any(record).metadata" />
}
@case (entityType.TEMPORAL) {
<admin-local-place-detail-view [record]="$any(record).metadata"></admin-local-place-detail-view>
<admin-local-place-detail-view [record]="$any(record).metadata" />
}
@case (entityType.TOPIC) {
<admin-local-topic-detail-view [record]="$any(record).metadata"></admin-local-topic-detail-view>
<admin-local-topic-detail-view [record]="$any(record).metadata" />
}
@case (entityType.WORK) {
<admin-local-work-detail-view [record]="$any(record).metadata"></admin-local-work-detail-view>
<admin-local-work-detail-view [record]="$any(record).metadata" />
}
@default {
{{ 'Missing template for this entity type:' | translate }} {{ $any(record).metadata.type }}
}
}
</article>
</article>
</div>
</p-accordionTab>
</p-accordion>
}

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { Component, Input } from '@angular/core';
@Component({
selector: 'admin-entities-local-global',
template: `
<dl class="entity-fields">
<dl class="metadata">
<ng-content></ng-content>
@if (record.source_catalog) {
<dt translate>Source catalog</dt>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
@if (record.subordinate_unit) {
<dt translate>Subordinate unit</dt>
<dd>
<ul>
<ul class="list-none p-0 m-0">
@for (name of record.subordinate_unit; track name) {
<li>{{ name }}</li>
}
Expand Down Expand Up @@ -72,7 +72,7 @@
@if (record.alternative_names && record.alternative_names.length > 0) {
<dt translate>Alternative names</dt>
<dd>
<ul>
<ul class="list-none p-0 m-0">
@for (name of record.alternative_names; track name) {
<li>{{ name }}</li>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
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
@if (record) {
<ng-core-detail-button
[record]="record"
[type]="type"
[adminMode]="adminMode"
Expand All @@ -27,20 +26,24 @@
(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>
}
<p-button
(onClick)="search(record)"
outlined
icon="fa fa-search"
[label]="'Search documents' | translate"
/>
@if (isEnabledOperationLog && record.metadata.pid) {
<admin-operation-logs-dialog
resourceType="local_entities"
[resourcePid]="record.metadata.pid"
/>
}
</ng-container>
</ng-core-detail-button>
}
@if (error) {
<ng-core-error [error]="error"></ng-core-error>
}
<ng-template ngCoreRecordDetail></ng-template>
</div>
}

@if (error) {
<ng-core-error [error]="error" />
}

<ng-template ngCoreRecordDetail />
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
@if (record.alternative_names && record.alternative_names.length > 0) {
<dt translate>Alternative names</dt>
<dd>
<ul>
<ul class="list-none p-0 m-0">
@for (name of record.alternative_names; track name) {
<li>{{ name }}</li>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
@if (record.alternative_names && record.alternative_names.length > 0) {
<dt translate>Alternative names</dt>
<dd>
<ul>
<ul class="list-none p-0 m-0">
@for (name of record.alternative_names; track name) {
<li>{{ name }}</li>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
@if (record.genreForm) {
<dt translate>Genre form</dt>
<dd>
<i class="fa mr-2" [ngClass]="{
<i class="fa" [ngClass]="{
'fa-check text-success': record.conference,
'fa-times text-danger': !record.conference
'fa-times text-error': !record.conference
}"></i>
</dd>
}
Expand All @@ -38,7 +38,7 @@
<ng-container>
<dt translate>Alternative names</dt>
<dd>
<ul>
<ul class="list-none p-0 m-0">
@for (name of record.alternative_names; track name) {
<li>{{ name }}</li>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,61 +16,65 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
@if (record$ | async; as record) {
<h1 class="mb-0" *ngVar="icon($any(record).metadata.type) as icon">
<i class="fa {{ icon.class }}" title="{{ icon.title }}" aria-hidden="true"></i>
<h1 *ngVar="icon($any(record).metadata.type) as icon">
<i class="fa {{ icon.class }}" [title]="icon.title" aria-hidden="true"></i>
{{ $any(record).metadata | extractSourceField : 'authorized_access_point' }}</h1>
<small>
{{ 'MEF ID' | translate }}: {{ $any(record).metadata.pid }}
</small>
<span class="badge badge-warning" translate>Remote</span>
<p-tag severity="warning" [value]="'Remote' | translate" />

<!-- SOURCES -->
@for (source of $any(record).metadata.sources.sort(); track source) {
<article class="card my-2">
<header class="card-header">
<b class="card-title mb-0">{{ source | translate | uppercase }}</b>
</header>
<article id="contribution-{{ source }}" class="card-body collapse show">
<dl class="entity-fields">
@switch ($any(record).metadata.type) {
@case (entityType.PERSON) {
<admin-remote-entities-person-detail-view [record]="$any(record).metadata[source]" [source]="source" />
<p-accordion styleClass="mt-2" [multiple]="true">
@for (source of $any(record).metadata.sources.sort(); track source) {
<p-accordionTab [selected]="true">
<ng-template pTemplate="header">
<h5>{{ source | translate | uppercase }}</h5>
</ng-template>
<div class="pt-2">
@switch ($any(record).metadata.type) {
@case (entityType.PERSON) {
<admin-remote-entities-person-detail-view [record]="$any(record).metadata[source]" [source]="source" />
}
@case (entityType.ORGANISATION) {
<admin-remote-entities-organisation-detail-view [record]="$any(record).metadata[source]" [source]="source" />
}
@case (entityType.TOPIC) {
<admin-remote-topic-detail-view [record]="$any(record).metadata[source]" [source]="source" />
}
@case (entityType.PLACE) {
<admin-remote-topic-detail-view [record]="$any(record).metadata[source]" [source]="source" />
}
@case (entityType.TEMPORAL) {
<admin-remote-topic-detail-view [record]="$any(record).metadata[source]" [source]="source" />
}
@default {
{{ 'Missing template for this entity type:' | translate }} {{ $any(record).metadata.type }}
}
}
@case (entityType.ORGANISATION) {
<admin-remote-entities-organisation-detail-view [record]="$any(record).metadata[source]" [source]="source" />
<!-- IDENTIFIED BY -->
@if ($any(record).metadata[source].identifiedBy?.length) {
@if (identifiedByFilter($any(record).metadata[source].identifiedBy).length > 0) {
<dl class="metadata">
<dt translate>Identified by</dt>
<dd>
<ul class="list-none p-0 m-0">
@for (identifiedBy of identifiedByFilter($any(record).metadata[source].identifiedBy); track identifiedBy) {
<li>
<a class="rero-ils-external-link" href="{{ identifiedBy.value }}" title="{{ identifiedBy.value }}" target="_blank">{{ identifiedBy.source }}</a>
</li>
}
</ul>
</dd>
</dl>
}
}
@case (entityType.TOPIC) {
<admin-remote-topic-detail-view [record]="$any(record).metadata[source]" [source]="source" />
}
@case (entityType.PLACE) {
<admin-remote-topic-detail-view [record]="$any(record).metadata[source]" [source]="source" />
}
@case (entityType.TEMPORAL) {
<admin-remote-topic-detail-view [record]="$any(record).metadata[source]" [source]="source" />
}
@default {
{{ 'Missing template for this entity type:' | translate }} {{ $any(record).metadata.type }}
}
}
<!-- IDENTIFIED BY -->
@if ($any(record).metadata[source].identifiedBy?.length) {
@if (identifiedByFilter($any(record).metadata[source].identifiedBy).length > 0) {
<dt translate>Identified by</dt>
<dd>
<ul>
@for (identifiedBy of identifiedByFilter($any(record).metadata[source].identifiedBy); track identifiedBy) {
<li>
<a class="rero-ils-external-link" href="{{ identifiedBy.value }}" title="{{ identifiedBy.value }}" target="_blank">{{ identifiedBy.source }}</a>
</li>
}
</ul>
</dd>
}
}
<dt translate>Id</dt>
<dd>{{ $any(record).metadata[source].pid }}</dd>
</dl>
</article>
</article>
}
<dl class="metadata">
<dt translate>Id</dt>
<dd>{{ $any(record).metadata[source].pid }}</dd>
</dl>
</div>
</p-accordionTab>
}
</p-accordion>
}
Loading
Loading