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

Feat / Restructure and a11y #435

Merged
merged 42 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
b088167
refactor: initialize workspace and separate services, stores and utils
ChristiaanScheermeijer Nov 17, 2023
b231abe
chore: update configurations and set up linting
ChristiaanScheermeijer Nov 20, 2023
6748fad
refactor(project): move web assets to theme package
ChristiaanScheermeijer Nov 20, 2023
653054f
docs: add i18n package readme
ChristiaanScheermeijer Nov 24, 2023
949ab1c
refactor: store supported languages in config store
ChristiaanScheermeijer Nov 27, 2023
9b06145
chore: update release workflow
ChristiaanScheermeijer Nov 30, 2023
a4dbc40
refactor: move web into platforms directory
ChristiaanScheermeijer Dec 15, 2023
ab4f4e7
chore: update web platform directory in workflows
ChristiaanScheermeijer Dec 15, 2023
fde6081
chore: update gitignore
ChristiaanScheermeijer Dec 15, 2023
0d23fe2
chore: fix epg fixtures
ChristiaanScheermeijer Dec 15, 2023
06c4f3e
refactor(project): remove vite from common, ui-react and hooks-react …
royschut Jan 9, 2024
21945fd
feat: remove browser typings from common
ChristiaanScheermeijer Jan 12, 2024
4869cc9
refactor(project): remove react from common package (#9)
royschut Jan 12, 2024
c630ace
feat(player): show nice error message when media item is geo blocked
langemike Jan 12, 2024
ea9c602
refactor(project): move icons to theme folder (#21)
MelissaDTH Jan 12, 2024
9955388
refactor(project): add createURL util to replace all url utils
royschut Jan 12, 2024
d16f0e6
refactor(project): remove react-router from hooks-react package
royschut Jan 12, 2024
3c2f81e
refactor: allow custom integration registration via container
ChristiaanScheermeijer Jan 10, 2024
3079b20
refactor(project): split url creation from location based
royschut Jan 15, 2024
d7143bf
feat(accessibility): accessibility improvements and quick wins
MelissaDTH Jan 3, 2024
684c9bb
fix(a11y): alertdialog with aria-modal for alert component
langemike Jan 9, 2024
fe97a75
fix(a11y): apply section to account and payment pages
R-Cloud-Designs Jan 11, 2024
029a0a0
refactor(a11y): refactor language menu switch for accessibility compl…
royschut Jan 15, 2024
e7b7568
fix(a11y): cards optimized for screen readers
langemike Jan 12, 2024
547a0f7
feat(i18n): reflect language switching in root html lang tag.
R-Cloud-Designs Jan 12, 2024
533697b
feat(a11y): make user menu keyboard accessible
royschut Jan 15, 2024
1865f42
fix: language menu button
ChristiaanScheermeijer Jan 17, 2024
c812c02
fix: slow login and preventable errors
ChristiaanScheermeijer Jan 17, 2024
f302dbd
fix: load subscription after restoring SVOD session
ChristiaanScheermeijer Jan 17, 2024
22bf874
fix(auth): set the correct loading state after logging the user in ac…
Jan 17, 2024
f1bd9c0
Merge branch 'develop' into feat/release-sprint-2024-1
ChristiaanScheermeijer Jan 18, 2024
d1ddcdb
fix: refresh entitlements on tvod purchase
ChristiaanScheermeijer Jan 18, 2024
6d7dc12
Merge branch 'develop' into feat/release-sprint-2024-1
ChristiaanScheermeijer Jan 18, 2024
949d709
chore: fix depcheck errors
ChristiaanScheermeijer Jan 18, 2024
fdb7e35
fix: infinite loader when buying a subscription
ChristiaanScheermeijer Jan 19, 2024
6624367
Merge branch 'develop' into feat/release-sprint-2024-1
ChristiaanScheermeijer Jan 23, 2024
298153e
Merge branch 'develop' into feat/release-sprint-2024-1
ChristiaanScheermeijer Jan 25, 2024
d151e83
docs(project): update documentation for workspaces
ChristiaanScheermeijer Jan 26, 2024
4057cad
chore: rename web specific workflows
ChristiaanScheermeijer Jan 26, 2024
d74f3f0
chore: pr feedback
ChristiaanScheermeijer Jan 29, 2024
ca38d06
chore: move build packages to configs directory
ChristiaanScheermeijer Jan 29, 2024
d6f7c84
fix: epg service bindings
ChristiaanScheermeijer Jan 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = {
'user',
'watchhistory',
'favorites',
'profiles',
'analytics',
'pwa',
'seo',
Expand All @@ -29,6 +30,7 @@ module.exports = {
'epg',
'tests',
'i18n',
'a11y',
],
],
},
Expand Down
38 changes: 12 additions & 26 deletions .depcheckrc.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,16 @@
ignores: [
# These are dependencies for vite and vite plugins that depcheck doesn't recognize as being used
'postcss-scss',
'stylelint-order',
'stylelint-config-recommended-scss',
'stylelint-declaration-strict-value',
'stylelint-scss',
'@vitest/coverage-v8',
# This is used by commitlint in .commitlintrc.js
'@commitlint/config-conventional',
# These are vite aliases / tsconfig paths that point to specific local directories
# Note the \ is necessary to escape the # or the ignore doesn't work
'\#src',
'\#test',
'\#types',
'\#components',
'\#utils',
'src', # This is used in src/styles, which recognizes absolute paths from the repo root
'allure-commandline', # To support e2e-reports
'@codeceptjs/allure-legacy',
'faker',
'i18next-parser', # For extracting i18next translation keys
'npm-run-all', # To run linting checks
'virtual:pwa-register', # Service Worker code is injected at build time
'vite-plugin-pwa/client', # Used to generate pwa framework
'reflect-metadata', # Used for ioc resolution
'@babel/plugin-proposal-decorators', # Used to build with decorators for ioc resolution
'babel-plugin-transform-typescript-metadata', # Used to build with decorators for ioc resolution
'@babel/core', # Required peer dependency for babel plugins above

# @todo: remove dep from main package, once i18next is moved to specific packages
'ts-node',

# Workspace packages
'eslint-config-jwp',
'@typescript-eslint/parser', # Required by eslint-config-jwp
'@typescript-eslint/eslint-plugin', # Required by eslint-config-jwp
'eslint-plugin-import', # Required by eslint-config-jwp

'depcheck',
'ts-node'
]
6 changes: 2 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Modules
node_modules/

# Test
coverage/

# Build output
build/

coverage/
128 changes: 1 addition & 127 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,129 +1,3 @@
const restrictedGlobals = require('confusing-browser-globals');

module.exports = {
parser: '@typescript-eslint/parser',

plugins: [
// Enable Typescript linting
'@typescript-eslint',

// Enable linting imports
'import',
],

extends: [
// Use default ESLint rules
'eslint:recommended',

// Use recommended TS rules
'plugin:@typescript-eslint/recommended',

// Use recommended React rules
'plugin:react/recommended',

'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
],

env: {
// Browser conf
browser: true,
es6: true,
},

rules: {
// Prevent development/debugging statements
'no-console': ['error', { allow: ['warn', 'error', 'info', 'debug'] }],
'no-alert': 'error',
'no-debugger': 'error',

// Prevent usage of confusing globals
'no-restricted-globals': ['error'].concat(restrictedGlobals),

// Assignments in function returns is confusing and could lead to unwanted side-effects
'no-return-assign': ['error', 'always'],

curly: ['error', 'multi-line'],

// Strict import ordering
'import/order': [
'warn',
{
groups: ['builtin', 'external', 'parent', 'sibling', 'index'],
pathGroups: [
// Sort absolute root imports before parent imports
{
pattern: '/**',
group: 'parent',
position: 'before',
},
],
'newlines-between': 'always',
},
],
// Not needed in React 17
'react/react-in-jsx-scope': 'off',
'import/no-named-as-default-member': 'off',
},
overrides: [
{
files: ['*.js'],
env: {
// We may still use CJS in .js files (eg. local scripts)
commonjs: true,
},
rules: {
// `require` is still allowed/recommended in JS
'@typescript-eslint/no-var-requires': 'off',
},
},
{
files: ['*.ts', '*.tsx'],
rules: {
// TypeScript 4.0 adds 'any' or 'unknown' type annotation on catch clause variables.
// We need to make sure error is of the type we are expecting
'@typescript-eslint/no-implicit-any-catch': 'error',

// These are handled by TS
'@typescript-eslint/no-explicit-any': ['warn', { ignoreRestArgs: true }],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'import/no-unresolved': 'off',
},
},
{
files: ['*.jsx', '*.tsx', 'src/hooks/*.ts'],
plugins: [
// Enable linting React code
'react',
'react-hooks',
],
rules: {
// Help with Hooks syntax
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',

// Handled by Typescript
'react/prop-types': 'off',

// This rule causes too many false positives, eg. with default exports or child render function
'react/display-name': 'off',
},
},
],

settings: {
react: {
pragma: 'React',
version: '17',
},
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
extends: ['jwp/typescript'],
};
3 changes: 2 additions & 1 deletion .github/workflows/release-build-tag-release.yml
dbudzins marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
echo "current-version=${version}" >> "$GITHUB_OUTPUT"

- name: Build App
working-directory: ./platforms/web
run: |
yarn build
cd build
Expand Down Expand Up @@ -51,7 +52,7 @@ jobs:
if: ${{ steps.package-version.outputs.current-version }}
with:
commit: 'release'
artifacts: 'build/ott-web-app-build-*.tar.gz, build/ott-web-app-build-*.zip'
artifacts: 'web/build/ott-web-app-build-*.tar.gz, web/build/ott-web-app-build-*.zip'
tag: v${{ steps.package-version.outputs.current-version }}
bodyFile: '.github/RELEASE_BODY_TEMPLATE.md'
token: ${{ secrets.github_token }}
5 changes: 5 additions & 0 deletions .github/workflows/release-deploy-prod-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches: ['release']
workflow_dispatch:

defaults:
run:
working-directory: ./platforms/web

jobs:
deploy_live_website:
runs-on: ubuntu-latest
Expand All @@ -20,3 +24,4 @@ jobs:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}'
channelId: live
entryPoint: './platforms/web'
6 changes: 5 additions & 1 deletion .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
- cron: '30 3 * * 1-5'
workflow_dispatch:

defaults:
run:
working-directory: ./platforms/web

jobs:
test-e2e:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -40,5 +44,5 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: allure-report-${{ matrix.config }}
path: ./test-e2e/output/${{ matrix.config }}
path: ./platforms/web/test-e2e/output/${{ matrix.config }}
retention-days: 7
5 changes: 5 additions & 0 deletions .github/workflows/test-preview-and-lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Test - Deploy Preview and Lighthouse Test
on:
pull_request:

defaults:
run:
working-directory: ./platforms/web

jobs:
build_and_preview:
name: Build and preview
Expand All @@ -18,6 +22,7 @@ jobs:
- uses: FirebaseExtended/action-hosting-deploy@v0
id: firebase_hosting_preview
with:
entryPoint: './platforms/web'
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}'
expires: 30d
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-unit-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: yarn install, build, and test
- name: yarn install and test
run: |
yarn
yarn test
Expand Down
15 changes: 0 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
# project, build, and deployment
node_modules
build
.snowpack
coverage
output
public/locales/**/*_old.json
yarn-error.log
.firebase
firebase-debug.log
.stylelintcache
.lighthouseci

