Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to node 20 for building assets. Change to using Vite from CRA. #249

Merged
merged 79 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
2dd68fa
1541: remove os2display-grid-generator temp, will re-add
sinejespersen May 28, 2024
e88ec3e
1541: change lodash imports and dependency to avoid tree shaking
sinejespersen May 28, 2024
4770389
1541: yarn upgrade
sinejespersen May 28, 2024
ae4b93c
1541: remove unused dependencies
sinejespersen May 28, 2024
1645604
1541: initial work on vite and upgrade node
sinejespersen May 29, 2024
bd83e61
1541: remote component now works
sinejespersen May 29, 2024
aa45f50
1541: readd lodash tree-shaking
sinejespersen May 29, 2024
d14138b
1541: readd os2display-grid-generator
sinejespersen May 29, 2024
230c7fd
1541: readd os2display-grid-generator
sinejespersen May 29, 2024
2a150da
1541: changelog
sinejespersen May 29, 2024
75174ce
1541: correct tiny error, uniqwith instead of uniqWith in import
sinejespersen May 29, 2024
339228e
1541: add eslint to package.json
sinejespersen May 29, 2024
319745d
1541: remove healthcheck
sinejespersen Jun 3, 2024
4743c03
1541: reverse port 3000
sinejespersen Jun 3, 2024
120ddee
1541: move eslint to dev dependencies
sinejespersen Jun 3, 2024
145e99b
1541: update changelog to reflect new repo
sinejespersen Jun 3, 2024
4c91ea8
1541: remove unused path import
sinejespersen Jun 4, 2024
00955c1
Merge pull request #2 from aroskanalen/feature/1541-update-node-migra…
sinejespersen Jun 6, 2024
214dcb3
1541: initial work on vite and upgrade node
sinejespersen May 29, 2024
e21aacd
1541: add eslint to package.json
sinejespersen May 29, 2024
41542d4
1541: initial cypress to playwright
sinejespersen May 31, 2024
02c4810
1541: fix baseurl
sinejespersen May 31, 2024
41c27a9
1541: update readme with playwright
sinejespersen May 31, 2024
5486877
1541: remove cypress specific linting
sinejespersen May 31, 2024
9493161
1541: add yarn.lock without cypress linting
sinejespersen May 31, 2024
1c5c61a
1541: change sdf to localScreenGroup
sinejespersen May 31, 2024
78e2596
1541: campaigntests
sinejespersen May 31, 2024
b527c22
1541: delete campaign cypress tests
sinejespersen May 31, 2024
aff20a4
1541: delete slide cypress tests
sinejespersen May 31, 2024
3445905
1541: delete cypress login tests
sinejespersen May 31, 2024
ffab625
1541: remvoe media tests, and two failing tests
sinejespersen May 31, 2024
bc866b9
1541: theme spec updated
sinejespersen May 31, 2024
b362314
1541: remove tests
sinejespersen May 31, 2024
c924ec6
1541: remove tests
sinejespersen Jun 3, 2024
0a1472f
1541: topbar tests
sinejespersen Jun 3, 2024
a181a10
1541: add theme list tests to theme spec
sinejespersen Jun 3, 2024
c9332e4
1541: delete theme list spec
sinejespersen Jun 3, 2024
2bdb65f
1541: media tests added
sinejespersen Jun 3, 2024
16d3bbb
1541: playlist tests in playwright
sinejespersen Jun 3, 2024
753a009
1541: shared playlist tests added
sinejespersen Jun 3, 2024
f84013c
1541: screen tests
sinejespersen Jun 3, 2024
8e650ab
1541: format screen groups
sinejespersen Jun 3, 2024
479c02f
1541: remove cypress json files
sinejespersen Jun 3, 2024
c921dd7
1541: yarn.lock rebuild
sinejespersen Jun 3, 2024
26bfa31
1541: remove ids used in test
sinejespersen Jun 3, 2024
db56412
1541: update changelog
sinejespersen Jun 3, 2024
a5d4803
1541: add env CI: 'true' to pr.yml to avoid endless tests in GA
sinejespersen Jun 3, 2024
d92e677
1541: delete failing test
sinejespersen Jun 3, 2024
ff08f4f
1541: add reporter: [['html', { open: 'never' }]] to playwright.config
sinejespersen Jun 3, 2024
b63e504
1541: readd remote component
sinejespersen Jun 3, 2024
a5420d0
1541: readd grid generation
sinejespersen Jun 6, 2024
453a0b5
1541: move playwrigt to override, remove version from dockercompose
sinejespersen Jun 6, 2024
9ca3d43
1541: remove ports 3000 (rebase error)
sinejespersen Jun 6, 2024
fe93945
Merge pull request #1 from aroskanalen/feature/1541-cypress-becomes-p…
sinejespersen Jun 6, 2024
72fca2a
173: Removed default props from components
tuj Jun 17, 2024
66d84c7
173: Removed defaultProps
tuj Jun 18, 2024
51355e2
173: Upgraded modules to avoid warnings
tuj Jun 18, 2024
b87ea3e
173: Updated changelog
tuj Jun 18, 2024
31485e6
173: Fixed HMR setup
tuj Jun 18, 2024
3e4568a
173: Removed array spread
tuj Jun 18, 2024
30ac9cd
Merge pull request #3 from aroskanalen/feature/remove-default-props
tuj Jun 19, 2024
ac8652c
Merge branch 'develop' into feature/module-upgrades
tuj Jun 19, 2024
5dbf83c
Merge pull request #4 from aroskanalen/feature/module-upgrades
tuj Jun 19, 2024
7a52a3e
Merge branch 'develop' into feature/hmr
tuj Jun 19, 2024
a2022b2
Merge pull request #5 from aroskanalen/feature/hmr
tuj Jun 19, 2024
06012b8
Merge branch 'develop' into feature/remove-array-spread
tuj Jun 19, 2024
7692533
Merge pull request #6 from aroskanalen/feature/remove-array-spread
tuj Jun 19, 2024
2d8dea6
173: Fixed HMR setup
tuj Jun 19, 2024
4a8b2ec
Merge pull request #7 from aroskanalen/feature/hmr-2
tuj Jun 19, 2024
7fa0491
1859: Fixed configurable base path
tuj Jul 3, 2024
9dd383e
1859: Fixed build dir
tuj Jul 4, 2024
2345fbe
1859: Changed path for tests
tuj Jul 5, 2024
cf1e09e
1859: Changed to fixed base path /admin
tuj Aug 1, 2024
8dbe057
1859: Fixed tests and vite config
tuj Aug 1, 2024
2a0b19e
Merge pull request #8 from aroskanalen/feature/configurable-base-path
tuj Aug 1, 2024
9a048cf
Merge branch 'develop' into develop
tuj Aug 1, 2024
65be3aa
1859: Set infrastructure node version to 20
tuj Aug 2, 2024
f9c3b4e
Merge pull request #9 from aroskanalen/feature/infrastructure-node-20
tuj Aug 2, 2024
f208d31
Merge branch 'develop' into develop
tuj Aug 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
7 changes: 7 additions & 0 deletions .docker/vhost.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,11 @@ server {
proxy_set_header Host $http_host;
proxy_pass http://node:3000;
}

