Skip to content

Commit c60b9aa

Browse files
committed
Merge branch 'master' into TTA-189-create-an-anchor-for-the-edit-a-customer-action
2 parents c893bc0 + 0498d2e commit c60b9aa

31 files changed

+699
-95
lines changed
300 Bytes
Binary file not shown.
Binary file not shown.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ testem.log
4242
/typings
4343
debug.log
4444
*.vscode
45+
.hintrc
4546

4647
# System Files
4748
.DS_Store

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ build: ## Create docker image with dependencies needed for development.
1414
docker-compose build timetracker_ui
1515

1616
.PHONY: cleanup
17-
cleanup: ## Delete image timetracker_ui
17+
cleanup: ## Delete image timetracker_ui.
1818
docker rmi timetracker_ui
1919

2020
.PHONY: run
21-
run: ## Execute timetracker_ui dev docker containe.
22-
docker-compose --env-file=.dev.env up -d timetracker_ui
21+
run: ## Execute timetracker_ui dev docker container.
22+
docker-compose --env-file=.dev.env up -d timetracker_ui
2323

2424
.PHONY: logs
2525
logs: ## Show logs of timetracker_ui.
@@ -85,7 +85,7 @@ publish_prod: ## Upload a docker image to the prod azure container registry acr=
8585
docker push $(acr).azurecr.io/timetracker_ui:$(image_tag)
8686

8787
.PHONY: login
88-
login: ## Login in respository of docker images.
88+
login: ## Login in respository of docker images
8989
az acr login --name $(acr)
9090

9191
.PHONY: release

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "time-tracker",
3-
"version": "1.75.22",
3+
"version": "1.75.40",
44
"scripts": {
55
"preinstall": "npx npm-force-resolutions",
66
"ng": "ng",

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.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<router-outlet></router-outlet>
1+
<router-outlet></router-outlet>

src/app/app.module.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
33
import { ToastrModule } from 'ngx-toastr';
44
import { CommonModule, DatePipe } from '@angular/common';
55
import { BrowserModule } from '@angular/platform-browser';
6-
import { NgModule, Component } from '@angular/core';
6+
import { NgModule } from '@angular/core';
77
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
88
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
99
import { DataTablesModule } from 'angular-datatables';
@@ -14,6 +14,8 @@ import { DragDropModule } from '@angular/cdk/drag-drop';
1414
import { MatCheckboxModule } from '@angular/material/checkbox';
1515
import { MatDatepickerModule } from '@angular/material/datepicker';
1616
import { MatInputModule } from '@angular/material/input';
17+
import { MatButtonModule } from '@angular/material/button';
18+
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
1719
import { MatIconModule } from '@angular/material/icon';
1820
import { MatListModule } from '@angular/material/list';
1921
import { MatMomentDateModule } from '@angular/material-moment-adapter';
@@ -70,6 +72,7 @@ import { UserEffects } from './modules/user/store/user.effects';
7072
import { EntryEffects } from './modules/time-clock/store/entry.effects';
7173
import { InjectTokenInterceptor } from './modules/shared/interceptors/inject.token.interceptor';
7274
import { SubstractDatePipe } from './modules/shared/pipes/substract-date/substract-date.pipe';
75+
import { SubstractDatePipeDisplayAsFloat } from './modules/shared/pipes/substract-date-return-float/substract-date-return-float.pipe';
7376
import { TechnologiesComponent } from './modules/shared/components/technologies/technologies.component';
7477
import { TimeEntriesSummaryComponent } from './modules/time-clock/components/time-entries-summary/time-entries-summary.component';
7578
import { TimeDetailsPipe } from './modules/time-clock/pipes/time-details.pipe';
@@ -95,6 +98,9 @@ import { SearchUserComponent } from './modules/shared/components/search-user/sea
9598
import { TimeRangeCustomComponent } from './modules/reports/components/time-range-custom/time-range-custom.component';
9699
import { TimeRangeHeaderComponent } from './modules/reports/components/time-range-custom/time-range-header/time-range-header.component';
97100
import { TimeRangeOptionsComponent } from './modules/reports/components/time-range-custom/time-range-options/time-range-options.component';
101+
import { V2RedirectComponent } from './modules/v2-redirect/v2-redirect.component';
102+
import { SpinnerOverlayComponent } from './modules/shared/components/spinner-overlay/spinner-overlay.component';
103+
import { SpinnerInterceptor } from './modules/shared/interceptors/spinner.interceptor';
98104

99105
const maskConfig: Partial<IConfig> = {
100106
validation: false,
@@ -133,6 +139,7 @@ const maskConfig: Partial<IConfig> = {
133139
CreateProjectTypeComponent,
134140
EntryFieldsComponent,
135141
SubstractDatePipe,
142+
SubstractDatePipeDisplayAsFloat,
136143
TechnologiesComponent,
137144
SearchUserComponent,
138145
TimeEntriesSummaryComponent,
@@ -154,6 +161,8 @@ const maskConfig: Partial<IConfig> = {
154161
TimeRangeCustomComponent,
155162
TimeRangeHeaderComponent,
156163
TimeRangeOptionsComponent,
164+
V2RedirectComponent,
165+
SpinnerOverlayComponent,
157166
],
158167
imports: [
159168
NgxMaskModule.forRoot(maskConfig),
@@ -172,6 +181,7 @@ const maskConfig: Partial<IConfig> = {
172181
DataTablesModule,
173182
AutocompleteLibModule,
174183
NgxMaterialTimepickerModule,
184+
MatProgressSpinnerModule,
175185
UiSwitchModule,
176186
DragDropModule,
177187
MatIconModule,
@@ -206,6 +216,11 @@ const maskConfig: Partial<IConfig> = {
206216
useClass: InjectTokenInterceptor,
207217
multi: true,
208218
},
219+
{
220+
provide: HTTP_INTERCEPTORS,
221+
useClass: SpinnerInterceptor,
222+
multi: true,
223+
},
209224
DatePipe,
210225
CookieService,
211226
{provide: Window, useValue: window}

src/app/modules/login/login.component.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,12 @@ export class LoginComponent implements OnInit {
6464
ngOnInit() {
6565

6666
this.googleAuthSDK();
67-
if (this.isProduction && this.azureAdB2CService.isLogin()) {
68-
this.router.navigate(['']);
69-
} else {
7067
this.loginService.isLogin().subscribe(isLogin => {
7168
if (isLogin) {
7269
this.router.navigate(['']);
7370
}
7471
});
75-
}
72+
7673
window.handleCredentialResponse = (response) => {
7774
const {credential = ''} = response;
7875
this.featureToggleCookiesService.setCookies();

0 commit comments

Comments
 (0)