Commit 411fe443 authored by Kaustubh Negi's avatar Kaustubh Negi

Merge branch 'develop' into 'master'

24-02-2023

See merge request !4
parents c681f2ee 4d1195d7
......@@ -17,7 +17,7 @@ import { TestDashboardComponent } from './test-dashboard/test-dashboard.componen
import { Td2Component } from './td2/td2.component';
import { AttendRepComponent } from './attend-rep/attend-rep.component';
import { DashbComponent } from './dashb/dashb.component';
import {AuthGuard} from './shared/auth.guard';
const routes: Routes = [
......@@ -38,7 +38,7 @@ const routes: Routes = [
{path:"loggedin",component:TestStartedComponent},
{path:"dashboard2",component:Dashboard2Component},
{path:"attrep",component:AttendanceReportComponent},
{path:"td",component:TestDashboardComponent},
{path:"td",component:TestDashboardComponent,canActivate:[AuthGuard]},
{path:"td2",component:Td2Component},
{path:"attendrep",component:AttendRepComponent},
{path:"dashb",component:DashbComponent}
......
......@@ -114,6 +114,18 @@ html, body{
.col-md-3 {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
}
.col-md-3 .form-group {
flex-basis: calc(33.33% - 20px);
margin-right: 20px;
}
@media (max-width:767px) {
......
<!-- <div class="header">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="logo"><img src="assets/img/logo1.png"></div>
</div>
</div>
</div>
</div> -->
<div class ="logout-page">
<div class = "container">
<div class = "row">
<div class="col-md-12">
<div class="col-md-12">
<h4>You have worked for this much hours kindly please fill your timesheet</h4>
</div>
......@@ -80,20 +74,26 @@
</table>
</div>
</div>
</div>
<div class = "col-md-12">
<div class = "col-md-13">
<div class= "logout-inner">
<div class = "row">
<div class="col-md-3">
<div class="form-group">
<label>Total Time Usage:</label>
<div class="form-control" *ngIf="inputs.length>0 && isValidInput() && totalTime <= 1440"></div>
<h3 class="form-control" *ngIf="inputs.length>0 && isValidInput() && totalTime <= 1440"></h3>
<div class="form-control" >1000</div>
</div>
</div>
<div class = "col-md-3">
<div class="form-group">
......@@ -108,7 +108,8 @@
<div class = "col-md-3">
<div class="form-group">
<label>Remaining Time:</label><div class="form-control">{{1440-totalTime}}</div>
<label>Remaining Time:</label>
<div class="form-control">{{1440-totalTime}}</div>
</div>
</div>
......@@ -122,16 +123,50 @@
</div>
</div>
</div>
</div>
<!-- <div class = "col-md-13">
<div class= "logout-inner">
<div class = "row">
<div class="col-md-3">
<div class="form-group form-inline">
<label>Total Time Usage:</label>
<div class="form-control" *ngIf="inputs.length>0 && isValidInput() && totalTime <= 1440"></div>
<div class="form-control">1000</div>
</div>
</div>
<div class = "col-md-3">
<div class="form-group form-inline">
<label>Total Time Calculated:</label>
<div class="form-control">{{totalTime}}</div>
</div>
</div>
<div class = "col-md-3">
<div class="form-group form-inline">
<label>Remaining Time:</label>
<div class="form-control">{{1440-totalTime}}</div>
</div>
</div>
<div class = "col-md-3">
<div class="form-group form-inline">
<label>&nbsp;</label>
<button class ="btn btn-outline-primary" (click)="saveInputs()">Save</button>
</div>
</div>
</div>
</div>
</div> -->
</div>
</div>
</div>
</div>
\ No newline at end of file
......@@ -8,7 +8,7 @@ import { HttpClient } from '@angular/common/http';
selector: 'app-logout',
templateUrl: './logout.component.html',
// styleUrls: ['./logout.component.css',]
styleUrls: ['./assets/css/custom.css','./assets/css/bootstrap.min.css', './assets/css/custom.css', './assets/css/font-awesome.min.css']
styleUrls: ['./logout.component.css','./assets/css/bootstrap.min.css', './assets/css/custom.css', './assets/css/font-awesome.min.css']
})
export class LogoutComponent implements OnInit {
......
import { TestBed } from '@angular/core/testing';
import { AuthService } from './auth.service';
describe('AuthService', () => {
let service: AuthService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(AuthService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class AuthService {
constructor() { }
}
import { TestBed } from '@angular/core/testing';
import { AuthGuard } from './auth.guard';
describe('AuthGuard', () => {
let guard: AuthGuard;
beforeEach(() => {
TestBed.configureTestingModule({});
guard = TestBed.inject(AuthGuard);
});
it('should be created', () => {
expect(guard).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
import { Observable } from 'rxjs';
import { AuthService } from './auth.service';
@Injectable({
providedIn: 'root'
})
export class AuthGuard implements CanActivate {
constructor(private auth: AuthService, private router : Router){}
// canActivate(){
// if(this.auth.isLoggedin())
// return true;
// this.router.navigate(['/login']);
// }
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean | UrlTree {
if (this.auth.isLoggedin()) {
return true;
} else {
return this.router.parseUrl('/login');
}
}
}
import { TestBed } from '@angular/core/testing';
import { AuthService } from './auth.service';
describe('AuthService', () => {
let service: AuthService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(AuthService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class AuthService {
constructor() { }
isLoggedin(){
return !!localStorage.getItem('response');
// return false;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment