From ca7c589dd9bfd874c8b1f81d6ad61aefba9a519d Mon Sep 17 00:00:00 2001 From: rrigato Date: Sat, 25 Nov 2023 08:40:32 -0600 Subject: [PATCH 1/4] correct File path --- .github/workflows/homepage_update.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/homepage_update.yml b/.github/workflows/homepage_update.yml index 89ed97b..144f894 100644 --- a/.github/workflows/homepage_update.yml +++ b/.github/workflows/homepage_update.yml @@ -2,6 +2,7 @@ name: Updates web application on: push: branches: + - dev - master jobs: @@ -26,7 +27,7 @@ jobs: - run: npm run build - name: script-execution-permissions - run: chmod +x '.github/scripts/homepage_source_files.sh' + run: chmod +x './.github/scripts/homepage_source_files.sh' - name: upload-webpack-artifacts shell: bash @@ -35,7 +36,7 @@ jobs: AWS_DEFAULT_REGION: 'us-east-1' AWS_S3_BUCKET_NAME: 'ryanrigato.com' AWS_SECRET_ACCESS_KEY: ${{secrets.PERSISTANT_STORAGE_KEY}} - run: '.github/scripts/homepage_source_files.sh' + run: './.github/scripts/homepage_source_files.sh' From 704307249bf4728f50e231511c65d4da5ffebb79 Mon Sep 17 00:00:00 2001 From: rrigato Date: Sat, 25 Nov 2023 08:51:26 -0600 Subject: [PATCH 2/4] Stub out BookRecommendations component --- .github/workflows/homepage_update.yml | 4 ++-- static/js/BookRecommendations.jsx | 20 ++++++++++++++++++++ static/tests/BookRecommendations.test.js | 6 +++--- 3 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 static/js/BookRecommendations.jsx diff --git a/.github/workflows/homepage_update.yml b/.github/workflows/homepage_update.yml index 144f894..76d8935 100644 --- a/.github/workflows/homepage_update.yml +++ b/.github/workflows/homepage_update.yml @@ -27,7 +27,7 @@ jobs: - run: npm run build - name: script-execution-permissions - run: chmod +x './.github/scripts/homepage_source_files.sh' + run: chmod +x '../.github/scripts/homepage_source_files.sh' - name: upload-webpack-artifacts shell: bash @@ -36,7 +36,7 @@ jobs: AWS_DEFAULT_REGION: 'us-east-1' AWS_S3_BUCKET_NAME: 'ryanrigato.com' AWS_SECRET_ACCESS_KEY: ${{secrets.PERSISTANT_STORAGE_KEY}} - run: './.github/scripts/homepage_source_files.sh' + run: '../.github/scripts/homepage_source_files.sh' diff --git a/static/js/BookRecommendations.jsx b/static/js/BookRecommendations.jsx new file mode 100644 index 0000000..67a7cde --- /dev/null +++ b/static/js/BookRecommendations.jsx @@ -0,0 +1,20 @@ +import React from 'react'; +import '../css/homepageSection.css'; +import aboutPhoto from '../img/aboutPhoto.jpg'; + +/**Book Recommendations + * + * @returns react jsx + */ +export function BookRecommendations(){ + return( +
+
+
    +

    Everyday Reads

    +

    Software Engineering

    +
+
+
+ ); +} \ No newline at end of file diff --git a/static/tests/BookRecommendations.test.js b/static/tests/BookRecommendations.test.js index a2a13b1..932ab57 100644 --- a/static/tests/BookRecommendations.test.js +++ b/static/tests/BookRecommendations.test.js @@ -1,5 +1,5 @@ import { render } from '@testing-library/react'; -// import { BookRecommendations } from '../js/BookRecommendations.jsx'; +import { BookRecommendations } from '../js/BookRecommendations.jsx'; describe('BookRecommendations displayed on screen', () => { @@ -7,7 +7,7 @@ describe('BookRecommendations displayed on screen', () => { jest.resetAllMocks(); }); - test.skip('BookRecommendations section', async () => { + test('BookRecommendations section', async () => { const {getAllByRole, getByRole} = render(); @@ -16,6 +16,6 @@ describe('BookRecommendations displayed on screen', () => { const numHeaders = getAllByRole( 'heading' ); - expect(numHeaders.length).toBe(1); + expect(numHeaders.length).toBe(2); }); }); \ No newline at end of file From f6279abc29fe14e3313bd124224a4fb5978c7349 Mon Sep 17 00:00:00 2001 From: rrigato Date: Sat, 25 Nov 2023 09:32:10 -0600 Subject: [PATCH 3/4] update image directory location --- .github/scripts/homepage_source_files.sh | 2 +- static/js/BookRecommendations.jsx | 1 - static/webpack.config.js | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/scripts/homepage_source_files.sh b/.github/scripts/homepage_source_files.sh index 9f9d6f0..3b76246 100644 --- a/.github/scripts/homepage_source_files.sh +++ b/.github/scripts/homepage_source_files.sh @@ -6,5 +6,5 @@ cd dist ls -aws s3 cp --dry-run . $AWS_S3_BUCKET_NAME \ +aws s3 cp --dryrun . $AWS_S3_BUCKET_NAME \ --recursive diff --git a/static/js/BookRecommendations.jsx b/static/js/BookRecommendations.jsx index 67a7cde..60ebfcd 100644 --- a/static/js/BookRecommendations.jsx +++ b/static/js/BookRecommendations.jsx @@ -1,6 +1,5 @@ import React from 'react'; import '../css/homepageSection.css'; -import aboutPhoto from '../img/aboutPhoto.jpg'; /**Book Recommendations * diff --git a/static/webpack.config.js b/static/webpack.config.js index 21901cd..083b14c 100644 --- a/static/webpack.config.js +++ b/static/webpack.config.js @@ -17,7 +17,7 @@ module.exports = { test: /\.jpg$/i, type: 'asset/resource', generator: { - filename: 'img/[name][ext]', + filename: '[name][ext]', }, }, { From c14a7f6f578449275ae12b9e06ef4fc06c1523b2 Mon Sep 17 00:00:00 2001 From: rrigato Date: Sat, 25 Nov 2023 09:35:07 -0600 Subject: [PATCH 4/4] correct bucket name --- .github/scripts/homepage_source_files.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/homepage_source_files.sh b/.github/scripts/homepage_source_files.sh index 3b76246..c51659f 100644 --- a/.github/scripts/homepage_source_files.sh +++ b/.github/scripts/homepage_source_files.sh @@ -6,5 +6,5 @@ cd dist ls -aws s3 cp --dryrun . $AWS_S3_BUCKET_NAME \ +aws s3 cp --dryrun . s3://$AWS_S3_BUCKET_NAME \ --recursive