From 5af3974767776c2e63f0891e10c0809bece3b369 Mon Sep 17 00:00:00 2001 From: Suman Mhalsank <48148023+Sumanmhalsank02@users.noreply.github.com> Date: Sat, 25 Mar 2023 18:52:17 -0400 Subject: [PATCH 01/26] ADDED: docker repo --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 402eeb701..e005e30ff 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,7 +9,7 @@ on: - 'v*' env: - DOCKER_REPO_NAME: kaw393939/mywebclass + DOCKER_REPO_NAME: sumansmhalsank11/mywebclass_simulation jobs: build: From 1b105fb4539e4eba6563cb80b575588d35122e87 Mon Sep 17 00:00:00 2001 From: Suman Mhalsank <48148023+Sumanmhalsank02@users.noreply.github.com> Date: Sat, 25 Mar 2023 19:03:44 -0400 Subject: [PATCH 02/26] Create nextjs.yml --- .github/workflows/nextjs.yml | 95 ++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 .github/workflows/nextjs.yml diff --git a/.github/workflows/nextjs.yml b/.github/workflows/nextjs.yml new file mode 100644 index 000000000..0b4b9a25b --- /dev/null +++ b/.github/workflows/nextjs.yml @@ -0,0 +1,95 @@ +# Sample workflow for building and deploying a Next.js site to GitHub Pages +# +# To get started with Next.js see: https://nextjs.org/docs/getting-started +# +name: Deploy Next.js site to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["master"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Detect package manager + id: detect-package-manager + run: | + if [ -f "${{ github.workspace }}/yarn.lock" ]; then + echo "manager=yarn" >> $GITHUB_OUTPUT + echo "command=install" >> $GITHUB_OUTPUT + echo "runner=yarn" >> $GITHUB_OUTPUT + exit 0 + elif [ -f "${{ github.workspace }}/package.json" ]; then + echo "manager=npm" >> $GITHUB_OUTPUT + echo "command=ci" >> $GITHUB_OUTPUT + echo "runner=npx --no-install" >> $GITHUB_OUTPUT + exit 0 + else + echo "Unable to determine packager manager" + exit 1 + fi + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: "16" + cache: ${{ steps.detect-package-manager.outputs.manager }} + - name: Setup Pages + uses: actions/configure-pages@v3 + with: + # Automatically inject basePath in your Next.js configuration file and disable + # server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized). + # + # You may remove this line if you want to manage the configuration yourself. + static_site_generator: next + - name: Restore cache + uses: actions/cache@v3 + with: + path: | + .next/cache + # Generate a new cache whenever packages or source files change. + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} + # If source files changed but packages didn't, rebuild from a prior cache. + restore-keys: | + ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}- + - name: Install dependencies + run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} + - name: Build with Next.js + run: ${{ steps.detect-package-manager.outputs.runner }} next build + - name: Static HTML export with Next.js + run: ${{ steps.detect-package-manager.outputs.runner }} next export + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: ./out + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 From d784612dc10d5a062b5483fcbde3aa8206b2c798 Mon Sep 17 00:00:00 2001 From: Suman Mhalsank <48148023+Sumanmhalsank02@users.noreply.github.com> Date: Sat, 25 Mar 2023 19:37:55 -0400 Subject: [PATCH 03/26] Create jekyll-docker.yml --- .github/workflows/jekyll-docker.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/jekyll-docker.yml diff --git a/.github/workflows/jekyll-docker.yml b/.github/workflows/jekyll-docker.yml new file mode 100644 index 000000000..4943c9cc7 --- /dev/null +++ b/.github/workflows/jekyll-docker.yml @@ -0,0 +1,20 @@ +name: Jekyll site CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build the site in the jekyll/builder container + run: | + docker run \ + -v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \ + jekyll/builder:latest /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future" From b6de845548ac38c8333e2db96c29d224759b20f1 Mon Sep 17 00:00:00 2001 From: Suman Mhalsank <48148023+Sumanmhalsank02@users.noreply.github.com> Date: Sat, 25 Mar 2023 19:48:36 -0400 Subject: [PATCH 04/26] ADDED: Url to package.json --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 9a0bbb78d..d7b3065fa 100644 --- a/package.json +++ b/package.json @@ -25,14 +25,14 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/NJIT-WIS/mywebclass.git" + "url": "git+https://github.com/Sumanmhalsank02/mywebclass-simulation.git" }, - "author": "Keith Williams @ NJIT.EDU", + "author": "Suman S Mhalsank @ NJIT.EDU", "license": "MIT", "bugs": { - "url": "https://github.com/NJIT-WIS/mywebclass/issues" + "url": "https://github.com/Sumanmhalsank02/mywebclass-simulation/issues" }, - "homepage": "https://github.com/NJIT-WIS/mywebclass#readme", + "homepage": "https://github.com/Sumanmhalsank02/mywebclass-simulation#readme", "devDependencies": { "@playwright/test": "^1.31.1", "autoprefixer": "^10.4.13", From 7282b869e1831b6909976191d120f1c6a528e289 Mon Sep 17 00:00:00 2001 From: Sumanmhalsank02 Date: Sat, 25 Mar 2023 21:10:34 -0400 Subject: [PATCH 05/26] UPDATED: index.html --- src/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index ad76fc58c..ea469bc3f 100644 --- a/src/index.html +++ b/src/index.html @@ -11,7 +11,7 @@ - + From ed28a74b0eed523b26ca53859daf7e955c9eb94f Mon Sep 17 00:00:00 2001 From: Sumanmhalsank02 Date: Sat, 25 Mar 2023 21:44:57 -0400 Subject: [PATCH 06/26] UPDATED: index.html --- src/index.html | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/index.html b/src/index.html index ea469bc3f..b049e98c7 100644 --- a/src/index.html +++ b/src/index.html @@ -21,7 +21,6 @@ -
- kid learning tech + person learning tech
From 90b96a75f62a48d4cc5928e3b1f5d3643311f8a9 Mon Sep 17 00:00:00 2001 From: Sumanmhalsank02 Date: Sat, 25 Mar 2023 23:06:52 -0400 Subject: [PATCH 08/26] UPDATED: index.html --- src/index.html | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/index.html b/src/index.html index ad76fc58c..e5e7b90b9 100644 --- a/src/index.html +++ b/src/index.html @@ -11,7 +11,7 @@ - + @@ -21,7 +21,6 @@ -
From 73fc5cbe5e69817145ce4524d09017f6f64d04a6 Mon Sep 17 00:00:00 2001 From: Sumanmhalsank02 Date: Sun, 26 Mar 2023 13:27:27 -0400 Subject: [PATCH 16/26] npm audit fix: added override to package.json --- package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package.json b/package.json index d7b3065fa..3d7522cdd 100644 --- a/package.json +++ b/package.json @@ -62,4 +62,8 @@ "dependencies": { "@popperjs/core": "^2.11.6" } + "overrides": { + "graceful-fs": "^4.2.10" + } + } } From 708dfd463cfbc43615821d9c9e6afb0eb69fab69 Mon Sep 17 00:00:00 2001 From: Sumanmhalsank02 Date: Sun, 26 Mar 2023 13:35:08 -0400 Subject: [PATCH 17/26] npm audit fix: added override to package.json --- package.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/package.json b/package.json index 3d7522cdd..539e5b8e6 100644 --- a/package.json +++ b/package.json @@ -62,8 +62,5 @@ "dependencies": { "@popperjs/core": "^2.11.6" } - "overrides": { - "graceful-fs": "^4.2.10" + } - } -} From b47af9961cd399d0245bcf107f2221f42cbcb9b3 Mon Sep 17 00:00:00 2001 From: Sumanmhalsank02 Date: Sun, 26 Mar 2023 13:57:02 -0400 Subject: [PATCH 18/26] ADDED: Internationalization to the website --- mywebclass_internationalization.spec.js | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 mywebclass_internationalization.spec.js diff --git a/mywebclass_internationalization.spec.js b/mywebclass_internationalization.spec.js new file mode 100644 index 000000000..f292379c9 --- /dev/null +++ b/mywebclass_internationalization.spec.js @@ -0,0 +1,26 @@ +import { test, expect } from '@playwright/test' + +test.describe('MyWebClass.org internationalization', () => { + let page + + test.beforeEach(async ({ browser }) => { + page = await browser.newPage() + await page.goto('http://localhost:3000') + }) + + test.afterEach(async () => { + await page.close() + }) + + test('should display the site in "en" when the "Accept-Language" header is set to "en"', async () => { + // Set the Accept-Language header and navigate to the website + await page.setExtraHTTPHeaders({ 'Accept-Language': 'en' }) + await page.goto('http://localhost:3000') + + // Check if the lang attribute of the HTML tag is set to "en" + const langAttribute = await page.getAttribute('html', 'lang') + expect(langAttribute).toBe('en', 'The lang attribute of the HTML tag is not set to "en".') + + // Perform any additional checks for the "en" language version of the website here, e.g., checking specific text or elements + }) +}) \ No newline at end of file From 3ba7d7c7636ff8888709ff43bafaa5fbce193732 Mon Sep 17 00:00:00 2001 From: Sumanmhalsank02 Date: Sun, 26 Mar 2023 14:01:58 -0400 Subject: [PATCH 19/26] ADDED: Internationalization to the website --- tests/mywebclass_internationalization.spec.js | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/mywebclass_internationalization.spec.js diff --git a/tests/mywebclass_internationalization.spec.js b/tests/mywebclass_internationalization.spec.js new file mode 100644 index 000000000..f292379c9 --- /dev/null +++ b/tests/mywebclass_internationalization.spec.js @@ -0,0 +1,26 @@ +import { test, expect } from '@playwright/test' + +test.describe('MyWebClass.org internationalization', () => { + let page + + test.beforeEach(async ({ browser }) => { + page = await browser.newPage() + await page.goto('http://localhost:3000') + }) + + test.afterEach(async () => { + await page.close() + }) + + test('should display the site in "en" when the "Accept-Language" header is set to "en"', async () => { + // Set the Accept-Language header and navigate to the website + await page.setExtraHTTPHeaders({ 'Accept-Language': 'en' }) + await page.goto('http://localhost:3000') + + // Check if the lang attribute of the HTML tag is set to "en" + const langAttribute = await page.getAttribute('html', 'lang') + expect(langAttribute).toBe('en', 'The lang attribute of the HTML tag is not set to "en".') + + // Perform any additional checks for the "en" language version of the website here, e.g., checking specific text or elements + }) +}) \ No newline at end of file From 97c6d576ab992ef466ed0ca4ed8990579a2d183e Mon Sep 17 00:00:00 2001 From: Sumanmhalsank02 Date: Sun, 26 Mar 2023 14:47:22 -0400 Subject: [PATCH 20/26] FIX: npm audit fix 2 --- package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package.json b/package.json index 539e5b8e6..40c9e4931 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,10 @@ }, "dependencies": { "@popperjs/core": "^2.11.6" + }, + + "overrides": { + "graceful-fs": "^4.2.10" } } From b32e6d59e09f5374aea59caa3476868fb63e5aab Mon Sep 17 00:00:00 2001 From: Suman Mhalsank <48148023+Sumanmhalsank02@users.noreply.github.com> Date: Sun, 26 Mar 2023 19:07:35 -0400 Subject: [PATCH 21/26] UPDATED: Homepage contents --- src/index.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/index.html b/src/index.html index f81cd55e9..71f2d2f88 100644 --- a/src/index.html +++ b/src/index.html @@ -37,6 +37,9 @@ +
From 77ac5f997e03254b71a734a0edb245a9229081c3 Mon Sep 17 00:00:00 2001 From: Sumanmhalsank02 Date: Sun, 26 Mar 2023 19:17:49 -0400 Subject: [PATCH 22/26] UPDATED: homepage content --- src/index.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/index.html b/src/index.html index 71f2d2f88..97f0436da 100644 --- a/src/index.html +++ b/src/index.html @@ -39,6 +39,9 @@ +
From fd8df5901611d3e08341fb6c6a83f446e6ed01fb Mon Sep 17 00:00:00 2001 From: Sumanmhalsank02 Date: Sun, 26 Mar 2023 19:54:34 -0400 Subject: [PATCH 23/26] UPDATED: homepage content --- src/index.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/index.html b/src/index.html index 97f0436da..84c984935 100644 --- a/src/index.html +++ b/src/index.html @@ -1,3 +1,13 @@ + + + + From f50bd7b8e8df1d5594c7fa1ee5f37a7a4809c023 Mon Sep 17 00:00:00 2001 From: Sumanmhalsank02 Date: Sun, 26 Mar 2023 19:58:09 -0400 Subject: [PATCH 24/26] UPDATED: homepage content --- tests/mywebclass_internationalization.spec.js | 26 ------------------- 1 file changed, 26 deletions(-) delete mode 100644 tests/mywebclass_internationalization.spec.js diff --git a/tests/mywebclass_internationalization.spec.js b/tests/mywebclass_internationalization.spec.js deleted file mode 100644 index f292379c9..000000000 --- a/tests/mywebclass_internationalization.spec.js +++ /dev/null @@ -1,26 +0,0 @@ -import { test, expect } from '@playwright/test' - -test.describe('MyWebClass.org internationalization', () => { - let page - - test.beforeEach(async ({ browser }) => { - page = await browser.newPage() - await page.goto('http://localhost:3000') - }) - - test.afterEach(async () => { - await page.close() - }) - - test('should display the site in "en" when the "Accept-Language" header is set to "en"', async () => { - // Set the Accept-Language header and navigate to the website - await page.setExtraHTTPHeaders({ 'Accept-Language': 'en' }) - await page.goto('http://localhost:3000') - - // Check if the lang attribute of the HTML tag is set to "en" - const langAttribute = await page.getAttribute('html', 'lang') - expect(langAttribute).toBe('en', 'The lang attribute of the HTML tag is not set to "en".') - - // Perform any additional checks for the "en" language version of the website here, e.g., checking specific text or elements - }) -}) \ No newline at end of file From 7e85298effdf4464293b1ce282aad037a74c9c75 Mon Sep 17 00:00:00 2001 From: Sumanmhalsank02 Date: Sun, 26 Mar 2023 20:06:42 -0400 Subject: [PATCH 25/26] ADDED: Google Analytics to the webpage --- src/index.html | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/index.html b/src/index.html index 84c984935..017c7f35f 100644 --- a/src/index.html +++ b/src/index.html @@ -1,17 +1,19 @@ - - - - + + + + + + MyWebClass.org From ed327399f2a18dc5b39b4de9c29a645d5ea87f77 Mon Sep 17 00:00:00 2001 From: Sumanmhalsank02 Date: Sun, 26 Mar 2023 20:17:04 -0400 Subject: [PATCH 26/26] FIXED : BUG --- src/index.html | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/index.html b/src/index.html index 017c7f35f..0e4b35664 100644 --- a/src/index.html +++ b/src/index.html @@ -2,18 +2,14 @@ - - - - MyWebClass.org