Skip to content

Commit

Permalink
issue-181, created ci job for ui and fixed ui gracefuly
Browse files Browse the repository at this point in the history
  • Loading branch information
GrandShow authored and hiendevt committed Jul 20, 2020
1 parent 6633766 commit 8527d31
Show file tree
Hide file tree
Showing 21 changed files with 84 additions and 100 deletions.
48 changes: 26 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
os: linux

language: go
go:
- 1.13.11

env:
- GO111MODULE=on

install:
- curl -L https://github.com/golang-migrate/migrate/releases/download/v4.11.0/migrate.linux-amd64.tar.gz | tar xvz

# Don't email me the results of the test runs.
notifications:
email: false

script:
- go build ./cmd/ims
- go build ./cmd/rbac
- go build ./cmd/rbacgen

after_success:
- echo "Process Done."
matrix:
include:
- language: go
go:
- 1.13.11
env:
- GO111MODULE=on
install:
- curl -L https://github.com/golang-migrate/migrate/releases/download/v4.11.0/migrate.linux-amd64.tar.gz | tar xvz
script:
- go build ./cmd/ims
- go build ./cmd/rbac
- go build ./cmd/rbacgen
after_success:
- echo "Process Done."
- language: node_js
node_js:
- "14.3.0"
before_script:
- npm install -g @angular/cli
- cd ui
script:
- npm install
- npm run build
- npm run prettier
- npm run lint
2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"prettier": "2.0.5",
"prettier": "^2.0.5",
"protractor": "~5.4.3",
"ts-node": "~8.3.0",
"tslint": "~5.18.0",
Expand Down
11 changes: 4 additions & 7 deletions ui/src/app/admin/admin.component.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';

@Component({
selector: 'app-admin',
templateUrl: './admin.component.html',
styleUrls: ['./admin.component.sass']
styleUrls: ['./admin.component.sass'],
})
export class AdminComponent implements OnInit {
constructor() {}

constructor() { }

ngOnInit(): void {
}

ngOnInit(): void {}
}
12 changes: 4 additions & 8 deletions ui/src/app/core/auth/auth.module.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';


import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';

@NgModule({
declarations: [],
imports: [
CommonModule
]
imports: [CommonModule],
})
export class AuthModule { }
export class AuthModule {}
11 changes: 4 additions & 7 deletions ui/src/app/error-page/error-page.component.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';

@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() { }

ngOnInit(): void {
}

ngOnInit(): void {}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';

