Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Time-Tracking-Application-Client-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kaustubh Negi
Time-Tracking-Application-Client-End
Commits
411fe443
You need to sign in or sign up before continuing.
Commit
411fe443
authored
Feb 24, 2023
by
Kaustubh Negi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into 'master'
24-02-2023 See merge request
!4
parents
c681f2ee
4d1195d7
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
167 additions
and
20 deletions
+167
-20
app-routing.module.ts
src/app/app-routing.module.ts
+2
-2
logout.component.css
src/app/logout/logout.component.css
+12
-0
logout.component.html
src/app/logout/logout.component.html
+52
-17
logout.component.ts
src/app/logout/logout.component.ts
+1
-1
auth.service.spec.ts
src/app/share/auth.service.spec.ts
+16
-0
auth.service.ts
src/app/share/auth.service.ts
+9
-0
auth.guard.spec.ts
src/app/shared/auth.guard.spec.ts
+16
-0
auth.guard.ts
src/app/shared/auth.guard.ts
+29
-0
auth.service.spec.ts
src/app/shared/auth.service.spec.ts
+16
-0
auth.service.ts
src/app/shared/auth.service.ts
+14
-0
No files found.
src/app/app-routing.module.ts
View file @
411fe443
...
...
@@ -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
}
...
...
src/app/logout/logout.component.css
View file @
411fe443
...
...
@@ -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
)
{
...
...
src/app/logout/logout.component.html
View file @
411fe443
<!-- <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,18 +74,24 @@
</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"
>
<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"
>
...
...
@@ -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>
...
...
@@ -123,10 +124,44 @@
</div>
</div>
</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> </label>
<button class ="btn btn-outline-primary" (click)="saveInputs()">Save</button>
</div>
</div>
</div>
</div>
</div> -->
</div>
...
...
@@ -134,4 +169,4 @@
</div>
</div>
</div>
\ No newline at end of file
\ No newline at end of file
src/app/logout/logout.component.ts
View file @
411fe443
...
...
@@ -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
{
...
...
src/app/share/auth.service.spec.ts
0 → 100644
View file @
411fe443
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
();
});
});
src/app/share/auth.service.ts
0 → 100644
View file @
411fe443
import
{
Injectable
}
from
'@angular/core'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
AuthService
{
constructor
()
{
}
}
src/app/shared/auth.guard.spec.ts
0 → 100644
View file @
411fe443
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
();
});
});
src/app/shared/auth.guard.ts
0 → 100644
View file @
411fe443
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'
);
}
}
}
src/app/shared/auth.service.spec.ts
0 → 100644
View file @
411fe443
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
();
});
});
src/app/shared/auth.service.ts
0 → 100644
View file @
411fe443
import
{
Injectable
}
from
'@angular/core'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
AuthService
{
constructor
()
{
}
isLoggedin
(){
return
!!
localStorage
.
getItem
(
'response'
);
// return false;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment