Skip to content

Commit 1420c79

Browse files
feat: TTA-66 create new environment
1 parent 358e576 commit 1420c79

File tree

26 files changed

+125
-30
lines changed

26 files changed

+125
-30
lines changed

.env

111 Bytes
Binary file not shown.

angular.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,34 @@
7878
"maximumError": "10kb"
7979
}
8080
]
81+
},
82+
"productionlegacy": {
83+
"fileReplacements": [
84+
{
85+
"replace": "src/environments/environment.ts",
86+
"with": "src/environments/environment.prodlegacy.ts"
87+
}
88+
],
89+
"optimization": true,
90+
"outputHashing": "all",
91+
"sourceMap": false,
92+
"extractCss": true,
93+
"namedChunks": false,
94+
"extractLicenses": true,
95+
"vendorChunk": false,
96+
"buildOptimizer": true,
97+
"budgets": [
98+
{
99+
"type": "initial",
100+
"maximumWarning": "2mb",
101+
"maximumError": "5mb"
102+
},
103+
{
104+
"type": "anyComponentStyle",
105+
"maximumWarning": "6kb",
106+
"maximumError": "10kb"
107+
}
108+
]
81109
}
82110
}
83111
},

docker-compose.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ services:
1010
- 4200:4200
1111
- 9876:9876
1212
environment:
13+
API_URL: ${API_URL}
1314
AUTHORITY: ${AUTHORITY}
1415
CLIENT_ID: ${CLIENT_ID}
16+
CLIENT_URL: ${CLIENT_URL}
1517
SCOPES: ${SCOPES}
1618
STACK_EXCHANGE_ID: ${STACK_EXCHANGE_ID}
1719
STACK_EXCHANGE_ACCESS_TOKEN: ${STACK_EXCHANGE_ACCESS_TOKEN}
1820
AZURE_APP_CONFIGURATION_CONNECTION_STRING: ${AZURE_APP_CONFIGURATION_CONNECTION_STRING}
19-
AUTHORITY_JSON: ${AUTHORITY_JSON}
20-
CLIENT_ID_JSON: ${CLIENT_ID_JSON}
21-
SCOPES_JSON: ${SCOPES_JSON}
2221
volumes:
2322
- ./src:/home/timetracker/time-tracker-ui/src/
2423
- ./scripts:/home/timetracker/time-tracker-ui/scripts/
@@ -39,12 +38,11 @@ services:
3938
- 9876:9876
4039
environment:
4140
CHROME_BIN: /opt/google/chrome/google-chrome
41+
API_URL: ${API_URL}
4242
AUTHORITY: ${AUTHORITY}
4343
CLIENT_ID: ${CLIENT_ID}
44+
CLIENT_URL: ${CLIENT_URL}
4445
SCOPES: ${SCOPES}
4546
STACK_EXCHANGE_ID: ${STACK_EXCHANGE_ID}
4647
STACK_EXCHANGE_ACCESS_TOKEN: ${STACK_EXCHANGE_ACCESS_TOKEN}
4748
AZURE_APP_CONFIGURATION_CONNECTION_STRING: ${AZURE_APP_CONFIGURATION_CONNECTION_STRING}
48-
AUTHORITY_JSON: ${AUTHORITY_JSON}
49-
CLIENT_ID_JSON: ${CLIENT_ID_JSON}
50-
SCOPES_JSON: ${SCOPES_JSON}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"ng": "ng",
77
"start": "ng serve",
88
"build": "ng build --prod",
9+
"build-legacy": "ng build --configuration productionlegacy",
910
"test": "ng test --browsers ChromeHeadless",
1011
"test-headless": "ng test --browsers ChromeHeadless",
1112
"ci-test": "ng test --no-watch --no-progress --browsers ChromeHeadless",

scripts/populate-keys.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/bin/bash
22

33
> .env
4+
echo "API_URL='$API_URL'" >> .env
45
echo "AUTHORITY='$AUTHORITY'" >> .env
56
echo "CLIENT_ID='$CLIENT_ID'" >> .env
7+
echo "CLIENT_URL='$CLIENT_URL'" >> .env
68
echo "SCOPES='$SCOPES'" >> .env
79
echo "STACK_EXCHANGE_ID='$STACK_EXCHANGE_ID'" >> .env
810
echo "STACK_EXCHANGE_ACCESS_TOKEN='$STACK_EXCHANGE_ACCESS_TOKEN'" >> .env

