From a16623d982fc9f24f0f3e917f73c9791f15e640e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Wed, 21 Oct 2020 18:42:07 +0200 Subject: [PATCH 1/5] Added gitlabci MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Woźniak --- .gitlab-ci.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..82396a2 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,37 @@ +tages: + - build + - test + - deploy + +build: + stage: build + image: node + script: + - echo "Start building App" + - npm install typescript + - npm install + - npm audit fix + - npm run build + - echo "Build successfully!" + artifacts: + expire_in: 1 hour + paths: + - build + - node_modules/ + +test: + stage: test + image: node + script: + - echo "Testing App" + - CI=true npm test --passWithNoTests + - echo "Test successfully!" + +deploy_production: + stage: deploy + script: + - echo "Deploying to server" + - rsync --progress -r build/* --delete root@35.207.132.68:/var/www/plannaplan.pl + - echo "Deployed" + only: + - master From 8da403d4fe3a562a74c5217016796caf5f86d96a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Wed, 21 Oct 2020 18:45:19 +0200 Subject: [PATCH 2/5] Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Woźniak --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 82396a2..b05ad46 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -tages: +stages: - build - test - deploy From 13df63c026d6810d591c6b2f8d682a0b44c861f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Wed, 21 Oct 2020 18:50:19 +0200 Subject: [PATCH 3/5] Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Woźniak --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b05ad46..125bd2f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,7 +10,6 @@ build: - echo "Start building App" - npm install typescript - npm install - - npm audit fix - npm run build - echo "Build successfully!" artifacts: From 7a80915f454addfd38609a3569da8480776ac82c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Wed, 21 Oct 2020 18:54:25 +0200 Subject: [PATCH 4/5] Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Woźniak --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 125bd2f..cc0d6be 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,7 +8,7 @@ build: image: node script: - echo "Start building App" - - npm install typescript + - npm install typescript eslint - npm install - npm run build - echo "Build successfully!" From 9d1cf2011c7f8d7e3379ab6bb27cb6f2e94e2a60 Mon Sep 17 00:00:00 2001 From: wrzesinski-hubert Date: Mon, 26 Oct 2020 19:40:03 +0100 Subject: [PATCH 5/5] changes to new package --- src/contexts/CoursesProvider.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/contexts/CoursesProvider.tsx b/src/contexts/CoursesProvider.tsx index 56d7de7..3cac1c4 100644 --- a/src/contexts/CoursesProvider.tsx +++ b/src/contexts/CoursesProvider.tsx @@ -73,14 +73,15 @@ export const CoursesProvider = ({ children }: CoursesProviderProps) => { useEffect(() => { const fetchData = async () => { - const { data } = await axios.get }>>( + const { data } = await axios.get, classes:Array }>>( `${process.env.REACT_APP_API_URL}/api/v1/courses/getCoursesWithGroups`, ); - const courses = data.map(({ id, name, groups }) => ({ - id: parseInt(id), - name, - lectures: groups.filter(({ type }) => type === GroupType.LECTURE), - classes: groups.filter(({ type }) => type === GroupType.CLASS), + console.log(data); + const courses = data.map(({ id, name, lectures, classes }) => ({ + id, + name, + lectures, + classes, })) as Array; courses.sort((a: Course, b: Course) => (a.name > b.name ? 1 : -1));