Skip to content

Commit d825c36

Browse files
committed
merge from master
2 parents 35e304e + 69a2ef9 commit d825c36

File tree

16 files changed

+193
-74
lines changed

16 files changed

+193
-74
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,14 @@ jobs:
3535
STACK_EXCHANGE_ACCESS_TOKEN: ${{ secrets.stack_exchange_access_token }}
3636
AZURE_APP_CONFIGURATION_CONNECTION_STRING: ${{ secrets.azure_app_configuration_connection_string }}
3737
run: |
38-
chmod +x ./scripts/populate-var-file.sh
39-
sh ./scripts/populate-var-file.sh
38+
chmod +x ./scripts/populate-keys.sh
39+
sh ./scripts/populate-keys.sh
4040
4141
- name: 'run: npm install and build'
4242
run: |
43+
set -a
44+
source .env
45+
set +a
4346
npm install
4447
npm run build --prod --if-present
4548
cp scripts/default-static-site.js ${BUILD_PATH}

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,16 @@ jobs:
4848
STACK_EXCHANGE_ACCESS_TOKEN: ${{ secrets.STACK_EXCHANGE_ACCESS_TOKEN }}
4949
AZURE_APP_CONFIGURATION_CONNECTION_STRING: ${{ secrets.AZURE_APP_CONFIGURATION_CONNECTION_STRING }}
5050
run: |
51-
chmod +x ./scripts/populate-var-file.sh
52-
sh ./scripts/populate-var-file.sh
51+
chmod +x ./scripts/populate-keys.sh
52+
sh ./scripts/populate-keys.sh
5353
5454
- name: Running tests
55-
run: npm run ci-test --if-present
55+
run: |
56+
set -a
57+
source .env
58+
set +a
59+
npm run ci-test --if-present
60+
rm .env
5661
5762
- name: Generate coverage report
5863
env:

Docker/Dockerfile.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ RUN chown ${USERNAME}:${USERNAME} -R ${HOME}/time-tracker-ui \
1212
USER ${USERNAME}
1313
RUN npm cache clean --force && npm install
1414
EXPOSE 4200
15-
CMD npm run config && ${HOME}/time-tracker-ui/node_modules/.bin/ng serve --host 0.0.0.0 --disableHostCheck
15+
CMD ${HOME}/time-tracker-ui/node_modules/.bin/ng serve --host 0.0.0.0 --disableHostCheck

Docker/Dockerfile.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ COPY .env .
4444
EXPOSE 4200
4545
EXPOSE 9876
4646
RUN npm cache clean --force && npm install
47-
CMD npm run config && npm run ci-test
47+
CMD npm run ci-test

Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@ RUN chmod -R 777 ${HOME}/time-tracker-ui
1010

1111
USER ${USERNAME}
1212
RUN npm cache clean --force && npm install
13+
EXPOSE 4200
14+
EXPOSE 9876
15+
CMD ${HOME}/time-tracker-ui/node_modules/.bin/ng serve --host 0.0.0.0 --disableHostCheck
16+
17+
1318

1419
FROM development as build
1520
COPY .env .
16-
RUN npm run config && npm run build
21+
RUN npm run build
1722

1823
FROM nginx:1.21 AS production
1924

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "time-tracker",
33
"version": "1.72.9",
44
"scripts": {
5-
"config": "ts-node ./scripts/setenv.ts",
65
"preinstall": "npx npm-force-resolutions",
76
"ng": "ng",
87
"start": "ng serve",

scripts/populate-keys.sh

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

33
> .env
4-
echo 'AUTHORITY = '$AUTHORITY'' >> .env
5-
echo 'CLIENT_ID = '$CLIENT_ID'' >> .env
6-
echo 'SCOPES = '$SCOPES'' >> .env
7-
echo 'STACK_EXCHANGE_ID = '$STACK_EXCHANGE_ID'' >> .env
8-
echo 'STACK_EXCHANGE_ACCESS_TOKEN = '$STACK_EXCHANGE_ACCESS_TOKEN'' >> .env
9-
echo 'AZURE_APP_CONFIGURATION_CONNECTION_STRING = '$AZURE_APP_CONFIGURATION_CONNECTION_STRING'' >> .env
4+
echo "AUTHORITY='$AUTHORITY'" >> .env
5+
echo "CLIENT_ID='$CLIENT_ID'" >> .env
6+
echo "SCOPES='$SCOPES'" >> .env
7+
echo "STACK_EXCHANGE_ID='$STACK_EXCHANGE_ID'" >> .env
8+
echo "STACK_EXCHANGE_ACCESS_TOKEN='$STACK_EXCHANGE_ACCESS_TOKEN'" >> .env
9+
echo "AZURE_APP_CONFIGURATION_CONNECTION_STRING='$AZURE_APP_CONFIGURATION_CONNECTION_STRING'" >> .env
1010
cat .env

scripts/populate-var-file.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.

scripts/setenv.ts

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/app/modules/activities-management/store/activity-management.selectors.spec.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,49 @@ describe('ActivityManagement Selectors', () => {
2424
expect(selectors.allActivities.projector(activityState)).toBe(activities);
2525
});
2626

27+
it('should return all the ordered data in the state when the selector allAtiveActivities is called', () => {
28+
const activities = [
29+
{
30+
id: '001',
31+
name: 'Meeting',
32+
description: 'Some description'
33+
},
34+
{
35+
id: '002',
36+
name: 'ABC',
37+
description: 'Some description'
38+
},
39+
{
40+
id: '003',
41+
name: 'XYZ',
42+
description: 'Some description'
43+
},
44+
];
45+
46+
const activitiesOrdered = [
47+
{
48+
id: '002',
49+
name: 'ABC',
50+
description: 'Some description'
51+
},
52+
{
53+
id: '001',
54+
name: 'Meeting',
55+
description: 'Some description'
56+
},
57+
{
58+
id: '003',
59+
name: 'XYZ',
60+
description: 'Some description'
61+
},
62+
];
63+
64+
const activityState = { data: activities };
65+
66+
expect(selectors.allActiveActivities.projector(activityState)).toEqual(activitiesOrdered);
67+
68+
});
69+
2770
it('should return all active data in the state when the selector allActiveActivities is called', () => {
2871
const activities = [{ id: 'id', name: 'abc', description: 'xxx', status: 'active' },
2972
{ id: '2', name: 'xyz', description: 'yyy', status: 'inactive' },

0 commit comments

Comments
 (0)