Skip to content

Commit

Permalink
primeng: admin documents
Browse files Browse the repository at this point in the history
Co-Authored-by: Johnny Mariéthoz <Johnny.Mariethoz@rero.ch>
Co-Authored-by: Bertrand Zuchuat <bertrand.zuchuat@rero.ch>
  • Loading branch information
jma and Garfield-fr committed Dec 18, 2024
1 parent 6175a39 commit e503b06
Show file tree
Hide file tree
Showing 119 changed files with 1,813 additions and 2,408 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@
@if (permissions.update.can) {
<p-button
icon="fa fa-pencil"
[outlined]="true"
outlined
[routerLink]="['/records', 'acq_accounts', 'edit', account.pid]"
/>
}
@if (permissions.delete.can) {
<p-button icon="fa fa-trash" severity="danger" [outlined]="true" (onClick)="delete()" styleClass="ml-1" />
<p-button icon="fa fa-trash" severity="danger" outlined (onClick)="delete()" styleClass="ml-1" />
} @else {
<p-button
icon="fa fa-trash"
severity="danger"
[outlined]="true"
outlined
[title]="'Delete' | translate"
[pTooltip]="tooltipContent"
tooltipPosition="top"
Expand All @@ -85,7 +85,7 @@
</div>
</div>
} @placeholder {
<i class="fa fa-spinner"></i>
<i class="fa fa-spin fa-spinner"></i>
}