# os or editor
.idea
.DS_Store
.vscode/

# ignore local files
*.local

# Exclude ini files because they have customer specific data
ini/*.ini

# Ignore working area for i18n checks
.temp-translations
39 changes: 39 additions & 0 deletions .syncpackrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"$schema": "https://unpkg.com/[email protected]/dist/schema.json",
"semverGroups": [
{
"dependencies": ["codeceptjs", "codeceptjs**", "react-router", "react-router-dom"],
"packages": ["**"],
"isIgnored": true
},
{
"range": "^",
"dependencies": ["**"],
"packages": ["**"],
"dependencyTypes": ["prod", "dev", "peer", "resolutions"]
}
],
"versionGroups": [
{
"label": "Ensure semver ranges for locally developed packages satisfy the local version",
"dependencies": ["@jwp/**", "**-config-jwp"],
"dependencyTypes": ["peer"],
"packages": ["**"],
"pinVersion": "*"
},
{
"label": "Ensure local packages are installed as peerDependency",
"dependencies": ["@jwp/**", "**-config-jwp"],
"dependencyTypes": ["dev", "prod"],
"packages": ["**"],
"isBanned": true
},
{
"dependencies": ["@types/**"],
"dependencyTypes": ["!dev"],
"packages": ["**"],
"isBanned": true,
"label": "@types packages should only be under devDependencies"
}
]
}
4 changes: 2 additions & 2 deletions docs/features/video-analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The app sends the following events (param `e`) to JW platform:

## Event JS Script

The event trigger implementation for the ott web app can be found at [jwpltx.js](/public/jwpltx.js)
The event trigger implementation for the ott web app can be found at [jwpltx.js](/web/public/jwpltx.js)

Note that `navigator.sendBeacon()` is used to call the endpoints. The browser will not do CORS checks on this operation. It furthermore minimizes performance impact as the browser doesn't wait for the response of the server.

Expand All @@ -51,7 +51,7 @@ It also lets us to use `beforeunload` event in order to send remaining data to a

A special data parameter is the Analytics ID (`aid`). It determines to which JW Player account & property the events belong. Each property has its unique analytics ID and is provided by a JW PLayer Solution Engineer or Account manager.

For the OTT Web App the Analytics ID is stored in [`config.json`](/public/config.json) as `analyticsToken`
For the OTT Web App the Analytics ID is stored in [`config.json`](/web/public/config.json) as `analyticsToken`

## Metrics

Expand Down
6 changes: 3 additions & 3 deletions docs/initialization-file.md
dbudzins marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Initialization (ini) File

The JW OTT Web App loads a small initialization (.ini) file at startup. This file provides a mechanism to set key startup parameters without modifying the source code.
Template ini files are included in the repo and with the pre-compiled production release builds ([.webapp.prod.ini](/ini/templates/.webapp.prod.ini)).
Template ini files are included in the repo and with the pre-compiled production release builds ([.webapp.prod.ini](/web/ini/templates/.webapp.prod.ini)).
Make sure you include a copy of the ini file edited to include your account data at `/public/.webapp.ini` for the application to load correctly.

For all manual builds (`yarn start` or `yarn build`), the ini file is copied from `/ini/.webapp.<mode>.ini` to `build/public/.webapp.ini`, which the application fetches and parses at startup. For production builds, the ini file is stripped of comments and extra whitespace.
If a file doesn't exist in /ini/.webapp.<mode>.ini, then the template file will first be copied from [`/ini/templates`](/ini/templates).
If a file doesn't exist in /ini/.webapp.<mode>.ini, then the template file will first be copied from [`/ini/templates`](/web/ini/templates).
All of the .ini files directly inside of `/ini` are ignored in git, so you can create your own files locally to run the application with your account parameters without creating conflicts with committed code or leaking your details into source control.

## Ini Parameters
Expand Down Expand Up @@ -47,7 +47,7 @@ Keep in mind, if the playerLicenseKey ini setting is provided, it will be used e

An array of 8-character IDs (entered 1 per line) for app configs in your JWP account (or url paths) that can be used with the [`app-config=<config source>` query param](configuration.md#switching-between-app-configs).
This may be useful for example if you have a staging or experimental config that you want to be able to test on your site using the [`app-config` query parameter](configuration.md#switching-between-app-configs) without changing the default config that the application loads with for all of your users.
See [.webapp.test.ini](/ini/templates/.webapp.test.ini) for an example.
See [.webapp.test.ini](/web/ini/templates/.webapp.test.ini) for an example.

### UNSAFE_allowAnyConfigSource

Expand Down
Loading
Loading