From 38ad50a51d751b63ad17364bc2672175ef9a2881 Mon Sep 17 00:00:00 2001 From: YuraSimonyan <73949887+YuraSimonyan@users.noreply.github.com> Date: Fri, 26 Feb 2021 13:20:05 +0200 Subject: [PATCH] added registration-provider comp (#74) --- src/app/shared/material/material.module.ts | 17 +++- .../provider-registration.component.html | 82 +++++++++++++++++++ .../provider-registration.component.scss | 17 ++++ .../provider-registration.component.spec.ts | 25 ++++++ .../provider-registration.component.ts | 15 ++++ src/app/shell/provider/provider.guard.ts | 17 ++-- src/app/shell/shell-routing.module.ts | 31 ++++--- src/app/shell/shell.module.ts | 13 ++- 8 files changed, 190 insertions(+), 27 deletions(-) create mode 100644 src/app/shell/provider-registration/provider-registration.component.html create mode 100644 src/app/shell/provider-registration/provider-registration.component.scss create mode 100644 src/app/shell/provider-registration/provider-registration.component.spec.ts create mode 100644 src/app/shell/provider-registration/provider-registration.component.ts diff --git a/src/app/shared/material/material.module.ts b/src/app/shared/material/material.module.ts index 404da5661c..ae81f9b823 100644 --- a/src/app/shared/material/material.module.ts +++ b/src/app/shared/material/material.module.ts @@ -1,10 +1,18 @@ -import { NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatDialogModule } from '@angular/material/dialog'; +import {NgModule} from '@angular/core'; +import {MatButtonModule} from '@angular/material/button'; +import {MatDialogModule} from '@angular/material/dialog'; +import {MatSelectModule} from '@angular/material/select'; +import {MatCheckboxModule} from '@angular/material/checkbox'; +import {MatFormFieldModule} from '@angular/material/form-field'; +import {MatInputModule} from '@angular/material/input'; const materialComponent = [ MatButtonModule, MatDialogModule, + MatSelectModule, + MatCheckboxModule, + MatFormFieldModule, + MatInputModule ]; @NgModule({ @@ -13,4 +21,5 @@ const materialComponent = [ materialComponent ], }) -export class MaterialModule { } +export class MaterialModule { +} diff --git a/src/app/shell/provider-registration/provider-registration.component.html b/src/app/shell/provider-registration/provider-registration.component.html new file mode 100644 index 0000000000..241934a407 --- /dev/null +++ b/src/app/shell/provider-registration/provider-registration.component.html @@ -0,0 +1,82 @@ +
+

реєстрація нового надавача послуг

+
+ + Тип организациїї + + ФОП + Громадська організація + ТОВ + ПП + Заклад освіти + Інше + + + + Назва/ПІБ(для ФОП) + + + + Назва/ПІБ(для ФОП) + + + + Телефон + + + + Телефон + + + + Email + + + + Веб сайт + + + + facebook + + + + Instagram + + +
+

Опис

+ + + +
+

Юридична інформація

+ + ЄДРПОУ/ІПН(Серія та номер паспорту якщо видсутній за религийнімі переконанямі + + + + Логін + + + + Пароль + + +
+ + + Даю згоду на обробку персональних даннних +
+
+ + + я не робот +
+
+ + +
+
+
diff --git a/src/app/shell/provider-registration/provider-registration.component.scss b/src/app/shell/provider-registration/provider-registration.component.scss new file mode 100644 index 0000000000..df2e22f8d7 --- /dev/null +++ b/src/app/shell/provider-registration/provider-registration.component.scss @@ -0,0 +1,17 @@ + +form{ + display: flex; + flex-direction: column; + .checkbox { + display: flex; + justify-content: flex-start; + } + .reg-section{ + padding: 40px; + display: flex; + justify-content: space-between; + } +} +h2{ + margin: 0 auto; +} diff --git a/src/app/shell/provider-registration/provider-registration.component.spec.ts b/src/app/shell/provider-registration/provider-registration.component.spec.ts new file mode 100644 index 0000000000..f066bfd44e --- /dev/null +++ b/src/app/shell/provider-registration/provider-registration.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ProviderRegistrationComponent } from './provider-registration.component'; + +describe('ProviderRegistrationComponent', () => { + let component: ProviderRegistrationComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ProviderRegistrationComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ProviderRegistrationComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/shell/provider-registration/provider-registration.component.ts b/src/app/shell/provider-registration/provider-registration.component.ts new file mode 100644 index 0000000000..288a49d87d --- /dev/null +++ b/src/app/shell/provider-registration/provider-registration.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-provider-registration', + templateUrl: './provider-registration.component.html', + styleUrls: ['./provider-registration.component.scss'] +}) +export class ProviderRegistrationComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/src/app/shell/provider/provider.guard.ts b/src/app/shell/provider/provider.guard.ts index 89eb56eb69..f73ed3c446 100644 --- a/src/app/shell/provider/provider.guard.ts +++ b/src/app/shell/provider/provider.guard.ts @@ -1,19 +1,20 @@ -import { Injectable } from '@angular/core'; -import { CanLoad, Route, UrlSegment, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree } from '@angular/router'; -import { Observable } from 'rxjs'; -import { Store } from '@ngxs/store'; -import { UserRegistrationState } from '../../shared/store/user-registration.state'; +import {Injectable} from '@angular/core'; +import {CanLoad, Route, UrlSegment, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree} from '@angular/router'; +import {Observable} from 'rxjs'; +import {Store} from '@ngxs/store'; +import {UserRegistrationState} from '../../shared/store/user-registration.state'; @Injectable({ providedIn: 'root' }) export class ProviderGuard implements CanLoad { - constructor(public store: Store) {} + constructor(public store: Store) { + } canLoad( route: Route, segments: UrlSegment[]): Observable | Promise | boolean | UrlTree { - const role=this.store.selectSnapshot(UserRegistrationState.role); - return role==='organization'; + const role = this.store.selectSnapshot(UserRegistrationState.role); + return role === 'organization'; } } diff --git a/src/app/shell/shell-routing.module.ts b/src/app/shell/shell-routing.module.ts index 25cb76060f..eafd573923 100644 --- a/src/app/shell/shell-routing.module.ts +++ b/src/app/shell/shell-routing.module.ts @@ -1,19 +1,28 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; -import { MainComponent } from './main/main.component'; -import { ResultComponent } from './main/result/result.component'; -import { ProviderGuard } from './provider/provider.guard'; -import { ParentGuard } from './parent/parent.guard'; +import {NgModule} from '@angular/core'; +import {Routes, RouterModule} from '@angular/router'; +import {MainComponent} from './main/main.component'; +import {ResultComponent} from './main/result/result.component'; +import {ProviderRegistrationComponent} from './provider-registration/provider-registration.component'; +import {ProviderGuard} from './provider/provider.guard'; +import {ParentGuard} from './parent/parent.guard'; const routes: Routes = [ - { path: '', component: MainComponent }, - { path: 'result', component: ResultComponent }, - { path: 'provider', loadChildren: () => import('./provider/provider.module').then(m => m.ProviderModule), canLoad: [ProviderGuard] }, - { path: 'parent', loadChildren: () => import('./parent/parent.module').then(m => m.ParentModule), canLoad: [ParentGuard] } + {path: '', component: MainComponent}, + {path: 'result', component: ResultComponent}, + { + path: 'provider', loadChildren: () => import('./provider/provider.module') + .then(m => m.ProviderModule), canLoad: [ProviderGuard], component: ProviderRegistrationComponent + }, + { + path: 'parent', + loadChildren: () => import('./parent/parent.module').then(m => m.ParentModule), + canLoad: [ParentGuard] + } ]; @NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule] }) -export class ShellRoutingModule { } +export class ShellRoutingModule { +} diff --git a/src/app/shell/shell.module.ts b/src/app/shell/shell.module.ts index 93cb0ec248..630b47fedd 100644 --- a/src/app/shell/shell.module.ts +++ b/src/app/shell/shell.module.ts @@ -22,7 +22,7 @@ import { DigitOnlyDirective } from '../shared/directives/digit-only.directive'; import { CityFilterComponent } from './main/filters-list/city-filter/city-filter.component'; import { HttpClientModule } from '@angular/common/http'; import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input' +import { MatInputModule } from '@angular/material/input'; import { MatIconModule } from '@angular/material/icon'; import { MatAutocompleteModule } from '@angular/material/autocomplete'; import { OrderingComponent } from './main/result/organization-cards-list/ordering/ordering.component'; @@ -30,6 +30,8 @@ import { MatChipsModule } from '@angular/material/chips'; import { OrganizationCardComponent } from '../shared/organization-card/organization-card.component'; import { ParentGuard } from './parent/parent.guard'; import { ProviderGuard } from './provider/provider.guard'; +import { ProviderRegistrationComponent } from './provider-registration/provider-registration.component'; +import {MaterialModule} from '../shared/material/material.module'; @NgModule({ @@ -46,7 +48,8 @@ import { ProviderGuard } from './provider/provider.guard'; ResultComponent, OrganizationCardsListComponent, OrderingComponent, - OrganizationCardComponent + OrganizationCardComponent, + ProviderRegistrationComponent ], imports: [ CommonModule, @@ -62,11 +65,13 @@ import { ProviderGuard } from './provider/provider.guard'; HttpClientModule, MatButtonToggleModule, MatChipsModule, - LeafletModule + LeafletModule, + MaterialModule ], providers: [ ParentGuard, - ProviderGuard + ProviderGuard, + LeafletModule, ] }) export class ShellModule { }