@for (childAccount of children; track childAccount) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h1 translate>Acquisition accounts</h1>
<!-- TRANSFER BUTTON -->
<p-button
icon="fa fa-exchange"
[outlined]="true"
outlined
[label]="'Transfer funds'|translate"
[routerLink]="['/', 'acquisition', 'accounts', 'transfer']"
[permissions]="permissions.ACAC_TRANSFER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ <h1 translate>Fund transfer</h1>
}
</div>
<div class="col text-right">
<p-button class="mr-2" type="reset" [label]="'Cancel'|translate" severity="danger" [outlined]="true" />
<p-button class="mr-2" type="reset" [label]="'Cancel'|translate" severity="danger" outlined />
<p-button type="submit" [label]="'Transfer'|translate" [disabled]="form.invalid" />
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<p-button
icon="fa {{ isCollapsed ? 'fa-angle-right' : 'fa-angle-down' }}"
[rounded]="true"
[outlined]="true"
outlined
(onClick)="isCollapsed = !isCollapsed"
[attr.aria-expanded]="!isCollapsed"
aria-controls="collapse"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ <h5 class="col-8" translate>Order lines</h5>
<p-button
icon="fa fa-plus-square-o"
[label]="'Add'|translate"
[outlined]="true"
outlined
[routerLink]="['/', 'records', 'acq_order_lines', 'new']"
[queryParams]="{ order: order.pid }"
/>
} @else {
<p-button
icon="fa fa-plus-square-o"
[label]="'Add'|translate"
[outlined]="true"
outlined
[pTooltip]="tooltipContent"
tooltipPosition="top"
styleClass="text-blue-200"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ <h5 class="col-8 m-0">
<p-button
icon="fa fa-plus-square-o"
[label]="'Add'|translate"
[outlined]="true"
outlined
[routerLink]="['/', 'acquisition', 'acq_orders', order.pid, 'receive']"
/>
} @else {
<p-button
icon="fa fa-plus-square-o"
[label]="'Add'|translate"
[outlined]="true"
outlined
[pTooltip]="tooltipContent"
tooltipPosition="top"
styleClass="text-blue-200"
Expand Down
2 changes: 2 additions & 0 deletions projects/admin/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ const routes: Routes = [

@NgModule({
imports: [RouterModule.forRoot(routes)],
// for debug
//imports: [RouterModule.forRoot(routes, { enableTracing: true })],
exports: [RouterModule]
})
export class AppRoutingModule {
Expand Down
4 changes: 2 additions & 2 deletions projects/admin/src/app/app.component.html

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions projects/admin/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ import { FrontpageComponent } from './widgets/frontpage/frontpage.component';
import { HotkeysShortcutPipe } from '@ngneat/hotkeys';
import { EntityAutocompleteComponent } from './record/editor/formly/primeng/entity-autocomplete/entity-autocomplete.component';
import { RemoteAutocompleteService as UiRemoteAutocompleteService } from './record/editor/formly/primeng/remote-autocomplete/remote-autocomplete.service';
import { CirculationLogsDialogComponent } from './record/circulation-logs/circulation-logs-dialog.component';

/** Init application factory */
export function appInitFactory(appInitializerService: AppInitializerService): () => Observable<any> {
Expand All @@ -205,6 +206,7 @@ export function appInitFactory(appInitializerService: AppInitializerService): ()
declarations: [
AppComponent,
CircPoliciesBriefViewComponent,
CirculationLogsDialogComponent,
DocumentEditorComponent,
DocumentsBriefViewComponent,
ExceptionDatesEditComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
id="action-patron"
icon="fa fa-user"
[label]="'Patron account'|translate"
[outlined]="true"
outlined
(onClick)="setAction('patron')"
/>
<p-button
id="action-item"
icon="fa fa-file-o"
[label]="'Checkin the item'|translate"
[outlined]="true"
outlined
(onClick)="setAction('item')"
/>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
icon="fa fa-refresh pr-1"
[label]="'Renew'|translate"
severity="secondary"
[outlined]="true"
outlined
[disabled]="!item.actions.includes(itemAction.extend_loan)"
[id]="item.barcode | idAttribute:{prefix: 'item', suffix: 'renew-button'}"
(onClick)="extendLoanClick($event)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
icon="fa fa-check"
[label]="'Validate'|translate"
[id]="item.barcode | idAttribute:{prefix: 'item', suffix: 'validate-button'}"
[outlined]="true"
outlined
(onClick)="validateRequest()"
/>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ import { MessageService } from 'primeng/api';
<p-button
icon="fa fa-trash-o"
severity="danger"
[outlined]="true"
outlined
(onClick)="showCancelRequestDialog($event)"
/>
} @else {
<p-button
icon="fa fa-trash-o"
severity="danger"
[title]="'The request cannot be cancelled'|translate"
[outlined]="true"
outlined
[disabled]="true"
/>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h3>
</div>
</div>
<div class="flex">
<p-button icon="fa fa-close" severity="danger" [outlined]="true" (onClick)="clear()"></p-button>
<p-button icon="fa fa-close" severity="danger" outlined (onClick)="clear()"></p-button>
</div>
</div>
<!-- NOTES-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<div class="col-1 text-right">
<p-button
icon="fa fa-eye"
[outlined]="true"
outlined
[title]="'Details'|translate"
[routerLink]="['/', 'records', 'ill_requests', 'detail', record.metadata.pid]"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<p-menu #menu [model]="items" [popup]="true" />
<p-button [outlined]="true" (onClick)="menu.toggle($event)" icon="fa fa-cog" styleClass="text-color-secondary" />
<p-button outlined (onClick)="menu.toggle($event)" icon="fa fa-cog" styleClass="text-color-secondary" />
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<form [formGroup]="form" (ngSubmit)="submit(model)">
<formly-form [form]="form" [fields]="formFields" [model]="model"></formly-form>
<div class="text-right">
<p-button [label]="'Cancel'|translate" severity="danger" [outlined]="true" (onClick)="closeModal()" />
<p-button [label]="'Cancel'|translate" severity="danger" outlined (onClick)="closeModal()" />
<p-button styleClass="ml-1" [label]="'Save'|translate" type="submit" [disabled]="!form.valid" />
</div>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
@if (canUpdate()) {
<p-button
id="profile-change-password-button"
[outlined]="true"
outlined
[label]="'Change Password'|translate"
(onClick)="updatePatronPassword(patron)"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
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/>.
-->
@if (response?.error) {
@if (response) {
<admin-preview-email
[emails]="suggestions.emails"
[emailTypes]="emailTypes"
Expand All @@ -27,7 +27,12 @@
(data)="confirmIssue($event)"
>
<ng-container headerMessage>
<p translate>You're about to send the claim.</p>
<p-messages
[value]="[{ severity: 'warn', detail:'You\'re about to send the claim.'|translate }]"
[closable]="false"
[enableService]="false"
showTransitionOptions="0ms"
/>
</ng-container>
<ng-container previewBottomMessage>
<p translate>Below you can find the preview message that will be sent.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@
<div class="flex align-items-center gap-2 justify-content-center">
<p-button
size="small"
[outlined]="true"
outlined
[label]="'Validate' | translate"
(click)="save()"
icon="pi pi-check"
/>
<p-button
[outlined]="true"
outlined
size="small"
[label]="'Reject' | translate"
(click)="reject()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ <h5>{{ availableTypes[0].label | translate }}</h5>
<div class="grid">
<ng-core-list-filters
class="col-12"
[aggregations]="aggregations"
[aggregationsFilters]="aggregationsFilters"
[searchFilters]="searchFilters"
(remove)="removeFilter($event)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,57 +16,46 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
@if (record) {
<article class="flex w-full border-0">
<div class="flex">
<shared-thumbnail class="col-sm-2" [record]="record" isSmall=true />
<article class="flex gap-4">
<div class="hidden md:block">
<shared-thumbnail [record]="record" />
</div>
<div class="flex flex-wrap align-items-start py-0">
<h5 class="mb-0 w-full">
<a [routerLink]="['/records', type.startsWith('import_') ? type: 'documents', 'detail', record.metadata.pid]">
{{ record.metadata.title | mainTitle }}
</a>
</h5>
<div class="flex-grow-1">
<!-- document title -->
<h4 class="mb-1">
<a target="_self" [routerLink]="['/records', type.startsWith('import_') ? type: 'documents', 'detail', record.metadata.pid]">{{ record.metadata.title | mainTitle }}</a>
</h4>
<!-- contribution -->
<div class="w-full">
<shared-contribution
[contributions]="record.metadata?.contribution"
[limitRecord]="3"
[activateLink]="!type.startsWith('import_')"
></shared-contribution>
</div>
<shared-contribution
[contributions]="record.metadata?.contribution"
[limitRecord]="3"
[activateLink]="!type.startsWith('import_')"
/>
<!-- provision activity publications -->
@if (provisionActivityPublications.length > 0) {
<div class="w-full">
<ul class="list-unstyled">
@for (publication of provisionActivityPublications; track publication) {
<li>{{ publication.value }}</li>
}
</ul>
</div>
<ul class="list-none mb-0 p-0">
@for (publication of provisionActivityPublications; track publication) {
<li>{{ publication.value }}</li>
}
</ul>
}
<!-- shared part -->
<div class="w-full">
<shared-part-of [record]="record"></shared-part-of>
</div>
<shared-part-of [record]="record" />
<!-- edition statement -->
@if (record.metadata.editionStatement) {
<div class="w-full">
<ul class="list-unstyled mb-0">
@for (edition of record.metadata.editionStatement; track edition) {
<li>{{ edition._text[0].value }}</li>
}
</ul>
</div>
<ul class="list-none mb-0 p-0">
@for (edition of record.metadata.editionStatement; track edition) {
<li>{{ edition._text[0].value }}</li>
}
</ul>
}
<!-- availability -->
@if (!type.startsWith('import_') && record.metadata.type !== 'ebook') {
<div class="w-full">
<shared-availability
recordType="document"
[record]="record"
[apiService]="documentApiService"
></shared-availability>
</div>
<shared-availability
recordType="document"
[record]="record"
[apiService]="documentApiService"
/>
}
</div>
</article>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ import { ResultItem } from '@rero/ng-core';

@Component({
selector: 'admin-documents-brief-view',
templateUrl: './documents-brief-view.component.html',
styles: []
templateUrl: './documents-brief-view.component.html'
})
export class DocumentsBriefViewComponent implements ResultItem {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ import { ResultItem } from '@rero/ng-core';

@Component({
selector: 'admin-inventory-brief-view',
templateUrl: './items-brief-view.component.html',
styles: []
templateUrl: './items-brief-view.component.html'
})
export class ItemsBriefViewComponent implements ResultItem {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
<h5 class="flex-grow-1">{{ record.metadata.document.title | mainTitle }}</h5>
<!-- ACTIONS BUTTON -->
<div class="flex gap-1">
<p-button icon="fa fa-history" severity="secondary" [outlined]="true" size="small" (onClick)="openTransactionHistoryDialog(record.metadata.pid)" />
<p-button icon="fa fa-history" severity="secondary" outlined size="small" (onClick)="openTransactionHistoryDialog(record.metadata.pid)" />
@if (canUseDebugMode) {
<p-button [icon]="debugMode ? 'fa fa-toggle-on' : 'fa fa-toggle-off'" severity="warning" [outlined]="!debugMode" size="small"
(onClick)="debugMode=!debugMode"
>
<i class="mr-1 fa fa-bug" [ngClass]=""></i>
<i class="mr-1 fa fa-bug"></i>
</p-button>
}
</div>
Expand Down
Loading

0 comments on commit e503b06

Please sign in to comment.