-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added registration-provider comp (#74)
- Loading branch information
1 parent
ae77248
commit 38ad50a
Showing
8 changed files
with
190 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
src/app/shell/provider-registration/provider-registration.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<div class="container"> | ||
<h2>реєстрація нового надавача послуг</h2> | ||
<form> | ||
<mat-form-field appearance="fill"> | ||
<mat-label>Тип организациїї</mat-label> | ||
<mat-select> | ||
<mat-option value="option">ФОП</mat-option> | ||
<mat-option value="option">Громадська організація</mat-option> | ||
<mat-option value="option">ТОВ</mat-option> | ||
<mat-option value="option">ПП</mat-option> | ||
<mat-option value="option">Заклад освіти</mat-option> | ||
<mat-option value="option">Інше</mat-option> | ||
</mat-select> | ||
</mat-form-field> | ||
<mat-form-field appearance="legacy"> | ||
<mat-label>Назва/ПІБ(для ФОП)</mat-label> | ||
<input matInput placeholder="Іванов/ЦТДЮ/Освіта"> | ||
</mat-form-field> | ||
<mat-form-field appearance="legacy"> | ||
<mat-label>Назва/ПІБ(для ФОП)</mat-label> | ||
<input matInput placeholder="Іванов/ЦТДЮ/Освіта"> | ||
</mat-form-field> | ||
<mat-form-field appearance="legacy"> | ||
<mat-label>Телефон</mat-label> | ||
<input matInput placeholder="Іванов/ЦТДЮ/Освіта" value="+380"> | ||
</mat-form-field> | ||
<mat-form-field appearance="legacy" class="MatFormFieldControl"> | ||
<mat-label>Телефон</mat-label> | ||
<input matInput placeholder="Іванов/ЦТДЮ/Освіта" value="+380"> | ||
</mat-form-field> | ||
<mat-form-field appearance="legacy" class="MatFormFieldControl"> | ||
<mat-label>Email</mat-label> | ||
<input matInput placeholder=""> | ||
</mat-form-field> | ||
<mat-form-field appearance="legacy" class="MatFormFieldControl"> | ||
<mat-label>Веб сайт</mat-label> | ||
<input matInput placeholder=""> | ||
</mat-form-field> | ||
<mat-form-field appearance="legacy" class="MatFormFieldControl"> | ||
<mat-label>facebook</mat-label> | ||
<input matInput placeholder=""> | ||
</mat-form-field> | ||
<mat-form-field appearance="legacy" class="MatFormFieldControl"> | ||
<mat-label>Instagram</mat-label> | ||
<input matInput placeholder=""> | ||
</mat-form-field> | ||
<hr> | ||
<h2>Опис</h2> | ||
<mat-form-field appearance="legacy" class="MatFormFieldControl"> | ||
<textarea matInput placeholder="" cols="30" rows="10"> | ||
</textarea> | ||
</mat-form-field> | ||
<hr> | ||
<h2>Юридична інформація</h2> | ||
<mat-form-field appearance="legacy" class="MatFormFieldControl"> | ||
<mat-label>ЄДРПОУ/ІПН(Серія та номер паспорту якщо видсутній за религийнімі переконанямі</mat-label> | ||
<input matInput placeholder=""> | ||
</mat-form-field> | ||
<mat-form-field appearance="legacy" class="MatFormFieldControl"> | ||
<mat-label>Логін</mat-label> | ||
<input matInput placeholder=""> | ||
</mat-form-field> | ||
<mat-form-field appearance="legacy" class="MatFormFieldControl"> | ||
<mat-label>Пароль</mat-label> | ||
<input matInput placeholder=""> | ||
</mat-form-field> | ||
<div class="checkbox"> | ||
<mat-checkbox> | ||
</mat-checkbox> | ||
<mat-label>Даю згоду на обробку персональних даннних</mat-label> | ||
</div> | ||
<div class="checkbox"> | ||
<mat-checkbox> | ||
</mat-checkbox> | ||
<mat-label>я не робот</mat-label> | ||
</div> | ||
<div class="reg-section"> | ||
<button mat-raised-button color="warn">Відмініти</button> | ||
<button mat-raised-button color="primary">зареєструватися</button> | ||
</div> | ||
</form> | ||
</div> |
17 changes: 17 additions & 0 deletions
17
src/app/shell/provider-registration/provider-registration.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
25 changes: 25 additions & 0 deletions
25
src/app/shell/provider-registration/provider-registration.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<ProviderRegistrationComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ ProviderRegistrationComponent ] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ProviderRegistrationComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
15 changes: 15 additions & 0 deletions
15
src/app/shell/provider-registration/provider-registration.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree { | ||
const role=this.store.selectSnapshot<string>(UserRegistrationState.role); | ||
return role==='organization'; | ||
const role = this.store.selectSnapshot<string>(UserRegistrationState.role); | ||
return role === 'organization'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters