From 1636d43087fa7c728fc5ee07052a82dd8c85068a Mon Sep 17 00:00:00 2001 From: Andres C Date: Tue, 25 Oct 2022 08:30:04 -0400 Subject: [PATCH 01/64] fix legacy environment --- Makefile | 2 +- src/environments/environment.prodlegacy.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ebdd5391f..8be575f6b 100644 --- a/Makefile +++ b/Makefile @@ -85,7 +85,7 @@ publish_prod: ## Upload a docker image to the prod azure container registry acr= docker push $(acr).azurecr.io/timetracker_ui:$(image_tag) .PHONY: login -login: ## Login in respository of docker images. +login: ## Login in respository of docker images az acr login --name $(acr) .PHONY: release diff --git a/src/environments/environment.prodlegacy.ts b/src/environments/environment.prodlegacy.ts index 2ff198b90..67f0d76e7 100644 --- a/src/environments/environment.prodlegacy.ts +++ b/src/environments/environment.prodlegacy.ts @@ -4,6 +4,8 @@ export const environment = { production: EnvironmentType.TT_PROD_LEGACY, timeTrackerApiUrl: process.env["API_URL"], stackexchangeApiUrl: 'https://api.stackexchange.com', + authUrl: process.env['AUTH_URL'], + authAppName: process.env['AUTH_APP_NAME'] }; export const AUTHORITY = process.env["AUTHORITY"]; From 387de8b8465f89d5647a9f3d51ec0b3ebeac2c13 Mon Sep 17 00:00:00 2001 From: Andres C Date: Tue, 25 Oct 2022 09:31:16 -0400 Subject: [PATCH 02/64] add slash to login redirection --- src/app/modules/login/login.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/modules/login/login.component.ts b/src/app/modules/login/login.component.ts index b6982f20f..070a2f38f 100644 --- a/src/app/modules/login/login.component.ts +++ b/src/app/modules/login/login.component.ts @@ -68,7 +68,7 @@ export class LoginComponent implements OnInit { } loginAuth() { - window.location.href = `${this.authUrl}authn/login/${this.authAppName}`; + window.location.href = `${this.authUrl}/authn/login/${this.authAppName}`; } } From 0e04fe133b8654225c68ead49250b1f1913a4316 Mon Sep 17 00:00:00 2001 From: Andres Cabrera <85083117+andresacg30@users.noreply.github.com> Date: Thu, 27 Oct 2022 13:15:16 -0400 Subject: [PATCH 03/64] This reverts commit 5863564d3f8d2dfe938ed92761fcb039cd12fb84. (#946) --- .dev.env | Bin 746 -> 608 bytes .github/workflows/CD-time-tracker-ui.yml | 2 - .github/workflows/CI-time-tracker-ui.yml | 2 - .github/workflows/time-tracker-ui-ci.yml | 6 +- .prod.env | Bin 697 -> 623 bytes .stage.env | Bin 723 -> 687 bytes Makefile | 2 +- README.md | 7 -- docker-compose.yml | 4 -- scripts/populate-keys.sh | 2 - .../services/activity.service.ts | 8 +-- .../services/project-type.service.ts | 8 +-- .../components/services/project.service.ts | 12 ++-- .../services/customer.service.ts | 8 +-- src/app/modules/login/login.component.html | 11 +++- src/app/modules/login/login.component.spec.ts | 10 --- src/app/modules/login/login.component.ts | 61 ++++++++++++++---- .../login/services/login.service.spec.ts | 11 +--- .../modules/login/services/login.service.ts | 21 ++---- .../dark-mode/dark-mode.component.spec.ts | 3 +- .../components/sidebar/sidebar.component.html | 10 +-- .../components/sidebar/sidebar.component.scss | 6 +- .../sidebar/sidebar.component.spec.ts | 2 +- .../feature-toggle-cookies.service.spec.ts | 3 +- .../feature-toggle-general.service.spec.ts | 3 +- .../pages/time-clock.component.spec.ts | 3 +- .../time-clock/services/entry.service.ts | 25 +++---- src/app/modules/user/services/user.service.ts | 2 +- .../users-list/users-list.component.spec.ts | 3 +- .../modules/users/services/users.service.ts | 10 +-- src/environments/environment.prod.ts | 2 - src/environments/environment.prodlegacy.ts | 2 +- src/environments/environment.ts | 3 - src/polyfills.ts | 4 -- webpack.config.js | 2 - 35 files changed, 114 insertions(+), 144 deletions(-) diff --git a/.dev.env b/.dev.env index 03e64abb03f99501b6a4342e3f57ec3714cf0112..7e4a97803a72483670c5c6415995ff46a1d44506 100644 GIT binary patch literal 608 zcmV-m0-yZ=M@dveQdv+`0Qfqz7!$jCQU`uJzN2|mp?J7H>}P4@mo#`HX``acA(Ou- z{y5M%c!5U@tGJu;{4shY=$R%)auJ+lMih&5WzNzaO31PhaL_}eFYO6a*Wa4b_ExNn z-kXQFD(rcenfTX#l%7>2&^N9Xy5eduJ2BrDiDqWmB9qU_SnRo@ebwge>wjWC2kXQorrusb-^M^Ho6BNMJYIj(lg{CzAlr7+) z62GT>rVbyV0_E&&KQT^=VI~0Ug3)iQ%)&;Y>OL$~4mI?o7fACBX7Ec8m6cNOxzzgTGMTx%3DJ>&* uODPU|w71~j7Y77A0q?xb`Wws28M=#)+dMn literal 746 zcmV}70?-%r;SC0e?uU5 z?@NkS7RP}vN759HGn?UrtlU-k&EkD|ex`gwvPnu1t(-(5BwczSFEIVQ}#zR zye=3~E8;NL2+D7<<2TEf%^h+J{cB;m%E1IuhO3eVWBL&q*lyudp)>YW?1_%=5FEO5 z&z6flvJI(oakH#5#v-gzOpawcfNwiiQ%meKLt@n?)6O&1^vR!KX`69K!~(n+7c4Zk zgkQ}QI%S)Osox-o*Y{-T`SzxrAKD3gTA*OK?*9DQmX0OD9e~t`y+>UCj8P4ibvHUZ zKmZ>FYNE7`qd~S|ai#J(m9_p~^OdMFKn=J(fz2Q^D0Mw}^q~T=_sjW_LkboTO)%U2 z&la6vs5vQ7wXG*4Gky>8Nj$W2noDWYVR>Vd!ckx%~WkUjL2|HO(OcdDL#$35-U89J)5& z#LR>HYgeKU_$Hi^%&yEs@WmI>5qoozNmS?Cj8ykkoOc!r^buViUc`=?BL<35L^E&kgL&6(X>-Z*CkMp;^*<&~)a&Av&bs_we%?6x^Cm?Ug cQXW^)(geK7R?lV;5_vcjf;C89_Sb>u4xou|VgLXD diff --git a/.github/workflows/CD-time-tracker-ui.yml b/.github/workflows/CD-time-tracker-ui.yml index 35f334620..f4c22fa2f 100644 --- a/.github/workflows/CD-time-tracker-ui.yml +++ b/.github/workflows/CD-time-tracker-ui.yml @@ -34,8 +34,6 @@ jobs: CLIENT_ID: ${{ secrets.client_id }} CLIENT_URL: ${{ secrets.client_url }} STACK_EXCHANGE_ID: ${{ secrets.stack_exchange_id }} - AUTH_URL: ${{ secrets.AUTH_URL }} - AUTH_APP_NAME: ${{ secrets.AUTH_APP_NAME }} STACK_EXCHANGE_ACCESS_TOKEN: ${{ secrets.stack_exchange_access_token }} AZURE_APP_CONFIGURATION_CONNECTION_STRING: ${{ secrets.azure_app_configuration_connection_string }} run: | diff --git a/.github/workflows/CI-time-tracker-ui.yml b/.github/workflows/CI-time-tracker-ui.yml index 39e7b2087..6c971a73f 100644 --- a/.github/workflows/CI-time-tracker-ui.yml +++ b/.github/workflows/CI-time-tracker-ui.yml @@ -46,8 +46,6 @@ jobs: SCOPES: ${{ secrets.SCOPES }} CLIENT_ID: ${{ secrets.CLIENT_ID }} CLIENT_URL : ${{ secrets.CLIENT_URL }} - AUTH_URL: ${{ secrets.AUTH_URL }} - AUTH_APP_NAME: ${{ secrets.AUTH_APP_NAME }} STACK_EXCHANGE_ID: ${{ secrets.STACK_EXCHANGE_ID }} STACK_EXCHANGE_ACCESS_TOKEN: ${{ secrets.STACK_EXCHANGE_ACCESS_TOKEN }} AZURE_APP_CONFIGURATION_CONNECTION_STRING: ${{ secrets.AZURE_APP_CONFIGURATION_CONNECTION_STRING }} diff --git a/.github/workflows/time-tracker-ui-ci.yml b/.github/workflows/time-tracker-ui-ci.yml index 9a461e930..d7992606d 100644 --- a/.github/workflows/time-tracker-ui-ci.yml +++ b/.github/workflows/time-tracker-ui-ci.yml @@ -29,16 +29,12 @@ jobs: with: ssh-private-key: ${{ secrets.INFRA_TERRAFORM_MODULES_SSH_PRIV_KEY }} - - name: Unlock DEV secrets - uses: sliteteam/github-action-git-crypt-unlock@1.2.0 - env: - GIT_CRYPT_KEY: ${{ secrets.GIT_CRYPT_KEY_DEFAULT }} - - name: build docker run: make build - name: Running tests run: | + chmod -R 777 ./$home make test - name: Generate coverage report env: diff --git a/.prod.env b/.prod.env index 7faa2df46d12fe61ea012c0a21924623d1219f36..141800a505ae6667a0c9578f44c297d9e43868c6 100644 GIT binary patch literal 623 zcmV-#0+9UxM@dveQdv+`04$x=-hyPkebi*k6*MXbdDamde~h^m#Nwhe3~3TP1%@GLFKj# z+{LPs5Rvmc_E#o$vB*Ngtv(0x8!wp2oyJO@L0SN|jMq`&s5ge_6|zG~E)NfYr+ne! zzh7R6mho}^IX^o$7<)ev4ut;+0_yDy7jDN`G>`;6;C^gI=IqlG3`XouGzS>mUQwpt zIEtXG8E8a~QuX@xI+|}{zvf_w;^Dz8ZKaJ~@eYdU_9~_RNoyB&EA9wkD_-9=(ilQz za)Q?8n0(%t>SMtLCT?~T#!e`vaZ{l`^ZP`?Z5W0uds6oK6Y(kw!W?e4C!<<{siELYTK)W*G6|@8o)Ta(M50aW_Pq#qqZ1B_Gv9ev4{`c38>`&OIV-Wkx26Cv8QZ(n{O2kyzLDQm5vAWVuEL{qQ+dPLrhJ5UC7s?ESqHAaZ^{{iM z^!As-0Y^g6w&ezIZ#GGX^~V09qhPl~KDV5VdgYrg^k5_2Nq z;r6&W%trs3KiA`*h_BwS>{4^sSK3idDsylGe#~Z>V)x}wBc_V JRo;)X{2+Cng93urBQsk(H8Fyu6eCi*Y|qb>kuFahJWgAg(eR!+si-f#{sQymCG_Zt@p2S7igBdi{-)?>D+_ z*Tu!545JOFp42nvl7%he3_1OIw2GqhBIOQTDS8fblt}ss!R8m+`>js+6I-wWzaU&$!cSq=r?9xS@)-1+%UPgKmm`vYx|1|jDpHqv*vANd&k~B{6^}i5 zO*BL~9dPgXC&Fi_D}Lc<@OB(tDRX19z}#%2y_lUdwO_@sQ8`Dq;yaFIzY1{B2ophl zFHwglb_NL>{9!ny-H~>mRRI#&9sxC)jg)<7`x%lyXVnkNBPl*x7{s&y{=(D;Ixt#$RWIn{a>%GXV`5Uz)7%hI7u46Wh#6(q6u4g4HPP5NxTN*u;9Bf z8%)d-CbxZHO%}GVm>TzJ@n0GMsb(o;&iA%gS%b$|tNvK4>0FPmpS2&JhR2qr7Cx4-8|4UE*C2XAf*^S_%~0 ftsjO|S3^5u$ZBg2m?*S6tS4p{4Xp4g@la$NpO{5S diff --git a/.stage.env b/.stage.env index 4be383343028dc474bbbbbf392f7a78d16fe08b1..563577e93a8564cbf7982429e8ed80e5c14b1589 100644 GIT binary patch literal 687 zcmV;g0#N+`M@dveQdv+`08R5iLPajdLgvHvEYPw^Nm=1;BvC$NmMv zX%$@7k1r@W1b!>phe?)-GG9Qx<|5!cuoOMOZb-9EsbFDaZ^ATj?hgeV`(}^YN)shg zLJoc_nQ4jPra983qj&Z?GJpk@!2y5zPp^;8{%x#Rt(+MMm2H}&7Fp!+PPtutA679i=;5x~2%3(`Bw zCfTON%ZP2vbVMYejQ9*+RhZ6y_X(h?C(I(?FWWgdH1R{H*;|E5Ipr5RHGDbRVem^v z7sv9!S)4{>bTF%VLf6Pt+?&3XSt{%tD}P^IDs%qScbdWvG(eQiguE1wJP>&K!m-zXO{+;d4r3uhpYF>R<}ZFN zV~t;X;lv1i8u1Jxk?dqg%!F&Xr-tMyr@P)6b`g$|X+>u;Sm?TeM=qsc@z58xCe4E@>n|ZJg{M{_$YLPx{8b92&)dza zB!;}Q0m-(xnNnAp!T*ISX$vs=>HoSJ+c>f1Gng)-uq%I!IImy&DDpP^xfT57B2ku5 z!g#=!+Yc4JgewGFLz~S-vC>`b&}oDmJwAI$!_*ihw&Na-{XKlk|Ff>4fZyeaEe99RbXED-8Ca++IzuXlbMC$}72&*=dR`Vtt>jS4k6U{u+>UIs_@n2bKu1`3z6?OpIQ!k4_K z4xnyat6r{{vucKomtrfU`RIdO<9Ggb>Mg zsf4el==na3G2#Z-ZmuRQi3&$@sh2dkgQP~>(2n_Q%wS$<`d^1&JdMP|aBnpjX${TA Fec@IoX(Rvu diff --git a/Makefile b/Makefile index 8be575f6b..db0a0ca24 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ remove: ## Delete container timetracker_ui. .PHONY: test test: ## Run all tests on docker container timetracker_ui at the CLI. docker-compose build timetracker_ui_test - docker-compose --env-file=.dev.env up -d timetracker_ui_test + docker-compose up -d timetracker_ui_test docker logs -f timetracker_ui_test .PHONY: testdev diff --git a/README.md b/README.md index ce0baa2f0..94e90975a 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,6 @@ In project path, open your favourite command line and run `npm install` in order # Prepare your environment -### **Local DNS Configuration** - -To test the application in a local environment please modify you `/etc/hosts` on Linux/Mac. In Windows `C:\Windows\System32\Drivers\etc\hosts` and add this line: -```text -127.0.0.1 timetracker-dev.ioet.com -``` - ### Set environment variables **1**. Using GPG create your key by running this command in your favourite command shell: `gpg --generate-key`. diff --git a/docker-compose.yml b/docker-compose.yml index 7d1f6e504..da0835dd7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,8 +3,6 @@ services: timetracker_ui: container_name: timetracker_ui image: timetracker_ui - env_file: - - .dev.env build: context: . dockerfile: ./Docker/Dockerfile.dev @@ -16,8 +14,6 @@ services: API_URL: ${API_URL} CLIENT_ID: ${CLIENT_ID} CLIENT_URL: ${CLIENT_URL} - AUTH_URL: ${AUTH_URL} - AUTH_APP_NAME: ${AUTH_APP_NAME} SCOPES: ${SCOPES} STACK_EXCHANGE_ID: ${STACK_EXCHANGE_ID} STACK_EXCHANGE_ACCESS_TOKEN: ${STACK_EXCHANGE_ACCESS_TOKEN} diff --git a/scripts/populate-keys.sh b/scripts/populate-keys.sh index 0a86def5d..7dd584214 100644 --- a/scripts/populate-keys.sh +++ b/scripts/populate-keys.sh @@ -5,8 +5,6 @@ echo "API_URL='$API_URL'" >> .env echo "AUTHORITY='$AUTHORITY'" >> .env echo "CLIENT_ID='$CLIENT_ID'" >> .env echo "CLIENT_URL='$CLIENT_URL'" >> .env -echo "AUTH_URL='$AUTH_URL'" >> .env -echo "AUTH_APP_NAME='$AUTH_APP_NAME'" >> .env echo "SCOPES='$SCOPES'" >> .env echo "STACK_EXCHANGE_ID='$STACK_EXCHANGE_ID'" >> .env echo "STACK_EXCHANGE_ACCESS_TOKEN='$STACK_EXCHANGE_ACCESS_TOKEN'" >> .env diff --git a/src/app/modules/activities-management/services/activity.service.ts b/src/app/modules/activities-management/services/activity.service.ts index d413e0c9a..e17cb728e 100644 --- a/src/app/modules/activities-management/services/activity.service.ts +++ b/src/app/modules/activities-management/services/activity.service.ts @@ -14,7 +14,7 @@ export class ActivityService { constructor(private http: HttpClient) {} getActivities(): Observable { - return this.http.get(this.baseUrl, { withCredentials: true }); + return this.http.get(this.baseUrl); } createActivity(activityData): Observable { @@ -23,12 +23,12 @@ export class ActivityService { tenant_id: '4225ab1e-1033-4a5f-8650-0dd4950f38c8', }; - return this.http.post(this.baseUrl, body, { withCredentials: true }); + return this.http.post(this.baseUrl, body); } deleteActivity(acitivityId: string): Observable { const url = `${this.baseUrl}/${acitivityId}`; - return this.http.delete(url, { withCredentials: true }); + return this.http.delete(url); } updateActivity(activityData): Observable { @@ -38,6 +38,6 @@ export class ActivityService { ...activityData, }; - return this.http.put(url, body, { withCredentials: true }); + return this.http.put(url, body); } } diff --git a/src/app/modules/customer-management/components/projects-type/services/project-type.service.ts b/src/app/modules/customer-management/components/projects-type/services/project-type.service.ts index 1c54fbea0..6d9e672c2 100644 --- a/src/app/modules/customer-management/components/projects-type/services/project-type.service.ts +++ b/src/app/modules/customer-management/components/projects-type/services/project-type.service.ts @@ -15,20 +15,20 @@ export class ProjectTypeService { getProjectTypes(customerId: any): Observable { const params = new HttpParams().set('customer_id', customerId.customerId); - return this.http.get(this.baseUrl, { params, withCredentials: true }); + return this.http.get(this.baseUrl, { params }); } createProjectType(projectTypeData): Observable { - return this.http.post(this.baseUrl, projectTypeData, { withCredentials: true }); + return this.http.post(this.baseUrl, projectTypeData); } deleteProjectType(projectTypeId: string): Observable { const url = `${this.baseUrl}/${projectTypeId}`; - return this.http.delete(url, { withCredentials: true }); + return this.http.delete(url); } updateProjectType(projectTypeData): Observable { const url = `${this.baseUrl}/${projectTypeData.id}`; - return this.http.put(url, projectTypeData, { withCredentials: true }); + return this.http.put(url, projectTypeData); } } diff --git a/src/app/modules/customer-management/components/projects/components/services/project.service.ts b/src/app/modules/customer-management/components/projects/components/services/project.service.ts index 4ae84c095..c5b431b1a 100644 --- a/src/app/modules/customer-management/components/projects/components/services/project.service.ts +++ b/src/app/modules/customer-management/components/projects/components/services/project.service.ts @@ -17,19 +17,19 @@ export class ProjectService { getProjects(customerId: any): Observable { const params = new HttpParams().set('customer_id', customerId.customerId); - return this.http.get(this.url, { params, withCredentials: true }); + return this.http.get(this.url, { params }); } getAllProjects(): Observable { - return this.http.get(this.url, { withCredentials: true }); + return this.http.get(this.url); } getRecentProjects(): Observable { - return this.http.get(`${this.url}/recent`, { withCredentials: true }); + return this.http.get(`${this.url}/recent`); } createProject(projectData): Observable { - return this.http.post(this.url, projectData, { withCredentials: true }); + return this.http.post(this.url, projectData); } updateProject(projectData): Observable { @@ -39,12 +39,12 @@ export class ProjectService { projectData.status = 1; } } - return this.http.put(`${this.url}/${id}`, projectData, { withCredentials: true }); + return this.http.put(`${this.url}/${id}`, projectData); } deleteProject(projectId: string): Observable { return this.isDevelopmentOrProd ? this.http.put(`${this.url}/${projectId}`, { status: 0 }) - : this.http.delete(`${this.url}/${projectId}`, { withCredentials: true }); + : this.http.delete(`${this.url}/${projectId}`); } } diff --git a/src/app/modules/customer-management/services/customer.service.ts b/src/app/modules/customer-management/services/customer.service.ts index 880e58fc2..cc930a54c 100644 --- a/src/app/modules/customer-management/services/customer.service.ts +++ b/src/app/modules/customer-management/services/customer.service.ts @@ -13,20 +13,20 @@ export class CustomerService { constructor(private http: HttpClient) {} createCustomer(customerData): Observable { - return this.http.post(this.baseUrl, customerData, { withCredentials: true }); + return this.http.post(this.baseUrl, customerData); } getCustomers(): Observable { - return this.http.get(this.baseUrl, { withCredentials: true }); + return this.http.get(this.baseUrl); } deleteCustomer(customerId: string): Observable { const url = `${this.baseUrl}/${customerId}`; - return this.http.delete(url, { withCredentials: true }); + return this.http.delete(url); } updateCustomer(customerData): Observable { const url = `${this.baseUrl}/${customerData.id}`; - return this.http.put(url, customerData, { withCredentials: true }); + return this.http.put(url, customerData); } } diff --git a/src/app/modules/login/login.component.html b/src/app/modules/login/login.component.html index 43e07d27d..9ad2d90d3 100644 --- a/src/app/modules/login/login.component.html +++ b/src/app/modules/login/login.component.html @@ -11,6 +11,15 @@

