Skip to content

Commit c27026e

Browse files
andresacg30Andres Cabrerammaquina
authored
Tta 174 create pop up message for redirecting users from legacy to production (#935)
* feat: TT-174 pop-up message for redirect to b2 from legacy * change variable from let to const * v2-redirect component * create html for figma design * erase images bg * Montserrat Font * add media screen for responsiveness * fix: TT-174 css * final styling * fix sonarcloud problems * fix tests errors * fix bad naming for css * fix import errors * abigails comments * adding test for conditional env checking * add title for html * remove app-routing-module from test * exclude test files * fix: TTA-174 update to check if it is legacy Co-authored-by: Nicole Garcia <nicolsss> Co-authored-by: Andres Cabrera <andres@MSI> Co-authored-by: mmaquina <[email protected]>
1 parent 4f51335 commit c27026e

File tree

9 files changed

+288
-18
lines changed

9 files changed

+288
-18
lines changed

src/app/app-routing.module.ts

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,46 @@ import { HomeComponent } from './modules/home/home.component';
1111
import { LoginComponent } from './modules/login/login.component';
1212
import { CustomerComponent } from './modules/customer-management/pages/customer.component';
1313
import { UsersComponent } from './modules/users/pages/users.component';
14+
import { V2RedirectComponent } from './modules/v2-redirect/v2-redirect.component';
15+
import { EnvironmentType } from 'src/environments/enum';
16+
import { environment } from 'src/environments/environment';
1417

15-
const routes: Routes = [
16-
{
17-
path: '',
18-
component: HomeComponent,
19-
canActivate: [LoginGuard],
20-
children: [
21-
{ path: 'reports', canActivate: [AdminGuard], component: ReportsComponent },
22-
{ path: 'time-clock', component: TimeClockComponent },
23-
{ path: 'time-entries', component: TimeEntriesComponent },
24-
{ path: 'activities-management', component: ActivitiesManagementComponent },
25-
{ path: 'customers-management', canActivate: [AdminGuard], component: CustomerComponent },
26-
{ path: 'users', canActivate: [AdminGuard], component: UsersComponent },
27-
{ path: '', pathMatch: 'full', redirectTo: 'time-clock' },
28-
],
29-
},
30-
{ path: 'login', component: LoginComponent },
31-
];
18+
const isNotLegacy: boolean = environment.production !== EnvironmentType.TT_PROD_LEGACY;
19+
let routes: Routes;
3220

21+
if (isNotLegacy) {
22+
routes = [
23+
{
24+
path: '',
25+
component: HomeComponent,
26+
canActivate: [LoginGuard],
27+
children: [
28+
{ path: 'reports', canActivate: [AdminGuard], component: ReportsComponent },
29+
{ path: 'time-clock', component: TimeClockComponent },
30+
{ path: 'time-entries', component: TimeEntriesComponent },
31+
{ path: 'activities-management', component: ActivitiesManagementComponent },
32+
{ path: 'customers-management', canActivate: [AdminGuard], component: CustomerComponent },
33+
{ path: 'users', canActivate: [AdminGuard], component: UsersComponent },
34+
{ path: '', pathMatch: 'full', redirectTo: 'time-clock' },
35+
],
36+
},
37+
{ path: 'login', component: LoginComponent }
38+
];
39+
40+
} else {
41+
routes = [
42+
{
43+
path: '',
44+
children: [
45+
{ path: '**', component: V2RedirectComponent },
46+
],
47+
},
48+
];
49+
}
3350
@NgModule({
3451
imports: [RouterModule.forRoot(routes)],
3552
exports: [RouterModule],
3653
})
37-
export class AppRoutingModule { }
54+
export class AppRoutingModule {
55+
56+
}

src/app/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ import { SearchUserComponent } from './modules/shared/components/search-user/sea
9797
import { TimeRangeCustomComponent } from './modules/reports/components/time-range-custom/time-range-custom.component';
9898
import { TimeRangeHeaderComponent } from './modules/reports/components/time-range-custom/time-range-header/time-range-header.component';
9999
import { TimeRangeOptionsComponent } from './modules/reports/components/time-range-custom/time-range-options/time-range-options.component';
100+
import { V2RedirectComponent } from './modules/v2-redirect/v2-redirect.component';
100101
import { SpinnerOverlayComponent } from './modules/shared/components/spinner-overlay/spinner-overlay.component';
101102
import { SpinnerInterceptor } from './modules/shared/interceptors/spinner.interceptor';
102103

@@ -158,6 +159,7 @@ const maskConfig: Partial<IConfig> = {
158159
TimeRangeCustomComponent,
159160
TimeRangeHeaderComponent,
160161
TimeRangeOptionsComponent,
162+
V2RedirectComponent,
161163
SpinnerOverlayComponent,
162164
],
163165
imports: [
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
.btn-primary {
2+
background-color: #F85221;
3+
border-radius: 30px;
4+
border: none;
5+
}
6+
7+
.btn-primary:hover {
8+
background-color: #bf3816;
9+
}
10+
11+
h2 {
12+
font-weight: 600;
13+
color: #5B4F62;
14+
}
15+
16+
h1 {
17+
font-weight: 800;
18+
font-size:4em;
19+
color: #5B4F62;
20+
21+
}
22+
23+
h3 {
24+
font-weight: 500;
25+
font-size: 2em;
26+
color: #831C86;
27+
}
28+
29+
#main-image {
30+
padding-top: 20%;
31+
max-width: 100%;
32+
}
33+
34+
.grid {
35+
display: grid;
36+
grid-template-columns: [x0] 2fr [x1] 1fr [x2];
37+
justify-items: center;
38+
}
39+
40+
41+
#logo {
42+
padding-top: 20px;
43+
padding-left: 25px;
44+
position:absolute;
45+
max-width: 18rem;
46+
left: 0;
47+
top: 0;
48+
z-index: 10;
49+
}
50+
51+
.decoration{
52+
z-index: 0;
53+
position: absolute;
54+
bottom:0;
55+
right:0;
56+
}
57+
58+
.text{
59+
padding-top: 50%;
60+
padding-right: 30%;
61+
}
62+
63+
64+
.redirection {
65+
padding-top:1rem;
66+
text-align: center;
67+
}
68+
69+
body {
70+
text-align: center;
71+
font-family: 'Montserrat', sans-serif;
72+
}
73+
74+
@media screen and (max-width: 1307px) {
75+
76+
#main-image {
77+
padding-top: 6%;
78+
}
79+
h1 {
80+
color:#831C86;
81+
}
82+
83+
.grid {
84+
display: grid;
85+
grid-template-columns: 1fr;
86+
position: relative;
87+
width:auto;
88+
}
89+
90+
.text{
91+
padding-top: 2rem;
92+
padding-right: 0px;
93+
text-align: center;
94+
95+
}
96+
97+
.redirection {
98+
padding-top: 0px;
99+
padding-right: 0px;
100+
margin-bottom: 30px;
101+
text-align: center;
102+
}
103+
104+
#quote {
105+
display: none;
106+
}
107+
108+
}
109+
110+
111+
@media screen and (max-width: 430px) {
112+
.btn-primary {
113+
font-size:small;
114+
115+
}
116+
body{
117+
text-align: center;
118+
}
119+
h1 {
120+
font-size: 2rem;
121+
color:#831C86;
122+
}
123+
h2 {
124+
font-size: 1rem;
125+
}
126+
.grid {
127+
display: grid;
128+
grid-template-columns: 1fr;
129+
position: relative;
130+
width:auto;
131+
}
132+
133+
.text{
134+
padding-top: 2rem;
135+
padding-right: 0px;
136+
text-align: center;
137+
138+
}
139+
140+
.redirection {
141+
padding-top: 0px;
142+
padding-right: 0px;
143+
margin-bottom: 30px;
144+
text-align: center;
145+
}
146+
147+
#quote {
148+
display: none;
149+
}
150+
151+
.decoration {
152+
display: none;
153+
}
154+
#logo {
155+
padding-right: auto;
156+
padding-left: auto;
157+
padding-top: 20px;
158+
position:absolute;
159+
max-width: 80%;
160+
left: 0;
161+
top: 0;
162+
z-index: 10;
163+
}
164+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>Time Tracker</title>
5+
<link rel="preconnect" href="https://fonts.googleapis.com" />
6+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
7+
<link
8+
href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,500;0,800;0,900;1,600&display=swap"
9+
rel="stylesheet"
10+
/>
11+
<link
12+
rel="stylesheet"
13+
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
14+
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
15+
crossorigin="anonymous"
16+
/>
17+
<link rel="stylesheet" href="./v2-redirect.component.css" />
18+
</head>
19+
20+
<body>
21+
<div>
22+
<img id="logo" src="../../../assets/img/time-tracker-logo.png" alt="Time Tracker logo" />
23+
</div>
24+
<div class="decoration">
25+
<img src="../../../assets/img/decoration.png" alt="decoration blue splash" />
26+
</div>
27+
<div class="grid">
28+
<div>
29+
<img id="main-image" src="../../../assets/img/main-image.png" alt="person moving boxes" />
30+
</div>
31+
<div class="text">
32+
<h1>WE HAVE MOVED</h1>
33+
<h3 id="quote">The world is in<br />constant evolution,<br /><strong>SO ARE WE.</strong></h3>
34+
</div>
35+
<div class="redirection">
36+
<div id="goto">
37+
<h2>GO TO TIME TRACKER V2</h2>
38+
</div>
39+
<div id="link">
40+
<a class="btn btn-primary btn-lg" href="https://ui.timetrackerapp.ioet.com/" role="button"
41+
>ui.timetrackerapp.ioet.com</a
42+
>
43+
</div>
44+
</div>
45+
</div>
46+
</body>
47+
</html>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { V2RedirectComponent } from './v2-redirect.component';
4+
5+
describe('V2RedirectComponent', () => {
6+
let component: V2RedirectComponent;
7+
let fixture: ComponentFixture<V2RedirectComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
declarations: [ V2RedirectComponent ]
12+
})
13+
.compileComponents();
14+
});
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(V2RedirectComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should create', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-v2-redirect',
5+
templateUrl: './v2-redirect.component.html',
6+
styleUrls: ['./v2-redirect.component.css']
7+
})
8+
export class V2RedirectComponent {
9+
10+
}

src/assets/img/decoration.png

8.08 KB
Loading

src/assets/img/main-image.png

82.4 KB
Loading

tsconfig.spec.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@
1414
"include": [
1515
"src/**/*.spec.ts",
1616
"src/**/*.d.ts"
17+
],
18+
"exclude": [
19+
"src/app/app-routing.module.ts"
1720
]
1821
}

0 commit comments

Comments
 (0)