Unverified Commit 4a3af37f authored by Ruslan Konviser's avatar Ruslan Konviser Committed by GitHub
Browse files

Merge pull request #1084 from ever-co/fix/#1050-hide-closing-button-on-add-customer

fix: made closing button not visible on create customer panel
parents fced36a4 9d0e0fa6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
			(user ? 'Edit customer' : 'CUSTOMERS_VIEW.ADD_CUSTOMER') | translate
		}}
	</h4>
	<button class="close" (click)="cancelModal()">
	<button class="close" *ngIf="visible" (click)="cancelModal()">
		<i class="fa fa-close"></i>
	</button>
	<ion-row class="crete-user">
+11 −0
Original line number Diff line number Diff line
@@ -43,6 +43,12 @@ export class UserMutationComponent {
	@Output()
	customerIdEmitter = new EventEmitter<string>();

	@Input()
	visible: boolean = true;

	@Output()
	updateVisible = new EventEmitter<boolean>();

	mapCoordinatesEmitter = new EventEmitter<
		google.maps.LatLng | google.maps.LatLngLiteral
	>();
@@ -79,6 +85,11 @@ export class UserMutationComponent {
		this.customerIdEmitter.emit(customerId);
	}

	changeState(): void {
		this.visible = false;
		this.updateVisible.emit(this.visible);
	}

	async createCustomer() {
		let userId: string;
		let message: string;
+8 −0
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@ import { TranslateService } from '@ngx-translate/core';

			<div *ngIf="!isSelectedFromExisting">
				<user-mutation
					[visible]="visible"
					(changeState)="changeState($event)"
					(customerIdEmitter)="broadcastCustomerId($event)"
				></user-mutation>
			</div>
@@ -33,6 +35,8 @@ import { TranslateService } from '@ngx-translate/core';
export class SelectAddCustomerComponent implements OnInit {
	private ngDestroy$ = new Subject<void>();

	visible: boolean;

	@Input()
	customerOptionSelected: number;

@@ -63,6 +67,10 @@ export class SelectAddCustomerComponent implements OnInit {
		this.broadcastCustomerId(ev.data.id);
	}

	changeState(ev): void {
		this.visible = ev;
	}

	broadcastCustomerId(customerId: string) {
		this.customerIdEmitter.emit(customerId);
	}