Skip to content
Snippets Groups Projects
Commit d89b169d authored by Rafael László's avatar Rafael László :speech_balloon:
Browse files

Document rest of files and add prod environment

parent 9f1485ec
Branches
No related tags found
No related merge requests found
import { Component, OnInit, ViewChild } from '@angular/core';
import { ErrorModel } from '../../models/error.model';
import { ErrorService } from '../../services/error.service';
import { ModalDismissReasons, NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { Router } from '@angular/router';
/**
* Component that opens a new dialog if the errorService is updated
*/
@Component({
selector: 'app-error-dialog',
templateUrl: './error-dialog.component.html',
styleUrls: ['./error-dialog.component.css'],
})
export class ErrorDialogComponent implements OnInit {
/**
* Error that will be displayed
*/
error: ErrorModel;
/**
* Get the modal from template
*/
@ViewChild('modalData') modalData: any;
closeModal: string;
constructor(private errorService: ErrorService, private modalService: NgbModal, private router: Router) {}
/**
* Subscribe to the ErrorService and trigger the modal on change
*/
ngOnInit(): void {
this.errorService.errorData$.subscribe((e) => {
if (e) {
......@@ -26,10 +36,16 @@ export class ErrorDialogComponent implements OnInit {
});
}
/**
* Open the modal
*/
triggerModal(): void {
this.modalService.open(this.modalData, { ariaLabelledBy: 'modal-basic-title' });
}
/**
* Redirect to the given route in the error
*/
redirectToHome(): void {
if (this.error.navigate) {
this.router.navigate(this.error.navigate);
......
import { Component, Input, OnInit } from '@angular/core';
/**
* Basic bootstrap loader component.
*/
@Component({
selector: 'app-loader',
templateUrl: './loader.component.html',
styleUrls: ['./loader.component.css']
})
export class LoaderComponent implements OnInit {
/**
* colorClass that can be overwritten
*/
@Input() colorClass?: string;
constructor() { }
......
import { AbstractControl, FormGroup, ValidationErrors, ValidatorFn } from '@angular/forms';
/**
* A validator that can be used to specify which fields should equal in a formGroup
* @param controlName first control in formGroup
* @param matchingControlName the matching control in formGroup
*/
export const mustMatchValidator = (controlName: string, matchingControlName: string): ValidatorFn => (
control: AbstractControl
): ValidationErrors | null => {
......
export const environment = {
production: true
production: true,
apiUrl: 'https://stat.maze.sch.bme.hu/api/v1',
jwtRefreshBeforeMinutes: 10
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment