diff --git a/package.json b/package.json index 83238d243..ab3a8f155 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,7 @@ "config": { "commit-message-validator": { "pattern": "^(fix: TTA-|feat: TTA-|perf: TTA-|build: TTA-|ci: TTA-|docs: TTA-|refactor: TTA-|style: TTA-|test: TTA-|code-smell: TTA-)[0-9].*", - "errorMessage": "Your commit message needs to start with fix: , feat:, or perf: followed by any commit message, e.g. fix: TT-43 any commit message." + "errorMessage": "\nYour commit message must comply with the following pattern:\n ^(fix: TTA-|feat: TTA-|perf: TTA-|build: TTA-|ci: TTA-|docs: TTA-|refactor: TTA-|style: TTA-|test: TTA-|code-smell: TTA-)[0-9].*\n followed by any commit message.\n\n Example:\n fix: TTA-43 any commit message\n" } }, "resolutions": { diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 4cb50a9bf..c4a881854 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -11,27 +11,46 @@ import { HomeComponent } from './modules/home/home.component'; import { LoginComponent } from './modules/login/login.component'; import { CustomerComponent } from './modules/customer-management/pages/customer.component'; import { UsersComponent } from './modules/users/pages/users.component'; +import { V2RedirectComponent } from './modules/v2-redirect/v2-redirect.component'; +import { EnvironmentType } from 'src/environments/enum'; +import { environment } from 'src/environments/environment'; -const routes: Routes = [ - { - path: '', - component: HomeComponent, - canActivate: [LoginGuard], - children: [ - { path: 'reports', canActivate: [AdminGuard], component: ReportsComponent }, - { path: 'time-clock', component: TimeClockComponent }, - { path: 'time-entries', component: TimeEntriesComponent }, - { path: 'activities-management', component: ActivitiesManagementComponent }, - { path: 'customers-management', canActivate: [AdminGuard], component: CustomerComponent }, - { path: 'users', canActivate: [AdminGuard], component: UsersComponent }, - { path: '', pathMatch: 'full', redirectTo: 'time-clock' }, - ], - }, - { path: 'login', component: LoginComponent }, -]; +const isNotLegacy: boolean = environment.production !== EnvironmentType.TT_DEV; +let routes: Routes; +if (isNotLegacy) { + routes = [ + { + path: '', + component: HomeComponent, + canActivate: [LoginGuard], + children: [ + { path: 'reports', canActivate: [AdminGuard], component: ReportsComponent }, + { path: 'time-clock', component: TimeClockComponent }, + { path: 'time-entries', component: TimeEntriesComponent }, + { path: 'activities-management', component: ActivitiesManagementComponent }, + { path: 'customers-management', canActivate: [AdminGuard], component: CustomerComponent }, + { path: 'users', canActivate: [AdminGuard], component: UsersComponent }, + { path: '', pathMatch: 'full', redirectTo: 'time-clock' }, + ], + }, + { path: 'login', component: LoginComponent } + ]; + +} else { + routes = [ + { + path: '', + children: [ + { path: '**', component: V2RedirectComponent }, + ], + }, + ]; +} @NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule], }) -export class AppRoutingModule { } +export class AppRoutingModule { + +} diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 391675003..6effbff75 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -95,6 +95,7 @@ import { SearchUserComponent } from './modules/shared/components/search-user/sea import { TimeRangeCustomComponent } from './modules/reports/components/time-range-custom/time-range-custom.component'; import { TimeRangeHeaderComponent } from './modules/reports/components/time-range-custom/time-range-header/time-range-header.component'; import { TimeRangeOptionsComponent } from './modules/reports/components/time-range-custom/time-range-options/time-range-options.component'; +import { V2RedirectComponent } from './modules/v2-redirect/v2-redirect.component'; const maskConfig: Partial = { validation: false, @@ -154,6 +155,7 @@ const maskConfig: Partial = { TimeRangeCustomComponent, TimeRangeHeaderComponent, TimeRangeOptionsComponent, + V2RedirectComponent, ], imports: [ NgxMaskModule.forRoot(maskConfig), diff --git a/src/app/modules/v2-redirect/v2-redirect.component.css b/src/app/modules/v2-redirect/v2-redirect.component.css new file mode 100644 index 000000000..85e23a77e --- /dev/null +++ b/src/app/modules/v2-redirect/v2-redirect.component.css @@ -0,0 +1,164 @@ +.btn-primary { + background-color: #F85221; + border-radius: 30px; + border: none; +} + +.btn-primary:hover { + background-color: #bf3816; +} + +h2 { + font-weight: 600; + color: #5B4F62; +} + +h1 { + font-weight: 800; + font-size:4em; + color: #5B4F62; + +} + +h3 { + font-weight: 500; + font-size: 2em; + color: #831C86; +} + +#main-image { + padding-top: 20%; + max-width: 100%; +} + +.grid { + display: grid; + grid-template-columns: [x0] 2fr [x1] 1fr [x2]; + justify-items: center; +} + + +#logo { + padding-top: 20px; + padding-left: 25px; + position:absolute; + max-width: 18rem; + left: 0; + top: 0; + z-index: 10; +} + +.decoration{ + z-index: 0; + position: absolute; + bottom:0; + right:0; +} + +.text{ + padding-top: 50%; + padding-right: 30%; +} + + +.redirection { + padding-top:1rem; + text-align: center; +} + +body { + text-align: center; + font-family: 'Montserrat', sans-serif; + } + +@media screen and (max-width: 1307px) { + + #main-image { + padding-top: 6%; + } + h1 { + color:#831C86; + } + + .grid { + display: grid; + grid-template-columns: 1fr; + position: relative; + width:auto; + } + + .text{ + padding-top: 2rem; + padding-right: 0px; + text-align: center; + + } + + .redirection { + padding-top: 0px; + padding-right: 0px; + margin-bottom: 30px; + text-align: center; + } + + #quote { + display: none; + } + +} + + +@media screen and (max-width: 430px) { + .btn-primary { + font-size:small; + + } + body{ + text-align: center; + } + h1 { + font-size: 2rem; + color:#831C86; + } + h2 { + font-size: 1rem; + } + .grid { + display: grid; + grid-template-columns: 1fr; + position: relative; + width:auto; + } + + .text{ + padding-top: 2rem; + padding-right: 0px; + text-align: center; + + } + + .redirection { + padding-top: 0px; + padding-right: 0px; + margin-bottom: 30px; + text-align: center; + } + + #quote { + display: none; + } + + .decoration { + display: none; + } + #logo { + padding-right: auto; + padding-left: auto; + padding-top: 20px; + position:absolute; + max-width: 80%; + left: 0; + top: 0; + z-index: 10; + } +} diff --git a/src/app/modules/v2-redirect/v2-redirect.component.html b/src/app/modules/v2-redirect/v2-redirect.component.html new file mode 100644 index 000000000..26b2c591b --- /dev/null +++ b/src/app/modules/v2-redirect/v2-redirect.component.html @@ -0,0 +1,47 @@ + + + + Time Tracker + + + + + + + + +
+ +
+
+ decoration blue splash +
+
+
+ person moving boxes +
+
+

WE HAVE MOVED

+

The world is in
constant evolution,
SO ARE WE.

+
+
+
+

GO TO TIME TRACKER V2

+
+ +
+
+ + diff --git a/src/app/modules/v2-redirect/v2-redirect.component.spec.ts b/src/app/modules/v2-redirect/v2-redirect.component.spec.ts new file mode 100644 index 000000000..19d380ef2 --- /dev/null +++ b/src/app/modules/v2-redirect/v2-redirect.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { V2RedirectComponent } from './v2-redirect.component'; + +describe('V2RedirectComponent', () => { + let component: V2RedirectComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ V2RedirectComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(V2RedirectComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/modules/v2-redirect/v2-redirect.component.ts b/src/app/modules/v2-redirect/v2-redirect.component.ts new file mode 100644 index 000000000..61ccb0903 --- /dev/null +++ b/src/app/modules/v2-redirect/v2-redirect.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-v2-redirect', + templateUrl: './v2-redirect.component.html', + styleUrls: ['./v2-redirect.component.css'] +}) +export class V2RedirectComponent { + +} diff --git a/src/assets/img/decoration.png b/src/assets/img/decoration.png new file mode 100644 index 000000000..31ef4e894 Binary files /dev/null and b/src/assets/img/decoration.png differ diff --git a/src/assets/img/main-image.png b/src/assets/img/main-image.png new file mode 100644 index 000000000..a07581590 Binary files /dev/null and b/src/assets/img/main-image.png differ diff --git a/tsconfig.spec.json b/tsconfig.spec.json index 6400fde7d..a6c54e6ac 100644 --- a/tsconfig.spec.json +++ b/tsconfig.spec.json @@ -14,5 +14,8 @@ "include": [ "src/**/*.spec.ts", "src/**/*.d.ts" + ], + "exclude": [ + "src/app/app-routing.module.ts" ] }