Skip to content

Commit 0d4c2ff

Browse files
author
Reihtw
authored
Tta 180 integrate time tracker with auth app (#940)
* refactor: TTA-180 change Client URL for Auth URL * TTA-180: fixing endpoints to send credentials * refactor: TTA-115 refactor backend URL for dev * refactor: TTA-115 pass the environment auth variable link to the a tag * fix: TTA-115 fix error Type 'string' is not assignable to type 'void in login.component * feat: TTA-180 creating logout * fix: TTA-180 fixing tests * fix: TTA-180 fixing environment variables * fix: TTA-180 fixing environment variables * fix: TTA-180 fixing environment variables * fix: TTA-180 fixing environment variables * fix: TTA-180 fixing environment variables * fix: TTA-180 fixing environment variables * feat: TTA-180 updating README.md * fix: TTA-180 removing unused variables * fix: TTA-180 increasing test coveragew * fix: TTA-180 increasing test coveragew * fix: TTA-180 CR fixes Co-authored-by: Abigail Cabascango <sacabascango1espe.edu.ec>
1 parent 6565aa6 commit 0d4c2ff

File tree

32 files changed

+144
-114
lines changed

32 files changed

+144
-114
lines changed

.dev.env

138 Bytes
Binary file not shown.

.github/workflows/CD-time-tracker-ui.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
CLIENT_ID: ${{ secrets.client_id }}
3535
CLIENT_URL: ${{ secrets.client_url }}
3636
STACK_EXCHANGE_ID: ${{ secrets.stack_exchange_id }}
37+
AUTH_URL: ${{ secrets.AUTH_URL }}
38+
AUTH_APP_NAME: ${{ secrets.AUTH_APP_NAME }}
3739
STACK_EXCHANGE_ACCESS_TOKEN: ${{ secrets.stack_exchange_access_token }}
3840
AZURE_APP_CONFIGURATION_CONNECTION_STRING: ${{ secrets.azure_app_configuration_connection_string }}
3941
run: |

.github/workflows/CI-time-tracker-ui.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ jobs:
4646
SCOPES: ${{ secrets.SCOPES }}
4747
CLIENT_ID: ${{ secrets.CLIENT_ID }}
4848
CLIENT_URL : ${{ secrets.CLIENT_URL }}
49+
AUTH_URL: ${{ secrets.AUTH_URL }}
50+
AUTH_APP_NAME: ${{ secrets.AUTH_APP_NAME }}
4951
STACK_EXCHANGE_ID: ${{ secrets.STACK_EXCHANGE_ID }}
5052
STACK_EXCHANGE_ACCESS_TOKEN: ${{ secrets.STACK_EXCHANGE_ACCESS_TOKEN }}
5153
AZURE_APP_CONFIGURATION_CONNECTION_STRING: ${{ secrets.AZURE_APP_CONFIGURATION_CONNECTION_STRING }}

.github/workflows/time-tracker-ui-ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,16 @@ jobs:
2929
with:
3030
ssh-private-key: ${{ secrets.INFRA_TERRAFORM_MODULES_SSH_PRIV_KEY }}
3131

32+
- name: Unlock DEV secrets
33+
uses: sliteteam/[email protected]
34+
env:
35+
GIT_CRYPT_KEY: ${{ secrets.GIT_CRYPT_KEY_DEFAULT }}
36+
3237
- name: build docker
3338
run: make build
3439

3540
- name: Running tests
3641
run: |
37-
chmod -R 777 ./$home
3842
make test
3943
- name: Generate coverage report
4044
env:

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ cleanup: ## Delete image timetracker_ui
1919

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

2424
.PHONY: logs
2525
logs: ## Show logs of timetracker_ui.
@@ -41,7 +41,7 @@ remove: ## Delete container timetracker_ui.
4141
.PHONY: test
4242
test: ## Run all tests on docker container timetracker_ui at the CLI.
4343
docker-compose build timetracker_ui_test
44-
docker-compose up -d timetracker_ui_test
44+
docker-compose --env-file=.dev.env up -d timetracker_ui_test
4545
docker logs -f timetracker_ui_test
4646

4747
.PHONY: testdev

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ In project path, open your favourite command line and run `npm install` in order
5959

6060
# Prepare your environment
6161

62+
### **Local DNS Configuration**
63+
64+
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:
65+
```text
66+
127.0.0.1 timetracker-dev.ioet.com
67+
```
68+
6269
### Set environment variables
6370
**1**. Using GPG create your key by running this command in your favourite command shell: `gpg --generate-key`.
6471

docker-compose.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ services:
33
timetracker_ui:
44
container_name: timetracker_ui
55
image: timetracker_ui
6+
env_file:
7+
- .dev.env
68
build:
79
context: .
810
dockerfile: ./Docker/Dockerfile.dev
@@ -14,6 +16,8 @@ services:
1416
API_URL: ${API_URL}
1517
CLIENT_ID: ${CLIENT_ID}
1618
CLIENT_URL: ${CLIENT_URL}
19+
AUTH_URL: ${AUTH_URL}
20+
AUTH_APP_NAME: ${AUTH_APP_NAME}
1721
SCOPES: ${SCOPES}
1822
STACK_EXCHANGE_ID: ${STACK_EXCHANGE_ID}
1923
STACK_EXCHANGE_ACCESS_TOKEN: ${STACK_EXCHANGE_ACCESS_TOKEN}

scripts/populate-keys.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ echo "API_URL='$API_URL'" >> .env
55
echo "AUTHORITY='$AUTHORITY'" >> .env
66
echo "CLIENT_ID='$CLIENT_ID'" >> .env
77
echo "CLIENT_URL='$CLIENT_URL'" >> .env
8+
echo "AUTH_URL='$AUTH_URL'" >> .env
9+
echo "AUTH_APP_NAME='$AUTH_APP_NAME'" >> .env
810
echo "SCOPES='$SCOPES'" >> .env
911
echo "STACK_EXCHANGE_ID='$STACK_EXCHANGE_ID'" >> .env
1012
echo "STACK_EXCHANGE_ACCESS_TOKEN='$STACK_EXCHANGE_ACCESS_TOKEN'" >> .env

src/app/modules/activities-management/services/activity.service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class ActivityService {
1414
constructor(private http: HttpClient) {}
1515

1616
getActivities(): Observable<Activity[]> {
17-
return this.http.get<Activity[]>(this.baseUrl);
17+
return this.http.get<Activity[]>(this.baseUrl, { withCredentials: true });
1818
}
1919

2020
createActivity(activityData): Observable<any> {
@@ -23,12 +23,12 @@ export class ActivityService {
2323
tenant_id: '4225ab1e-1033-4a5f-8650-0dd4950f38c8',
2424
};
2525

26-
return this.http.post(this.baseUrl, body);
26+
return this.http.post(this.baseUrl, body, { withCredentials: true });
2727
}
2828

2929
deleteActivity(acitivityId: string): Observable<any> {
3030
const url = `${this.baseUrl}/${acitivityId}`;
31-
return this.http.delete(url);
31+
return this.http.delete(url, { withCredentials: true });
3232
}
3333

3434
updateActivity(activityData): Observable<any> {
@@ -38,6 +38,6 @@ export class ActivityService {
3838
...activityData,
3939
};
4040

41-
return this.http.put(url, body);
41+
return this.http.put(url, body, { withCredentials: true });
4242
}
4343
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ export class ProjectTypeService {
1515

1616
getProjectTypes(customerId: any): Observable<ProjectType[]> {
1717
const params = new HttpParams().set('customer_id', customerId.customerId);
18-
return this.http.get<ProjectType[]>(this.baseUrl, { params });
18+
return this.http.get<ProjectType[]>(this.baseUrl, { params, withCredentials: true });
1919
}
2020

2121
createProjectType(projectTypeData): Observable<any> {
22-
return this.http.post(this.baseUrl, projectTypeData);
22+
return this.http.post(this.baseUrl, projectTypeData, { withCredentials: true });
2323
}
2424

2525
deleteProjectType(projectTypeId: string): Observable<any> {
2626
const url = `${this.baseUrl}/${projectTypeId}`;
27-
return this.http.delete(url);
27+
return this.http.delete(url, { withCredentials: true });
2828
}
2929

3030
updateProjectType(projectTypeData): Observable<any> {
3131
const url = `${this.baseUrl}/${projectTypeData.id}`;
32-
return this.http.put(url, projectTypeData);
32+
return this.http.put(url, projectTypeData, { withCredentials: true });
3333
}
3434
}

0 commit comments

Comments
 (0)