-
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.
Merge branch 'develop' of https://github.com/ita-social-projects/OoS-…
…Frontend into develop
- Loading branch information
Showing
45 changed files
with
703 additions
and
168 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Child } from "./child.model"; | ||
import { Workshop } from "./workshop.model"; | ||
|
||
export class Application { | ||
id: number; | ||
status: string; | ||
message: string; | ||
date: Date; | ||
workshop: Workshop; | ||
child: Child; | ||
|
||
constructor(info) { | ||
this.id = null; | ||
this.status = info.status; | ||
this.message = info.message; | ||
this.date = info.date; | ||
this.child = info.child; | ||
this.workshop = info.workshop; | ||
} | ||
} |
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
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,8 @@ | ||
import { ApplicationFilterPipe } from "./application-filter.pipe"; | ||
|
||
describe('ApplicationFilterPipe', () => { | ||
it('create an instance', () => { | ||
const pipe = new ApplicationFilterPipe(); | ||
expect(pipe).toBeTruthy(); | ||
}); | ||
}); |
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,14 @@ | ||
import { Pipe, PipeTransform } from '@angular/core'; | ||
import { Application } from '../models/application.model'; | ||
|
||
@Pipe({ | ||
name: 'applicationFilter', | ||
pure: false | ||
}) | ||
export class ApplicationFilterPipe implements PipeTransform { | ||
|
||
transform(array: Application[], status: string): Application[] { | ||
return array.filter(card => card.status === status); | ||
} | ||
|
||
} |
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,9 @@ | ||
import { ApplicationSortPipe } from "./application-sort.pipe"; | ||
|
||
|
||
describe('ApplicationSortPipe', () => { | ||
it('create an instance', () => { | ||
const pipe = new ApplicationSortPipe(); | ||
expect(pipe).toBeTruthy(); | ||
}); | ||
}); |
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,28 @@ | ||
import { Pipe, PipeTransform } from '@angular/core'; | ||
import { Application } from '../models/application.model'; | ||
|
||
@Pipe({ | ||
name: 'applicationSort', | ||
pure: false | ||
}) | ||
export class ApplicationSortPipe implements PipeTransform { | ||
transform(array: Application[], status?: string, date?: string): Application[] { | ||
|
||
return array.sort((a, b) => { | ||
// firstly sort according to the property status 'new' | ||
if (a.status === 'new' && b.status !== 'new') | ||
return -1; | ||
|
||
if (a.status !== 'new' && b.status === 'new') | ||
return 1; | ||
|
||
// if both objects has the same status sort according to the title | ||
if (a.status === 'new' && b.status === 'new') | ||
return (a.date < b.date) ? -1 : 1; | ||
|
||
//the rest sorts according to the last date | ||
return (a.date < b.date) ? -1 : 1; | ||
}); | ||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
src/app/shared/services/applications/applications.service.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,16 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { ApplicationsService } from './applications.service'; | ||
|
||
describe('Applications', () => { | ||
let service: ApplicationsService; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({}); | ||
service = TestBed.inject(ApplicationsService); | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
19 changes: 19 additions & 0 deletions
19
src/app/shared/services/applications/applications.service.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,19 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { Observable } from 'rxjs'; | ||
import { Application } from '../../models/application.model'; | ||
import { HttpClient } from '@angular/common/http'; | ||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
|
||
export class ApplicationsService { | ||
|
||
dataUrl = '/assets/mock-applications.json'; | ||
|
||
constructor(private http: HttpClient) { | ||
} | ||
|
||
getApplications(): Observable<Application[]> { | ||
return this.http.get<Application[]>(this.dataUrl); | ||
} | ||
} |
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
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
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,17 +1,21 @@ | ||
import { FormArray, FormGroup } from "@angular/forms"; | ||
export class GetActivitiesCards { | ||
static readonly type = '[provider] gets activities cards'; | ||
constructor() {} | ||
constructor() { } | ||
} | ||
export class GetApplications { | ||
static readonly type = '[provider] gets applications'; | ||
constructor() { } | ||
} | ||
export class CreateWorkshop { | ||
static readonly type = '[provider] create Workshop'; | ||
constructor( public about: FormGroup, public description: FormGroup, public address: FormGroup, public teachers: FormArray ) {} | ||
constructor(public about: FormGroup, public description: FormGroup, public address: FormGroup, public teachers: FormArray) { } | ||
} | ||
export class CreateAddress { | ||
static readonly type = '[provider] create Address'; | ||
constructor( public payload: FormGroup ) {} | ||
constructor(public payload: FormGroup) { } | ||
} | ||
export class CreateTeachers { | ||
static readonly type = '[provider] create Teachers'; | ||
constructor( public payload: FormArray ) {} | ||
constructor(public payload: FormArray) { } | ||
} |
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
21 changes: 12 additions & 9 deletions
21
src/app/shell/provider/personal-cabinet/personal-cabinet.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 |
---|---|---|
@@ -1,9 +1,12 @@ | ||
<div class="container"> | ||
<h1 class="title">КАБІНЕТ КОРИСТУВАЧА</h1> | ||
<nav class="nav" mat-tab-nav-bar> | ||
<a mat-tab-link [routerLinkActive]="['active']" [routerLink]="'./config'">ОСОБИСТА ІНФОРМАЦІЯ</a> | ||
<a mat-tab-link [routerLinkActive]="['active']" [routerLink]="'./org-info'">ІНФОРМАЦІЯ ПРО ЗАКЛАД</a> | ||
<a mat-tab-link [routerLinkActive]="['active']" [routerLink]="'./activities'">ГУРТКИ</a> | ||
<a mat-tab-link [routerLinkActive]="['active']" [routerLink]="'./requests'">ЗАЯВКИ</a> | ||
</nav> | ||
<router-outlet></router-outlet> | ||
<div> | ||
<div class="container"> | ||
<h1 class="title">КАБІНЕТ КОРИСТУВАЧА</h1> | ||
<nav class="nav" mat-tab-nav-bar> | ||
<a mat-tab-link [routerLinkActive]="['active']" [routerLink]="'./config'">ОСОБИСТА ІНФОРМАЦІЯ</a> | ||
<a mat-tab-link [routerLinkActive]="['active']" [routerLink]="'./org-info'">ІНФОРМАЦІЯ ПРО ЗАКЛАД</a> | ||
<a mat-tab-link [routerLinkActive]="['active']" [routerLink]="'./activities'">ГУРТКИ</a> | ||
<a mat-tab-link [routerLinkActive]="['active']" [routerLink]="'./applications'">ЗАЯВКИ</a> | ||
</nav> | ||
</div> | ||
<router-outlet></router-outlet> | ||
</div> |
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
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
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
Oops, something went wrong.