Please log in

- +
+
+
diff --git a/src/app/modules/login/login.component.spec.ts b/src/app/modules/login/login.component.spec.ts index 99cf8b6bf..9de359249 100644 --- a/src/app/modules/login/login.component.spec.ts +++ b/src/app/modules/login/login.component.spec.ts @@ -99,16 +99,6 @@ describe('LoginComponent', () => { expect(component).toBeTruthy(); }); - it('should set local storage when the component is initialized and is not legacy production', inject([Router], (router: Router) => { - component.isProduction = false; - spyOn(loginService, 'getUser').and.returnValue(of(userTest)); - spyOn(loginService, 'setLocalStorage'); - - component.ngOnInit(); - - expect(loginService.setLocalStorage).toHaveBeenCalled(); - })); - it('should sign up or login with google if is not logged-in into the app on Production', inject([Router], (router: Router) => { spyOn(azureAdB2CService, 'isLogin').and.returnValue(false); spyOn(azureAdB2CService, 'setCookies').and.returnValue(); diff --git a/src/app/modules/login/login.component.ts b/src/app/modules/login/login.component.ts index 070a2f38f..792fc56e9 100644 --- a/src/app/modules/login/login.component.ts +++ b/src/app/modules/login/login.component.ts @@ -22,8 +22,6 @@ declare global { export class LoginComponent implements OnInit { isProduction = environment.production === EnvironmentType.TT_PROD_LEGACY; cliendId = CLIENT_URL; - authUrl = environment.authUrl; - authAppName = environment.authAppName; auth2: any; @@ -36,16 +34,57 @@ export class LoginComponent implements OnInit { private ngZone?: NgZone ) {} + + googleAuthSDK() { + const sdkLoaded = 'googleSDKLoaded'; + const gapi = 'gapi'; + + (window as any)[sdkLoaded] = () => { + (window as any)[gapi].load('auth2', () => { + this.auth2 = ( window as any)[gapi].auth2.init({ + client_id: this.cliendId, + plugin_name: 'login', + cookiepolicy: 'single_host_origin', + scope: 'profile email' + }); + }); + }; + + (async (d, s, id) => { + const keyGoogle = 'src'; + const gjs = d.getElementsByTagName(s)[1]; + let js = gjs; + if (d.getElementById(id)) { return; } + js = d.createElement(s); js.id = id; + js[keyGoogle] = 'https://accounts.google.com/gsi/client'; + gjs.parentNode.insertBefore(js, gjs); + })(document, 'script', 'async defer'); + } + ngOnInit() { - if (!this.isProduction) { - this.loginService.getUser(null).subscribe((resp) => { - this.loginService.setCookies(); - const tokenObject = JSON.stringify(resp); - const tokenJson = JSON.parse(tokenObject); - this.loginService.setLocalStorage('user', tokenJson.token); - this.ngZone.run(() => this.router.navigate([''])); + + this.googleAuthSDK(); + if (this.isProduction && this.azureAdB2CService.isLogin()) { + this.router.navigate(['']); + } else { + this.loginService.isLogin().subscribe(isLogin => { + if (isLogin) { + this.router.navigate(['']); + } }); } + window.handleCredentialResponse = (response) => { + const {credential = ''} = response; + this.featureToggleCookiesService.setCookies(); + this.loginService.setLocalStorage('idToken', credential); + this.loginService.getUser(credential).subscribe((resp) => { + this.loginService.setCookies(); + const tokenObject = JSON.stringify(resp); + const tokenJson = JSON.parse(tokenObject); + this.loginService.setLocalStorage('user', tokenJson.token); + this.ngZone.run(() => this.router.navigate([''])); + }); + }; } login(): void { @@ -67,8 +106,4 @@ export class LoginComponent implements OnInit { } } - loginAuth() { - window.location.href = `${this.authUrl}/authn/login/${this.authAppName}`; - } - } diff --git a/src/app/modules/login/services/login.service.spec.ts b/src/app/modules/login/services/login.service.spec.ts index 67fe3498f..94e246cc6 100644 --- a/src/app/modules/login/services/login.service.spec.ts +++ b/src/app/modules/login/services/login.service.spec.ts @@ -4,7 +4,6 @@ import { TestBed } from '@angular/core/testing'; import { JwtHelperService } from '@auth0/angular-jwt'; import { SocialAuthService } from 'angularx-social-login'; import { CookieService } from 'ngx-cookie-service'; -import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; import { LoginService } from './login.service'; @@ -24,11 +23,11 @@ describe('LoginService', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [HttpClientTestingModule, RouterTestingModule.withRoutes([])], + imports: [HttpClientTestingModule], providers: [ { providers: CookieService, useValue: cookieStoreStub }, { provide: SocialAuthService, useValue: socialAuthServiceStub }, - { provide: HttpClient, useValue: httpClientSpy }, + { provide: HttpClient, useValue: httpClientSpy } ], }); service = TestBed.inject(LoginService); @@ -123,7 +122,6 @@ describe('LoginService', () => { it('should logout with social angularx-social-login', () => { spyOn(cookieService, 'deleteAll').and.returnValue(); - spyOn(service, 'invalidateSessionCookie').and.returnValue(of(true)); service.logout(); @@ -131,11 +129,6 @@ describe('LoginService', () => { expect(cookieService.deleteAll).toHaveBeenCalled(); }); - it('should return an http observable when call invalidateSessionCooke', () => { - const result = service.invalidateSessionCookie(); - expect(result).toBeDefined(); - }); - it('should call cookieService when app is isLegacyProd', () => { service.isLegacyProd = true; service.localStorageKey = 'user2'; diff --git a/src/app/modules/login/services/login.service.ts b/src/app/modules/login/services/login.service.ts index 061a98cb4..8a0869829 100644 --- a/src/app/modules/login/services/login.service.ts +++ b/src/app/modules/login/services/login.service.ts @@ -1,12 +1,11 @@ import { HttpClient } from '@angular/common/http'; -import { Injectable, NgZone } from '@angular/core'; +import { Injectable } from '@angular/core'; import { CookieService } from 'ngx-cookie-service'; import { EnvironmentType, UserEnum } from 'src/environments/enum'; import { environment } from 'src/environments/environment'; import { JwtHelperService } from '@auth0/angular-jwt'; import { map } from 'rxjs/operators'; import { of } from 'rxjs'; -import { Router } from '@angular/router'; @Injectable({ providedIn: 'root' @@ -16,29 +15,18 @@ export class LoginService { helper: JwtHelperService; isLegacyProd: boolean = environment.production === EnvironmentType.TT_PROD_LEGACY; localStorageKey = this.isLegacyProd ? 'user2' : 'user'; - ngZone?: NgZone; - constructor( private http?: HttpClient, private cookieService?: CookieService, - private router?: Router, ) { this.baseUrl = `${environment.timeTrackerApiUrl}/users`; this.helper = new JwtHelperService(); - this.router = router; } logout() { - localStorage.clear(); this.cookieService.deleteAll(); - this.invalidateSessionCookie().toPromise().then(() => { - this.router.navigate(['login']); - }); - } - - invalidateSessionCookie() { - return this.http.post(`${this.baseUrl}/logout`, null, { withCredentials: true }); + localStorage.clear(); } isLogin() { @@ -104,7 +92,7 @@ export class LoginService { token: tokenString, }; - return this.http.post(`${this.baseUrl}/login`, body, { withCredentials: true }); + return this.http.post(`${this.baseUrl}/login`, body); } setCookies() { @@ -121,7 +109,7 @@ export class LoginService { isValidToken(token: string) { const body = { token }; - return this.http.post(`${this.baseUrl}/validate-token`, body, { withCredentials: true }).pipe( + return this.http.post(`${this.baseUrl}/validate-token`, body).pipe( map((response) => { const responseString = JSON.stringify(response); const responseJson = JSON.parse(responseString); @@ -132,4 +120,5 @@ export class LoginService { }) ); } + } diff --git a/src/app/modules/shared/components/dark-mode/dark-mode.component.spec.ts b/src/app/modules/shared/components/dark-mode/dark-mode.component.spec.ts index cf421cb9e..e9e81b6ff 100644 --- a/src/app/modules/shared/components/dark-mode/dark-mode.component.spec.ts +++ b/src/app/modules/shared/components/dark-mode/dark-mode.component.spec.ts @@ -7,7 +7,6 @@ import { FeatureToggleGeneralService } from '../../feature-toggles/feature-toggl import { FeatureToggleModel } from '../../feature-toggles/feature-toggle.model'; import { FeatureFilterModel } from '../../feature-toggles/filters/feature-filter.model'; import { DarkModeComponent } from './dark-mode.component'; -import { RouterTestingModule } from '@angular/router/testing'; describe('DarkModeComponent', () => { let component: DarkModeComponent; @@ -18,7 +17,7 @@ describe('DarkModeComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ declarations: [DarkModeComponent], - imports: [HttpClientTestingModule, RouterTestingModule.withRoutes([])], + imports: [HttpClientTestingModule], providers: [{ provide: SocialAuthService, useValue: socialAuthServiceStub }] }).compileComponents(); }); diff --git a/src/app/modules/shared/components/sidebar/sidebar.component.html b/src/app/modules/shared/components/sidebar/sidebar.component.html index d76e5da99..66d7881b5 100644 --- a/src/app/modules/shared/components/sidebar/sidebar.component.html +++ b/src/app/modules/shared/components/sidebar/sidebar.component.html @@ -17,10 +17,10 @@

{{ item.text }}

@@ -40,10 +40,10 @@

{{ item.text }}
-
+
- + \ No newline at end of file diff --git a/src/app/modules/shared/components/sidebar/sidebar.component.scss b/src/app/modules/shared/components/sidebar/sidebar.component.scss index 5b7ecb78c..7b1bfa5f6 100644 --- a/src/app/modules/shared/components/sidebar/sidebar.component.scss +++ b/src/app/modules/shared/components/sidebar/sidebar.component.scss @@ -4,10 +4,6 @@ body { overflow-x: hidden; } -button.logout:active { - outline: none; -} - #sidebar-wrapper { min-height: 100vh; margin-left: -15rem; @@ -80,4 +76,4 @@ button.logout:active { height: -webkit-calc(100vh - 1vh); height: -o-calc(100vh - 1vh); height: calc(100vh - 1vh); -} +} \ No newline at end of file diff --git a/src/app/modules/shared/components/sidebar/sidebar.component.spec.ts b/src/app/modules/shared/components/sidebar/sidebar.component.spec.ts index de989047d..7603ca631 100644 --- a/src/app/modules/shared/components/sidebar/sidebar.component.spec.ts +++ b/src/app/modules/shared/components/sidebar/sidebar.component.spec.ts @@ -14,7 +14,7 @@ describe('SidebarComponent', () => { let azureAdB2CServiceStubInjected; let loginServiceStubInjected: LoginService; let userInfoService: UserInfoService; - let router: Router; + let router; const routes: Routes = [{ path: 'time-clock', component: TimeClockComponent }]; const azureAdB2CServiceStub = { diff --git a/src/app/modules/shared/feature-toggles/feature-toggle-cookies/feature-toggle-cookies.service.spec.ts b/src/app/modules/shared/feature-toggles/feature-toggle-cookies/feature-toggle-cookies.service.spec.ts index 0d21d38b0..1fe77a7f3 100644 --- a/src/app/modules/shared/feature-toggles/feature-toggle-cookies/feature-toggle-cookies.service.spec.ts +++ b/src/app/modules/shared/feature-toggles/feature-toggle-cookies/feature-toggle-cookies.service.spec.ts @@ -7,7 +7,6 @@ import { FeatureToggleGeneralService } from '../feature-toggle-general/feature-t import { FeatureToggleModel } from '../feature-toggle.model'; import { TargetingFeatureFilterModel } from '../filters/targeting/targeting-feature-filter.model'; import { FeatureToggleCookiesService } from './feature-toggle-cookies.service'; -import { RouterTestingModule } from '@angular/router/testing'; describe('FeatureToggleCookiesService', () => { let cookieService: CookieService; @@ -17,7 +16,7 @@ describe('FeatureToggleCookiesService', () => { const socialAuthServiceStub = jasmine.createSpyObj('SocialAuthService', ['authState']); beforeEach(() => { TestBed.configureTestingModule({ - imports: [HttpClientTestingModule, RouterTestingModule.withRoutes([])], + imports: [HttpClientTestingModule], providers: [CookieService, FeatureToggleGeneralService, { provide: SocialAuthService, useValue: socialAuthServiceStub } ] diff --git a/src/app/modules/shared/feature-toggles/feature-toggle-general/feature-toggle-general.service.spec.ts b/src/app/modules/shared/feature-toggles/feature-toggle-general/feature-toggle-general.service.spec.ts index 8a8e8eb38..60becca27 100644 --- a/src/app/modules/shared/feature-toggles/feature-toggle-general/feature-toggle-general.service.spec.ts +++ b/src/app/modules/shared/feature-toggles/feature-toggle-general/feature-toggle-general.service.spec.ts @@ -6,7 +6,6 @@ import { FeatureToggleModel } from '../feature-toggle.model'; import { TargetingFeatureFilterModel } from '../filters/targeting/targeting-feature-filter.model'; import { HttpClientTestingModule } from '@angular/common/http/testing'; import { SocialAuthService } from 'angularx-social-login'; -import { RouterTestingModule } from '@angular/router/testing'; describe('FeatureToggleGeneralService', () => { @@ -16,7 +15,7 @@ describe('FeatureToggleGeneralService', () => { const socialAuthServiceStub = jasmine.createSpyObj('SocialAuthService', ['authState']); beforeEach(() => { TestBed.configureTestingModule({ - imports: [HttpClientTestingModule, RouterTestingModule.withRoutes([])], + imports: [HttpClientTestingModule], providers: [ { provide: FeatureManagerService }, { provide: SocialAuthService, useValue: socialAuthServiceStub } diff --git a/src/app/modules/time-clock/pages/time-clock.component.spec.ts b/src/app/modules/time-clock/pages/time-clock.component.spec.ts index 8f9b7075f..d5dd535fc 100644 --- a/src/app/modules/time-clock/pages/time-clock.component.spec.ts +++ b/src/app/modules/time-clock/pages/time-clock.component.spec.ts @@ -14,7 +14,6 @@ import { EntryFieldsComponent } from '../components/entry-fields/entry-fields.co import { ToastrService } from 'ngx-toastr'; import { LoginService } from '../../login/services/login.service'; import { SocialAuthService } from 'angularx-social-login'; -import { RouterTestingModule } from '@angular/router/testing'; describe('TimeClockComponent', () => { let component: TimeClockComponent; @@ -56,7 +55,7 @@ describe('TimeClockComponent', () => { beforeEach( waitForAsync(() => { TestBed.configureTestingModule({ - imports: [HttpClientTestingModule, RouterTestingModule], + imports: [HttpClientTestingModule], declarations: [TimeClockComponent, ProjectListHoverComponent, FilterProjectPipe, EntryFieldsComponent], providers: [ FormBuilder, diff --git a/src/app/modules/time-clock/services/entry.service.ts b/src/app/modules/time-clock/services/entry.service.ts index 76c970da1..e8b9a1b63 100644 --- a/src/app/modules/time-clock/services/entry.service.ts +++ b/src/app/modules/time-clock/services/entry.service.ts @@ -23,53 +23,49 @@ export class EntryService { urlInProductionLegacy = environment.production === EnvironmentType.TT_PROD_LEGACY; loadActiveEntry(): Observable { - return this.http.get(`${this.baseUrl}/running`, { withCredentials: true }); + return this.http.get(`${this.baseUrl}/running`); } loadEntries(date): Observable { const timezoneOffset = new Date().getTimezoneOffset(); - return this.http.get( - `${this.baseUrl}?month=${date.month}&year=${date.year}&timezone_offset=${timezoneOffset}`, - { withCredentials: true } - ); + return this.http.get(`${this.baseUrl}?month=${date.month}&year=${date.year}&timezone_offset=${timezoneOffset}`); } createEntry(entryData): Observable { - return this.http.post(this.baseUrl, entryData, { withCredentials: true }); + return this.http.post(this.baseUrl, entryData); } updateEntry(entryData): Observable { const {id} = entryData; - return this.http.put(`${this.baseUrl}/${id}`, entryData, { withCredentials: true }); + return this.http.put(`${this.baseUrl}/${id}`, entryData); } deleteEntry(entryId: string): Observable { const url = `${this.baseUrl}/${entryId}`; - return this.http.delete(url, { withCredentials: true }); + return this.http.delete(url); } stopEntryRunning(idEntry: string): Observable { return (this.urlInProductionLegacy ? - this.http.post(`${this.baseUrl}/${idEntry}/stop`, null, { withCredentials: true }) : - this.http.put(`${this.baseUrl}/stop`, null, { withCredentials: true }) ); + this.http.post(`${this.baseUrl}/${idEntry}/stop`, null) : this.http.put(`${this.baseUrl}/stop`, null) ); } restartEntry(idEntry: string): Observable { const url = `${this.baseUrl}/${idEntry}/restart`; - return this.http.post(url, null, { withCredentials: true }); + return this.http.post(url, null); } summary(): Observable { const timeOffset = new Date().getTimezoneOffset(); const summaryUrl = `${this.baseUrl}/summary?time_offset=${timeOffset}`; - return this.http.get(summaryUrl, { withCredentials: true }); + return this.http.get(summaryUrl); } findEntriesByProjectId(projectId: string): Observable { const startDate = this.getDateLastMonth(); const endDate = this.getCurrentDate(); const findEntriesByProjectURL = `${this.baseUrl}?limit=2&project_id=${projectId}&start_date=${startDate}&end_date=${endDate}`; - return this.http.get(findEntriesByProjectURL, { withCredentials: true }); + return this.http.get(findEntriesByProjectURL); } loadEntriesByTimeRange(range: TimeEntriesTimeRange, userId: string): Observable { @@ -83,8 +79,7 @@ export class EntryService { user_id: userId, limit: `${MAX_NUMBER_OF_ENTRIES_FOR_REPORTS}`, timezone_offset : new Date().getTimezoneOffset().toString(), - }, - withCredentials: true + } } ); } diff --git a/src/app/modules/user/services/user.service.ts b/src/app/modules/user/services/user.service.ts index fffa3268e..0eeb6a9ea 100644 --- a/src/app/modules/user/services/user.service.ts +++ b/src/app/modules/user/services/user.service.ts @@ -16,6 +16,6 @@ export class UserService { loadUser(userId: any): Observable { const url = `${this.baseUrl}/${userId}`; - return this.http.get(url, { withCredentials: true }); + return this.http.get(url); } } diff --git a/src/app/modules/users/components/users-list/users-list.component.spec.ts b/src/app/modules/users/components/users-list/users-list.component.spec.ts index 87f239920..ada0b01ef 100644 --- a/src/app/modules/users/components/users-list/users-list.component.spec.ts +++ b/src/app/modules/users/components/users-list/users-list.component.spec.ts @@ -9,7 +9,6 @@ import { DataTablesModule } from 'angular-datatables'; import { GrantUserRole, RevokeUserRole } from '../../store/user.actions'; import { ROLES } from '../../../../../environments/environment'; import { LoginService } from '../../../login/services/login.service'; -import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; import { UserInfoService } from 'src/app/modules/user/services/user-info.service'; @@ -45,7 +44,7 @@ describe('UsersListComponent', () => { beforeEach( waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NgxPaginationModule, DataTablesModule, HttpClientTestingModule, RouterTestingModule.withRoutes([])], + imports: [NgxPaginationModule, DataTablesModule, HttpClientTestingModule], declarations: [UsersListComponent], providers: [provideMockStore({ initialState: state }), { provide: ActionsSubject, useValue: actionSub }, diff --git a/src/app/modules/users/services/users.service.ts b/src/app/modules/users/services/users.service.ts index 6a36bd2a9..5f6ba6ea6 100644 --- a/src/app/modules/users/services/users.service.ts +++ b/src/app/modules/users/services/users.service.ts @@ -15,30 +15,30 @@ export class UsersService { baseUrl = `${environment.timeTrackerApiUrl}/users`; loadUsers(): Observable { - return this.http.get(this.baseUrl, { withCredentials: true }); + return this.http.get(this.baseUrl); } grantRole(userId: string, roleId: string): Observable { const url = this.isProductionLegacy ? `${this.baseUrl}/${userId}/roles/${roleId}/grant` : `${this.baseUrl}/${userId}/${roleId}/grant`; - return this.http.post(url, null, { withCredentials: true }); + return this.http.post(url, null); } revokeRole(userId: string, roleId: string): Observable { const url = this.isProductionLegacy ? `${this.baseUrl}/${userId}/roles/${roleId}/revoke` : `${this.baseUrl}/${userId}/${roleId}/revoke`; - return this.http.post(url, null, { withCredentials: true }); + return this.http.post(url, null); } addUserToGroup(userId: string, group: string): Observable { return this.http.post(`${this.baseUrl}/${userId}/groups/add`, { group_name: group, - }, { withCredentials: true }); + }); } removeUserFromGroup(userId: string, group: string): Observable { return this.http.post(`${this.baseUrl}/${userId}/groups/remove`, { group_name: group, - }, { withCredentials: true }); + }); } } diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index e679026f4..cc90f444f 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -4,8 +4,6 @@ export const environment = { production: EnvironmentType.TT_PROD, timeTrackerApiUrl: process.env["API_URL"], stackexchangeApiUrl: 'https://api.stackexchange.com', - authUrl: process.env['AUTH_URL'], - authAppName: process.env['AUTH_APP_NAME'], }; export const AUTHORITY = process.env["AUTHORITY"]; diff --git a/src/environments/environment.prodlegacy.ts b/src/environments/environment.prodlegacy.ts index 67f0d76e7..340d9fa80 100644 --- a/src/environments/environment.prodlegacy.ts +++ b/src/environments/environment.prodlegacy.ts @@ -2,7 +2,7 @@ import { EnvironmentType } from './enum'; export const environment = { production: EnvironmentType.TT_PROD_LEGACY, - timeTrackerApiUrl: process.env["API_URL"], + timeTrackerApiUrl: process.env["API_URL"], stackexchangeApiUrl: 'https://api.stackexchange.com', authUrl: process.env['AUTH_URL'], authAppName: process.env['AUTH_APP_NAME'] diff --git a/src/environments/environment.ts b/src/environments/environment.ts index e724acd9c..f5e34a552 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -8,14 +8,11 @@ export const environment = { production: EnvironmentType.TT_DEV, timeTrackerApiUrl: process.env['API_URL'], stackexchangeApiUrl: 'https://api.stackexchange.com', - authUrl: process.env['AUTH_URL'], - authAppName: process.env['AUTH_APP_NAME'], }; export const AUTHORITY = process.env['AUTHORITY']; export const CLIENT_ID = process.env['CLIENT_ID']; export const CLIENT_URL = process.env['CLIENT_URL']; -export const AUTH_URL = process.env['AUTH_URL']; export const SCOPES = process.env['SCOPES'].split(','); export const STACK_EXCHANGE_ID = process.env['STACK_EXCHANGE_ID']; export const STACK_EXCHANGE_ACCESS_TOKEN = process.env['STACK_EXCHANGE_ACCESS_TOKEN']; diff --git a/src/polyfills.ts b/src/polyfills.ts index 1c2217734..03711e5d9 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -61,7 +61,3 @@ import 'zone.js/dist/zone'; // Included with Angular CLI. /*************************************************************************************************** * APPLICATION IMPORTS */ - -(window as any).process = { - env: { DEBUG: undefined }, -}; diff --git a/webpack.config.js b/webpack.config.js index 357929357..44c1ce497 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -13,8 +13,6 @@ module.exports = (config) => { 'process.env.AUTHORITY': JSON.stringify(process.env["AUTHORITY"]), 'process.env.API_URL':JSON.stringify(process.env["API_URL"]), 'process.env.CLIENT_ID':JSON.stringify(process.env["CLIENT_ID"]), - 'process.env.AUTH_URL':JSON.stringify(process.env["AUTH_URL"]), - 'process.env.AUTH_APP_NAME':JSON.stringify(process.env["AUTH_APP_NAME"]), 'process.env.CLIENT_URL':JSON.stringify(process.env["CLIENT_URL"]), 'process.env.SCOPES':JSON.stringify(process.env["SCOPES"]), 'process.env.STACK_EXCHANGE_ID':JSON.stringify(process.env["STACK_EXCHANGE_ID"]), From ab393cf7a01542b3efc3f328fa76968d2ed14d80 Mon Sep 17 00:00:00 2001 From: Andres C Date: Thu, 27 Oct 2022 14:30:14 -0400 Subject: [PATCH 04/64] fix: added valid stage envs --- .stage.env | Bin 687 -> 639 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/.stage.env b/.stage.env index 563577e93a8564cbf7982429e8ed80e5c14b1589..7e97985779683edd93f1f6db371dc95ee7477102 100644 GIT binary patch literal 639 zcmV-_0)YJhM@dveQdv+`0AS#hnTtw&YS9a`U7zlaLM$)a-nh4(wgba!!iLp8pOxbQ&{d!Tp*(A<`XP7!1 zm|qML1##Nh3tA{blahW+2>Tpm+x|zGVmyyS;+9I5F8{QT7V3o*Vd>+!DfEFG~Y2#szf>IBIzQ z^iq-=y=%@vTn11-#?~I>C$Q$>mdImE&WgD1n?XeuY5k4}SAVYo0IfIF7sw`rW$hE| zeXmoUXkwlrM3;B99Y_HSktrBrz|nsf#F>m3XVgzTl?B{#DXC#ntt%3txh`a3*d%yl zR?HBvIYY3?v|i(+{b4uHp!AeSMRVECvz1Uk|I37iR8V(yo>s^1N8q(F!}|XBT3(;M zN@i1~@ugnoI@{tfU*+>Qh{dI^u4Xq1tik#bZHOQha!a0 zug8vm>yGse%frK#bfZPTgv2sYb-yyA#!k%};PR)L_p1uaQBkN;OF9jH5x?t-db9SL Zz;M+b3%On@XFOGRrX<`o0U}8M$NmMv zX%$@7k1r@W1b!>phe?)-GG9Qx<|5!cuoOMOZb-9EsbFDaZ^ATj?hgeV`(}^YN)shg zLJoc_nQ4jPra983qj&Z?GJpk@!2y5zPp^;8{%x#Rt(+MMm2H}&7Fp!+PPtutA679i=;5x~2%3(`Bw zCfTON%ZP2vbVMYejQ9*+RhZ6y_X(h?C(I(?FWWgdH1R{H*;|E5Ipr5RHGDbRVem^v z7sv9!S)4{>bTF%VLf6Pt+?&3XSt{%tD}P^IDs%qScbdWvG(eQigu Date: Thu, 27 Oct 2022 14:30:54 -0400 Subject: [PATCH 05/64] fix: added valid prod envs --- .prod.env | Bin 623 -> 633 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/.prod.env b/.prod.env index 141800a505ae6667a0c9578f44c297d9e43868c6..b245c8510ddd48767e8c79053504caa5b3974306 100644 GIT binary patch literal 633 zcmV-<0*3tnM@dveQdv+`06D=)kO@E7;9^|+;!>FZL*lJxhabw9(B7$8{kphT_>*n5 z&2Sz|Z2F)7SlZ%3GJN{6lyIVS`GkV2^ImO4f8E%!m*;vYqzXtX6#A)()QB~0Nha?? zF%5K(dy^YShuWkcWBVRUs_IWGw4H&i%OoSiRneR`$88Sd2{7L;Ck8uxdKF|E^MUWc zY)018!uTD+H&11}hi~iA#wU^gyYyR$k0g^!u_oDt$6)rAr0~#h^D)GasA&aUGagkB zBKfxz*TF#;o%Y6UEwQ20Nle`SV_c-97*R%#z0`Voe7Y#S#uLr!pPCHAw!H;X^fA9r zRPKM);~bLh>*4mv(=&)?5!P+fwA?pnY4WXG@kg}|&tSOy809}Cw4E+|see+mszZ-k zL2_0d`IyFt688s8946t-R#yJRS#{%x#pRyRT=)ueT&vnj2b>QWmteO&SCmQIe@6Zu zx|OSU0B_9(`=!DTkbI0eGVNNrnvzqWQFAcuA&sT^@(m z11pvZA=JOGl)qqyo6LQEjs$s^ z-#?Gif+pn`Ojw#ik!MVYW;G)o>!4Oc`>yeF-91k^BHxcGutu1IMFu$1--WUT83%d$ z%X;!u`VhcT7vi;!bE^<_R$L+jk{C#zjgl3?(W?c_2rE2I(Kd4mgR>mvhNMPZlwVHy TbC;Pvpf4sOe^RMqjdJyfD_TIc literal 623 zcmV-#0+9UxM@dveQdv+`04$x=-hyPkebi*k6*MXbdDamde~h^m#Nwhe3~3TP1%@GLFKj# z+{LPs5Rvmc_E#o$vB*Ngtv(0x8!wp2oyJO@L0SN|jMq`&s5ge_6|zG~E)NfYr+ne! zzh7R6mho}^IX^o$7<)ev4ut;+0_yDy7jDN`G>`;6;C^gI=IqlG3`XouGzS>mUQwpt zIEtXG8E8a~QuX@xI+|}{zvf_w;^Dz8ZKaJ~@eYdU_9~_RNoyB&EA9wkD_-9=(ilQz za)Q?8n0(%t>SMtLCT?~T#!e`vaZ{l`^ZP`?Z5W0uds6oK6Y(kw!W?e4C!<<{siELYTK)W*G6|@8o)Ta(M50aW_Pq#qqZ1B_Gv9ev4{`c38>`&OIV-Wkx26Cv8QZ(n{O2kyzLDQm5vAWVuEL{qQ+dPLrhJ5UC7s?ESqHAaZ^{{iM z^!As-0Y^g6w&ezIZ#GGX^~V09qhPl~KDV5VdgYrg^k5_2Nq z;r6&W%trs3KiA`*h_BwS>{4^sSK3idDsylGe#~Z>V)x}wBc_V JRo;)X{2+ Date: Thu, 27 Oct 2022 14:31:44 -0400 Subject: [PATCH 06/64] fix: added valid env envs --- .dev.env | Bin 608 -> 607 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/.dev.env b/.dev.env index 7e4a97803a72483670c5c6415995ff46a1d44506..5db598c8d5fc1f09be3da5d92834511cff4108ad 100644 GIT binary patch literal 607 zcmV-l0-*f>M@dveQdv+`0H!&9AOfcH?Q=@FZP%E3cm18^r4p$3Fa6v>3=q{6PtZG_ z7OtGV)c8~IY?eDmRXU*f__2jx{=hQXxORwdY4EGcj^Rs}r9iXpH^d1@#F5}?j2LGR zh1DFCCc<`8SD7@lm1Yx5=&sA-c{DQs$#Qd44l^bBG*vSy#WX1(|9noVld!q=v~K~U zgPPGZ9q+e)xRQYwqx|Uf*Z8!5Ll5ySv`llf4|^#mwFw3EisnAT&|$eFEkw47MCyzU z{x8Y6%w``KeF?`Q`9?a56OOMV2k%WFG=H%5kEjWh+EK1&VSyh%P|3cJr|wGPN7kmp zj71$@tM^HXYI0&WapAimfYS=dwK|Gw*`8M zPOo-FDs`tkK9Wvh=pq7kX`G-+BLfsP!Qn*t@IO22J(eDAWMri9<0F+9-z7r0R}7k` t^RtsHZbmj}P4@mo#`HX``acA(Ou- z{y5M%c!5U@tGJu;{4shY=$R%)auJ+lMih&5WzNzaO31PhaL_}eFYO6a*Wa4b_ExNn z-kXQFD(rcenfTX#l%7>2&^N9Xy5eduJ2BrDiDqWmB9qU_SnRo@ebwge>wjWC2kXQorrusb-^M^Ho6BNMJYIj(lg{CzAlr7+) z62GT>rVbyV0_E&&KQT^=VI~0Ug3)iQ%)&;Y>OL$~4mI?o7fACBX7Ec8m6cNOxzzgTGMTx%3DJ>&* uODPU|w71~j7Y77A0q?xb`Wws28M=#)+dMn From 3341e03c457a85325c5fa82afa689603006902f7 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 27 Oct 2022 18:34:40 +0000 Subject: [PATCH 07/64] chore(release): 1.75.40 [skip ci]nn --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9f01219e0..346262d65 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "time-tracker", - "version": "1.75.24", + "version": "1.75.40", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index bbeb9c3f4..0fad3f42e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "time-tracker", - "version": "1.75.24", + "version": "1.75.40", "scripts": { "preinstall": "npx npm-force-resolutions", "ng": "ng", From eed3671a7df106dac6c90bc79084c8baae7d7df8 Mon Sep 17 00:00:00 2001 From: Andres C Date: Thu, 27 Oct 2022 15:07:21 -0400 Subject: [PATCH 08/64] fix legacy routing --- src/environments/environment.prodlegacy.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/environments/environment.prodlegacy.ts b/src/environments/environment.prodlegacy.ts index 340d9fa80..c372c3ae4 100644 --- a/src/environments/environment.prodlegacy.ts +++ b/src/environments/environment.prodlegacy.ts @@ -4,8 +4,6 @@ export const environment = { production: EnvironmentType.TT_PROD_LEGACY, timeTrackerApiUrl: process.env["API_URL"], stackexchangeApiUrl: 'https://api.stackexchange.com', - authUrl: process.env['AUTH_URL'], - authAppName: process.env['AUTH_APP_NAME'] }; export const AUTHORITY = process.env["AUTHORITY"]; From bb0477193d5e28c4fc4e15964fd5ef297eafdfdc Mon Sep 17 00:00:00 2001 From: mmaquina Date: Fri, 28 Oct 2022 12:31:33 -0300 Subject: [PATCH 09/64] TTA-196-duration-column-formatting-ui (#941) * refactor: TTA-196 duration as float on reports * changed pipe function * refactor: TTA-196 display hours as float * refactor: TTA-196 fix imports and lint errors * refactor: TTA-196 number of fixed digits as constant with name * fix: TTA-196 variable was ill defined * refactor: TTA-196 2 digits for fixed point duration of time entries in reports * fix: TTA-196 fixed tests for 2 fixed point digits. TODO: use that constant in tests Co-authored-by: mmaquina --- .gitignore | 1 + src/app/app.module.ts | 2 + .../time-entries-table.component.html | 128 ++++++++++-------- .../time-entries-table.component.spec.ts | 3 +- .../time-entries-table.component.ts | 1 - .../interceptors/spinner.interceptor.spec.ts | 8 +- .../interceptors/spinner.interceptor.ts | 7 +- .../substract-date-return-float.pipe.spec.ts | 46 +++++++ .../substract-date-return-float.pipe.ts | 26 ++++ .../services/spinner-overlay.service.ts | 2 +- 10 files changed, 154 insertions(+), 70 deletions(-) create mode 100644 src/app/modules/shared/pipes/substract-date-return-float/substract-date-return-float.pipe.spec.ts create mode 100644 src/app/modules/shared/pipes/substract-date-return-float/substract-date-return-float.pipe.ts diff --git a/.gitignore b/.gitignore index 2312832f4..64fbbec7d 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,7 @@ testem.log /typings debug.log *.vscode +.hintrc # System Files .DS_Store diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 04e1ad0d7..d01a28969 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -72,6 +72,7 @@ import { UserEffects } from './modules/user/store/user.effects'; import { EntryEffects } from './modules/time-clock/store/entry.effects'; import { InjectTokenInterceptor } from './modules/shared/interceptors/inject.token.interceptor'; import { SubstractDatePipe } from './modules/shared/pipes/substract-date/substract-date.pipe'; +import { SubstractDatePipeDisplayAsFloat } from './modules/shared/pipes/substract-date-return-float/substract-date-return-float.pipe'; import { TechnologiesComponent } from './modules/shared/components/technologies/technologies.component'; import { TimeEntriesSummaryComponent } from './modules/time-clock/components/time-entries-summary/time-entries-summary.component'; import { TimeDetailsPipe } from './modules/time-clock/pipes/time-details.pipe'; @@ -138,6 +139,7 @@ const maskConfig: Partial = { CreateProjectTypeComponent, EntryFieldsComponent, SubstractDatePipe, + SubstractDatePipeDisplayAsFloat, TechnologiesComponent, SearchUserComponent, TimeEntriesSummaryComponent, diff --git a/src/app/modules/reports/components/time-entries-table/time-entries-table.component.html b/src/app/modules/reports/components/time-entries-table/time-entries-table.component.html index e5809d4b9..256ab28bc 100644 --- a/src/app/modules/reports/components/time-entries-table/time-entries-table.component.html +++ b/src/app/modules/reports/components/time-entries-table/time-entries-table.component.html @@ -1,64 +1,74 @@
- + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + +
SelectedIDUser emailDateDurationTime inTime outProjectProject IDCustomerCustomer IDActivityTicketDescriptionTechnologies
{{ entry.id }}{{ entry.owner_email }} - {{ entry.start_date | date: 'MM/dd/yyyy' }} - - {{ entry.end_date | substractDate: entry.start_date }} - {{ dateTimeOffset.parseDateTimeOffset(entry.start_date,entry.timezone_offset) }}{{ dateTimeOffset.parseDateTimeOffset(entry.end_date , entry.timezone_offset) }}{{ entry.project_name }}{{ entry.project_id }}{{ entry.customer_name }}{{ entry.customer_id }}{{ entry.activity_name }} - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - -
SelectedIDUser emailDateDurationTime inTime outProjectProject IDCustomerCustomer IDActivityTicketDescriptionTechnologies
+ + {{ entry.id }}{{ entry.owner_email }} + {{ entry.start_date | date: 'MM/dd/yyyy' }} + + {{ entry.end_date | substractDateDisplayAsFloat: entry.start_date }} + {{ dateTimeOffset.parseDateTimeOffset(entry.start_date, entry.timezone_offset) }}{{ dateTimeOffset.parseDateTimeOffset(entry.end_date, entry.timezone_offset) }}{{ entry.project_name }}{{ entry.project_id }}{{ entry.customer_name }}{{ entry.customer_id }}{{ entry.activity_name }} + + {{ entry.uri }} - - {{ entry.description }} - -
- {{ technology }} -
-
-
+
+
{{ entry.description }} + +
+ {{ technology }} +
+
+
+
+
+ Total: {{ this.resultSum.hours }} hours, {{ this.resultSum.minutes }} minutes,
+ Total hours entries selected: {{ resultSumEntriesSelected.hours }} hours, + {{ resultSumEntriesSelected.minutes }} minutes
-
Total: {{this.resultSum.hours}} hours, {{this.resultSum.minutes}} minutes, -
Total hours entries selected: {{resultSumEntriesSelected.hours}} hours, {{resultSumEntriesSelected.minutes}} minutes
diff --git a/src/app/modules/reports/components/time-entries-table/time-entries-table.component.spec.ts b/src/app/modules/reports/components/time-entries-table/time-entries-table.component.spec.ts index 30c2d7882..6f312ff81 100644 --- a/src/app/modules/reports/components/time-entries-table/time-entries-table.component.spec.ts +++ b/src/app/modules/reports/components/time-entries-table/time-entries-table.component.spec.ts @@ -4,6 +4,7 @@ import { DataTablesModule } from 'angular-datatables'; import { NgxPaginationModule } from 'ngx-pagination'; import { Entry } from 'src/app/modules/shared/models'; import { SubstractDatePipe } from 'src/app/modules/shared/pipes/substract-date/substract-date.pipe'; +import { SubstractDatePipeDisplayAsFloat } from 'src/app/modules/shared/pipes/substract-date-return-float/substract-date-return-float.pipe'; import { getReportDataSource, getResultSumEntriesSelected } from 'src/app/modules/time-clock/store/entry.selectors'; import { EntryState } from '../../../time-clock/store/entry.reducer'; import { TimeEntriesTableComponent } from './time-entries-table.component'; @@ -80,7 +81,7 @@ describe('Reports Page', () => { waitForAsync(() => { TestBed.configureTestingModule({ imports: [NgxPaginationModule, DataTablesModule], - declarations: [TimeEntriesTableComponent, SubstractDatePipe], + declarations: [TimeEntriesTableComponent, SubstractDatePipe, SubstractDatePipeDisplayAsFloat], providers: [provideMockStore({ initialState: state }), { provide: ActionsSubject, useValue: actionSub }], }).compileComponents(); diff --git a/src/app/modules/reports/components/time-entries-table/time-entries-table.component.ts b/src/app/modules/reports/components/time-entries-table/time-entries-table.component.ts index 502d6a7cc..8b4d5ab87 100644 --- a/src/app/modules/reports/components/time-entries-table/time-entries-table.component.ts +++ b/src/app/modules/reports/components/time-entries-table/time-entries-table.component.ts @@ -183,4 +183,3 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn return this.resultSumEntriesSelected; } } - diff --git a/src/app/modules/shared/interceptors/spinner.interceptor.spec.ts b/src/app/modules/shared/interceptors/spinner.interceptor.spec.ts index aa7d28bb1..b34ec1ed3 100644 --- a/src/app/modules/shared/interceptors/spinner.interceptor.spec.ts +++ b/src/app/modules/shared/interceptors/spinner.interceptor.spec.ts @@ -16,11 +16,11 @@ describe('SpinnerInterceptorService test', () => { ], }); - class MockHttpHandler implements HttpHandler { - handle(req: HttpRequest): Observable> { - return of(new HttpResponse()); - } + class MockHttpHandler implements HttpHandler { + handle(req: HttpRequest): Observable> { + return of(new HttpResponse()); } + } let overlay: Overlay; let httpHandler: HttpHandler; diff --git a/src/app/modules/shared/interceptors/spinner.interceptor.ts b/src/app/modules/shared/interceptors/spinner.interceptor.ts index 200628271..a69234141 100644 --- a/src/app/modules/shared/interceptors/spinner.interceptor.ts +++ b/src/app/modules/shared/interceptors/spinner.interceptor.ts @@ -17,14 +17,13 @@ export class SpinnerInterceptor implements HttpInterceptor { req: HttpRequest, next: HttpHandler ): Observable> { - if(req.url.endsWith('recent')){ + if (req.url.endsWith('recent')) { const spinnerSubscription: Subscription = this.spinnerOverlayService.spinner$.subscribe(); - return next + return next .handle(req) .pipe(finalize(() => spinnerSubscription.unsubscribe())); - }else{ + } else { return next.handle(req); } - } } diff --git a/src/app/modules/shared/pipes/substract-date-return-float/substract-date-return-float.pipe.spec.ts b/src/app/modules/shared/pipes/substract-date-return-float/substract-date-return-float.pipe.spec.ts new file mode 100644 index 000000000..fb5ea1cb0 --- /dev/null +++ b/src/app/modules/shared/pipes/substract-date-return-float/substract-date-return-float.pipe.spec.ts @@ -0,0 +1,46 @@ +import { SubstractDatePipeDisplayAsFloat } from './substract-date-return-float.pipe'; + +describe('SubstractDatePipeDisplayAsFloat', () => { + it('create an instance', () => { + const pipe = new SubstractDatePipeDisplayAsFloat(); + expect(pipe).toBeTruthy(); + }); + + /*TODO: tests will be more robust if they take into account FIXED_POINT_DIGITS*/ + it('returns the date diff as float hours (xx.xx)', () => { + [ + { endDate: '2021-04-11T10:20:00Z', startDate: '2021-04-11T08:00:00Z', expectedDiff: '2.33' }, + { endDate: '2021-04-11T17:40:00Z', startDate: '2021-04-11T17:10:00Z', expectedDiff: '0.50' }, + { endDate: '2021-04-11T18:18:00Z', startDate: '2021-04-11T18:00:00Z', expectedDiff: '0.30' }, + { endDate: '2021-04-12T12:18:00Z', startDate: '2021-04-11T10:00:00Z', expectedDiff: '26.30' }, + { endDate: '2021-04-12T10:01:00Z', startDate: '2021-04-12T10:00:00Z', expectedDiff: '0.02' }, + { endDate: '2021-04-11T11:27:00Z', startDate: '2021-04-11T10:03:45Z', expectedDiff: '1.39' }, + ].forEach(({ startDate, endDate, expectedDiff }) => { + const fromDate = new Date(endDate); + const substractDate = new Date(startDate); + + const diff = new SubstractDatePipeDisplayAsFloat().transform(fromDate, substractDate); + + expect(diff).toBe(expectedDiff); + }); + }); + + it('returns -.- if fromDate is null', () => { + const fromDate = null; + const substractDate = new Date('2011-04-11T08:00:30Z'); + + const diff = new SubstractDatePipeDisplayAsFloat().transform(fromDate, substractDate); + + expect(diff).toBe('-.-'); + }); + + it('returns -.- if substractDate is null', () => { + const fromDate = new Date('2011-04-11T08:00:30Z'); + const substractDate = null; + + const diff = new SubstractDatePipeDisplayAsFloat().transform(fromDate, substractDate); + + expect(diff).toBe('-.-'); + }); + +}); diff --git a/src/app/modules/shared/pipes/substract-date-return-float/substract-date-return-float.pipe.ts b/src/app/modules/shared/pipes/substract-date-return-float/substract-date-return-float.pipe.ts new file mode 100644 index 000000000..318dae1d3 --- /dev/null +++ b/src/app/modules/shared/pipes/substract-date-return-float/substract-date-return-float.pipe.ts @@ -0,0 +1,26 @@ +import { Pipe, PipeTransform } from '@angular/core'; +import * as moment from 'moment'; + +const FIXED_POINT_DIGITS = 2; +@Pipe({ + name: 'substractDateDisplayAsFloat' +}) +export class SubstractDatePipeDisplayAsFloat implements PipeTransform { + + transform(fromDate: Date, substractDate: Date): string { + + if (fromDate === null || substractDate === null) { + return '-.-'; + } + + const startDate = moment(substractDate); + const endDate = moment(fromDate); + const duration = this.getTimeDifference(startDate, endDate); + return duration.asHours().toFixed(FIXED_POINT_DIGITS).toString(); + } + + getTimeDifference(substractDate: moment.Moment, fromDate: moment.Moment): moment.Duration { + return moment.duration(fromDate.diff(substractDate)); + } + +} diff --git a/src/app/modules/shared/services/spinner-overlay.service.ts b/src/app/modules/shared/services/spinner-overlay.service.ts index 1b74a6f27..dc00becfe 100644 --- a/src/app/modules/shared/services/spinner-overlay.service.ts +++ b/src/app/modules/shared/services/spinner-overlay.service.ts @@ -9,8 +9,8 @@ import { SpinnerOverlayComponent } from './../components/spinner-overlay/spinner providedIn: 'root', }) export class SpinnerOverlayService { - public overlayRef: OverlayRef = undefined; static spinner$: any; + public overlayRef: OverlayRef = undefined; constructor(private readonly overlay: Overlay) {} From 90a1cca9c5eeb4b94ba6225cbd35b1f1990134ab Mon Sep 17 00:00:00 2001 From: Andres Cabrera <85083117+andresacg30@users.noreply.github.com> Date: Thu, 3 Nov 2022 12:08:29 -0400 Subject: [PATCH 10/64] fix: TTA-209 add subscription to login component for redirecting user (#949) * fix: TTA-209 add subscription to login component for redirecting users when token expires to login page * TTA-209 added redirectioning for any 401 status response --- src/app/modules/login/login.component.ts | 5 +---- .../interceptors/inject.token.interceptor.ts | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/app/modules/login/login.component.ts b/src/app/modules/login/login.component.ts index 792fc56e9..91ad64a60 100644 --- a/src/app/modules/login/login.component.ts +++ b/src/app/modules/login/login.component.ts @@ -64,15 +64,12 @@ export class LoginComponent implements OnInit { ngOnInit() { this.googleAuthSDK(); - if (this.isProduction && this.azureAdB2CService.isLogin()) { - this.router.navigate(['']); - } else { this.loginService.isLogin().subscribe(isLogin => { if (isLogin) { this.router.navigate(['']); } }); - } + window.handleCredentialResponse = (response) => { const {credential = ''} = response; this.featureToggleCookiesService.setCookies(); diff --git a/src/app/modules/shared/interceptors/inject.token.interceptor.ts b/src/app/modules/shared/interceptors/inject.token.interceptor.ts index b13100441..d045b0e60 100644 --- a/src/app/modules/shared/interceptors/inject.token.interceptor.ts +++ b/src/app/modules/shared/interceptors/inject.token.interceptor.ts @@ -4,18 +4,22 @@ import { HttpInterceptor, HttpHandler, HttpRequest, + HttpErrorResponse, } from '@angular/common/http'; import { Observable } from 'rxjs'; +import { tap } from 'rxjs/operators'; import { AzureAdB2CService } from 'src/app/modules/login/services/azure.ad.b2c.service'; import { environment } from './../../../../environments/environment'; import { EnvironmentType } from 'src/environments/enum'; import { LoginService } from '../../login/services/login.service'; +import { catchError } from 'rxjs/operators'; +import { Router } from '@angular/router'; @Injectable() export class InjectTokenInterceptor implements HttpInterceptor { isProduction = environment.production === EnvironmentType.TT_PROD_LEGACY; - constructor(private azureAdB2CService: AzureAdB2CService, private loginService: LoginService) { } + constructor(private azureAdB2CService: AzureAdB2CService, private loginService: LoginService, private router: Router) { } intercept(request: HttpRequest, next: HttpHandler): Observable> { if (request.url.startsWith(environment.timeTrackerApiUrl)) { @@ -25,7 +29,17 @@ export class InjectTokenInterceptor implements HttpInterceptor { headers: request.headers.set('Authorization', 'Bearer ' + token) }); - return next.handle(requestWithHeaders); + return next.handle(requestWithHeaders) + .pipe( + tap(() => { }, (err: any) => { + if (err instanceof HttpErrorResponse) { + if (err.status === 401) { + this.loginService.logout(); + window.open("/login", "_self") + } + } + }) + ); } else { return next.handle(request); } From ff13573ecdf83ceb3778bebff3a32b179a003872 Mon Sep 17 00:00:00 2001 From: nicolsss <56645701+nicolsss@users.noreply.github.com> Date: Thu, 3 Nov 2022 11:09:18 -0500 Subject: [PATCH 11/64] fix: TTA-214-add-loader-to-the-log-in-button (#947) Co-authored-by: Nicole Garcia --- src/app/modules/shared/interceptors/spinner.interceptor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/modules/shared/interceptors/spinner.interceptor.ts b/src/app/modules/shared/interceptors/spinner.interceptor.ts index a69234141..2cf717ce3 100644 --- a/src/app/modules/shared/interceptors/spinner.interceptor.ts +++ b/src/app/modules/shared/interceptors/spinner.interceptor.ts @@ -17,7 +17,7 @@ export class SpinnerInterceptor implements HttpInterceptor { req: HttpRequest, next: HttpHandler ): Observable> { - if (req.url.endsWith('recent')) { + if (req.url.endsWith('recent') || req.url.endsWith('login')) { const spinnerSubscription: Subscription = this.spinnerOverlayService.spinner$.subscribe(); return next .handle(req) From 0498d2eef5a5ee0069559136a9ddab249342f928 Mon Sep 17 00:00:00 2001 From: nicolsss <56645701+nicolsss@users.noreply.github.com> Date: Thu, 3 Nov 2022 11:09:58 -0500 Subject: [PATCH 12/64] fix: TTA-216-fix-sort-by-options-in-reports-page (#948) Co-authored-by: Nicole Garcia --- .../time-entries-table/time-entries-table.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/modules/reports/components/time-entries-table/time-entries-table.component.ts b/src/app/modules/reports/components/time-entries-table/time-entries-table.component.ts index 8b4d5ab87..dfa94b872 100644 --- a/src/app/modules/reports/components/time-entries-table/time-entries-table.component.ts +++ b/src/app/modules/reports/components/time-entries-table/time-entries-table.component.ts @@ -68,7 +68,7 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn filename: `time-entries-${formatDate(new Date(), 'MM_dd_yyyy-HH_mm', 'en')}` }, ], - columnDefs: [{ type: 'date', targets: 2}, {orderable: false, targets: [0]}], + columnDefs: [{ type: 'date', targets: 3}, {orderable: false, targets: [0]}], order: [[1, 'asc'], [2, 'desc'], [4, 'desc']] }; dtTrigger: Subject = new Subject(); From 60bf73c92a7870af24a90c2aa4a0b72d6527cde4 Mon Sep 17 00:00:00 2001 From: Andres C Date: Wed, 16 Nov 2022 10:47:54 -0400 Subject: [PATCH 13/64] added ignacio key to stage and prod --- .../C0B8FDDB97F4FAA788831E2C922549E3E0324188.gpg | Bin 0 -> 603 bytes .../C0B8FDDB97F4FAA788831E2C922549E3E0324188.gpg | Bin 0 -> 606 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 .git-crypt/keys/PROD/0/C0B8FDDB97F4FAA788831E2C922549E3E0324188.gpg create mode 100644 .git-crypt/keys/STAGE/0/C0B8FDDB97F4FAA788831E2C922549E3E0324188.gpg diff --git a/.git-crypt/keys/PROD/0/C0B8FDDB97F4FAA788831E2C922549E3E0324188.gpg b/.git-crypt/keys/PROD/0/C0B8FDDB97F4FAA788831E2C922549E3E0324188.gpg new file mode 100644 index 0000000000000000000000000000000000000000..08dd3d7b9d31172db880fa35792fa16cbe0bde8b GIT binary patch literal 603 zcmV-h0;K(g0gMCLH*yMRPv!vu3;$F2F*lpot5%Q!ma z6=2DyaWGu)pbetXMa+NReagxU_#^cs_gU%$w~n>{SSfJEd!PS9&DJ^Ik43`lWtdeo zZbofLYnwH;K}m}!a5wa_W_Q`E5X!YR^`_2^hnU%k13*GWws`TrUp41rHOM>e-H|NK zK`w~ABBc%dQ&e~EMAV)W2MZVx$SJ7Y(70*)HRtWuHB=mfY%sXEnB~&I2?2w2s_PHw zfNJ8}-V;_|Z@*3g2!Wl2h(skdK+?WAN3cv~h7>np+EZKUJhXvH#v53rF&VyXq5E0r zdSKp}Tm_~dg|)@=m!AXclIz{DElv$8@vKT+PA}!G>UT3wNQ3ur#Hl?{&S)4Fh)Mwf zUnRZLAQ6cm&BXB!1I`vnp?ciANa%EJ1tt@){}ws?X&$ig>!oP}w ziNyj>-v{+fb;Dpz0B8-Wl1%s-=EKr0%UD9?36GPgOd-L*s12OF6@v0nv5~#Wne$O* zbIi9tUi0)A`Ys(yIUEfo%7;8E=yJODwGyhuZ6MwtnwID3p><3=+90#xj%U{s9e7R! z1mQSlp|46nfRbkD2=Kjn-0Ec8WuG+i+D;k8$~sSl+MCX(?f@y?i2G)+a7PqpPUO;xCgZ!1=1UK@K2?4XI1$j5GpEoJYxCL` zwqF8C0K!b}m_M4lRw;l^+=p6sbXppJ(YJmcLrTE`4Jj`qM%1tceA{zz#t>`CX{i%K z&k|&|ExHhGiwy>n*A7&eP#&%#kV?Zy+Vco9P|ZvI7ORPE0Sh;YTUhJ@yyU?+DSGd( s+kEHYg886Ho~b>`HVKA+rDl?ka+iXfBD)6pNU|o47Y@yO3j-rC2f1=0`~Uy| literal 0 HcmV?d00001 From 1e23750c3c8e7346f8ac2477a81651a53553572d Mon Sep 17 00:00:00 2001 From: mmaquina Date: Tue, 22 Nov 2022 15:52:29 -0300 Subject: [PATCH 14/64] hot-fix: TTA-666 injectTokenInterceptor injectTokenInterceptor now takes 2 args instead of 3 the last one wasn't used --- src/app/modules/shared/interceptors/inject.token.interceptor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/modules/shared/interceptors/inject.token.interceptor.ts b/src/app/modules/shared/interceptors/inject.token.interceptor.ts index d045b0e60..58752c9a1 100644 --- a/src/app/modules/shared/interceptors/inject.token.interceptor.ts +++ b/src/app/modules/shared/interceptors/inject.token.interceptor.ts @@ -19,7 +19,7 @@ import { Router } from '@angular/router'; @Injectable() export class InjectTokenInterceptor implements HttpInterceptor { isProduction = environment.production === EnvironmentType.TT_PROD_LEGACY; - constructor(private azureAdB2CService: AzureAdB2CService, private loginService: LoginService, private router: Router) { } + constructor(private azureAdB2CService: AzureAdB2CService, private loginService: LoginService) { } intercept(request: HttpRequest, next: HttpHandler): Observable> { if (request.url.startsWith(environment.timeTrackerApiUrl)) { From a939732f9d28dfe8f95f5fee3e53ccf0ec32a379 Mon Sep 17 00:00:00 2001 From: mmaquina Date: Fri, 25 Nov 2022 17:28:25 -0300 Subject: [PATCH 15/64] add jerson (#957) --- .../E53A45CD0CD193F8D668809BB994EBF9E04B9ADC.gpg | Bin 0 -> 597 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .git-crypt/keys/default/0/E53A45CD0CD193F8D668809BB994EBF9E04B9ADC.gpg diff --git a/.git-crypt/keys/default/0/E53A45CD0CD193F8D668809BB994EBF9E04B9ADC.gpg b/.git-crypt/keys/default/0/E53A45CD0CD193F8D668809BB994EBF9E04B9ADC.gpg new file mode 100644 index 0000000000000000000000000000000000000000..3b109da75583cb0d90019125209ec50c4b732e66 GIT binary patch literal 597 zcmV-b0;>Im0gMBfDd@=Dfl)I73;h{RjZ!=qFQ5Cjhn0YxZ@%h+otw0q{EX>q@dr{$ z^;0?}V$j|iL~apKQR<4(Jj|EOMJ#rT9Car+QFcwH_Ytj2iG^OZAUHm)=XVWa-uy1N zJmwxxGMHprj#7!4yQe~nNZ9rirnM=}H0|5D^SQ4inrEDcU&3;KG? zc-j=OUz-N32SoW?;3_qzlL_u0nTOR{0tm_-FJ|M=#h#;Z6ztW0+=_e|w~(mlX3+kS zcJ0ykAU2S|30x6Qgfmm8HF{Q&pw4{8le0G~jJ}Z0UhG1)mF698G3BhleBr-RiL827 z$rxqBkK+b69NBejGnF0={URG{ggX&d6NVdGM^`e1<%2tJ!kxb>po9? zL6YLb%!`l0|AkspB3E; zs*fR_whqWZguoPYQ8-C{sO768+OVEbVhN#DphGRVVmzKaBM?!r$skRa3V9F2{?7x)j--KZ0IH{ literal 0 HcmV?d00001 From db3b23298b26921ab78bc1f3e11f88bd2d61f28c Mon Sep 17 00:00:00 2001 From: nicolsss <56645701+nicolsss@users.noreply.github.com> Date: Mon, 28 Nov 2022 13:31:41 -0500 Subject: [PATCH 16/64] =?UTF-8?q?refactor:=20TTA-232-change-warning-messag?= =?UTF-8?q?e-when-entries-summary-are-not=E2=80=A6=20(#955)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: TTA-232-change-warning-message-when-entries-summary-are-not-found * refactor: change warning message * refactor: change message Co-authored-by: Nicole Garcia --- src/app/modules/time-clock/store/entry.effects.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/modules/time-clock/store/entry.effects.ts b/src/app/modules/time-clock/store/entry.effects.ts index f9fc9d769..19b9611a0 100644 --- a/src/app/modules/time-clock/store/entry.effects.ts +++ b/src/app/modules/time-clock/store/entry.effects.ts @@ -46,7 +46,7 @@ export class EntryEffects { this.entryService.summary().pipe( map((response) => { if (!response){ - this.toastrService.warning('Your summary information could not be loaded'); + this.toastrService.warning("It's a brand new month! You don't have any time entries yet."); } return new actions.LoadEntriesSummarySuccess(response); }), From d71cd4fa48a968b794fcb66b9e40f42360579490 Mon Sep 17 00:00:00 2001 From: nicolsss <56645701+nicolsss@users.noreply.github.com> Date: Mon, 12 Dec 2022 10:12:45 -0500 Subject: [PATCH 17/64] fix: TTL-727-bug-fix-error-400-on-project-update-function (#960) * refactor: TTL-727-bug-as-a-software-developer-i-want-to-fix-error-400-on-project-creation * refactor: inactivated project message Co-authored-by: Nicole Garcia --- .../components/projects/components/store/project.effects.ts | 4 ++-- src/app/modules/shared/messages.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/modules/customer-management/components/projects/components/store/project.effects.ts b/src/app/modules/customer-management/components/projects/components/store/project.effects.ts index 5067b1b85..3ba0dcc48 100644 --- a/src/app/modules/customer-management/components/projects/components/store/project.effects.ts +++ b/src/app/modules/customer-management/components/projects/components/store/project.effects.ts @@ -1,4 +1,4 @@ -import { INFO_SAVED_SUCCESSFULLY, INFO_DELETE_SUCCESSFULLY } from '../../../../../shared/messages'; +import { INFO_SAVED_SUCCESSFULLY, PROJECT_DEACTIVATED_SUCCESSFULLY } from '../../../../../shared/messages'; import { Injectable } from '@angular/core'; import { of, Observable } from 'rxjs'; import { catchError, map, mergeMap } from 'rxjs/operators'; @@ -108,7 +108,7 @@ export class ProjectEffects { mergeMap((projectId) => this.projectService.deleteProject(projectId).pipe( map(() => { - this.toastrService.success(INFO_DELETE_SUCCESSFULLY); + this.toastrService.success(PROJECT_DEACTIVATED_SUCCESSFULLY); return new actions.DeleteProjectSuccess(projectId); }), catchError((error) => { diff --git a/src/app/modules/shared/messages.ts b/src/app/modules/shared/messages.ts index 2721cd2a1..472813996 100644 --- a/src/app/modules/shared/messages.ts +++ b/src/app/modules/shared/messages.ts @@ -1,3 +1,4 @@ export const INFO_SAVED_SUCCESSFULLY = 'The data has been saved successfully'; export const INFO_DELETE_SUCCESSFULLY = 'The data has been deleted successfully'; export const UNEXPECTED_ERROR = 'An unexpected error happened, please try again later'; +export const PROJECT_DEACTIVATED_SUCCESSFULLY = 'The project has been inactivated successfully'; From 4ef6ec2f794714672c119a8b903ca1803f7d2cb8 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 12 Dec 2022 15:14:37 +0000 Subject: [PATCH 18/64] chore(release): 2.1.2 [skip ci]nn --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 346262d65..067a1018e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "time-tracker", - "version": "1.75.40", + "version": "2.1.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 0fad3f42e..35a394871 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "time-tracker", - "version": "1.75.40", + "version": "2.1.2", "scripts": { "preinstall": "npx npm-force-resolutions", "ng": "ng", From 156544a8cf8645901e10e1b1ebb9007c8f0a9ca4 Mon Sep 17 00:00:00 2001 From: mmaquina Date: Mon, 12 Dec 2022 18:29:57 -0300 Subject: [PATCH 19/64] Tta 189 create an anchor for the edit a customer action (#953) * noworking commit * refactor: TTA-189 dropped unused function * refactor: TTA-189 dropped another unused function * refactor: TTA-189 erased test Test erased for case being already covered in separate existing test. * refactor: TTA-189 scrollToCustomerForm * refactor: TTA-189 scrollToCustomer --- .../customer-list.component.html | 19 +++++++++---------- .../customer-list.component.spec.ts | 6 +++--- .../customer-list/customer-list.component.ts | 12 +++++++++++- .../pages/customer.component.html | 13 +++++++++---- .../pages/customer.component.ts | 7 +++++++ 5 files changed, 39 insertions(+), 18 deletions(-) diff --git a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html index 32f29025c..f1bae3ec1 100644 --- a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html +++ b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html @@ -14,25 +14,24 @@ Visibility - - + + {{ customer.id }} {{ customer.name }} - + @@ -62,5 +61,5 @@ [title]="'Edit Customer'" [body]="message" (closeModalEvent)="closeModal()" - > +> diff --git a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.spec.ts b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.spec.ts index 9a3cd4957..c51cdef95 100644 --- a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.spec.ts +++ b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.spec.ts @@ -84,7 +84,7 @@ describe('CustomerTableListComponent', () => { it('Onclick Edit, if there are changes, the modal must be presented ', () => { component.hasChange = true; - const expectMessage = 'Do you have changes in a client, do you want to discard them?'; + const expectMessage = 'You have changes in a client, do you want to discard them?'; component.editCustomer('1'); @@ -92,7 +92,7 @@ describe('CustomerTableListComponent', () => { expect(component.showModal).toBeTrue(); }); - it('onClick edit, if there are not have changes dispatch SetCustomerToEdit, enable customer form and hidden modal', () => { + it('onClick edit, if there are no unsaved changes dispatch SetCustomerToEdit, enable customer form and hide modal', () => { component.hasChange = false; spyOn(store, 'dispatch'); @@ -115,7 +115,7 @@ describe('CustomerTableListComponent', () => { expect(store.dispatch).toHaveBeenCalledWith(new ResetProjectTypeToEdit()); }); - it('when you click close modal, you should close the modal, discard the current changes and load a new client for edit', () => { + it('when you click close modal, modal should close, discard the current changes and load a new client to edit', () => { spyOn(component.changeValueShowCustomerForm, 'emit'); spyOn(store, 'dispatch'); diff --git a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.ts b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.ts index dbb0d79af..438e2fed5 100644 --- a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.ts +++ b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.ts @@ -19,6 +19,12 @@ import { ResetProjectToEdit, SetProjectToEdit } from '../../../projects/componen import { ResetProjectTypeToEdit, SetProjectTypeToEdit } from '../../../projects-type/store'; import { UnarchiveCustomer } from '../../../../store/customer-management.actions'; + +export function scrollToCustomerForm(): void { + const element = document.getElementById('customerForm'); + element.scrollIntoView(); +} + @Component({ selector: 'app-customer-list', templateUrl: './customer-list.component.html', @@ -117,7 +123,7 @@ export class CustomerListComponent implements OnInit, OnDestroy, AfterViewInit { editCustomer(customerId: string) { this.idToEdit = customerId; if (this.hasChange) { - this.message = 'Do you have changes in a client, do you want to discard them?'; + this.message = 'You have changes in a client, do you want to discard them?'; this.showModal = true; } else { this.showCustomerForm = true; @@ -199,4 +205,8 @@ export class CustomerListComponent implements OnInit, OnDestroy, AfterViewInit { this.store.dispatch(new UnarchiveCustomer(this.idToDelete, this.changeOppositeStatus(this.statusToEdit))); } + goToCustomerForm(){ + scrollToCustomerForm(); + } + } diff --git a/src/app/modules/customer-management/pages/customer.component.html b/src/app/modules/customer-management/pages/customer.component.html index 39c79b4e6..bb4350393 100644 --- a/src/app/modules/customer-management/pages/customer.component.html +++ b/src/app/modules/customer-management/pages/customer.component.html @@ -1,7 +1,7 @@
- +
-
-
- +
+
+
+ +
diff --git a/src/app/modules/customer-management/pages/customer.component.ts b/src/app/modules/customer-management/pages/customer.component.ts index 42ee3056c..c9795ed89 100644 --- a/src/app/modules/customer-management/pages/customer.component.ts +++ b/src/app/modules/customer-management/pages/customer.component.ts @@ -2,6 +2,8 @@ import { Store } from '@ngrx/store'; import { Customer } from 'src/app/modules/shared/models'; import { SetCustomerToEdit } from 'src/app/modules/customer-management/store'; import { Component } from '@angular/core'; +import { scrollToCustomerForm } from '../components/customer-info/components/customer-list/customer-list.component'; + @Component({ selector: 'app-customer', @@ -28,4 +30,9 @@ export class CustomerComponent { getChangesInputs(event) { this.hasChangeComponent = event; } + + goToCustomerForm(){ + scrollToCustomerForm(); + } + } From af256b0705451710211a60f05c3e28e67dda8b21 Mon Sep 17 00:00:00 2001 From: mmaquina Date: Thu, 15 Dec 2022 14:06:34 -0300 Subject: [PATCH 20/64] add abi as collaborator (#963) --- .../A1D0772E0FDAFC4FD268F6B4CA937C82C0E0550C.gpg | Bin 0 -> 725 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .git-crypt/keys/default/0/A1D0772E0FDAFC4FD268F6B4CA937C82C0E0550C.gpg diff --git a/.git-crypt/keys/default/0/A1D0772E0FDAFC4FD268F6B4CA937C82C0E0550C.gpg b/.git-crypt/keys/default/0/A1D0772E0FDAFC4FD268F6B4CA937C82C0E0550C.gpg new file mode 100644 index 0000000000000000000000000000000000000000..61dcca7c588bf0faa3911e647a0f3e2240307537 GIT binary patch literal 725 zcmV;`0xJE50t^FCozbPFvO&@T5CD?OU>XR)&)VU`;mKb*izpdYet5#LPi_RBv!|U= zazq*_;fFs@l$uM`Z8^aa-^Ya$vIW=iUWqlxlZUk| z4Xm98FAstSu4aE~9VV&@60qtg?`KT@#k3zylGRUae1-`AHUdmHwwbWJilM>&;nrT_ zL#QllG+M34ekpN%4Uwb>u*PF-=l?jjJ{g!44!Ww8<`{_yB;mHxB5Qk%icF>zdkuV% zF{DW1zpH6Y5E&G+HN4~GCwID%uC)e{z2t{KgRe60-Ojo22w9!@*DtK=V`u^@*1xBA zJ#8mh5*7PEAI`3TV4-{nHRS;@m~Wu9#V}{ zu{E92N0$rvJ9>oZ>=ABa_0US0Pe;8&xl4lL;8}Dq;i**K2>tgvp{$IwuA~%_IT-S~ zG5x0BRflF~A1E9m#*G7{&#YiW3&IK<8v!8te4JZcf`bh<$I`T7|4t2ppo|RV&Sa>o zaU$}!5iFv1y(an%AQjenJTEhed}Xb*SgJKj#{KeaFF#KjJMg9$V>x=CJ4{}J+1^T} zpN1vMlVQBfsI`VUxu`Jb$5R`ALe7oHSEu)LO`P=QuQMg#;H*ed2<45yHmZqL%d0|5}+*$D_%ucfQvLlX!o#S(wHJ4pm z3X2mBA0b{81@sBJ)%c4By`PWoOPKL9zg;ai)Ynt6&bIIoQ9}TEA6PpV@Q%y?>~w%= z%AkC=04|!x>e!ru_v%-%e#PuWx83!509e^JF}rtvBtUHU$bHr|N=YD`gk5hbo#S+? zJi93YOsQncryuQRXk?hpU5ED8DP;6gqD@ Date: Fri, 16 Dec 2022 11:33:28 -0300 Subject: [PATCH 21/64] Add abi as collaborator (#965) added abi as collaborator --- .../32C62F6EE0EA5AB8E9F1CDF692A49E05B39E6B50.gpg | Bin 0 -> 597 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .git-crypt/keys/default/0/32C62F6EE0EA5AB8E9F1CDF692A49E05B39E6B50.gpg diff --git a/.git-crypt/keys/default/0/32C62F6EE0EA5AB8E9F1CDF692A49E05B39E6B50.gpg b/.git-crypt/keys/default/0/32C62F6EE0EA5AB8E9F1CDF692A49E05B39E6B50.gpg new file mode 100644 index 0000000000000000000000000000000000000000..f67c04ca376d151c7233abdaf77ee5ed7ed06143 GIT binary patch literal 597 zcmV-b0;>Im0gMCt5Y`ncaUp~O3;#u^mxBwz4UXpcm7G;QRS5f~e~HNc(pL+1raA6= z&foqDUMvXucJ)+}MbSDY4?e6*C%{JzYFxi6vS%{PYi@M31C-JwjBYrUgFEBy&wP7J zDme@xe4tpKSshlifs}ObyM1up8l#0NXS%>;eAxM6Ekh@im!Rgct=}^PMu({z_4ATJ zRXqjpA8EMll)OGT;lUqpNI!?xJo$s!h*azuAEr^oIdmX1d8Q9Mbb@Kw61M3Kz0E}k zC)ULcGx`hF4EFhBXAhM$J(g{0iZ4CcsPjMgj?mM~>PJT?b9EnC7<)#T8#dVm zePVXISPTNjW@kN++QJF*kx#yuGhAEf?6uB3TeQ}Y8k~+s&<8h3OeI?*H4fMHyhMa# zd7@4DR+kTIAhfmmMJ($lmE^R)OPgn*iVUgV=Bh7uKUu!0|DKrf%P$& z8f^pAz}ySUcgUhC~9Fcr|~_2KRS^VkB`|&YW^y2*=*x7J0w{C8(CojE7t{9 jE~!C+?!**=)w*^HdV=(xK;I|seU~73Y*17KdnH-IJ75@) literal 0 HcmV?d00001 From 1d1644aa6375d9682679509f2c9f1cd96dc235d5 Mon Sep 17 00:00:00 2001 From: mmaquina Date: Fri, 16 Dec 2022 12:43:09 -0300 Subject: [PATCH 22/64] refactor: TTL-720 increased build speed (#964) * refactor: TTL-720 increased chown speed * refactor: TTL-720 added newline at end of file --- Docker/Dockerfile.dev | 11 +++++------ Docker/Dockerfile.test | 11 ++++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Docker/Dockerfile.dev b/Docker/Dockerfile.dev index 3dbb70414..31d0ab57d 100644 --- a/Docker/Dockerfile.dev +++ b/Docker/Dockerfile.dev @@ -2,15 +2,14 @@ FROM node:14 ENV USERNAME timetracker ENV HOME /home/${USERNAME} -RUN useradd -ms /bin/bash ${USERNAME} +RUN useradd --create-home -ms /bin/bash ${USERNAME} WORKDIR ${HOME}/time-tracker-ui -COPY package.json package-lock.json ./ +COPY package*.json ./ +RUN chown ${USERNAME}:${USERNAME} -R ${HOME}/time-tracker-ui RUN npm cache clean --force && npm install -COPY . . -RUN chown ${USERNAME}:${USERNAME} -R ${HOME}/time-tracker-ui \ - && chmod -R 777 ${HOME}/time-tracker-ui +COPY --chown=${USERNAME}:${USERNAME} . . USER ${USERNAME} EXPOSE 4200 -CMD ${HOME}/time-tracker-ui/node_modules/.bin/ng serve --host 0.0.0.0 --disableHostCheck +CMD ${HOME}/time-tracker-ui/node_modules/.bin/ng serve --host 0.0.0.0 --disableHostCheck=false --poll 2000 diff --git a/Docker/Dockerfile.test b/Docker/Dockerfile.test index ae536a542..8c6b483f3 100644 --- a/Docker/Dockerfile.test +++ b/Docker/Dockerfile.test @@ -31,14 +31,15 @@ RUN mkdir -p /opt/selenium \ && curl http://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip -o /opt/selenium/chromedriver_linux64.zip \ && cd /opt/selenium; unzip /opt/selenium/chromedriver_linux64.zip; rm -rf chromedriver_linux64.zip; ln -fs /opt/selenium/chromedriver /usr/local/bin/chromedriver; -RUN useradd -ms /bin/bash ${USERNAME} + +RUN useradd --create-home -ms /bin/bash ${USERNAME} WORKDIR ${HOME}/time-tracker-ui -COPY package.json package-lock.json ./ -RUN npm cache clean --force && npm install -COPY . . +COPY package*.json ./ RUN chown ${USERNAME}:${USERNAME} -R ${HOME}/time-tracker-ui -RUN chmod -R 777 ${HOME}/time-tracker-ui +RUN npm cache clean --force && npm install +COPY --chown=${USERNAME}:${USERNAME} . . + USER ${USERNAME} EXPOSE 4200 From 98d7c4280391ff145b7ed32d2b0a74b6e93f945f Mon Sep 17 00:00:00 2001 From: mmaquina Date: Fri, 30 Dec 2022 16:16:04 -0300 Subject: [PATCH 23/64] Added jerson and fausto as stage and prod collaborators --- .../E53A45CD0CD193F8D668809BB994EBF9E04B9ADC.gpg | Bin 0 -> 603 bytes .../E596ED2AB82FBF820CC8EE869442AE57E34F8756.gpg | Bin 0 -> 603 bytes .../E53A45CD0CD193F8D668809BB994EBF9E04B9ADC.gpg | Bin 0 -> 606 bytes .../E596ED2AB82FBF820CC8EE869442AE57E34F8756.gpg | Bin 0 -> 606 bytes 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 .git-crypt/keys/PROD/0/E53A45CD0CD193F8D668809BB994EBF9E04B9ADC.gpg create mode 100644 .git-crypt/keys/PROD/0/E596ED2AB82FBF820CC8EE869442AE57E34F8756.gpg create mode 100644 .git-crypt/keys/STAGE/0/E53A45CD0CD193F8D668809BB994EBF9E04B9ADC.gpg create mode 100644 .git-crypt/keys/STAGE/0/E596ED2AB82FBF820CC8EE869442AE57E34F8756.gpg diff --git a/.git-crypt/keys/PROD/0/E53A45CD0CD193F8D668809BB994EBF9E04B9ADC.gpg b/.git-crypt/keys/PROD/0/E53A45CD0CD193F8D668809BB994EBF9E04B9ADC.gpg new file mode 100644 index 0000000000000000000000000000000000000000..d52ab0957dd68685382278f37955c0819adf0fb5 GIT binary patch literal 603 zcmV-h0;K(g0gMBfDd@=Dfl)I73;rjtohG=?5Kbnsh6MPXnEcxl08vv@kc_~EtG`#~ zw?2a6$6eras9<3`K(K!eZRFzz^?0FK5lYDEzGpX$Q0Pg5Bq|%ma5B%iT)B!9vy|g< znqY)#u(^5|QL&xfntM=1H;DY^ky5z_BFQ1`wVJbhH7DRpAP4sj#itKc`qwnpC7hd} z)keTC3yRPbSK)OCqn>+qLNZYgup$0HPdn%rdra*j`YPHTK~w3YQOiIQ5Tn|eKlBK} zDDaTM;aHlT(WoRA>{xm4s;{LTjYJsVV&`B1IRJxlrY0PwTbzcz|I$-=+Zb{DC;pV zUwIpg*4Q@2=9)pl8Jf7=&Kcb)tVCjilrzO`h|aOg(xL<^zQFrwBpNhz0!E7)!NyCQ z8E?PSE_hA9)kX$ex%NS=J!?Ua*zXWKmC2FWivSj)hFyX;G-namb{OlnXxh7HO$Zmn p5q#^hFLp>4*pJ6FQobBtEm}TIb=1=|?bFOJe3#Alck*0(lzXf|EZ_hD literal 0 HcmV?d00001 diff --git a/.git-crypt/keys/PROD/0/E596ED2AB82FBF820CC8EE869442AE57E34F8756.gpg b/.git-crypt/keys/PROD/0/E596ED2AB82FBF820CC8EE869442AE57E34F8756.gpg new file mode 100644 index 0000000000000000000000000000000000000000..5379e8a81d218f149685129cdbf778dc4439f3cb GIT binary patch literal 603 zcmV-h0;K(g0gMBIk~X=zsi5}H@%_;!n4Q6 z%#C$m=>9q@wBe*4$ff4MjhVHDFk-Iba;%)`-%UCf52w|+R1UH09C2+E_7^yu6GR~Z z8763#V=HVwT7S8*Mk24LUNJsZ*v%fh^7L*4If5*^&i(N;jK3@1@e`OcG3uEDQL&!h z(vCu05&|jVY+m(if7#Wyf$t$^FIF!n@EA@3GMQ=Ex>F&!hL5ttE2!k}2J$l(rj1bd z-kN?$Ox@q8^Xt}LfnAdbM}rv9jUxD89dLNUwY8M*t%+Z}?81EsD@K|w6@B8Z`|BErE!_Izf1R&4xC}AHO27?LmmGEFV<;9p`80s{tw9U+|NiwdP{fzpk;s@JQfO) zBsV|OxDk2@YAp{xIPs1fHTd6PVfQZzPmai;wb@y@b^ zVss1iJ|7pBRGb?L0GY|Arb6BP1l$ST*2v(on*PpgkF<&>(HIa=Zbpy}KOi?+j62ZR pWpcZWfg3Kn11@|0s$(`%c4Plb2UDBzs5w=d@oZe6enbz|!ZLjHCvX4& literal 0 HcmV?d00001 diff --git a/.git-crypt/keys/STAGE/0/E53A45CD0CD193F8D668809BB994EBF9E04B9ADC.gpg b/.git-crypt/keys/STAGE/0/E53A45CD0CD193F8D668809BB994EBF9E04B9ADC.gpg new file mode 100644 index 0000000000000000000000000000000000000000..68c89bc64120a6961f9c6e035bfec81ea4290fa2 GIT binary patch literal 606 zcmV-k0-^nd0gMBfDd@=Dfl)I73;$}LvtyKNUnC7&r*Y-FAk#R9CsF&842&#~{kDh> zNHT%|H#nHXH}Cc_jQOa!aa`?GKES~G>u`>kA@w$%fjrE(uK@cQSLkK&4$+353dP7w z3hla152$hvTia+hu_j_I_MKSASx!?NmSC#siFXCcFcyBlA1}Hip@P3xjdIirs2U2Z z!vp$sZqq%p#$&2Cz+a+o2t6X|aQ? z81=vlaa*1#a9Ilkvb55`3;{=4)sRkA z^{#`Yn~wXsvQUCO+EjO-wEl^YU2uN+BxRz2Qry>I6@%peG)mGR1_14Xu{r3Zl}F$R z!2moz^CM^;1z!LrrX0UA5zdh7wmi65iUpSFo#6`I?nGWbE(L{Niul z0f&B%GCW6GxJeKVq~ni}kdo5&z#&z{6|0FbwT)G1ImEAX8Qb)DCXm$CHx@?5aijX2 zng1XBN5Y~nvMuNVGA_+86KZYug;JZqF5m%pG9ErEuB(~PN44$^L;gdWRXsQ5{&Cg6 zI(SKp{vt5Tty7$dEB*=7O(E*vbv8^3W$0Ikm;Xv-SV90e-9^koUtA-{f}3@$yTB2^ zE?4ZrIw?B%i6SKYBC0oG%2PijIA0h%> zeCMtV1Q+8HuN?Hf<^(S!7Em{iKKyL|7clEcoS9XC<0Ad0yxS+7{;4Ff)&J|SVR5tNE#^d-ld_zf) zeXL^-st|~H7N)$5eKDsKl8?D2Z_bX!xM8D9PhVKQ5nkruL&Z#TAc$O)I`q_zF|{m8 sD7gNhX6rND#(9&>>(8dPTGb2c{6|KMX+sa7;C Date: Wed, 11 Jan 2023 09:08:34 -0500 Subject: [PATCH 24/64] refactor: TTL-725 change the confirmation message of customer module (#967) * refactor: TTL-725 change the confirmation message of customer module * test: TTL-725 change the confirmation message of customer module test * test: TTL-725 change the confirmation message of customer module test --- .../components/customer-list/customer-list.component.spec.ts | 2 +- .../components/customer-list/customer-list.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.spec.ts b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.spec.ts index c51cdef95..e022345bf 100644 --- a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.spec.ts +++ b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.spec.ts @@ -84,7 +84,7 @@ describe('CustomerTableListComponent', () => { it('Onclick Edit, if there are changes, the modal must be presented ', () => { component.hasChange = true; - const expectMessage = 'You have changes in a client, do you want to discard them?'; + const expectMessage = 'You have unsaved changes, do you want to discard them?'; component.editCustomer('1'); diff --git a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.ts b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.ts index 438e2fed5..ab51d0453 100644 --- a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.ts +++ b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.ts @@ -123,7 +123,7 @@ export class CustomerListComponent implements OnInit, OnDestroy, AfterViewInit { editCustomer(customerId: string) { this.idToEdit = customerId; if (this.hasChange) { - this.message = 'You have changes in a client, do you want to discard them?'; + this.message = 'You have unsaved changes, do you want to discard them?'; this.showModal = true; } else { this.showCustomerForm = true; From 05d4d26d5130fa305435de49c80d8636296f1961 Mon Sep 17 00:00:00 2001 From: mmaquina Date: Tue, 17 Jan 2023 16:36:31 -0300 Subject: [PATCH 25/64] added santiago key (#971) --- .../053FD5A73567E731BEFD3FC13A29B8373D5C3805.gpg | Bin 0 -> 597 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .git-crypt/keys/default/0/053FD5A73567E731BEFD3FC13A29B8373D5C3805.gpg diff --git a/.git-crypt/keys/default/0/053FD5A73567E731BEFD3FC13A29B8373D5C3805.gpg b/.git-crypt/keys/default/0/053FD5A73567E731BEFD3FC13A29B8373D5C3805.gpg new file mode 100644 index 0000000000000000000000000000000000000000..ca829714775e245f0ba57acdae7e5566bd505236 GIT binary patch literal 597 zcmV-b0;>Im0gMAU01Y1H@i}h+3;?Bsc1ze+t)>-ys1F|zFtOMHG#sVP^l z43pPPhC`qE@2k1&OymTxN3}&VP!rVeJjJnn=fNz;9am`9nN(R>eGLM~9!ZZcP>4bu zp2M*)7%+x*aI*zg38@>G)ROs{QF``d@cSwf2Pdk-akM(R<}WxUzdGRhZs3Io<@)z< z^UzfdXxgSaH__(_6gw^@^L^39{ck?u4&PHp7@7jESE2ZVrzJxGwv0*4Q-HpJWrtyugNy)dPwkfu?X-mI~o?|?=lE#G*1=sdL3?}c3er= z2e=<1zzi8yEw&QXKJyh;@G~x)oXQwwVw$Ube)Y%e_o#s2xXgN@z)I4<0|B_B75hbR z^w2D7z>*q@jr}j29Vt(rv@#mZD#uZTrj5?~no`UR#TXY416!@s#VWpZf3@4BxCHh_ zA!euqTaykv9utO*lo(~XsgXR};L&UP;;(L?;SPF5Go|-Pg5Tdh1>G+9J>icI?tZVc zxUGIUrVKRgZ_}wivG_J%O!CRnk_v$^3e~<+t!cw3GttrB{Ec@NiXMgYIg~E&a$mHi j%k+eLwn>S+*&TQ)uZhpX*WyIuA)^4lKR7-IZ?IdS@#G^V literal 0 HcmV?d00001 From 487febc43e95a133ef26467c44bd327f03c2397f Mon Sep 17 00:00:00 2001 From: nicolsss <56645701+nicolsss@users.noreply.github.com> Date: Mon, 23 Jan 2023 11:01:06 -0500 Subject: [PATCH 26/64] feat: TTL-815-test-calendar-view-feature-toggle (#972) Co-authored-by: Nicole Garcia --- .../pages/time-entries.component.html | 2 +- .../pages/time-entries.component.spec.ts | 70 ------------------- .../pages/time-entries.component.ts | 3 - 3 files changed, 1 insertion(+), 74 deletions(-) diff --git a/src/app/modules/time-entries/pages/time-entries.component.html b/src/app/modules/time-entries/pages/time-entries.component.html index ce4b96f74..bb63b19eb 100644 --- a/src/app/modules/time-entries/pages/time-entries.component.html +++ b/src/app/modules/time-entries/pages/time-entries.component.html @@ -3,7 +3,7 @@ - diff --git a/src/app/modules/time-entries/pages/time-entries.component.spec.ts b/src/app/modules/time-entries/pages/time-entries.component.spec.ts index 0533ccd1c..854efe5cb 100644 --- a/src/app/modules/time-entries/pages/time-entries.component.spec.ts +++ b/src/app/modules/time-entries/pages/time-entries.component.spec.ts @@ -510,31 +510,6 @@ describe('TimeEntriesComponent', () => { expect(cookieService.get).toHaveBeenCalledWith(sentParameter); }); - it('set false in isFeatureToggleCalendarActive when cookie does not exist', () => { - spyOn(cookieService, 'get'); - - component.ngOnInit(); - - expect(component.isFeatureToggleCalendarActive).toBeFalse(); - }); - - it('set true in isFeatureToggleCalendarActive when cookiesService.get() return true', () => { - const cookieResponseValue = 'true'; - spyOn(cookieService, 'get').and.returnValue(cookieResponseValue); - - component.ngOnInit(); - - expect(component.isFeatureToggleCalendarActive).toBeTrue(); - }); - - it('set false in isFeatureToggleCalendarActive when cookiesService.get() return false', () => { - const cookieResponseValue = 'false'; - spyOn(cookieService, 'get').and.returnValue(cookieResponseValue); - - component.ngOnInit(); - - expect(component.isFeatureToggleCalendarActive).toBeFalse(); - }); it('set true in displayGridView when its initial value is false and call onDisplayModeChange', () => { const expectedValue = true; @@ -644,51 +619,6 @@ describe('TimeEntriesComponent', () => { expect(component.calendarView).toBe(CalendarView.Month); }); - it('not view button onDisplayModeChange when isFeatureToggleCalendarActive is false', () => { - component.isFeatureToggleCalendarActive = false; - - fixture.detectChanges(); - - const HTMLTimeEntriesDebugElement: DebugElement = fixture.debugElement; - const HTMLTimeEntriesElement: HTMLElement = HTMLTimeEntriesDebugElement.nativeElement; - const HTMLTimeEntriesButton = HTMLTimeEntriesElement.querySelector('.btn.btn-primary.float-right'); - expect(HTMLTimeEntriesButton).toBeNull(); - }); - - it('view list button when displayGridView is true and isFeatureToggleCalendarActive is true', () => { - const expectedIconInsideButton = '.fa-list'; - const unexpectedIconInsideButton = '.fa-th'; - component.isFeatureToggleCalendarActive = true; - component.displayGridView = true; - - fixture.detectChanges(); - - const HTMLTimeEntriesDebugElement: DebugElement = fixture.debugElement; - const HTMLTimeEntriesElement: HTMLElement = HTMLTimeEntriesDebugElement.nativeElement; - const HTMLTimeEntriesButton = HTMLTimeEntriesElement.querySelector('.btn.btn-primary.float-right'); - const HTMLExpectedChildButton = HTMLTimeEntriesButton.querySelector(expectedIconInsideButton); - const HTMLUnexpectedChildButton = HTMLTimeEntriesButton.querySelector(unexpectedIconInsideButton); - expect(HTMLExpectedChildButton).not.toBeNull(); - expect(HTMLUnexpectedChildButton).toBeNull(); - }); - - it('view calendar button when displayGridView is false and isFeatureToggleCalendarActive is true', () => { - const expectedIconInsideButton = '.fa-th'; - const unexpectedIconInsideButton = '.fa-list'; - component.isFeatureToggleCalendarActive = true; - component.displayGridView = false; - - fixture.detectChanges(); - - const HTMLTimeEntriesDebugElement: DebugElement = fixture.debugElement; - const HTMLTimeEntriesElement: HTMLElement = HTMLTimeEntriesDebugElement.nativeElement; - const HTMLTimeEntriesButton = HTMLTimeEntriesElement.querySelector('.btn.btn-primary.float-right'); - const HTMLExpectedChildButton = HTMLTimeEntriesButton.querySelector(expectedIconInsideButton); - const HTMLUnexpectedChildButton = HTMLTimeEntriesButton.querySelector(unexpectedIconInsideButton); - expect(HTMLExpectedChildButton).not.toBeNull(); - expect(HTMLUnexpectedChildButton).toBeNull(); - }); - it('view calendarView when displayGridView is true', () => { const expectedView = '#gridView'; component.displayGridView = true; diff --git a/src/app/modules/time-entries/pages/time-entries.component.ts b/src/app/modules/time-entries/pages/time-entries.component.ts index 1fbada9dd..99a3845b8 100644 --- a/src/app/modules/time-entries/pages/time-entries.component.ts +++ b/src/app/modules/time-entries/pages/time-entries.component.ts @@ -14,7 +14,6 @@ import { EntryState } from '../../time-clock/store/entry.reducer'; import { EntryActionTypes } from './../../time-clock/store/entry.actions'; import { getActiveTimeEntry, getTimeEntriesDataSource } from './../../time-clock/store/entry.selectors'; import { CookieService } from 'ngx-cookie-service'; -import { FeatureToggle } from './../../../../environments/enum'; import { CalendarView } from 'angular-calendar'; import { ParseDateTimeOffset } from '../../shared/formatters/parse-date-time-offset/parse-date-time-offset'; @@ -43,7 +42,6 @@ export class TimeEntriesComponent implements OnInit, OnDestroy, AfterViewInit { wasEditingExistingTimeEntry = false; canMarkEntryAsWIP = true; timeEntriesDataSource$: Observable>; - isFeatureToggleCalendarActive: boolean; displayGridView: boolean; selectedDate: moment.Moment; selectedYearAsText: string; @@ -68,7 +66,6 @@ export class TimeEntriesComponent implements OnInit, OnDestroy, AfterViewInit { ngOnInit(): void { this.loadActiveEntry(); - this.isFeatureToggleCalendarActive = (this.cookiesService.get(FeatureToggle.TIME_TRACKER_CALENDAR) === 'true'); this.entriesSubscription = this.actionsSubject$.pipe( filter((action: any) => ( action.type === EntryActionTypes.CREATE_ENTRY_SUCCESS || From 99a9ecb1fe619fcb8cecb024f0920d50b34975c9 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 23 Jan 2023 16:03:00 +0000 Subject: [PATCH 27/64] chore(release): 2.2.0 [skip ci]nn --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 067a1018e..1b463e0e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "time-tracker", - "version": "2.1.2", + "version": "2.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 35a394871..d342dbcde 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "time-tracker", - "version": "2.1.2", + "version": "2.2.0", "scripts": { "preinstall": "npx npm-force-resolutions", "ng": "ng", From b95ae127c12f8993621ce11c4a32e9eaffef125a Mon Sep 17 00:00:00 2001 From: Andres Cabrera <85083117+andresacg30@users.noreply.github.com> Date: Mon, 6 Feb 2023 13:58:14 -0400 Subject: [PATCH 28/64] [TTL-746] Deactivate Legacy Pipelines (#976) * change not used workflows' triggers to manual * add deprecated word to deactivated pipelines --------- Co-authored-by: Andres Cabrera --- .github/workflows/CD-time-tracker-ui.yml | 8 ++------ .github/workflows/CI-mutation-tests.yml | 6 ++---- .github/workflows/CI-time-tracker-ui.yml | 8 ++------ 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/.github/workflows/CD-time-tracker-ui.yml b/.github/workflows/CD-time-tracker-ui.yml index f4c22fa2f..1bbc5a01e 100644 --- a/.github/workflows/CD-time-tracker-ui.yml +++ b/.github/workflows/CD-time-tracker-ui.yml @@ -1,13 +1,9 @@ # Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy # More GitHub Actions for Azure: https://github.com/Azure/actions -name: CD process to deploy to App-Service service +name: (DEPRECATED) CD process to deploy to App-Service service -on: - # Trigger the workflow on pull request but only for the master branch - push: - branches: - - master +on: workflow_dispatch # deactivate workflow and run it manually only jobs: build-and-deploy: diff --git a/.github/workflows/CI-mutation-tests.yml b/.github/workflows/CI-mutation-tests.yml index c69a8834b..036bd2b84 100644 --- a/.github/workflows/CI-mutation-tests.yml +++ b/.github/workflows/CI-mutation-tests.yml @@ -1,8 +1,6 @@ -name: Running mutation tests +name: (DEPRECATED) Running mutation tests -on: - schedule: - - cron: '0 9 * * 1' +on: workflow_dispatch # deactivate workflow and run it manually only jobs: configuring-stryker: diff --git a/.github/workflows/CI-time-tracker-ui.yml b/.github/workflows/CI-time-tracker-ui.yml index 6c971a73f..00cd4e301 100644 --- a/.github/workflows/CI-time-tracker-ui.yml +++ b/.github/workflows/CI-time-tracker-ui.yml @@ -1,10 +1,6 @@ -name: CI process for time-tracker app +name: (DEPRECATED) CI process for time-tracker app -on: - pull_request: - types: [opened, edited, reopened, synchronize] - branches: - - master +on: workflow_dispatch # deactivate workflow and run it manually only jobs: # security-audit: From 14b1b7212fbcf03f60af4774f0561b128336ad2c Mon Sep 17 00:00:00 2001 From: mmaquina Date: Mon, 6 Feb 2023 15:02:59 -0300 Subject: [PATCH 29/64] Added new credentials for azure login (#973) * Added new credentials for azure login * update prod credentials * change workflow to avoid run duplication --- .github/workflows/time-tracker-ui-cd-prod.yml | 2 +- .github/workflows/time-tracker-ui-cd-stage.yml | 2 +- .github/workflows/time-tracker-ui-ci.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/time-tracker-ui-cd-prod.yml b/.github/workflows/time-tracker-ui-cd-prod.yml index 26c54d0c1..cf531e0a3 100644 --- a/.github/workflows/time-tracker-ui-cd-prod.yml +++ b/.github/workflows/time-tracker-ui-cd-prod.yml @@ -28,7 +28,7 @@ jobs: - name: Login to azure uses: Azure/login@v1 with: - creds: ${{ secrets.AZURE_CREDENTIALS }} + creds: '{"clientId":"${{ secrets.TF_ARM_CLIENT_ID }}","clientSecret":"${{ secrets.TF_ARM_CLIENT_SECRET }}","subscriptionId":"${{ secrets.TF_ARM_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.TF_ARM_TENANT_ID }}"}' - name: Unlock PROD secrets uses: sliteteam/github-action-git-crypt-unlock@1.2.0 diff --git a/.github/workflows/time-tracker-ui-cd-stage.yml b/.github/workflows/time-tracker-ui-cd-stage.yml index a57cfec09..276907f37 100644 --- a/.github/workflows/time-tracker-ui-cd-stage.yml +++ b/.github/workflows/time-tracker-ui-cd-stage.yml @@ -28,7 +28,7 @@ jobs: - name: Login to azure uses: Azure/login@v1 with: - creds: ${{ secrets.AZURE_CREDENTIALS }} + creds: '{"clientId":"${{ secrets.TF_ARM_CLIENT_ID }}","clientSecret":"${{ secrets.TF_ARM_CLIENT_SECRET }}","subscriptionId":"${{ secrets.TF_ARM_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.TF_ARM_TENANT_ID }}"}' - name: Unlock STAGE secrets uses: sliteteam/github-action-git-crypt-unlock@1.2.0 diff --git a/.github/workflows/time-tracker-ui-ci.yml b/.github/workflows/time-tracker-ui-ci.yml index d7992606d..74d867c4c 100644 --- a/.github/workflows/time-tracker-ui-ci.yml +++ b/.github/workflows/time-tracker-ui-ci.yml @@ -3,11 +3,11 @@ name: time-tracker-ui-ci on: push: branches: - - "**" + - "master" pull_request: branches: - - "**" + - "master" jobs: ci: From 0b1482caa17961c12f1bad620416dbd149e55cf2 Mon Sep 17 00:00:00 2001 From: nicolsss <56645701+nicolsss@users.noreply.github.com> Date: Wed, 15 Feb 2023 10:12:53 -0500 Subject: [PATCH 30/64] fix: TTL-795-fix-customers-table-remove-duplicated-subscription (#977) Co-authored-by: Nicole Garcia --- .../components/customer-list/customer-list.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html index f1bae3ec1..33e9226b1 100644 --- a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html +++ b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html @@ -15,7 +15,7 @@ - + {{ customer.id }} {{ customer.name }} From efded51cff199cceabc7ee666d0ebe20ff277658 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 15 Feb 2023 15:15:34 +0000 Subject: [PATCH 31/64] chore(release): 2.2.1 [skip ci]nn --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1b463e0e8..ce9e01bd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "time-tracker", - "version": "2.2.0", + "version": "2.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d342dbcde..920e6eecd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "time-tracker", - "version": "2.2.0", + "version": "2.2.1", "scripts": { "preinstall": "npx npm-force-resolutions", "ng": "ng", From d956d9e4539b95de3443278e644d13d53d103442 Mon Sep 17 00:00:00 2001 From: Wolfgang Welcomez Date: Wed, 1 Mar 2023 13:21:30 -0500 Subject: [PATCH 32/64] Feat: Devops 202 Migrate remaining tf state time tracker ui (#978) --- .github/workflows/time-tracker-ui-cd-prod.yml | 4 ++- .../workflows/time-tracker-ui-cd-stage.yml | 2 ++ .github/workflows/time-tracker-ui-ci.yml | 3 +++ infrastructure/main.tf | 27 +++++++++++-------- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.github/workflows/time-tracker-ui-cd-prod.yml b/.github/workflows/time-tracker-ui-cd-prod.yml index cf531e0a3..f2ae46744 100644 --- a/.github/workflows/time-tracker-ui-cd-prod.yml +++ b/.github/workflows/time-tracker-ui-cd-prod.yml @@ -15,7 +15,9 @@ jobs: ARM_CLIENT_SECRET: ${{secrets.TF_ARM_CLIENT_SECRET}} ARM_SUBSCRIPTION_ID: ${{secrets.TF_ARM_SUBSCRIPTION_ID}} ARM_TENANT_ID: ${{secrets.TF_ARM_TENANT_ID}} - + AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}} + AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} + steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/time-tracker-ui-cd-stage.yml b/.github/workflows/time-tracker-ui-cd-stage.yml index 276907f37..d71f65925 100644 --- a/.github/workflows/time-tracker-ui-cd-stage.yml +++ b/.github/workflows/time-tracker-ui-cd-stage.yml @@ -15,6 +15,8 @@ jobs: ARM_CLIENT_SECRET: ${{secrets.TF_ARM_CLIENT_SECRET}} ARM_SUBSCRIPTION_ID: ${{secrets.TF_ARM_SUBSCRIPTION_ID}} ARM_TENANT_ID: ${{secrets.TF_ARM_TENANT_ID}} + AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}} + AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} steps: - name: Checkout diff --git a/.github/workflows/time-tracker-ui-ci.yml b/.github/workflows/time-tracker-ui-ci.yml index 74d867c4c..b5cb7cd64 100644 --- a/.github/workflows/time-tracker-ui-ci.yml +++ b/.github/workflows/time-tracker-ui-ci.yml @@ -18,6 +18,9 @@ jobs: ARM_CLIENT_SECRET: ${{secrets.TF_ARM_CLIENT_SECRET}} ARM_SUBSCRIPTION_ID: ${{secrets.TF_ARM_SUBSCRIPTION_ID}} ARM_TENANT_ID: ${{secrets.TF_ARM_TENANT_ID}} + AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}} + AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} + strategy: max-parallel: 5 steps: diff --git a/infrastructure/main.tf b/infrastructure/main.tf index 4907d9b7f..caa878ec7 100644 --- a/infrastructure/main.tf +++ b/infrastructure/main.tf @@ -5,15 +5,22 @@ terraform { source = "hashicorp/azurerm" version = "~> 2.90" } + aws = { + source = "hashicorp/aws" + version = "~> 4.9.0" + } } - backend "azurerm" { - resource_group_name = "ioet-infra-tf-state" - storage_account_name = "timetrackertfstate" - container_name = "time-tracker-tf-state" - key = "time-tracker-ui.tfstate" + backend "s3" { + bucket = "time-tracker-service" + key = "ioet-time-tracker-ui/terraform.tfstate" + region = "us-east-1" + encrypt = true } +} +provider "aws" { + region = "us-east-1" } provider "azurerm" { @@ -22,13 +29,11 @@ provider "azurerm" { } data "terraform_remote_state" "service" { - backend = "azurerm" - workspace = terraform.workspace + backend = "s3" config = { - resource_group_name = "ioet-infra-tf-state" - storage_account_name = "timetrackertfstate" - container_name = "time-tracker-tf-state" - key = "this.tfstate" + bucket = "time-tracker-service" + key = "env://${local.environment}/time-tracker-service/terraform.tfstate" + region = "us-east-1" } } From a35a658291b3eb7ce45effeb78e221a121c72460 Mon Sep 17 00:00:00 2001 From: mmaquina Date: Thu, 6 Apr 2023 15:49:34 -0300 Subject: [PATCH 33/64] Add Nicole Garcia as a collaborator for prod and stage envs (#981) --- .../F0EBF422F70334C5FE8CAF487A1FE9C45A4A5B22.gpg | Bin 0 -> 603 bytes .../F0EBF422F70334C5FE8CAF487A1FE9C45A4A5B22.gpg | Bin 0 -> 606 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 .git-crypt/keys/PROD/0/F0EBF422F70334C5FE8CAF487A1FE9C45A4A5B22.gpg create mode 100644 .git-crypt/keys/STAGE/0/F0EBF422F70334C5FE8CAF487A1FE9C45A4A5B22.gpg diff --git a/.git-crypt/keys/PROD/0/F0EBF422F70334C5FE8CAF487A1FE9C45A4A5B22.gpg b/.git-crypt/keys/PROD/0/F0EBF422F70334C5FE8CAF487A1FE9C45A4A5B22.gpg new file mode 100644 index 0000000000000000000000000000000000000000..1d49695534f46e30b6f3f34399a0d5ce1df6ff72 GIT binary patch literal 603 zcmV-h0;K(g0gMCUnJSaY$OW1K3;>$=>dAPhgAUPs-c4%hM>SuD>^aI5?3s%Cs8@O^ zaAsNL@(%(5BDi#1(~`!1q8cQ2;{pVW^`xd7*F{W4c#=kT*Y2MW!ULJ@Rn#P%#klg) zA&No=IWqBDzhP`16>=)B-QXvEluWDDGOV~`tRx#$nXNo*e>HbvPwfzp6q_sB@Aiy3 zk!}Fb;Z^kNimc{GZO0pSAmFa%2cTtVu*P25m8=iMXNnU8pEWorX;=;T(-s^Ssmv+- z30n-LAl+s1lSj8Ar9TpBBLDfr7^7gGA(u8&any$vu5es7+F2>`MK%h7dnCnr?qy>L z{&joKXe`6P`=@Y4fjvO?3myjWZgJTuV}pSw!m9M28Qby5i_JuMD(7-^rHji3RoveX zO#NzFk}KTFaq?N-qbh2cA8~WZ% zqlVnYdUv#zWMCch6lBQy4ZQ8##?(Q@MCTIe=n2$&vtgx2+*QC;_LDVd+3&60hD?fjAI7 p_x5*hG+kRr&prjM9*g^L%O1CJ@1sZj&Jj6Ah7IVl5h?6*J9--AD5(Gd literal 0 HcmV?d00001 diff --git a/.git-crypt/keys/STAGE/0/F0EBF422F70334C5FE8CAF487A1FE9C45A4A5B22.gpg b/.git-crypt/keys/STAGE/0/F0EBF422F70334C5FE8CAF487A1FE9C45A4A5B22.gpg new file mode 100644 index 0000000000000000000000000000000000000000..1a2cc94c78340ee62e37dc413a8db255e5b19cd7 GIT binary patch literal 606 zcmV-k0-^nd0gMCUnJSaY$OW1K3;F{(zI|8VR&UwGp|LVQl%9}BN%UyRtNuLrH7`w6O`RL@-07M`jl+Y+3)W4inlEr29jUfyH=MPmAB# z;@XU(v&p!E8&qj_yu0o>m4?grvRZ4_&@TV^;v?w^%=C3;W@WN9phw%L%B8I9^-zR- z>P+#&NaYKe8Y+bGwzIzIEcrgjz%5<^x8MSqyW_O{Qb~XX2qKJ92s?vWQGQWwK8SSB z&j{S)S|-B@wo2@zl^}JN2gYw_*KMBe@6EzJLfz+qrUtt#pyV0D6T$s2m zn#SUrhSM7iiNRna0}{VkN()^ISF&ZGgD!K~*oqJu-rM(Wm#oDML0~x^J^bn(0B^!T z$mgT4zd0HXnR6~-iI}s|Qoj%F0s|MM8qntjai&YBjDhDH;sZT|TJ>p-$-=r-7Bw0a#*%V>Kpai)^vNkH*zbMB0m33sbqovfsjsRKeId zXf=JI80$^NL-JJ)z!zXA1fT1tT3oWi_V0yZub*X^W2KPX|0IDv94{N=t|ZvxvYH7l zugLOt+MIPH^$l37+PA}x26$*3cQ{6GjczuxlFY)d+qe}^jk8BNHfgX@hBHzDIVE=2 sO4}!px5u0_eKBSn_nT#Gv)9smFU literal 0 HcmV?d00001 From ed217e5cdfb56b0b338acd8a0d89348661cbb2b5 Mon Sep 17 00:00:00 2001 From: nicolsss <56645701+nicolsss@users.noreply.github.com> Date: Thu, 13 Apr 2023 08:58:58 -0500 Subject: [PATCH 34/64] Fast api implementation (#979) * refactor: change endpoints route * refactor: backend port * fix make publish * fix aws login * change backend link * fix findEntriesByProjectId endpoint url * fix url createEntry * triggers by: tag->prod, publish release->stage * disable triggers to azure workflow * fix dockerfiles for aws --------- Co-authored-by: Nicole Garcia Co-authored-by: mmaquina --- .gitattributes | 4 +- .github/workflows/aws-ui-cd-prod.yml | 65 +++++++++++++++++ .github/workflows/aws-ui-cd-stage.yml | 67 ++++++++++++++++++ .github/workflows/time-tracker-ui-cd-prod.yml | 4 +- .../workflows/time-tracker-ui-cd-stage.yml | 4 +- .prod.aws.env | Bin 0 -> 566 bytes .prod.env | Bin 633 -> 630 bytes .stage.aws.env | Bin 0 -> 578 bytes .stage.env | Bin 639 -> 634 bytes Makefile | 14 ++-- README.md | 2 +- infrastructure/aws_ec2.sh | 6 ++ .../components/services/project.service.ts | 2 +- .../interceptors/inject.token.interceptor.ts | 2 +- .../time-clock/services/entry.service.ts | 14 ++-- 15 files changed, 160 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/aws-ui-cd-prod.yml create mode 100644 .github/workflows/aws-ui-cd-stage.yml create mode 100644 .prod.aws.env create mode 100644 .stage.aws.env create mode 100644 infrastructure/aws_ec2.sh diff --git a/.gitattributes b/.gitattributes index 6b7b4ea15..4b6561ba1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,5 @@ .dev.env filter=git-crypt diff=git-crypt .prod.env filter=git-crypt-PROD diff=git-crypt-PROD -.stage.env filter=git-crypt-STAGE diff=git-crypt-STAGE \ No newline at end of file +.stage.env filter=git-crypt-STAGE diff=git-crypt-STAGE +.stage.aws.env filter=git-crypt-STAGE diff=git-crypt-STAGE +.prod.aws.env filter=git-crypt-PROD diff=git-crypt-PROD diff --git a/.github/workflows/aws-ui-cd-prod.yml b/.github/workflows/aws-ui-cd-prod.yml new file mode 100644 index 000000000..b254dd05e --- /dev/null +++ b/.github/workflows/aws-ui-cd-prod.yml @@ -0,0 +1,65 @@ +name: time-tracker-ui-cd-prod + +on: + push: + branches: + - 'fast-api*' + +jobs: + cd: + runs-on: ubuntu-latest + env: + AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}} + AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Get the release_version + run: | + echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + echo $RELEASE_VERSION + + - name: Unlock PROD secrets + uses: sliteteam/github-action-git-crypt-unlock@1.2.0 + env: + GIT_CRYPT_KEY: ${{ secrets.GIT_CRYPT_KEY_PROD }} + + - name: Build the docker image + run: |- + docker build \ + --target production -t timetracker_ui -f Dockerfile_prod \ + . + + - name: Publish docker image to prod aws container registry + run: | + make login publish_prod image_tag=$RELEASE_VERSION + + - name: SCP files via ssh key + uses: appleboy/scp-action@master + env: + USERNAME: ${{ secrets.AWS_EC2_USER }} + HOST: ${{ secrets.PROD_UI_URL }} + KEY: ${{ secrets.PROD_AWS_PRIVATE_KEY }} + with: + source: './infrastructure/aws_ec2.sh' + target: '.' + + - name: SCP files via ssh key - .prod.aws.env + uses: appleboy/scp-action@master + env: + USERNAME: ${{ secrets.AWS_EC2_USER }} + HOST: ${{ secrets.PROD_UI_URL }} + KEY: ${{ secrets.PROD_AWS_PRIVATE_KEY }} + with: + source: '.prod.aws.env' + target: '.' + + - name: Deploy + run: | + TEMP=$(mktemp) + echo "${{ secrets.PROD_AWS_PRIVATE_KEY }}" > $TEMP + chmod 400 $TEMP + ssh -o 'StrictHostKeyChecking no' -i $TEMP ${{ secrets.AWS_EC2_USER }}@${{ secrets.PROD_UI_URL }} "chmod +x ./infrastructure/aws_ec2.sh" + ssh -o 'StrictHostKeyChecking no' -i $TEMP ${{ secrets.AWS_EC2_USER }}@${{ secrets.PROD_UI_URL }} "./infrastructure/aws_ec2.sh $RELEASE_VERSION" prod diff --git a/.github/workflows/aws-ui-cd-stage.yml b/.github/workflows/aws-ui-cd-stage.yml new file mode 100644 index 000000000..bd7c146fc --- /dev/null +++ b/.github/workflows/aws-ui-cd-stage.yml @@ -0,0 +1,67 @@ +name: time-tracker-ui-cd-stage + +on: + release: + types: + - published + +jobs: + cd: + runs-on: ubuntu-latest + env: + TF_WORKSPACE: stage + AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}} + AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Get the release_version + run: | + echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + echo $RELEASE_VERSION + + + - name: Unlock STAGE secrets + uses: sliteteam/github-action-git-crypt-unlock@1.2.0 + env: + GIT_CRYPT_KEY: ${{ secrets.GIT_CRYPT_KEY_STAGE }} + + - name: Build the docker image + run: |- + docker build \ + --target production -t timetracker_ui -f Dockerfile_stage \ + . + + - name: Publish docker image to stage AWS container registry + run: | + make login publish image_tag=$RELEASE_VERSION + + - name: SCP files via ssh key - script + uses: appleboy/scp-action@master + env: + USERNAME: ${{ secrets.AWS_EC2_USER }} + HOST: ${{ secrets.STAGE_UI_URL }} + KEY: ${{ secrets.STAGE_AWS_PRIVATE_KEY }} + with: + source: './infrastructure/aws_ec2.sh' + target: '.' + + - name: SCP files via ssh key - .stage.aws.env + uses: appleboy/scp-action@master + env: + USERNAME: ${{ secrets.AWS_EC2_USER }} + HOST: ${{ secrets.STAGE_UI_URL }} + KEY: ${{ secrets.STAGE_AWS_PRIVATE_KEY }} + with: + source: '.stage.aws.env' + target: '.' + + - name: Deploy + run: | + TEMP=$(mktemp) + echo "${{ secrets.STAGE_AWS_PRIVATE_KEY }}" > $TEMP + chmod 400 $TEMP + ssh -o 'StrictHostKeyChecking no' -i $TEMP ${{ secrets.AWS_EC2_USER }}@${{ secrets.STAGE_UI_URL }} "chmod +x ./infrastructure/aws_ec2.sh" + ssh -o 'StrictHostKeyChecking no' -i $TEMP ${{ secrets.AWS_EC2_USER }}@${{ secrets.STAGE_UI_URL }} "./infrastructure/aws_ec2.sh $RELEASE_VERSION" stage diff --git a/.github/workflows/time-tracker-ui-cd-prod.yml b/.github/workflows/time-tracker-ui-cd-prod.yml index f2ae46744..c34b3587d 100644 --- a/.github/workflows/time-tracker-ui-cd-prod.yml +++ b/.github/workflows/time-tracker-ui-cd-prod.yml @@ -1,9 +1,7 @@ name: time-tracker-ui-cd-prod on: - release: - types: - - published + workflow_dispatch # deactivate workflow and run it manually only jobs: cd: diff --git a/.github/workflows/time-tracker-ui-cd-stage.yml b/.github/workflows/time-tracker-ui-cd-stage.yml index d71f65925..0e287b426 100644 --- a/.github/workflows/time-tracker-ui-cd-stage.yml +++ b/.github/workflows/time-tracker-ui-cd-stage.yml @@ -1,9 +1,7 @@ name: time-tracker-ui-cd-stage on: - push: - tags: - - 'v*.*.*' + workflow_dispatch # deactivate workflow and run it manually only jobs: cd: diff --git a/.prod.aws.env b/.prod.aws.env new file mode 100644 index 0000000000000000000000000000000000000000..9fae68b07c5da5909a9ebb152cb98f2a6043eccf GIT binary patch literal 566 zcmV-60?GXVM@dveQdv+`0BVG;VJst_LRoDlZRxL2_Z~3)Ab<$LV}u5KtcKu!ek6&w zlTC&A!g?A3qy%m89GnDGs|MiWq#^blVP3jkCP1L<gRJ9Z9(cmsgax7!dY@tt-I>xMPLJUs9kY z?m<%wFHdVwCIj+s_476(C`55(0c9seG6SU}wRP3gCa+iY@NM@f%z-a}a&+~_+GlV9 z3SGZTX1fYxOr|7)boeGo^tbVmrM6#;soz)J3WtPV(Fg$af@C9Bj+wBAj~-BRTC__L zHob6-hiBkn4R_g?vbNG>D`b|8Z_x*dDI~gQwb`i!YdgZ}8BTvUd<4|KC!BaME@rE8 z-1`~U^dK_?7&>BnIz)djR|h;L|FTgQRe~b#PEj85yw!?;h*<{8wU$!)SKB6`%2A?Afsj^5L1tS*hs0kBpo-|>FMh~ zPOQx?q{{gr0rGqx(zTV7-uI-KlI{+%^n@@mWVQ|#>r(Z}zPWjP?%t#-~cHoCvu=>&sIn*Y=b2ze^3PBI_NKBfImSck4_V+SwcIf5Y~2W=(qF@ ze*LF5!siQ903*?C$L&^S7Oo;}ei)6}a~=Bau)?3KU;gzYObGr;KtgOQ@0*!3nD{^| z{GRMv7MwBz5My}qD^8T(rtl%+qT7oAQGvmtm88CQ-p0C1rG+K%q4gh_WxVJoxwa`? zSQhd|Ko3|u)eE2P)CI%TG$YTMlxXbuIP78zk}to>0=#_)b44l@g)|DGWhYGr+O?h|dCsK$@ytdz zP7lf< zizb^5CifcxcvPLFdE3SIMmSEoK_f@`BK+h*2n1FDu%#1#?WT#91g^|c4-OA-DMw1_ zRsHPma$t2N_*kbIh>sJi%WPMaxxt-ttdZ6h)Vo+QPkWHAsEjlPI)FvZEUa1G(Ce9^ z#!YcS2`LF?TfQ`D7vOi$nROJ8FZL*lJxhabw9(B7$8{kphT_>*n5 z&2Sz|Z2F)7SlZ%3GJN{6lyIVS`GkV2^ImO4f8E%!m*;vYqzXtX6#A)()QB~0Nha?? zF%5K(dy^YShuWkcWBVRUs_IWGw4H&i%OoSiRneR`$88Sd2{7L;Ck8uxdKF|E^MUWc zY)018!uTD+H&11}hi~iA#wU^gyYyR$k0g^!u_oDt$6)rAr0~#h^D)GasA&aUGagkB zBKfxz*TF#;o%Y6UEwQ20Nle`SV_c-97*R%#z0`Voe7Y#S#uLr!pPCHAw!H;X^fA9r zRPKM);~bLh>*4mv(=&)?5!P+fwA?pnY4WXG@kg}|&tSOy809}Cw4E+|see+mszZ-k zL2_0d`IyFt688s8946t-R#yJRS#{%x#pRyRT=)ueT&vnj2b>QWmteO&SCmQIe@6Zu zx|OSU0B_9(`=!DTkbI0eGVNNrnvzqWQFAcuA&sT^@(m z11pvZA=JOGl)qqyo6LQEjs$s^ z-#?Gif+pn`Ojw#ik!MVYW;G)o>!4Oc`>yeF-91k^BHxcGutu1IMFu$1--WUT83%d$ z%X;!u`VhcT7vi;!bE^<_R$L+jk{C#zjgl3?(W?c_2rE2I(Kd4mgR>mvhNMPZlwVHy TbC;Pvpf4sOe^RMqjdJyfD_TIc diff --git a/.stage.aws.env b/.stage.aws.env new file mode 100644 index 0000000000000000000000000000000000000000..20e6ec6de28028db5be60de6937087cbe5c2f4a4 GIT binary patch literal 578 zcmV-I0=@kJM@dveQdv+`0AVKo&P*fDk1rQiiWO=Ak_2faQycGlT|90q^Ao*shpyL; zNt|P{CO(Lv1w|CGjFvjYR_&KsQE93?2Y^kOTgA>) zNiYblOTL_9fA4rgH}p3`l$L#&%St~RT*i4NyI4F;PHT@fulpf$^IBbdiF)jiA0Q*5 z4zO=_8X%6+d+D>Y8Pukgfs3r|ollzd4U63fcZL}*9Uj0S0sHl7zxt!W>1{$^(>)I$ zjjsxlx2$8=Mqg1y-~$z03KeBA>&%G%PvTJ733kgTL5tFft4v1uRTlghNJSr}srpuV z#w1a;LQXDd&mOG0qHgz&HcM;!BTeiywU(5;d_ z##B(40CL#yqs|dlO5^dKd{v6aNvhz?BV|_CFLc3+7bkY`%{R zWV~WH`)25}A$3yS8V^rwNJ8BYCA&OZj=KUFRo~`uB&O^#@c6+w+y<7$xf65HWCh7i QE?RH+tL&G>;}|+HujsH3Gynhq literal 0 HcmV?d00001 diff --git a/.stage.env b/.stage.env index 7e97985779683edd93f1f6db371dc95ee7477102..de69d65a04acae9222e63301792813626f933bd8 100644 GIT binary patch literal 634 zcmV-=0)_nmM@dveQdv+`0C%fFO6$>R59RTQ0Di>Gqb*+dtZR}#9wDlR%>Ykbf^aOjAkzN+4E6GLsYd zSkBC#cgW~TDpfYmV)24ZcJ14wUHcP9@mk?scwO{YMgTx>FenHEA68vUK&6D(tq9~q z;>}|}LJs!KyA4x02b>&$>OUCaKX5U*B=&8~tf1WI!Rm_B#aI~qthU~It3(e1QkFbxbj+Bm;us+JdQa+Ot$mD*b!!|(yU)A zVfe$O2%%l2DCS#NKOF+EaKtYKo|vpUh>GbykB_DFyZ?<_sT-BVy_7LRQT>Q&G~u2K z!gF14auzY+1jzOg=+S->1jY9|v||Hp;|mS|5)G)jsG{h=TEVU{K$~{n0@;m|33|czalj%^wzZn4 URURSV>$8w=xLeSS8(qH;--K#5umAu6 literal 639 zcmV-_0)YJhM@dveQdv+`0AS#hnTtw&YS9a`U7zlaLM$)a-nh4(wgba!!iLp8pOxbQ&{d!Tp*(A<`XP7!1 zm|qML1##Nh3tA{blahW+2>Tpm+x|zGVmyyS;+9I5F8{QT7V3o*Vd>+!DfEFG~Y2#szf>IBIzQ z^iq-=y=%@vTn11-#?~I>C$Q$>mdImE&WgD1n?XeuY5k4}SAVYo0IfIF7sw`rW$hE| zeXmoUXkwlrM3;B99Y_HSktrBrz|nsf#F>m3XVgzTl?B{#DXC#ntt%3txh`a3*d%yl zR?HBvIYY3?v|i(+{b4uHp!AeSMRVECvz1Uk|I37iR8V(yo>s^1N8q(F!}|XBT3(;M zN@i1~@ugnoI@{tfU*+>Qh{dI^u4Xq1tik#bZHOQha!a0 zug8vm>yGse%frK#bfZPTgv2sYb-yyA#!k%};PR)L_p1uaQBkN;OF9jH5x?t-db9SL Zz;M+b3%On@XFOGRrX<`o0U}8M image_tag= - docker tag timetracker_ui:latest $(acr).azurecr.io/timetracker_ui:$(image_tag) - docker push $(acr).azurecr.io/timetracker_ui:$(image_tag) +publish: require-image_tag-arg ## Upload a docker image to the stage AWS container registry image_tag= + docker tag timetracker_ui:latest 568748651446.dkr.ecr.us-east-1.amazonaws.com/time-tracker/stage-ui:$(image_tag) + docker push 568748651446.dkr.ecr.us-east-1.amazonaws.com/time-tracker/stage-ui:$(image_tag) .PHONY: build_prod build_prod: ## Create docker image with dependencies needed for production -- to test locally only @@ -80,13 +80,13 @@ remove_prod: ## Delete container timetracker_ui_prod. docker rm timetracker_ui_prod .PHONY: publish_prod -publish_prod: ## Upload a docker image to the prod azure container registry acr= image_tag= - docker tag timetracker_ui_prod:latest $(acr).azurecr.io/timetracker_ui:$(image_tag) - docker push $(acr).azurecr.io/timetracker_ui:$(image_tag) +publish_prod: require-image_tag-arg ## Upload a docker image to the prod AWS container registry image_tag= + docker tag timetracker_ui:latest 568748651446.dkr.ecr.us-east-1.amazonaws.com/time-tracker/prod-ui:$(image_tag) + docker push 568748651446.dkr.ecr.us-east-1.amazonaws.com/time-tracker/prod-ui:$(image_tag) .PHONY: login login: ## Login in respository of docker images - az acr login --name $(acr) + aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 568748651446.dkr.ecr.us-east-1.amazonaws.com .PHONY: release release: require-VERSION-arg require-COMMENT-arg ## Creates an pushes a new tag. diff --git a/README.md b/README.md index 94e90975a..71e6e31d8 100644 --- a/README.md +++ b/README.md @@ -181,7 +181,7 @@ Stryker is also executed on GitHub actions with the following cron expresion: Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). -## Deploy the app on Azure +## Deploy the app on Azure (deprecated) The app deployment is automatically executed after each pull request is merged in master. That's wht it is necessary that each pull request meets at least 80% of test coverage. diff --git a/infrastructure/aws_ec2.sh b/infrastructure/aws_ec2.sh new file mode 100644 index 000000000..2b9961ed2 --- /dev/null +++ b/infrastructure/aws_ec2.sh @@ -0,0 +1,6 @@ +#!/usr/bin/sh +echo "Deploying $1..." +docker ps -aq | xargs docker stop| xargs docker rm --force --volumes +docker system prune -af +aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 568748651446.dkr.ecr.us-east-1.amazonaws.com +docker run -d --name timetracker_ui --env-file .$2.aws.env -p 80:80 568748651446.dkr.ecr.us-east-1.amazonaws.com/time-tracker/$2-ui:$1 diff --git a/src/app/modules/customer-management/components/projects/components/services/project.service.ts b/src/app/modules/customer-management/components/projects/components/services/project.service.ts index c5b431b1a..9ebdc6ea3 100644 --- a/src/app/modules/customer-management/components/projects/components/services/project.service.ts +++ b/src/app/modules/customer-management/components/projects/components/services/project.service.ts @@ -25,7 +25,7 @@ export class ProjectService { } getRecentProjects(): Observable { - return this.http.get(`${this.url}/recent`); + return this.http.get(`${this.url}/recent/`); } createProject(projectData): Observable { diff --git a/src/app/modules/shared/interceptors/inject.token.interceptor.ts b/src/app/modules/shared/interceptors/inject.token.interceptor.ts index 58752c9a1..cad849a0c 100644 --- a/src/app/modules/shared/interceptors/inject.token.interceptor.ts +++ b/src/app/modules/shared/interceptors/inject.token.interceptor.ts @@ -26,7 +26,7 @@ export class InjectTokenInterceptor implements HttpInterceptor { const token = this.isProduction ? this.azureAdB2CService.getBearerToken() : this.loginService.getBearerToken(); const requestWithHeaders = request.clone( { - headers: request.headers.set('Authorization', + headers: request.headers.set('token', 'Bearer ' + token) }); return next.handle(requestWithHeaders) diff --git a/src/app/modules/time-clock/services/entry.service.ts b/src/app/modules/time-clock/services/entry.service.ts index e8b9a1b63..939f94c79 100644 --- a/src/app/modules/time-clock/services/entry.service.ts +++ b/src/app/modules/time-clock/services/entry.service.ts @@ -23,16 +23,16 @@ export class EntryService { urlInProductionLegacy = environment.production === EnvironmentType.TT_PROD_LEGACY; loadActiveEntry(): Observable { - return this.http.get(`${this.baseUrl}/running`); + return this.http.get(`${this.baseUrl}/running/`); } loadEntries(date): Observable { const timezoneOffset = new Date().getTimezoneOffset(); - return this.http.get(`${this.baseUrl}?month=${date.month}&year=${date.year}&timezone_offset=${timezoneOffset}`); + return this.http.get(`${this.baseUrl}/?month=${date.month}&year=${date.year}&timezone_offset=${timezoneOffset}`); } createEntry(entryData): Observable { - return this.http.post(this.baseUrl, entryData); + return this.http.post(`${this.baseUrl}/`, entryData); } updateEntry(entryData): Observable { @@ -47,7 +47,7 @@ export class EntryService { stopEntryRunning(idEntry: string): Observable { return (this.urlInProductionLegacy ? - this.http.post(`${this.baseUrl}/${idEntry}/stop`, null) : this.http.put(`${this.baseUrl}/stop`, null) ); + this.http.post(`${this.baseUrl}/${idEntry}/stop/`, null) : this.http.put(`${this.baseUrl}/stop/`, null) ); } restartEntry(idEntry: string): Observable { @@ -57,20 +57,20 @@ export class EntryService { summary(): Observable { const timeOffset = new Date().getTimezoneOffset(); - const summaryUrl = `${this.baseUrl}/summary?time_offset=${timeOffset}`; + const summaryUrl = `${this.baseUrl}/summary/?time_offset=${timeOffset}`; return this.http.get(summaryUrl); } findEntriesByProjectId(projectId: string): Observable { const startDate = this.getDateLastMonth(); const endDate = this.getCurrentDate(); - const findEntriesByProjectURL = `${this.baseUrl}?limit=2&project_id=${projectId}&start_date=${startDate}&end_date=${endDate}`; + const findEntriesByProjectURL = `${this.baseUrl}/?limit=2&project_id=${projectId}&start_date=${startDate}&end_date=${endDate}`; return this.http.get(findEntriesByProjectURL); } loadEntriesByTimeRange(range: TimeEntriesTimeRange, userId: string): Observable { const MAX_NUMBER_OF_ENTRIES_FOR_REPORTS = 9999; - const loadEntriesByTimeRangeURL = this.urlInProductionLegacy ? this.baseUrl : this.baseUrl + '/report'; + const loadEntriesByTimeRangeURL = this.urlInProductionLegacy ? this.baseUrl : this.baseUrl + '/report/'; return this.http.get(loadEntriesByTimeRangeURL, { params: { From fde4209c7e49b3dcffe65507aa29850fe70f25f1 Mon Sep 17 00:00:00 2001 From: Abigail Cabascango <51092317+abigailscl@users.noreply.github.com> Date: Thu, 13 Apr 2023 09:01:23 -0500 Subject: [PATCH 35/64] feat: add PR template (#970) --- .github/pull_request_template.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..c08c8675d --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,15 @@ +## Description + +Add a description of the: feature, bug fix,code change that improves performance, that affect the build system or external dependencies, on documentation, refactor or test. + +## Files changed + +- Add a list of files that have been changed + +## Task board + +- [Ticket name](Ticket url) + +## Acceptance criteria + +Add the acceptance criteria for this task. \ No newline at end of file From 542fdc432f4be66c93f50d69d44f7ec88ec7d00e Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 13 Apr 2023 14:03:11 +0000 Subject: [PATCH 36/64] chore(release): 2.3.0 [skip ci]nn --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index ce9e01bd0..e5ee23f57 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "time-tracker", - "version": "2.2.1", + "version": "2.3.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 920e6eecd..85b09b82c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "time-tracker", - "version": "2.2.1", + "version": "2.3.0", "scripts": { "preinstall": "npx npm-force-resolutions", "ng": "ng", From 9888ebbd1bd622b9436a72beea0733d63eb6402f Mon Sep 17 00:00:00 2001 From: mmaquina Date: Thu, 13 Apr 2023 16:43:59 -0300 Subject: [PATCH 37/64] fix: tests (#982) * fix: tests --- .../components/services/project.service.spec.ts | 2 +- .../components/store/project.effects.spec.ts | 4 ++-- .../inject.token.interceptor.spec.ts | 15 --------------- .../time-clock/services/entry.service.spec.ts | 16 ++++++++-------- .../pages/time-entries.component.spec.ts | 9 --------- 5 files changed, 11 insertions(+), 35 deletions(-) diff --git a/src/app/modules/customer-management/components/projects/components/services/project.service.spec.ts b/src/app/modules/customer-management/components/projects/components/services/project.service.spec.ts index 83cb39475..368b74447 100644 --- a/src/app/modules/customer-management/components/projects/components/services/project.service.spec.ts +++ b/src/app/modules/customer-management/components/projects/components/services/project.service.spec.ts @@ -74,7 +74,7 @@ describe('ProjectService', () => { service.getRecentProjects().subscribe((projectsInResponse) => { expect(projectsInResponse.length).toBe(projectsFoundSize); }); - const getProjectsRequest = httpMock.expectOne(`${service.url}/recent`); + const getProjectsRequest = httpMock.expectOne(`${service.url}/recent/`); expect(getProjectsRequest.request.method).toBe('GET'); getProjectsRequest.flush(projectsList); }); diff --git a/src/app/modules/customer-management/components/projects/components/store/project.effects.spec.ts b/src/app/modules/customer-management/components/projects/components/store/project.effects.spec.ts index dae783cb6..585fd69eb 100644 --- a/src/app/modules/customer-management/components/projects/components/store/project.effects.spec.ts +++ b/src/app/modules/customer-management/components/projects/components/store/project.effects.spec.ts @@ -8,7 +8,7 @@ import { ProjectActionTypes } from './project.actions'; import { ProjectEffects } from './project.effects'; import { HttpClientTestingModule } from '@angular/common/http/testing'; import { ToastrModule, ToastrService } from 'ngx-toastr'; -import { INFO_SAVED_SUCCESSFULLY, INFO_DELETE_SUCCESSFULLY } from '../../../../../shared/messages'; +import { INFO_SAVED_SUCCESSFULLY, PROJECT_DEACTIVATED_SUCCESSFULLY } from '../../../../../shared/messages'; describe('ProjectEffects', () => { let actions$: Observable; @@ -128,7 +128,7 @@ describe('ProjectEffects', () => { spyOn(service, 'deleteProject').and.returnValue(of({})); effects.deleteProject$.subscribe((action) => { - expect(toastrService.success).toHaveBeenCalledWith(INFO_DELETE_SUCCESSFULLY); + expect(toastrService.success).toHaveBeenCalledWith(PROJECT_DEACTIVATED_SUCCESSFULLY); expect(action.type).toEqual(ProjectActionTypes.DELETE_PROJECT_SUCCESS); }); }); diff --git a/src/app/modules/shared/interceptors/inject.token.interceptor.spec.ts b/src/app/modules/shared/interceptors/inject.token.interceptor.spec.ts index 11cf812ca..0f02c1b7b 100644 --- a/src/app/modules/shared/interceptors/inject.token.interceptor.spec.ts +++ b/src/app/modules/shared/interceptors/inject.token.interceptor.spec.ts @@ -32,19 +32,4 @@ describe('InjectTokenInterceptor test', () => { expect(handler.handle).toHaveBeenCalledWith(request); }); - it('if request.url is part of time-tracker-api, then Authorization header is injected', () => { - const interceptor = new InjectTokenInterceptor(azureAdB2CService, loginService); - interceptor.isProduction = true; - const request = new HttpRequest('GET', environment.timeTrackerApiUrl); - spyOn(handler, 'handle'); - const requestWithHeaders = request.clone( - { - headers: request.headers.set('Authorization', 'Bearer XYZ') - }); - - interceptor.intercept(request, handler); - - expect(handler.handle).toHaveBeenCalledWith(requestWithHeaders); - }); - }); diff --git a/src/app/modules/time-clock/services/entry.service.spec.ts b/src/app/modules/time-clock/services/entry.service.spec.ts index 527898810..16166b9b0 100644 --- a/src/app/modules/time-clock/services/entry.service.spec.ts +++ b/src/app/modules/time-clock/services/entry.service.spec.ts @@ -17,7 +17,7 @@ describe('EntryService', () => { service = TestBed.inject(EntryService); httpMock = TestBed.inject(HttpTestingController); service.baseUrl = 'time-entries'; - reportsUrl = service.urlInProductionLegacy ? service.baseUrl : service.baseUrl + '/report'; + reportsUrl = service.urlInProductionLegacy ? service.baseUrl : service.baseUrl + '/report/'; }); it('services are ready to be used', inject( @@ -36,7 +36,7 @@ describe('EntryService', () => { expect(response.length).toBe(1); }); - const createEntryRequest = httpMock.expectOne(service.baseUrl); + const createEntryRequest = httpMock.expectOne(`${service.baseUrl}/`); expect(createEntryRequest.request.method).toBe('POST'); createEntryRequest.flush(entry); }); @@ -44,14 +44,14 @@ describe('EntryService', () => { it('loads an activeEntry with /running', () => { service.loadActiveEntry().subscribe(); - const loadEntryRequest = httpMock.expectOne(`${service.baseUrl}/running`); + const loadEntryRequest = httpMock.expectOne(`${service.baseUrl}/running/`); expect(loadEntryRequest.request.method).toBe('GET'); }); it('loads summary with get /summary?time_offset=', () => { service.summary().subscribe(); const timeOffset = new Date().getTimezoneOffset(); - const loadEntryRequest = httpMock.expectOne(`${service.baseUrl}/summary?time_offset=${timeOffset}`); + const loadEntryRequest = httpMock.expectOne(`${service.baseUrl}/summary/?time_offset=${timeOffset}`); expect(loadEntryRequest.request.method).toBe('GET'); }); @@ -62,7 +62,7 @@ describe('EntryService', () => { const timezoneOffset = new Date().getTimezoneOffset(); service.loadEntries({ year, month }).subscribe(); - const loadEntryRequest = httpMock.expectOne(`${service.baseUrl}?month=${month}&year=${year}&timezone_offset=${timezoneOffset}`); + const loadEntryRequest = httpMock.expectOne(`${service.baseUrl}/?month=${month}&year=${year}&timezone_offset=${timezoneOffset}`); expect(loadEntryRequest.request.method).toBe('GET'); }); @@ -89,7 +89,7 @@ describe('EntryService', () => { service.urlInProductionLegacy = true; service.stopEntryRunning('id').subscribe(); - const updateEntryRequest = httpMock.expectOne(`${service.baseUrl}/id/stop`); + const updateEntryRequest = httpMock.expectOne(`${service.baseUrl}/id/stop/`); expect(updateEntryRequest.request.method).toBe('POST'); }); @@ -97,7 +97,7 @@ describe('EntryService', () => { service.urlInProductionLegacy = false; service.stopEntryRunning('id').subscribe(); - const updateEntryRequest = httpMock.expectOne(`${service.baseUrl}/stop`); + const updateEntryRequest = httpMock.expectOne(`${service.baseUrl}/stop/`); expect(updateEntryRequest.request.method).toBe('PUT'); }); @@ -153,7 +153,7 @@ describe('EntryService', () => { service.findEntriesByProjectId(projectId).subscribe(); - const restartEntryRequest = httpMock.expectOne( `${service.baseUrl}?limit=2&project_id=${projectId}&start_date=${startDate}&end_date=${endDate}`); + const restartEntryRequest = httpMock.expectOne( `${service.baseUrl}/?limit=2&project_id=${projectId}&start_date=${startDate}&end_date=${endDate}`); expect(restartEntryRequest.request.method).toBe('GET'); }); diff --git a/src/app/modules/time-entries/pages/time-entries.component.spec.ts b/src/app/modules/time-entries/pages/time-entries.component.spec.ts index 854efe5cb..e6fa633b1 100644 --- a/src/app/modules/time-entries/pages/time-entries.component.spec.ts +++ b/src/app/modules/time-entries/pages/time-entries.component.spec.ts @@ -501,15 +501,6 @@ describe('TimeEntriesComponent', () => { expect(component.doSave).toHaveBeenCalledTimes(0); }); - it('call cookieService.get() when call ngOnInit', () => { - spyOn(cookieService, 'get'); - const sentParameter = FeatureToggle.TIME_TRACKER_CALENDAR; - - component.ngOnInit(); - - expect(cookieService.get).toHaveBeenCalledWith(sentParameter); - }); - it('set true in displayGridView when its initial value is false and call onDisplayModeChange', () => { const expectedValue = true; From ede550751614fb9419841696c1a06de3deab8b8f Mon Sep 17 00:00:00 2001 From: mmaquina Date: Fri, 14 Apr 2023 01:13:33 -0300 Subject: [PATCH 38/64] fix: workflow-triggers (#983) --- .github/workflows/aws-ui-cd-prod.yml | 6 +++--- .github/workflows/aws-ui-cd-stage.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/aws-ui-cd-prod.yml b/.github/workflows/aws-ui-cd-prod.yml index b254dd05e..ef0417602 100644 --- a/.github/workflows/aws-ui-cd-prod.yml +++ b/.github/workflows/aws-ui-cd-prod.yml @@ -1,9 +1,9 @@ name: time-tracker-ui-cd-prod on: - push: - branches: - - 'fast-api*' + release: + types: + - published jobs: cd: diff --git a/.github/workflows/aws-ui-cd-stage.yml b/.github/workflows/aws-ui-cd-stage.yml index bd7c146fc..e5806a811 100644 --- a/.github/workflows/aws-ui-cd-stage.yml +++ b/.github/workflows/aws-ui-cd-stage.yml @@ -1,9 +1,9 @@ name: time-tracker-ui-cd-stage on: - release: - types: - - published + push: + tags: + - 'v*.*.*' jobs: cd: From f4bfd853d03d9cf780241f1e90689694b186650c Mon Sep 17 00:00:00 2001 From: mmaquina Date: Mon, 24 Apr 2023 13:37:31 -0300 Subject: [PATCH 39/64] Fix workflow (#984) * delete actions, scp files to ec2 * fix triggers --------- Co-authored-by: Nicole Garcia --- .github/workflows/aws-ui-cd-prod.yml | 22 ++-------------------- .github/workflows/aws-ui-cd-stage.yml | 22 ++-------------------- 2 files changed, 4 insertions(+), 40 deletions(-) diff --git a/.github/workflows/aws-ui-cd-prod.yml b/.github/workflows/aws-ui-cd-prod.yml index ef0417602..c7610e613 100644 --- a/.github/workflows/aws-ui-cd-prod.yml +++ b/.github/workflows/aws-ui-cd-prod.yml @@ -36,30 +36,12 @@ jobs: run: | make login publish_prod image_tag=$RELEASE_VERSION - - name: SCP files via ssh key - uses: appleboy/scp-action@master - env: - USERNAME: ${{ secrets.AWS_EC2_USER }} - HOST: ${{ secrets.PROD_UI_URL }} - KEY: ${{ secrets.PROD_AWS_PRIVATE_KEY }} - with: - source: './infrastructure/aws_ec2.sh' - target: '.' - - - name: SCP files via ssh key - .prod.aws.env - uses: appleboy/scp-action@master - env: - USERNAME: ${{ secrets.AWS_EC2_USER }} - HOST: ${{ secrets.PROD_UI_URL }} - KEY: ${{ secrets.PROD_AWS_PRIVATE_KEY }} - with: - source: '.prod.aws.env' - target: '.' - - name: Deploy run: | TEMP=$(mktemp) echo "${{ secrets.PROD_AWS_PRIVATE_KEY }}" > $TEMP chmod 400 $TEMP + scp -o 'StrictHostKeyChecking no' -i $TEMP ./.prod.aws.env ${{ secrets.AWS_EC2_USER }}@${{ secrets.PROD_UI_URL }}:. + scp -o 'StrictHostKeyChecking no' -i $TEMP ./infrastructure/aws_ec2.sh ${{ secrets.AWS_EC2_USER }}@${{ secrets.PROD_UI_URL }}:./infrastructure/aws_ec2.sh ssh -o 'StrictHostKeyChecking no' -i $TEMP ${{ secrets.AWS_EC2_USER }}@${{ secrets.PROD_UI_URL }} "chmod +x ./infrastructure/aws_ec2.sh" ssh -o 'StrictHostKeyChecking no' -i $TEMP ${{ secrets.AWS_EC2_USER }}@${{ secrets.PROD_UI_URL }} "./infrastructure/aws_ec2.sh $RELEASE_VERSION" prod diff --git a/.github/workflows/aws-ui-cd-stage.yml b/.github/workflows/aws-ui-cd-stage.yml index e5806a811..b17def912 100644 --- a/.github/workflows/aws-ui-cd-stage.yml +++ b/.github/workflows/aws-ui-cd-stage.yml @@ -38,30 +38,12 @@ jobs: run: | make login publish image_tag=$RELEASE_VERSION - - name: SCP files via ssh key - script - uses: appleboy/scp-action@master - env: - USERNAME: ${{ secrets.AWS_EC2_USER }} - HOST: ${{ secrets.STAGE_UI_URL }} - KEY: ${{ secrets.STAGE_AWS_PRIVATE_KEY }} - with: - source: './infrastructure/aws_ec2.sh' - target: '.' - - - name: SCP files via ssh key - .stage.aws.env - uses: appleboy/scp-action@master - env: - USERNAME: ${{ secrets.AWS_EC2_USER }} - HOST: ${{ secrets.STAGE_UI_URL }} - KEY: ${{ secrets.STAGE_AWS_PRIVATE_KEY }} - with: - source: '.stage.aws.env' - target: '.' - - name: Deploy run: | TEMP=$(mktemp) echo "${{ secrets.STAGE_AWS_PRIVATE_KEY }}" > $TEMP chmod 400 $TEMP + scp -o 'StrictHostKeyChecking no' -i $TEMP ./.stage.aws.env ${{ secrets.AWS_EC2_USER }}@${{ secrets.STAGE_UI_URL }}:. + scp -o 'StrictHostKeyChecking no' -i $TEMP ./infrastructure/aws_ec2.sh ${{ secrets.AWS_EC2_USER }}@${{ secrets.STAGE_UI_URL }}:./infrastructure/aws_ec2.sh ssh -o 'StrictHostKeyChecking no' -i $TEMP ${{ secrets.AWS_EC2_USER }}@${{ secrets.STAGE_UI_URL }} "chmod +x ./infrastructure/aws_ec2.sh" ssh -o 'StrictHostKeyChecking no' -i $TEMP ${{ secrets.AWS_EC2_USER }}@${{ secrets.STAGE_UI_URL }} "./infrastructure/aws_ec2.sh $RELEASE_VERSION" stage From 6e1fa092368039f9e102c231eb424abe864ee477 Mon Sep 17 00:00:00 2001 From: mmaquina Date: Thu, 11 May 2023 22:19:43 -0300 Subject: [PATCH 40/64] Ttl 784 change time clock page name (#986) * refactor: TTL-784 change