@Component({
selector: 'app-landing-header',
templateUrl: './landing-header.component.html',
styleUrls: ['./landing-header.component.sass']
styleUrls: ['./landing-header.component.sass'],
})
export class LandingHeaderComponent implements OnInit {
constructor() {}

constructor() { }

ngOnInit(): void {
}

ngOnInit(): void {}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';

@Component({
selector: 'app-landing-main-content',
templateUrl: './landing-main-content.component.html',
styleUrls: ['./landing-main-content.component.sass']
styleUrls: ['./landing-main-content.component.sass'],
})
export class LandingMainContentComponent implements OnInit {
constructor() {}

constructor() { }

ngOnInit(): void {
}

ngOnInit(): void {}
}
11 changes: 4 additions & 7 deletions ui/src/app/landing-page/landing-page.component.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';

@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() { }

ngOnInit(): void {
}

ngOnInit(): void {}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';

@Component({
selector: 'app-landing-sidenav',
templateUrl: './landing-sidenav.component.html',
styleUrls: ['./landing-sidenav.component.sass']
styleUrls: ['./landing-sidenav.component.sass'],
})
export class LandingSidenavComponent implements OnInit {
constructor() {}

constructor() { }

ngOnInit(): void {
}

ngOnInit(): void {}
}
4 changes: 2 additions & 2 deletions ui/src/app/models/Lesson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import * as moment from 'moment';
import {Group} from './Group';
import {User} from './User';
import {Room} from './Room';
import {iSubject} from './Subject';
import {ISubject} from './Subject';
export interface Lesson {
readonly id: string;
subject: iSubject;
subject: ISubject;
lecturer: User;
group: Group;
startAt: moment.Moment;
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/models/Subject.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface iSubject {
export interface ISubject {
id: string;
nameOfSubject: string;
}
4 changes: 2 additions & 2 deletions ui/src/app/timetable/in-memory-data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as moment from 'moment';
import {Lesson} from '../models/Lesson';
import {Group} from '../models/Group';
import {Room} from '../models/Room';
import {iSubject} from '../models/Subject';
import {ISubject} from '../models/Subject';
import {User} from '../models/User';
import {Role, FeatureEntry, Endpoint} from '../models/role';

Expand Down Expand Up @@ -289,7 +289,7 @@ export class InMemoryDataService implements InMemoryDbService {
room: '4',
},
];
const subjects: iSubject[] = [
const subjects: ISubject[] = [
{
id: '11',
nameOfSubject: 'Programming',
Expand Down
4 changes: 2 additions & 2 deletions ui/src/app/timetable/search-result/search-result.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {TimetableHttpService} from '../shared/timetable-http.service';

import {Group} from '../../models/Group';
import {User} from '../../models/User';
import {iSubject} from '../../models/Subject';
import {ISubject} from '../../models/Subject';
import {Room} from '../../models/Room';
@Component({
selector: 'app-search-result',
Expand All @@ -18,7 +18,7 @@ export class SearchResultComponent implements OnInit {
private usersUrl = 'api/users';
groups: Group[] = [];
lecturers: User[] = [];
subjects: iSubject[] = [];
subjects: ISubject[] = [];
rooms: Room[] = [];
constructor(
private timetableHttpService: TimetableHttpService,
Expand Down
10 changes: 7 additions & 3 deletions ui/src/app/timetable/shared/timetable-http.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,17 @@ export class TimetableHttpService {
if (filters.startDateFormControl) {
params = params.append(
'datefrom',
`${filters.startDateFormControl.getFullYear()}-${filters.startDateFormControl.getMonth()}-${filters.startDateFormControl.getDate()}`,
`${filters.startDateFormControl.getFullYear()}
-${filters.startDateFormControl.getMonth()}
-${filters.startDateFormControl.getDate()}`,
);
}
if (filters.endDateFormControl) {
params = params.append(
'dateto',
`${filters.endDateFormControl.getFullYear()}-${filters.endDateFormControl.getMonth()}-${filters.endDateFormControl.getDate()}`,
`${filters.endDateFormControl.getFullYear()}
-${filters.endDateFormControl.getMonth()}
-${filters.endDateFormControl.getDate()}`,
);
}
if (filters.startTimeFormControl) {
Expand All @@ -61,6 +65,6 @@ export class TimetableHttpService {
if (filters.endTimeFormControl) {
params = params.append('timeto', filters.endTimeFormControl);
}
return this.http.get<any[]>(url, {params: params});
return this.http.get<any[]>(url, {params});
}
}
7 changes: 4 additions & 3 deletions ui/src/app/timetable/sidebar/sidebar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {SearchResultComponent} from '../search-result/search-result.component';

import {Group} from '../../models/Group';
import {User} from '../../models/User';
import {iSubject} from '../../models/Subject';
import {ISubject} from '../../models/Subject';
import {Room} from '../../models/Room';
import {Error} from '../../models/Error';

Expand All @@ -29,7 +29,7 @@ export class SidebarComponent implements OnInit {

groups: Group[] = [];
lecturers: User[] = [];
subjects: iSubject[] = [];
subjects: ISubject[] = [];
rooms: Room[] = [];
constructor(
private timetableHttpService: TimetableHttpService,
Expand Down Expand Up @@ -81,7 +81,7 @@ export class SidebarComponent implements OnInit {
filters.endDateFormControl ||
filters.startTimeFormControl ||
filters.endTimeFormControl
)
) {
this.timetableHttpService.search(this.lessonsUrl, filters).subscribe(lessons => {
this.timetableService.setSearchResult(lessons);
const dialogRef = this.dialog.open(SearchResultComponent, {
Expand All @@ -94,6 +94,7 @@ export class SidebarComponent implements OnInit {
});
dialogRef.afterClosed().subscribe();
});
}
}

dateFilter(d: Date | null): boolean {
Expand Down
6 changes: 3 additions & 3 deletions ui/src/app/timetable/slider-menu/slider-menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog
import {Lesson} from '../../models/Lesson';
import {Group} from '../../models/Group';
import {User} from '../../models/User';
import {iSubject} from '../../models/Subject';
import {ISubject} from '../../models/Subject';
import {Room} from '../../models/Room';

@Component({
Expand All @@ -35,7 +35,7 @@ export class SliderMenuComponent implements OnInit {

groups: Group[] = [];
lecturers: User[] = [];
subjects: iSubject[] = [];
subjects: ISubject[] = [];
rooms: Room[] = [];
constructor(
private timetableHttpService: TimetableHttpService,
Expand Down Expand Up @@ -123,7 +123,7 @@ export class SliderMenuComponent implements OnInit {
this.addNewForm.reset();
}
updateLesson(
subject: iSubject,
subject: ISubject,
room: Room,
lecturer: User,
group: Group,
Expand Down
11 changes: 4 additions & 7 deletions ui/src/app/timetable/timetable.component.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';

@Component({
selector: 'app-timetable',
templateUrl: './timetable.component.html',
styleUrls: ['./timetable.component.sass']
styleUrls: ['./timetable.component.sass'],
})
export class TimetableComponent implements OnInit {
constructor() {}

constructor() { }

ngOnInit(): void {
}

ngOnInit(): void {}
}
8 changes: 4 additions & 4 deletions ui/src/app/timetable/timetable.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {TimetableHttpService} from './shared/timetable-http.service';
import {Lesson} from '../models/Lesson';
import {Group} from '../models/Group';
import {User} from '../models/User';
import {iSubject} from '../models/Subject';
import {ISubject} from '../models/Subject';
import {Room} from '../models/Room';

@Injectable({
Expand All @@ -18,7 +18,7 @@ export class TimetableService {
private selectedDate$: Subject<Date> = new Subject<Date>();

private lecturers$: Subject<User[]> = new Subject<User[]>();
private subjects$: Subject<iSubject[]> = new Subject<iSubject[]>();
private subjects$: Subject<ISubject[]> = new Subject<ISubject[]>();
private groups$: Subject<Group[]> = new Subject<Group[]>();
private rooms$: Subject<Room[]> = new Subject<Room[]>();

Expand All @@ -38,11 +38,11 @@ export class TimetableService {
this.searchResult$.next(result);
}

setSubjects(subjects: iSubject[]): void {
setSubjects(subjects: ISubject[]): void {
this.subjects$.next(subjects);
}

getSubjects(): Observable<iSubject[]> {
getSubjects(): Observable<ISubject[]> {
return this.subjects$;
}

Expand Down
Empty file modified ui/src/assets/img/deadman.svg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified ui/src/assets/img/junk.svg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified ui/src/assets/img/junks.svg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8527d31

Please sign in to comment.