src/app/app.module.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ import { ProjectEffects } from './modules/customer-management/components/project
4646
import { TechnologyEffects } from './modules/shared/store/technology.effects';
4747
import { ProjectTypeEffects } from './modules/customer-management/components/projects-type/store/project-type.effects';
4848
import { reducers, metaReducers } from './reducers';
49-
import { environment } from '../environments/environment';
49+
import { CLIENT_URL, environment } from '../environments/environment';
50+
import { EnvironmentType } from '../environments/enum';
5051
import { CustomerComponent } from './modules/customer-management/pages/customer.component';
5152
// tslint:disable-next-line: max-line-length
5253
import { CustomerListComponent } from './modules/customer-management/components/customer-info/components/customer-list/customer-list.component';
@@ -168,7 +169,7 @@ const maskConfig: Partial<IConfig> = {
168169
StoreModule.forRoot(reducers, {
169170
metaReducers,
170171
}),
171-
!environment.production
172+
environment.production === EnvironmentType.TT_DEV
172173
? StoreDevtoolsModule.instrument({
173174
maxAge: 15, // Retains last 15 states
174175
})
@@ -206,9 +207,7 @@ const maskConfig: Partial<IConfig> = {
206207
providers: [
207208
{
208209
id: GoogleLoginProvider.PROVIDER_ID,
209-
provider: new GoogleLoginProvider(
210-
'565556796659-hscrj9e6m2krc41cfng898793ocfnb8j.apps.googleusercontent.com'
211-
)
210+
provider: new GoogleLoginProvider(CLIENT_URL)
212211
}
213212
]
214213
} as SocialAuthServiceConfig,

src/app/guards/login-guard/login.guard.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ import { Router, CanActivate } from '@angular/router';
33
import { AzureAdB2CService } from '../../modules/login/services/azure.ad.b2c.service';
44
import { LoginService } from '../../modules/login/services/login.service';
55
import { environment } from 'src/environments/environment';
6+
import { EnvironmentType } from 'src/environments/enum';
7+
68

79
@Injectable({
810
providedIn: 'root',
911
})
1012
export class LoginGuard implements CanActivate {
11-
isProduction = environment.production;
13+
isProduction = environment.production === EnvironmentType.TT_PROD_LEGACY;
1214
constructor(
1315
private azureAdB2CService: AzureAdB2CService,
1416
private router: Router,

src/app/modules/activities-management/pages/activities-management.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Component, Input, OnInit } from '@angular/core';
22
import { environment } from 'src/environments/environment';
3+
import { EnvironmentType } from 'src/environments/enum';
34

45
@Component({
56
selector: 'app-activities-management',
@@ -11,6 +12,6 @@ export class ActivitiesManagementComponent implements OnInit {
1112
showOptionInDevelopment = true;
1213

1314
ngOnInit() {
14-
this.showOptionInDevelopment = !environment.production;
15+
this.showOptionInDevelopment = environment.production === EnvironmentType.TT_DEV;
1516
}
1617
}

src/app/modules/customer-management/components/projects/components/services/project.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
22
import { HttpClient, HttpParams } from '@angular/common/http';
33
import { Observable } from 'rxjs';
44
import { environment } from '../../../../../../../environments/environment';
5+
import { EnvironmentType } from '../../../../../../../environments/enum';
56
import { Project } from '../../../../../shared/models';
67

78
@Injectable({
@@ -10,7 +11,7 @@ import { Project } from '../../../../../shared/models';
1011
export class ProjectService {
1112
projects: Project[] = [];
1213
url = `${environment.timeTrackerApiUrl}/projects`;
13-
isDevelopment = !environment.production;
14+
isDevelopment = environment.production === EnvironmentType.TT_DEV;
1415

1516
constructor(private http: HttpClient) {}
1617

src/app/modules/home/home.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
22
import { Store } from '@ngrx/store';
33
import { LoadUser } from 'src/app/modules/user/store/user.actions';
44
import { environment } from 'src/environments/environment';
5+
import { EnvironmentType } from 'src/environments/enum';
56
import { AzureAdB2CService } from '../login/services/azure.ad.b2c.service';
67
import { LoginService } from '../login/services/login.service';
78

@@ -11,7 +12,7 @@ import { LoginService } from '../login/services/login.service';
1112
styleUrls: ['./home.component.scss'],
1213
})
1314
export class HomeComponent implements OnInit {
14-
isProduction = environment.production;
15+
isProduction = environment.production === EnvironmentType.TT_PROD_LEGACY;
1516
constructor(
1617
private azureAdB2CService: AzureAdB2CService,
1718
private loginService: LoginService,

0 commit comments

Comments
 (0)