Commit 3ec79e06 authored by Kaustubh Negi's avatar Kaustubh Negi

Merge branch 'develop' into 'master'

27-02-2023

See merge request !5
parents 411fe443 dc3703e1
...@@ -50,6 +50,7 @@ export class AttendComponent implements OnInit { ...@@ -50,6 +50,7 @@ export class AttendComponent implements OnInit {
console.log(this.endTime+" From the stopTimer() function"); console.log(this.endTime+" From the stopTimer() function");
this.endDay(); this.endDay();
clearInterval(this.interval); clearInterval(this.interval);
// this.endDay(); // this.endDay();
} }
......
This diff is collapsed.
<div class ="logout-page"> <div class ="logout-page">
<div class = "container"> <div class = "container">
<div class = "row"> <div class = "row">
<div class="col-md-12"> <div class="col-md-12">
<div class="col-md-12"> <div class="col-md-12">
<h4>You have worked for this much hours kindly please fill your timesheet</h4> <h4>You have worked for "{{ hours_worked }}" hours kindly please fill your timesheet</h4>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<div class="table-responsive tablenw"> <div class="table-responsive tablenw">
...@@ -18,9 +18,6 @@ ...@@ -18,9 +18,6 @@
<th>Activity</th> <th>Activity</th>
<th>&nbsp;</th> <th>&nbsp;</th>
</tr> </tr>
<tr *ngFor="let input of inputs; let i = index"> <tr *ngFor="let input of inputs; let i = index">
<td> <td>
...@@ -77,19 +74,19 @@ ...@@ -77,19 +74,19 @@
</div> </div>
<div class = "col-md-13"> <div class = "col-md-12">
<div class= "logout-inner"> <div class= "logout-inner">
<div class = "row"> <div class = "row">
<div class="col-md-3"> <div class="col-md-3">
<div class="form-group"> <div class="form-group">
<label>Total Time Usage:</label> <label>Total Time Usage:</label>
<div class="form-control" *ngIf="inputs.length>0 && isValidInput() && totalTime <= 1440"></div> <!-- <div class="form-control" *ngIf="inputs.length>0 && isValidInput() && totalTime <= 1440" ></div> -->
<div class="form-control" >1000</div> <div class="form-control" >{{minutes_worked}}</div>
</div> </div>
</div> </div>
...@@ -109,7 +106,7 @@ ...@@ -109,7 +106,7 @@
<div class = "col-md-3"> <div class = "col-md-3">
<div class="form-group"> <div class="form-group">
<label>Remaining Time:</label> <label>Remaining Time:</label>
<div class="form-control">{{1440-totalTime}}</div> <div class="form-control">{{minutes_worked-totalTime}}</div>
</div> </div>
</div> </div>
...@@ -129,6 +126,20 @@ ...@@ -129,6 +126,20 @@
</div> </div>
</div>
</div>
</div>
<!-- <div class = "col-md-13"> <!-- <div class = "col-md-13">
<div class= "logout-inner"> <div class= "logout-inner">
<div class = "row"> <div class = "row">
...@@ -160,13 +171,5 @@ ...@@ -160,13 +171,5 @@
</div> </div>
</div> </div>
</div> --> </div> -->
</div>
</div>
</div>
\ No newline at end of file
...@@ -7,24 +7,31 @@ import { HttpClient } from '@angular/common/http'; ...@@ -7,24 +7,31 @@ import { HttpClient } from '@angular/common/http';
@Component({ @Component({
selector: 'app-logout', selector: 'app-logout',
templateUrl: './logout.component.html', templateUrl: './logout.component.html',
// styleUrls: ['./logout.component.css',] styleUrls: ['./logout.component.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'] // styleUrls: ['./logout.component.css','./assets/css/bootstrap.min.css', './assets/css/custom.css', './assets/css/font-awesome.min.css']
}) })
export class LogoutComponent implements OnInit { export class LogoutComponent implements OnInit {
inputs: { description: string, time: number, activity: string }[] = [{ description: '', time: 0, activity: '' }]; inputs: { description: string, time: number, activity: string }[] = [{ description: '', time: 0, activity: '' }];
hours_worked: number = 0;
activityName: string[] = []; activityName: string[] = [];
activityId: string[] =[]; activityId: string[] =[];
jsonString: any =[] jsonString: any =[]
@Output() currentTimeChange = new EventEmitter<Date>(); @Output() currentTimeChange = new EventEmitter<Date>();
minutes_worked: number = 0;
constructor(private http: HttpClient) { } constructor(private http: HttpClient) { }
ngOnInit() { ngOnInit() {
this.fetchActivities(); this.fetchActivities();
this.getHours();
this.getMinutes();
} }
fetchActivities() { fetchActivities() {
...@@ -93,5 +100,65 @@ postInput() { ...@@ -93,5 +100,65 @@ postInput() {
}); });
} }
getMinutes():void {
let token:string ="";
let json: string | null = localStorage.getItem("response");
if (json) {
console.log("json "+json);
token = JSON.parse(json).token;
console.log(token);
}
const headers = {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
};
const url = 'http://localhost:3000/api/minutes';
this.http.get(url, { headers }).subscribe(
(data: any) => {
const minutes = data.minutes;
this.minutes_worked = minutes;
console.log('Minutes worked:', minutes);
// do something with the minutes value
},
(error) => {
console.error('Error:', error);
// handle the error
}
);
}
getHours(): void {
let token:string ="";
let json: string | null = localStorage.getItem("response");
if (json) {
console.log("json "+json);
token = JSON.parse(json).token;
console.log(token);
}
const headers = {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
};
const url = 'http://localhost:3000/api/hours';
this.http.get(url, { headers }).subscribe(
(data: any) => {
const hours = data.hours;
this.hours_worked = hours;
console.log('Hours worked:', hours);
// do something with the hours value
},
(error) => {
console.error('Error:', error);
// handle the error
}
);
}
} }
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
<div class="left-menu"> <div class="left-menu">
<nav class='animated bounceInDown'> <nav class='animated bounceInDown'>
<ul> <ul>
<li><a (click)="toggleDashb()" ><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-grid"><rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect></svg> Dashboard</a></li> <li><a (click)="selectView('dashboard')" ><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-grid"><rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect></svg> Dashboard</a></li>
<li><a (click)="toggleAttend()" ><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-clipboard"><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"></path><rect x="8" y="2" width="8" height="4" rx="1" ry="1"></rect></svg> Attendance</a></li> <li><a (click)="selectView('attendance')" ><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-clipboard"><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"></path><rect x="8" y="2" width="8" height="4" rx="1" ry="1"></rect></svg> Attendance</a></li>
<li><a ><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-clock"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg> Timesheet</a></li> <li><a (click)="selectView('timesheet')" ><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-clock"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg> Timesheet</a></li>
<!-- <li class='sub-menu'> <!-- <li class='sub-menu'>
...@@ -172,21 +172,39 @@ ...@@ -172,21 +172,39 @@
<div class="dashboard-main"></div> <div class="dashboard-main">
<app-logout>
<div *ngIf="selectedView === 'dashboard'">
<app-dashb></app-dashb>
</div>
<div *ngIf="selectedView === 'attendance'">
<app-attend></app-attend>
</div>
<div *ngIf="selectedView === 'timesheet'">
<app-logout></app-logout>
</div>
<!-- <div>
<app-logout>
</app-logout> </app-logout>
</div> -->
<!-- <div *ngIf="false">
<app-test-logout></app-test-logout> <app-test-logout></app-test-logout>
</div> -->
<!-- <div>here to place all your content</div> --> <!-- <div>here to place all your content</div> -->
<div *ngIf="showDashb"> <!-- <div *ngIf="showDashb">
<app-dashb></app-dashb> <app-dashb></app-dashb>
</div> </div> -->
<div *ngIf="showAttend"> <!-- <div *ngIf="showAttend">
<app-attend></app-attend> <app-attend></app-attend>
</div> </div> -->
<!-- <mat-form-field> <!-- <mat-form-field>
<mat-select [formControl]="selectedOptions" multiple> <mat-select [formControl]="selectedOptions" multiple>
...@@ -218,7 +236,7 @@ ...@@ -218,7 +236,7 @@
</mat-form-field> --> </mat-form-field> -->
</div>
</div> </div>
......
...@@ -59,6 +59,7 @@ export class TestDashboardComponent implements AfterViewInit { ...@@ -59,6 +59,7 @@ export class TestDashboardComponent implements AfterViewInit {
public isVisible = false; public isVisible = false;
selectedView: string = 'dashboard';
toggleSubMenu() { toggleSubMenu() {
this.isShown = !this.isShown; this.isShown = !this.isShown;
...@@ -81,6 +82,10 @@ export class TestDashboardComponent implements AfterViewInit { ...@@ -81,6 +82,10 @@ export class TestDashboardComponent implements AfterViewInit {
this.showAttend = !this.showAttend; this.showAttend = !this.showAttend;
} }
selectView(view: string) {
this.selectedView = view;
}
// test code // test code
......
...@@ -172,4 +172,148 @@ margin-top: 25px; ...@@ -172,4 +172,148 @@ margin-top: 25px;
.logout-page h4 { .logout-page h4 {
font-size: 20px; font-size: 20px;
font-weight:10px;} */ font-weight:10px;} */
\ No newline at end of file
/* @import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,900&display=swap');
*{
margin: 0;
padding: 0;
list-style: none;
text-decoration: none;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
html, body{
font-family: 'Poppins', sans-serif;
}
.login-page { width:100%; }
.logoin-bg {background:#0168F3;
width: 100%;
float: left;
height: 100%;}
.login {box-shadow:0px 0px 10px #00000029;background:#fff;width:430px;border-radius:5px; margin:auto; margin-top:70px; padding:25px;}
.login .logo {width:100%; text-align:center;}
.login .welc-login {width:170px; text-align:left;line-height: 36px; font-weight:300;font-size:22px; color:#606060;margin-top:20px;}
.login .welc-login span {font-weight:600;font-size:24px; display:block;}
.login .form {width:100%;margin-top:25px;}
.login .form .form-group {margin-top:25px;}
.login .form .form-group label {font-size: 14px;color: #606060;margin-bottom: 10px;font-weight: 400;}
.login .form .form-group .form-control {background:#EFEFEF; border:#E2E2E2 1px solid; color:#606060;}
.login .form .form-group .btn {background: #0168f3;color: #fff;border-radius: 3px;width: 100%;border: 1px solid #0168f3;}
.login .form .form-group .btn:hover {border: 1px solid #0168f3; background:#fff; color:#0168f3;}
@media (max-width:767px) {
} */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,900&display=swap');
* {
margin: 0;
padding: 0;
list-style: none;
text-decoration: none;
box-sizing: border-box;
}
html, body {
font-family: 'Poppins', sans-serif;
}
.login-page {
width: 100%;
}
.login-bg {
background: #0168F3;
background-size: cover; /* make background image cover the entire container */
width: 100%;
height: 100vh; /* set height to viewport height */
}
.login {
box-shadow: 0px 0px 10px #00000029;
background: #fff;
width: 430px;
border-radius: 5px;
margin: auto;
margin-top: 70px;
padding: 25px;
}
.login .logo {
width: 100%;
text-align: center;
}
.login .welc-login {
width: 170px;
text-align: left;
line-height: 36px;
font-weight: 300;
font-size: 22px;
color: #606060;
margin-top: 20px;
}
.login .welc-login span {
font-weight: 600;
font-size: 24px;
display: block;
}
.login .form {
width: 100%;
margin-top: 25px;
}
.login .form .form-group {
margin-top: 25px;
}
.login .form .form-group label {
font-size: 14px;
color: #606060;
margin-bottom: 10px;
font-weight: 400;
}
.login .form .form-group .form-control {
background: #EFEFEF;
border: #E2E2E2 1px solid;
color: #606060;
}
.login .form .form-group .btn {
background: #0168f3;
color: #fff;
border-radius: 3px;
width: 100%;
border: 1px solid #0168f3;
}
.login .form .form-group .btn:hover {
border: 1px solid #0168f3;
background: #fff;
color: #0168f3;
}
@media (max-width: 200px) {
/* Mobile styles go here */
}
...@@ -8,7 +8,7 @@ import { Input } from '@angular/core'; ...@@ -8,7 +8,7 @@ import { Input } from '@angular/core';
@Component({ @Component({
selector: 'app-test-login', selector: 'app-test-login',
templateUrl: './test-login.component.html', templateUrl: './test-login.component.html',
styleUrls: ['./test-login.component.css','./assets/css/bootstrap.min.css', './assets/css/custom.css', './assets/css/font-awesome.min.css'] styleUrls: ['./assets/css/bootstrap.min.css', './assets/css/custom.css', './assets/css/font-awesome.min.css']
}) })
export class TestLoginComponent implements OnInit { export class TestLoginComponent implements OnInit {
......
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