location /admin/ws {
proxy_pass http://node:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
4 changes: 2 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"airbnb",
"prettier",
"plugin:jsdoc/recommended",
"plugin:prettier/recommended",
"plugin:cypress/recommended"
"plugin:prettier/recommended"
],
"ignorePatterns": ["*.yml"],
"parser": "babel-eslint",
Expand All @@ -14,6 +13,7 @@
"allowImportExportEverywhere": true
},
"rules": {
"react/require-default-props": "off",
"react/jsx-filename-extension": [
"warn",
{
Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@ jobs:
docker compose run --rm node yarn install
docker compose run --rm node yarn check-coding-standards

cypress:
name: Cypress
playwright-tests:
name: Playwright
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
browser: ["chrome"]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -48,16 +46,21 @@ jobs:
- name: Install client
run: docker compose run node yarn

- name: Cypress run
run: docker compose run cypress run --browser ${{ matrix.browser }}
- name: Run playwright
env:
CI: 'true'
run: |
docker compose run --rm node yarn install
docker compose run --rm playwright npx playwright install --with-deps
docker compose run --rm playwright npx playwright test --retries 3


- name: Archive screenshots
if: ${{ failure() }}
uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-screenshots-${{ matrix.browser }}
path: cypress/screenshots
retention-days: 7
name: playwright-report
path: playwright-report/
retention-days: 30

changelog:
runs-on: ubuntu-latest
Expand Down
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ yarn-error.log*
# Ignore VS-code
.vscode

# Cypress
cypress/videos/*
cypress/screenshots/*

# Temp files
temp/

# API mock
json-server/
# Playwright
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/

# Json files in public folder
public/config.json
public/access-config.json
public/release.json
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@

# Changelog

All notable changes to this project will be documented in this file.

## [Unreleased]

- [#249](https://github.com/os2display/display-admin-client/pull/249)
- Set infrastructure node version to 20.
- Fixed base path to /admin in vite setup.
- Changed from vite CJS to ESM.
- Removed array spread.
- Fixed HMR setup.
- Upgraded @fortawesome/react-fontawesome, react-quill, react-toastify.
- Removed unused react-dayjs.
- Remove default props from the project.
- Migrate from Cypress to playwright
- Migrate from CRA to Vite
- Upgrade node from 14 -> 20

## [2.0.3] - 2024-08-14

- [#252](https://github.com/os2display/display-admin-client/pull/252)
Expand Down
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description of the admin.

### Create public/config file

By default the api that is requested is located at `/api/`.
By default, the api that is requested is located at `/api/`.
This can be configured by:

```shell
Expand Down Expand Up @@ -62,14 +62,20 @@ docker compose exec node npm --prefix src/redux/api install
docker compose exec node npm --prefix src/redux/api start
```

## Testing with cypress
## Testing with playwright

We use [cypress](https://www.cypress.io/) for testing.
We use [playwright](https://playwright.dev/) for testing.

To run cypress tests in the cypress container:
To run playwright tests with docker:

```shell
docker compose run --rm cypress run
docker compose run --rm playwright npx playwright test
```

To test with user interface, up the containers and change the baseUrl in playwright.config.ts, then:

```shell
yarn playwright test --ui
```

### Linting
Expand Down
9 changes: 0 additions & 9 deletions config-overrides.js

This file was deleted.

6 changes: 0 additions & 6 deletions cypress/fixtures/error.json

This file was deleted.

20 changes: 0 additions & 20 deletions cypress/fixtures/groups/group-successful.json

This file was deleted.

146 changes: 0 additions & 146 deletions cypress/fixtures/groups/groups.json

This file was deleted.

Loading
Loading