Skip to content

Commit

Permalink
CSCEXAM-000 Get rid of modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Matti Lupari committed Nov 25, 2023
1 parent c12e8ac commit 0f79d60
Show file tree
Hide file tree
Showing 61 changed files with 2,441 additions and 13,403 deletions.
14,487 changes: 2,226 additions & 12,261 deletions ui/package-lock.json

Large diffs are not rendered by default.

39 changes: 0 additions & 39 deletions ui/src/app/administrative/administrative.module.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
* on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and limitations under the Licence.
*/
import { DatePipe } from '@angular/common';
import { Component } from '@angular/core';
import { NgbPopover } from '@ng-bootstrap/ng-bootstrap';
import { TranslateModule } from '@ngx-translate/core';
import { format } from 'date-fns';
import { FileService } from 'src/app/shared/file/file.service';
import { DatePickerComponent } from '../../../shared/date/date-picker.component';

Expand Down Expand Up @@ -65,11 +65,11 @@ export class AnswersReportComponent {
startDate: Date | null = null;
endDate: Date | null = null;

constructor(private datePipe: DatePipe, private files: FileService) {}
constructor(private files: FileService) {}

getExamAnswerReport = () => {
const f = this.datePipe.transform(this.startDate || new Date(), 'dd.MM.yyyy');
const t = this.datePipe.transform(this.endDate || new Date(), 'dd.MM.yyyy');
const f = format(this.startDate || new Date(), 'dd.MM.yyyy');
const t = format(this.endDate || new Date(), 'dd.MM.yyyy');
this.files.download(`/app/statistics/allexams/${f}/${t}`, `exam_answers_${f}_${t}.xlsx`);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
* on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and limitations under the Licence.
*/
import { DatePipe } from '@angular/common';
import { Component } from '@angular/core';
import { NgbPopover } from '@ng-bootstrap/ng-bootstrap';
import { TranslateModule } from '@ngx-translate/core';
import { format } from 'date-fns';
import { DatePickerComponent } from '../../../shared/date/date-picker.component';
import { FileService } from '../../../shared/file/file.service';

Expand Down Expand Up @@ -64,11 +64,11 @@ export class ReviewsReportComponent {
startDate: Date | null = null;
endDate: Date | null = null;

constructor(private datePipe: DatePipe, private files: FileService) {}
constructor(private files: FileService) {}

getReviewsByDate = () => {
const f = this.datePipe.transform(this.startDate || new Date(), 'dd.MM.yyyy');
const t = this.datePipe.transform(this.endDate || new Date(), 'dd.MM.yyyy');
const f = format(this.startDate || new Date(), 'dd.MM.yyyy');
const t = format(this.endDate || new Date(), 'dd.MM.yyyy');
this.files.download(`/app/statistics/reviewsbydate/${f}/${t}`, `reviews_${f}_${t}.xlsx`);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
* on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and limitations under the Licence.
*/
import { DatePipe, NgIf } from '@angular/common';
import { NgIf } from '@angular/common';
import { Component, Input } from '@angular/core';
import { NgbPopover } from '@ng-bootstrap/ng-bootstrap';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { format } from 'date-fns';
import { ToastrService } from 'ngx-toastr';
import type { ExamRoom } from '../../../reservation/reservation.model';
import { DatePickerComponent } from '../../../shared/date/date-picker.component';
Expand Down Expand Up @@ -80,20 +81,15 @@ export class RoomsReportComponent {
startDate: Date | null = null;
endDate: Date | null = null;

constructor(
private translate: TranslateService,
private toast: ToastrService,
private datePipe: DatePipe,
private files: FileService,
) {}
constructor(private translate: TranslateService, private toast: ToastrService, private files: FileService) {}

roomSelected = (event?: Option<ExamRoom, number>) => {
this.room = event?.id;
};

getRoomReservationsByDate = () => {
const f = this.datePipe.transform(this.startDate || new Date(), 'dd.MM.yyyy');
const t = this.datePipe.transform(this.endDate || new Date(), 'dd.MM.yyyy');
const f = format(this.startDate || new Date(), 'dd.MM.yyyy');
const t = format(this.endDate || new Date(), 'dd.MM.yyyy');
if (this.room) {
this.files.download(`/app/statistics/resbydate/${this.room}/${f}/${t}`, `reservations_${f}_${t}.xlsx`);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { DatePipe, NgIf } from '@angular/common';
import { Component, Input } from '@angular/core';
import { NgbPopover } from '@ng-bootstrap/ng-bootstrap';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { format } from 'date-fns';
import { ToastrService } from 'ngx-toastr';
import type { User } from '../../../session/session.service';
import { DatePickerComponent } from '../../../shared/date/date-picker.component';
Expand Down Expand Up @@ -88,8 +89,8 @@ export class StudentsReportComponent {

getStudentReport = () => {
if (this.student) {
const f = this.datePipe.transform(this.startDate || new Date(), 'dd.MM.yyyy');
const t = this.datePipe.transform(this.endDate || new Date(), 'dd.MM.yyyy');
const f = format(this.startDate || new Date(), 'dd.MM.yyyy');
const t = format(this.endDate || new Date(), 'dd.MM.yyyy');
this.files.download(`/app/statistics/student/${this.student}/${f}/${t}`, 'student_activity.xlsx');
} else {
this.toast.error(this.translate.instant('sitnet_choose_student'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
* on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and limitations under the Licence.
*/
import { DatePipe, NgIf } from '@angular/common';
import { NgIf } from '@angular/common';
import { Component, Input } from '@angular/core';
import { NgbPopover } from '@ng-bootstrap/ng-bootstrap';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { format } from 'date-fns';
import { ToastrService } from 'ngx-toastr';
import type { User } from '../../../session/session.service';
import { DatePickerComponent } from '../../../shared/date/date-picker.component';
Expand Down Expand Up @@ -79,16 +80,11 @@ export class TeachersReportComponent {
answerStartDate: Date | null = null;
answerEndDate: Date | null = null;

constructor(
private datePipe: DatePipe,
private translate: TranslateService,
private toast: ToastrService,
private files: FileService,
) {}
constructor(private translate: TranslateService, private toast: ToastrService, private files: FileService) {}

getTeacherExamsByDate = () => {
const f = this.datePipe.transform(this.answerStartDate || new Date(), 'dd.MM.yyyy');
const t = this.datePipe.transform(this.answerEndDate || new Date(), 'dd.MM.yyyy');
const f = format(this.answerStartDate || new Date(), 'dd.MM.yyyy');
const t = format(this.answerEndDate || new Date(), 'dd.MM.yyyy');
if (this.teacher) {
this.files.download(
`/app/statistics/teacherexamsbydate/${this.teacher}/${f}/${t}`,
Expand Down
37 changes: 0 additions & 37 deletions ui/src/app/administrative/reports/reports.module.ts

This file was deleted.

2 changes: 0 additions & 2 deletions ui/src/app/administrative/statistics/statistics.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
NgbNavItem,
NgbNavItemRole,
NgbNavLink,
NgbNavLinkBase,
} from '@ng-bootstrap/ng-bootstrap';
import { TranslateModule } from '@ngx-translate/core';
import { DatePickerComponent } from '../../shared/date/date-picker.component';
Expand Down Expand Up @@ -55,7 +54,6 @@ enum Tab {
NgbNav,
NgbNavItem,
NgbNavItemRole,
NgbNavLinkBase,
NgbNavLink,
DatePickerComponent,
NgbDropdown,
Expand Down
2 changes: 2 additions & 0 deletions ui/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ const routes: Route[] = [
*/
{
path: 'staff',
//loadComponent: () =>
// import('./dashboard/staff/admin/admin-dashboard.component').then((mod) => mod.AdminDashboardComponent),
loadChildren: () => import('./dashboard/staff/staff-dashboard.module').then((mod) => mod.StaffDashboardModule),
},
];
Expand Down
48 changes: 0 additions & 48 deletions ui/src/app/calendar/calendar.module.ts

This file was deleted.

25 changes: 0 additions & 25 deletions ui/src/app/dashboard/staff/admin/admin-dashboard.module.ts

This file was deleted.

28 changes: 1 addition & 27 deletions ui/src/app/dashboard/staff/staff-dashboard.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,12 @@
*/
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { AdministrativeModule } from '../../administrative/administrative.module';
import { ExamModule } from '../../exam/exam.module';
import { ExaminationModule } from '../../examination/examination.module';
import { FacilityModule } from '../../facility/facility.module';
import { MaturityModule } from '../../maturity/maturity.module';
import { QuestionModule } from '../../question/question.module';
import { ReviewModule } from '../../review/review.module';
import { SharedModule } from '../../shared/shared.module';
import { SoftwareModule } from '../../software/software.module';
import { AdminDashboardModule } from './admin/admin-dashboard.module';
import { StaffDashboardComponent } from './staff-dashboard.component';
import { StaffRoutingModule } from './staff-routing.module';
import { TeacherDashboardModule } from './teacher/teacher-dashboard.module';

// TODO: Student & teacher dashboard + reservation modules should be lazy loaded to decrease bundle size
// We need a router setup that supports this first
@NgModule({
imports: [
SharedModule,
TeacherDashboardModule,
AdminDashboardModule,
ExamModule,
ExaminationModule,
QuestionModule,
ReviewModule,
MaturityModule,
AdministrativeModule,
SoftwareModule,
FacilityModule,
RouterModule,
StaffRoutingModule,
StaffDashboardComponent,
],
imports: [RouterModule, StaffRoutingModule, StaffDashboardComponent],
})
export class StaffDashboardModule {}
30 changes: 0 additions & 30 deletions ui/src/app/dashboard/staff/teacher/exam-search.pipe.ts

This file was deleted.

Loading

0 comments on commit 0f79d60

Please sign in to comment.