diff --git a/ui/src/app/admin/roles/roles.component.ts b/ui/src/app/admin/roles/roles.component.ts
index 354cd19..fa2c900 100644
--- a/ui/src/app/admin/roles/roles.component.ts
+++ b/ui/src/app/admin/roles/roles.component.ts
@@ -133,6 +133,10 @@ export class RolesComponent implements OnInit {
}
});
}
+
+ trackById(index, item) {
+ return item.id;
+ }
}
@Component({
@@ -155,6 +159,10 @@ export class SelectFeatureDialogComponent {
onNoClick(): void {
this.dialogRef.close();
}
+
+ trackById(index, item) {
+ return item.id;
+ }
}
@Component({
diff --git a/ui/src/app/admin/roles/select-feature.html b/ui/src/app/admin/roles/select-feature.html
index 7b72496..152055a 100644
--- a/ui/src/app/admin/roles/select-feature.html
+++ b/ui/src/app/admin/roles/select-feature.html
@@ -1,7 +1,7 @@
+
{{endpoint.name}}
{{endpoint.path}}
{{endpoint.method}}
diff --git a/ui/src/app/admin/users-management/users-management.component.ts b/ui/src/app/admin/users-management/users-management.component.ts
index 3e1276d..eb1b083 100644
--- a/ui/src/app/admin/users-management/users-management.component.ts
+++ b/ui/src/app/admin/users-management/users-management.component.ts
@@ -144,11 +144,11 @@ export class UsersManagementComponent implements OnInit {
}
}
- selectUnselectUser(User: User): void {
- if (this.selectedUsers.find(u => u === User)) {
- this.selectedUsers = this.selectedUsers.filter(u => u !== User);
+ selectUnselectUser(user: User): void {
+ if (this.selectedUsers.find(u => u === user)) {
+ this.selectedUsers = this.selectedUsers.filter(u => u !== user);
} else {
- this.selectedUsers.push(User);
+ this.selectedUsers.push(user);
}
}
diff --git a/ui/src/app/admin/users-management/users.service.ts b/ui/src/app/admin/users-management/users.service.ts
index b19db3e..67f7c46 100644
--- a/ui/src/app/admin/users-management/users.service.ts
+++ b/ui/src/app/admin/users-management/users.service.ts
@@ -20,14 +20,14 @@ export class UsersService {
return this.http.get
(`${this.UsersUrl}${query}`);
}
- addUsers(User: User): Observable {
+ addUsers(user: User): Observable {
console.log('added');
- return this.http.post(this.UsersUrl, User, this.httpOptions);
+ return this.http.post(this.UsersUrl, user, this.httpOptions);
}
- deleteUsers(User: User): Observable {
+ deleteUsers(user: User): Observable {
console.log('deleted');
- const url = `api/fullUsers/${User.userId}`;
+ const url = `api/fullUsers/${user.userId}`;
return this.http.delete(url, this.httpOptions);
}
}
diff --git a/ui/src/app/error-page/error-page.component.ts b/ui/src/app/error-page/error-page.component.ts
index 10d1cb0..e62ccdf 100644
--- a/ui/src/app/error-page/error-page.component.ts
+++ b/ui/src/app/error-page/error-page.component.ts
@@ -1,15 +1,15 @@
-import { Component, OnInit } from '@angular/core';
+import {Component, OnInit} from '@angular/core';
+import {Title} from '@angular/platform-browser';
@Component({
selector: 'app-error-page',
templateUrl: './error-page.component.html',
- styleUrls: ['./error-page.component.sass']
+ styleUrls: ['./error-page.component.sass'],
})
export class ErrorPageComponent implements OnInit {
-
- constructor() { }
+ constructor(private titleService: Title) {}
ngOnInit(): void {
+ this.titleService.setTitle('Oops, something went wrong');
}
-
}
diff --git a/ui/src/app/landing-page/landing-page.component.ts b/ui/src/app/landing-page/landing-page.component.ts
index 9116e13..d68bd0d 100644
--- a/ui/src/app/landing-page/landing-page.component.ts
+++ b/ui/src/app/landing-page/landing-page.component.ts
@@ -1,15 +1,30 @@
-import { Component, OnInit } from '@angular/core';
+import {Component, OnInit} from '@angular/core';
+import {Title} from '@angular/platform-browser';
+import {Meta} from '@angular/platform-browser';
@Component({
selector: 'app-landing-page',
templateUrl: './landing-page.component.html',
- styleUrls: ['./landing-page.component.sass']
+ styleUrls: ['./landing-page.component.sass'],
})
export class LandingPageComponent implements OnInit {
-
- constructor() { }
+ constructor(private titleService: Title, private meta: Meta) {}
ngOnInit(): void {
+ this.titleService.setTitle('OMC college');
+ this.meta.updateTag({
+ name: 'description',
+ content:
+ 'Welcome to Optical and Mechanical College, \
+ here you can read information about studying \
+ and articles about interesting inventions of our students \
+ and other their achievements and watch college`s life.',
+ });
+ this.meta.updateTag({
+ name: 'keywords',
+ content:
+ 'OMC college, student life, student news, education, studying, \
+ college, Taras Shevchenko University, programming, economy, physics, journalism',
+ });
}
-
}
diff --git a/ui/src/app/models/Lesson.ts b/ui/src/app/models/Lesson.ts
index b743fb2..fe0deb0 100644
--- a/ui/src/app/models/Lesson.ts
+++ b/ui/src/app/models/Lesson.ts
@@ -2,10 +2,10 @@ import * as moment from 'moment';
import {GroupAsResource} from './GroupAsResource';
import {UserAsResource} from './UserAsResource';
import {Room} from './Room';
-import {iSubject} from './Subject';
+import {SubjectInterface} from './Subject';
export interface Lesson {
readonly id: string;
- subject: iSubject;
+ subject: SubjectInterface;
lecturer: UserAsResource;
group: GroupAsResource;
startAt: moment.Moment;
diff --git a/ui/src/app/models/Subject.ts b/ui/src/app/models/Subject.ts
index bd395df..a61582e 100644
--- a/ui/src/app/models/Subject.ts
+++ b/ui/src/app/models/Subject.ts
@@ -1,4 +1,4 @@
-export interface iSubject {
+export interface SubjectInterface {
id: string;
nameOfSubject: string;
}
diff --git a/ui/src/app/models/signIn.ts b/ui/src/app/models/signIn.ts
index 5a9276a..2c6e501 100644
--- a/ui/src/app/models/signIn.ts
+++ b/ui/src/app/models/signIn.ts
@@ -1,4 +1,5 @@
export interface SignIn {
login: string;
password: string;
+ isRememberMe: boolean;
}
diff --git a/ui/src/app/sign-in/autorization.service.spec.ts b/ui/src/app/sign-in/authorization.service.spec.ts
similarity index 100%
rename from ui/src/app/sign-in/autorization.service.spec.ts
rename to ui/src/app/sign-in/authorization.service.spec.ts
diff --git a/ui/src/app/sign-in/autorisation.service.spec.ts b/ui/src/app/sign-in/autorisation.service.spec.ts
deleted file mode 100644
index b4d9792..0000000
--- a/ui/src/app/sign-in/autorisation.service.spec.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { TestBed } from '@angular/core/testing';
-
-import { AutorisationService } from './autorisation.service';
-
-describe('AutorisationService', () => {
- let service: AutorisationService;
-
- beforeEach(() => {
- TestBed.configureTestingModule({});
- service = TestBed.inject(AutorisationService);
- });
-
- it('should be created', () => {
- expect(service).toBeTruthy();
- });
-});
diff --git a/ui/src/app/sign-in/autorisation.service.ts b/ui/src/app/sign-in/autorisation.service.ts
deleted file mode 100644
index 749f5e7..0000000
--- a/ui/src/app/sign-in/autorisation.service.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import {Injectable} from '@angular/core';
-import {HttpClient, HttpHeaders} from '@angular/common/http';
-import {Observable} from 'rxjs';
-
-import {SignIn} from '../models/signIn';
-@Injectable({
- providedIn: 'root',
-})
-export class AutorisationService {
- httpOptions = {
- headers: new HttpHeaders({'Content-Type': 'application/json'}),
- };
-
- constructor(private http: HttpClient) {}
-
- signIn(value: SignIn): Observable {
- console.log('sign in');
- return this.http.post('api/signIn', value, this.httpOptions);
- }
-
- signUp(value): Observable {
- console.log('sign up');
- return this.http.post('api/signUp', value, this.httpOptions);
- }
-}
diff --git a/ui/src/app/sign-in/sign-in.module.ts b/ui/src/app/sign-in/sign-in.module.ts
index f0d6458..1f27c1f 100644
--- a/ui/src/app/sign-in/sign-in.module.ts
+++ b/ui/src/app/sign-in/sign-in.module.ts
@@ -14,6 +14,7 @@ import {MatSelectModule} from '@angular/material/select';
import {MatIconModule} from '@angular/material/icon';
import {MatToolbarModule} from '@angular/material/toolbar';
import {MatStepperModule} from '@angular/material/stepper';
+import {MatCheckboxModule} from '@angular/material/checkbox';
@NgModule({
declarations: [SignInComponent],
imports: [
@@ -30,6 +31,7 @@ import {MatStepperModule} from '@angular/material/stepper';
MatIconModule,
MatToolbarModule,
MatStepperModule,
+ MatCheckboxModule,
],
exports: [
SignInComponent,
@@ -43,6 +45,7 @@ import {MatStepperModule} from '@angular/material/stepper';
MatIconModule,
MatToolbarModule,
MatStepperModule,
+ MatCheckboxModule,
],
})
export class SignInModule {}
diff --git a/ui/src/app/sign-in/sign-in/sign-in.component.html b/ui/src/app/sign-in/sign-in/sign-in.component.html
index 98bdf81..ccb3ab0 100644
--- a/ui/src/app/sign-in/sign-in/sign-in.component.html
+++ b/ui/src/app/sign-in/sign-in/sign-in.component.html
@@ -4,8 +4,9 @@
- Not more then 60 characters long.
+ Not more then 64 characters long.
Login is required
+ You have less than 8 characters
You have more than 60 characters
@@ -28,13 +29,15 @@
{{ hide ? 'visibility_off' : 'visibility' }}
- Not more then 255 characters long.
+ Not more then 64 characters long.
Password is required
- You have more than 255 characters
+ You have less than 8 characters
+ You have more than 64 characters
+ Remember me
+
diff --git a/ui/src/app/sign-in/sign-in/sign-in.component.sass b/ui/src/app/sign-in/sign-in/sign-in.component.sass
index b198f67..db4a0fe 100644
--- a/ui/src/app/sign-in/sign-in/sign-in.component.sass
+++ b/ui/src/app/sign-in/sign-in/sign-in.component.sass
@@ -43,4 +43,6 @@ mat-form-field, mat-card-actions, mat-card-content, mat-horizontal-stepper, .hin
cursor: pointer
transition: 0.2s linear
&:hover
- color: #3f51b5
\ No newline at end of file
+ color: #3f51b5
+.rememberMe
+ margin-left: 8px
\ No newline at end of file
diff --git a/ui/src/app/sign-in/sign-in/sign-in.component.ts b/ui/src/app/sign-in/sign-in/sign-in.component.ts
index 9bf98de..f527f40 100644
--- a/ui/src/app/sign-in/sign-in/sign-in.component.ts
+++ b/ui/src/app/sign-in/sign-in/sign-in.component.ts
@@ -2,6 +2,8 @@ import {Component, OnInit} from '@angular/core';
import {FormControl, FormGroup, Validators} from '@angular/forms';
import {AuthorizationService} from '../authorization.service';
import {SignIn} from '../../models/signIn';
+import {Title} from '@angular/platform-browser';
+import {Meta} from '@angular/platform-browser';
@Component({
selector: 'app-sign-in',
@@ -10,23 +12,18 @@ import {SignIn} from '../../models/signIn';
})
export class SignInComponent implements OnInit {
signInForm: FormGroup;
- signUpForm: FormGroup;
- showSignUp = false;
hide = true;
- constructor(private authorisationService: AuthorizationService) {}
+ constructor(private authorisationService: AuthorizationService, private titleService: Title, private meta: Meta) {}
ngOnInit(): void {
+ this.titleService.setTitle('Authentication');
+ this.meta.updateTag({name: 'description', content: 'Sign in/up to OMC learning management system'});
+
this.signInForm = new FormGroup({
- login: new FormControl('', [Validators.required, Validators.maxLength(60)]),
- password: new FormControl('', [Validators.required, Validators.maxLength(255)]),
- });
- this.signUpForm = new FormGroup({
- firstName: new FormControl('', [Validators.required, Validators.maxLength(255)]),
- lastname: new FormControl('', [Validators.required, Validators.maxLength(255)]),
- surname: new FormControl('', [Validators.required, Validators.maxLength(255)]),
- email: new FormControl('', [Validators.required, Validators.maxLength(60)]),
- password: new FormControl('', [Validators.required, Validators.maxLength(255)]),
+ login: new FormControl('', [Validators.required, Validators.minLength(8), Validators.maxLength(64)]),
+ password: new FormControl('', [Validators.required, Validators.minLength(8), Validators.maxLength(64)]),
+ isRememberMe: new FormControl(''),
});
}
@@ -35,13 +32,14 @@ export class SignInComponent implements OnInit {
const signInValue: SignIn = {
login: value.login,
password: value.password,
+ isRememberMe: value.isRememberMe,
};
this.executeSignIn(signInValue);
}
}
private executeSignIn(value: SignIn) {
- this.authorisationService.signIn(value).subscribe(request => console.log(request));
+ this.authorisationService.signIn(value).subscribe();
}
hasSignInError(controlName: string, errorName: string) {
diff --git a/ui/src/app/timetable/calendar/calendar.component.ts b/ui/src/app/timetable/calendar/calendar.component.ts
index f44893d..a484a8d 100644
--- a/ui/src/app/timetable/calendar/calendar.component.ts
+++ b/ui/src/app/timetable/calendar/calendar.component.ts
@@ -9,7 +9,7 @@ import {MatCalendar} from '@angular/material/datepicker';
styleUrls: ['./calendar.component.sass'],
})
export class CalendarComponent implements OnInit {
- selectedDate: Date = new Date(); // date which is chosen at this moment
+ selectedDate: Date = new Date();
@ViewChild(MatCalendar) calendar: MatCalendar
;
diff --git a/ui/src/app/timetable/header/header.component.html b/ui/src/app/timetable/header/header.component.html
index f23be17..02da2e9 100644
--- a/ui/src/app/timetable/header/header.component.html
+++ b/ui/src/app/timetable/header/header.component.html
@@ -15,10 +15,7 @@
-
-