Skip to content

Commit

Permalink
fix (#1293)
Browse files Browse the repository at this point in the history
  • Loading branch information
litvinets authored Jun 7, 2022
1 parent bc0a2a9 commit 12efd13
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div *ngIf="!(isLoading$ | async)" class="wrapper" fxLayout="row wrap" fxLayoutAlign="start">
<ng-container *ngIf="platformInfo; else noInfoTmpl">
<div class="config">
<a routerLink="edit" class="config_edit-icon" [routerLink]="['../update', type, 'edit']">
<a routerLink="edit" class="config_edit-icon" [routerLink]="['./update', type, 'edit']">
<button mat-button style="color:#3849F9;">
<mat-icon style="color:#3849F9;">edit</mat-icon>Редагувати
</button>
Expand All @@ -16,7 +16,7 @@ <h4>{{portalItem.sectionName}}</h4>

<ng-template #noInfoTmpl>
<div class="config" fxLayout="column" fxLayoutAlign="center center">
<a routerLink="edit" class="config_edit-icon" [routerLink]="['../update', type, '']">
<a routerLink="edit" class="config_edit-icon" [routerLink]="['./update', type, '']">
<button mat-button style="color:#3849F9;">
<mat-icon style="color:#3849F9;">edit</mat-icon>Додати інформацію
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ <h3 class="wrapper-title">РЕДАГУВАННЯ {{editTitle}}</h3>
</div>

<div fxLayout="row" fxLayoutAlign="center center" class="footer">
<a [routerLink]="['/admin-tools/platform', platformInfoType]"><button mat-raised-button
class="btn btn-cancel">Скасувати</button></a>
<button mat-raised-button class="btn btn-cancel" (click)="onBack()">Скасувати</button>
<button class="btn" mat-button type="submit"[disabled]="PlatformInfoItemArray.invalid || titleFormControl.invalid" (click)="onSubmit()">Зберегти</button>
</div>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import { GetSupportInformation, GetLawsAndRegulations } from './../../../../../shared/store/admin.actions';
import { UpdatePlatformInfo } from 'src/app/shared/store/admin.actions';
import { PlatformInfoType } from 'src/app/shared/enum/platform';
import { ValidationConstants } from 'src/app/shared/constants/validation';
import { NAME_REGEX } from 'src/app/shared/constants/regex-constants';
import { Component, OnDestroy, OnInit } from '@angular/core';
import { FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Params } from '@angular/router';
import { Select, Store } from '@ngxs/store';
import { Observable, Subject } from 'rxjs';
import { takeUntil, filter, tap, takeLast } from 'rxjs/operators';
import { Observable } from 'rxjs';
import { takeUntil, filter, tap } from 'rxjs/operators';
import { NavigationBarService } from 'src/app/shared/services/navigation-bar/navigation-bar.service';
import { AdminState } from 'src/app/shared/store/admin.state';
import { CreateFormComponent } from 'src/app/shell/personal-cabinet/create-form/create-form.component';
import { CompanyInformation, СompanyInformationItem, PlatformInfoStateModel } from 'src/app/shared/models/сompanyInformation.model';
import { CompanyInformation, СompanyInformationItem } from 'src/app/shared/models/сompanyInformation.model';
import { PortalEditTitleUkr } from 'src/app/shared/enum/enumUA/tech-admin/admin-tabs';
import { GetPlatformInfo } from 'src/app/shared/store/admin.actions';
import { Location } from '@angular/common';

@Component({
selector: 'app-info-edit',
Expand All @@ -40,7 +39,9 @@ export class InfoEditComponent extends CreateFormComponent implements OnInit, On
store: Store,
route: ActivatedRoute,
navigationBarService: NavigationBarService,
private fb: FormBuilder) {
private fb: FormBuilder,
private location: Location
) {
super(store, route, navigationBarService);
}

Expand Down Expand Up @@ -119,6 +120,10 @@ export class InfoEditComponent extends CreateFormComponent implements OnInit, On
this.PlatformInfoItemArray.removeAt(index);
}

onBack(): void {
this.location.back();
}

onSubmit(): void {
if(this.PlatformInfoItemArray.valid && this.titleFormControl.valid){
const platformInfoItemArray: СompanyInformationItem[] = [];
Expand Down

0 comments on commit 12efd13

Please sign in to comment.