mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
Breadcrumb für Bearbeiten
This commit is contained in:
@@ -2,6 +2,8 @@ import { Location } from '@angular/common';
|
||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ApplicationService } from '@core/application';
|
||||
import { BreadcrumbService } from '@core/breadcrumb';
|
||||
import { CrmCustomerService } from '@domain/crm';
|
||||
import { CountryDTO, CustomerDTO } from '@swagger/crm';
|
||||
import { UiValidators } from '@ui/common';
|
||||
@@ -25,7 +27,9 @@ export abstract class CustomerDataEditComponent implements OnInit {
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private fb: FormBuilder,
|
||||
private cdr: ChangeDetectorRef,
|
||||
private location: Location
|
||||
private location: Location,
|
||||
private breadcrumb: BreadcrumbService,
|
||||
private application: ApplicationService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -36,6 +40,14 @@ export abstract class CustomerDataEditComponent implements OnInit {
|
||||
map((cr) => cr.result)
|
||||
);
|
||||
this.initForm();
|
||||
|
||||
this.breadcrumb.addBreadcrumbIfNotExists({
|
||||
key: this.application.activatedProcessId,
|
||||
name: 'Bearbeiten',
|
||||
path: `/customer/edit`,
|
||||
tags: ['customer', 'edit'],
|
||||
params: {},
|
||||
});
|
||||
}
|
||||
|
||||
async initForm() {
|
||||
|
||||
@@ -63,10 +63,15 @@
|
||||
</div>
|
||||
<ul class="card-customer-address">
|
||||
<li *ngIf="customer | address as defaultPayerAddress">
|
||||
<ui-form-control [label]="defaultPayerAddress">
|
||||
<ui-form-control *ngIf="(isB2b$ | async) === false" [label]="defaultPayerAddress">
|
||||
<input name="payerAddress" uiInput type="radio" [value]="undefined" [(ngModel)]="selectedPayer" />
|
||||
</ui-form-control>
|
||||
<a class="button-edit-address" [routerLink]="['/customer', customerId$ | async, 'edit', (isB2b$ | async) ? 'b2b' : 'b2c']"
|
||||
<span *ngIf="(isB2b$ | async) === true">{{ defaultPayerAddress }}</span>
|
||||
|
||||
<a
|
||||
*ngIf="canEdit$ | async"
|
||||
class="button-edit-address"
|
||||
[routerLink]="['/customer', customerId$ | async, 'edit', (isB2b$ | async) ? 'b2b' : 'b2c']"
|
||||
>Bearbeiten</a
|
||||
>
|
||||
</li>
|
||||
@@ -77,6 +82,7 @@
|
||||
<input name="payerAddress" uiInput type="radio" [value]="payer?.payer?.id" [(ngModel)]="selectedPayer" />
|
||||
</ui-form-control>
|
||||
<a
|
||||
*ngIf="canEdit$ | async"
|
||||
class="button-edit-address"
|
||||
[routerLink]="['/customer', customerId$ | async, 'payer', payer?.payer?.id, 'edit', (isB2b$ | async) ? 'b2b' : 'b2c']"
|
||||
>Bearbeiten</a
|
||||
@@ -98,7 +104,10 @@
|
||||
<ui-form-control [label]="defaultShippingAddress">
|
||||
<input name="shippingAddress" uiInput type="radio" [value]="undefined" [(ngModel)]="selectedAddress" />
|
||||
</ui-form-control>
|
||||
<a class="button-edit-address" [routerLink]="['/customer', customerId$ | async, 'edit', (isB2b$ | async) ? 'b2b' : 'b2c']"
|
||||
<a
|
||||
*ngIf="canEdit$ | async"
|
||||
class="button-edit-address"
|
||||
[routerLink]="['/customer', customerId$ | async, 'edit', (isB2b$ | async) ? 'b2b' : 'b2c']"
|
||||
>Bearbeiten</a
|
||||
>
|
||||
</li>
|
||||
@@ -108,6 +117,7 @@
|
||||
<input name="shippingAddress" uiInput type="radio" [value]="address?.id" [(ngModel)]="selectedAddress" />
|
||||
</ui-form-control>
|
||||
<a
|
||||
*ngIf="canEdit$ | async"
|
||||
class="button-edit-address"
|
||||
[routerLink]="['/customer', customerId$ | async, 'shipping', address?.id, 'edit', (isB2b$ | async) ? 'b2b' : 'b2c']"
|
||||
>Bearbeiten</a
|
||||
|
||||
Reference in New Issue
Block a user