Skip to content

Commit 26a27bd

Browse files
committed
fix: #29 Add key
1 parent bb6012b commit 26a27bd

File tree

10 files changed

+19
-10
lines changed

10 files changed

+19
-10
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
SCOPES: ${{ secrets.scopes }}
3030
CLIENT_ID: ${{ secrets.client_id }}
3131
AUTHORITY: ${{ secrets.authority }}
32+
STACK_EXCHANGE_ID: ${{ secrets.stack_exchange_id }}
33+
STACK_EXCHANGE_ACCESS_TOKEN: ${{ secrets.stack_exchange_access_token }}
3234
run: sudo sh scripts/populate-keys.sh
3335

3436
- name: 'run: npm install and build'

.github/workflows/CI-mutation-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
SCOPES: ${{ secrets.scopes }}
2727
CLIENT_ID: ${{ secrets.client_id }}
2828
AUTHORITY: ${{ secrets.authority }}
29+
STACK_EXCHANGE_ID: ${{ secrets.stack_exchange_id }}
30+
STACK_EXCHANGE_ACCESS_TOKEN: ${{ secrets.stack_exchange_access_token }}
2931
run: sudo sh scripts/populate-keys.sh
3032

3133
- name: Run the test

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,14 @@ jobs:
4444
SCOPES: ${{ secrets.scopes }}
4545
CLIENT_ID: ${{ secrets.client_id }}
4646
AUTHORITY: ${{ secrets.authority }}
47+
STACK_EXCHANGE_ID: ${{ secrets.stack_exchange_id }}
48+
STACK_EXCHANGE_ACCESS_TOKEN: ${{ secrets.stack_exchange_access_token }}
4749
run: sudo sh scripts/populate-keys.sh
4850

4951
- name: Run the test
5052
run: npm run ci-test --if-present
5153

5254
- name: Generate coverage report
53-
env:
55+
env:
5456
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
5557
run: bash <(curl -s https://codecov.io/bash)

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ Create a file keys.ts with the content pinned in our slack channel:
4040
export const AUTHORITY = 'XXX';
4141
export const CLIENT_ID = 'XXX';
4242
export const SCOPES = ['XXX'];
43+
export const STACK_EXCHANGE_ID = 'XXX';
44+
export const STACK_EXCHANGE_ACCESS_TOKEN = 'XXX';
4345
```
4446

4547
### Prepare your environment for vscode

scripts/populate-keys.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
echo 'export const AUTHORITY = "'$AUTHORITY'";' >> src/environments/keys.ts
55
echo 'export const CLIENT_ID = "'$CLIENT_ID'";' >> src/environments/keys.ts
66
echo 'export const SCOPES = ["'$SCOPES'"];' >> src/environments/keys.ts
7+
echo 'export const STACK_EXCHANGE_ID = ["'$STACK_EXCHANGE_ID'"];' >> src/environments/keys.ts
8+
echo 'export const STACK_EXCHANGE_ACCESS_TOKEN = ["'$STACK_EXCHANGE_ACCESS_TOKEN'"];' >> src/environments/keys.ts

src/app/modules/shared/components/details-fields/details-fields.component.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ describe('DetailsFieldsComponent', () => {
8383
const name = 'ngrx';
8484
component.selectedTechnology = ['java', 'javascript'];
8585
component.selectedTechnology.indexOf(name);
86-
component.selectedTechnology.length = 2;
8786
component.setTechnology(name);
8887
expect(component.selectedTechnology.length).toBe(3);
8988
});

src/app/modules/shared/components/details-fields/details-fields.component.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,8 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {
6262
const index = this.selectedTechnology.indexOf(name);
6363
if (index > -1) {
6464
this.removeTag(index);
65-
} else {
66-
if (this.selectedTechnology.length < 10) {
67-
this.selectedTechnology = [...this.selectedTechnology, name];
68-
}
65+
} else if (this.selectedTechnology.length < 10) {
66+
this.selectedTechnology = [...this.selectedTechnology, name];
6967
}
7068
}
7169

src/app/modules/shared/services/technology.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
22
import { HttpClient } from '@angular/common/http';
33
import { Observable } from 'rxjs';
44
import { Technology } from '../models/technology.model';
5-
import { KEY, environment } from '../../../../environments/environment';
5+
import { STACK_EXCHANGE_ID, STACK_EXCHANGE_ACCESS_TOKEN, environment } from '../../../../environments/environment';
66

77
@Injectable({
88
providedIn: 'root',
@@ -12,7 +12,7 @@ export class TechnologyService {
1212
constructor(private http: HttpClient) {}
1313

1414
getTechnologies(value: string): Observable<Technology> {
15-
const url = `${this.baseUrl}&inname=${value}&site=stackoverflow&key=${KEY}`;
15+
const url = `${this.baseUrl}&inname=${value}&site=stackoverflow&key=${STACK_EXCHANGE_ID}&access_token=${STACK_EXCHANGE_ACCESS_TOKEN}`;
1616
return this.http.get<Technology>(url);
1717
}
1818
}

src/environments/environment.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export const AUTHORITY = keys.AUTHORITY;
1313
export const CLIENT_ID = keys.CLIENT_ID;
1414
export const SCOPES = keys.SCOPES;
1515
export const ITEMS_PER_PAGE = 5;
16-
export const KEY = keys.KEY_TECHNOLOGY;
16+
export const STACK_EXCHANGE_ID = keys.STACK_EXCHANGE_ID;
17+
export const STACK_EXCHANGE_ACCESS_TOKEN = keys.STACK_EXCHANGE_ACCESS_TOKEN;
1718

1819
/*
1920
* For easier debugging in development mode, you can import the following file

src/environments/keys.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export const AUTHORITY = 'XXX';
22
export const CLIENT_ID = 'XXX';
33
export const SCOPES = ['XXX'];
4-
export const KEY_TECHNOLOGY = 'XXX';
4+
export const STACK_EXCHANGE_ID = 'XXX';
5+
export const STACK_EXCHANGE_ACCESS_TOKEN = 'XXX';

0 commit comments

Comments
 (0)