Skip to content
Snippets Groups Projects
Commit 7b918ded authored by jsk22's avatar jsk22
Browse files

Merge branch 'redirectionPage' into 'development'

Redirection page

See merge request !76
parents 19eac3e0 40f241e4
Branches development
No related tags found
1 merge request!76Redirection page
Pipeline #37505 passed
Showing
with 16334 additions and 12688 deletions
Source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -3,6 +3,7 @@ import { RouterModule, Routes } from '@angular/router';
import { AboutComponent } from './about/about.component';
import { HomeComponent } from './home/home.component';
import { RedirectionComponent } from './redirection/redirection.component';
import { NotFoundComponent } from './not-found/not-found.component';
import { TeamComponent } from './team/team.component';
import { PqrComponent } from './simulator/pqr/pqr.component';
......@@ -12,7 +13,7 @@ import { ResetPasswordComponent } from './reset-password/reset-password.componen
import { ContactComponent } from './contact/contact.component';
const routes: Routes = [
{ path: '', component: HomeComponent, canDeactivate: [HasErrorGuard] },
{ path: '', component: RedirectionComponent, canDeactivate: [HasErrorGuard] },
{ path: 'pqr', component: PqrComponent, canDeactivate: [HasErrorGuard] },
{ path: 'about', component: AboutComponent },
{ path: 'quality', component: QualityComponent },
......
......@@ -16,7 +16,7 @@
<img [src]="'assets/images/simcaq_logo_' + (isInverseColor ? 'gray' : 'white') + '.svg'" alt="Logo SimCAQ">
</a>
</div>
<div #navbarContent id="mainNavBar" class="collapse navbar-collapse" [collapse]="navBarIsCollapsed">
<!-- <div #navbarContent id="mainNavBar" class="collapse navbar-collapse" [collapse]="navBarIsCollapsed">
<p class="navbar-text slogan" [class.inverse]="isInverseColor">
<em>Por uma educação pública gratuita e de qualidade para todos/as</em>
</p>
......@@ -61,7 +61,7 @@
<app-profile [isInverseColor]="isInverseColor"></app-profile>
</div>
</ul>
</div>
</div> -->
</div>
</nav>
<nav class="navbar visible-print-inline">
......@@ -77,7 +77,7 @@
<router-outlet></router-outlet>
</div>
<div *ngIf="showFooter" class="container-fluid hidden-print">
<div class="sup-footer">
<!-- <div class="sup-footer">
<div class="row">
<div class="col-md-6 col-lg-3">
<ul class="list-sub-footer">
......@@ -131,7 +131,7 @@
</ul>
</div>
</div>
</div>
</div> -->
<div class="footer">
<div class="title">Realização:</div>
<a href="http://www.ufpr.br" target="_blank" title="Universidade Federal do Paraná - UFPR">
......
......@@ -76,9 +76,9 @@ export class AppComponent extends BaseUnsubscribe implements OnInit {
this.showFooter = true;
// Close the navbar menu (mobile screen).
if (this.navbarContent.nativeElement.classList.contains('show')) {
this.navbarMenuToggle.nativeElement.click();
}
// if (this.navbarContent.nativeElement.classList.contains('show')) {
// this.navbarMenuToggle.nativeElement.click();
// }
});
}
......
......@@ -13,6 +13,7 @@ import { AppHttpInterceptor } from './shared/services/http/interceptors/app-http
import { AppErrorHandler } from './shared/services/error-handler/app-error-handler.service';
import { AppComponent } from './app.component';
import { HomeComponent } from './home/home.component';
import { RedirectionComponent } from './redirection/redirection.component';
import { AppRoutingModule } from './app-routing.module';
import { LoginComponent } from './login/login.component';
import { NotFoundComponent } from './not-found/not-found.component';
......@@ -22,6 +23,7 @@ import { AboutComponent } from './about/about.component';
import { QualityComponent } from './quality/quality.component';
import { ResetPasswordComponent } from './reset-password/reset-password.component';
import { ContactComponent } from './contact/contact.component';
import { WarningModalComponent } from './shared/components/modal/warning/warningModal.component';
registerLocaleData(localePt, 'pt');
......@@ -39,6 +41,7 @@ registerLocaleData(localePt, 'pt');
declarations: [
AppComponent,
HomeComponent,
RedirectionComponent,
LoginComponent,
NotFoundComponent,
TeamComponent,
......@@ -46,7 +49,8 @@ registerLocaleData(localePt, 'pt');
AboutComponent,
QualityComponent,
ResetPasswordComponent,
ContactComponent
ContactComponent,
WarningModalComponent
],
entryComponents: [
LoginComponent,
......
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { takeUntil, map } from 'rxjs/operators';
import { BsModalService, BsModalRef } from 'ngx-bootstrap/modal';
import { SimulationType } from '../simulator/simulator/entities/enums/simulation-type.enum';
import { SimulatorService } from '../simulator/simulator/services/simulator.service';
import { AuthService } from '../shared/services/auth/auth.service';
import { BaseUnsubscribe } from '../shared/entities/base/base-unsubscribe';
import { WarningModalComponent } from 'app/shared/components/modal/warning/warningModal.component';
@Component({
selector: 'app-home',
......@@ -20,8 +22,15 @@ export class HomeComponent extends BaseUnsubscribe implements OnInit {
readonly planning: SimulationType = SimulationType.planning;
readonly financing: SimulationType = SimulationType.financing;
constructor(private simulatorService: SimulatorService, private authService: AuthService) {
bsModalRef: BsModalRef;
constructor(private simulatorService: SimulatorService, private authService: AuthService, private bsModalService: BsModalService) {
super();
// this.bsModalRef = this.bsModalService.show(WarningModalComponent);
// this.bsModalRef.content.title = 'O SIMCAQ não está mais sendo desenvolvido no C3SL/UFPR!';
// this.bsModalRef.content.body = 'Ele está no seguinte endereço: <a href="https://simcaq.ufg.br">https://simcaq.ufg.br</a> ';
}
ngOnInit(): void {
......
<meta http-equiv = "refresh" content = "10; url = https://simcaq.ufg.br" />
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="redirection-container">
<div class="redirection">
<div class="redirection-title">
<h1>O SIMCAQ não está mais sendo desenvolvido no C3SL/UFPR. </h1>
</div>
<div class="redirection-text">
Ele está no seguinte endereço: <a href="https://simcaq.ufg.br">https://simcaq.ufg.br</a>
</div>
<div class="redirection-text">
Você será redirecionado em {{this.counter}} segundos...
</div>
<div class="redirection-text">
<p>Se você não for redirecionado automaticamente, clique no botão abaixo.</p>
</div>
<div class="redirection-button">
<a href="https://simcaq.ufg.br" class="button">Ir direto para o link</a>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
.container {
margin-top: 20vh;
margin-bottom: 18%;
padding-left: 0;
padding-right: 0;
display: flex;
.redirection-text {
font-size: 20px;
padding-top: 20px;
}
.redirection-button {
padding-top: 20px;
.button {
border: 1px solid #49697d;
background-color: #49697d;
border-radius: 4px;
color: #fff;
padding: 10px 20px;
font-size: 15px;
}
}
}
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { RedirectionComponent } from './redirection.component';
describe('RedirectionComponent', () => {
let component: RedirectionComponent;
let fixture: ComponentFixture<RedirectionComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ RedirectionComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(RedirectionComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { takeUntil, map } from 'rxjs/operators';
import { Observable, timer } from 'rxjs';
import { BsModalService, BsModalRef } from 'ngx-bootstrap/modal';
import { SimulationType } from '../simulator/simulator/entities/enums/simulation-type.enum';
import { SimulatorService } from '../simulator/simulator/services/simulator.service';
import { AuthService } from '../shared/services/auth/auth.service';
import { BaseUnsubscribe } from '../shared/entities/base/base-unsubscribe';
import { WarningModalComponent } from 'app/shared/components/modal/warning/warningModal.component';
@Component({
selector: 'app-redirection',
templateUrl: './redirection.component.html',
styleUrls: ['./redirection.component.scss']
})
export class RedirectionComponent extends BaseUnsubscribe implements OnInit {
financingSimulationIsEnable: boolean = false;
readonly caq: SimulationType = SimulationType.caq;
readonly planning: SimulationType = SimulationType.planning;
readonly financing: SimulationType = SimulationType.financing;
bsModalRef: BsModalRef;
counter = 10;
constructor(private simulatorService: SimulatorService, private authService: AuthService, private bsModalService: BsModalService, private router: Router) {
super();
}
ngOnInit(): void {
setInterval( () => this.numDecrement(this.counter), 1000);
this.verifyFinancingSimulationIsEnable();
this.authService.userLoggedObserver.pipe(
takeUntil(this.unsubscribe))
.subscribe(userIsLoggedIn => {
if (userIsLoggedIn) {
this.verifyFinancingSimulationIsEnable();
} else {
this.financingSimulationIsEnable = false;
}
});
}
numDecrement(numRecieved : number) {
while(numRecieved > 0) {
this.counter = numRecieved - 1;
return numRecieved;
}
}
startSimulation(simulationType: SimulationType): void {
this.simulatorService.startSimulation(simulationType);
}
private verifyFinancingSimulationIsEnable(): void {
this.authService.userIsAdmin().pipe(
takeUntil(this.unsubscribe))
.subscribe(userIsAdmin => this.financingSimulationIsEnable = userIsAdmin);
}
}
<div class="modal-content">
<div class="modal-header">
<button *ngIf="!hideCloseButtonX" type="button" class="close" (click)="bsModalRef.hide()">&times;</button>
<h4 *ngIf="!richTitle" class="modal-title">
<strong>
{{title}}
</strong>
</h4>
<p *ngIf="richTitle" [innerHTML]="richTitle"></p>
</div>
<div class="modal-body">
<p [innerHTML]="body"></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" (click)="bsModalRef.hide()">{{closeButtonText}}</button>
</div>
</div>
\ No newline at end of file
.modal-content {
width: 100vh;
height: 50vh;
}
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { WarningModalComponent} from './warningModal.component';
describe('WarningModalComponent', () => {
let component: WarningModalComponent;
let fixture: ComponentFixture<WarningModalComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ WarningModalComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(WarningModalComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { BsModalRef } from 'ngx-bootstrap/modal';
@Component({
selector: 'app-warningModal',
templateUrl: './warningModal.component.html',
styleUrls: ['./warningModal.component.scss']
})
export class WarningModalComponent implements OnInit {
title: string = 'Mudou!';
richTitle: string;
body: string;
hideCloseButtonX: boolean;
closeButtonText: string = 'Ok';
list: Array<any>;
constructor(public bsModalRef: BsModalRef) { }
ngOnInit() {
}
}
......@@ -20,6 +20,7 @@ import { SourceInformationComponent } from './components/source-information/sour
import { SubmenuComponent } from './components/submenu/submenu.component';
import { InconsistencyComponent } from './components/inconsistency/inconsistency.component';
import { AlertComponent } from './components/modal/alert/alert.component';
import { WarningModalComponent } from './components/modal/warning/warningModal.component';
import { ConfirmComponent } from './components/modal/confirm/confirm/confirm.component';
import { PqrInfoComponent } from '../simulator/shared/components/pqr-info/pqr-info.component';
import { ComponentHostDirective } from './directives/component-host.directive';
......@@ -63,6 +64,7 @@ import { DownloadComponent } from './components/download/download.component';
],
entryComponents: [
AlertComponent,
WarningModalComponent,
ConfirmComponent
],
exports: [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment