Skip to content

Commit

Permalink
Merge branch 'develop' into feat/change-subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
naumovski-filip committed Jul 5, 2023
2 parents 265b16c + 7d4eabe commit c52b13e
Show file tree
Hide file tree
Showing 31 changed files with 899 additions and 247 deletions.
1 change: 1 addition & 0 deletions .github/workflows/firebase-live.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
- name: Build
env:
APP_PLAYER_LICENSE_KEY: ${{ secrets.PLAYER_LICENSE_KEY }}
APP_GOOGLE_SITE_VERIFICATION_ID: ${{ vars.GOOGLE_SITE_VERIFICATION_ID }}
run: yarn && MODE=demo yarn build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
Expand Down
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
# [4.22.0](https://github.com/jwplayer/ott-web-app/compare/v4.21.0...v4.22.0) (2023-07-05)


### Features

* **project:** remove github pages ([a83bfe9](https://github.com/jwplayer/ott-web-app/commit/a83bfe9ac5087def6d46bebce2b226ec80313cbf))
* **project:** remove hash routing ([91acf86](https://github.com/jwplayer/ott-web-app/commit/91acf86508b9b93fbb7ef965b12aa05ac8e5b246))



# [4.21.0](https://github.com/jwplayer/ott-web-app/compare/v4.20.0...v4.21.0) (2023-07-05)


### Features

* **project:** test cases for analytics ([2abf28b](https://github.com/jwplayer/ott-web-app/commit/2abf28b88cb716efb33ac154e375285c307e7246))
* **project:** test cases for analytics ([41f900d](https://github.com/jwplayer/ott-web-app/commit/41f900d88361b862048e281e00ffe27fc5ec7c04))



# [4.20.0](https://github.com/jwplayer/ott-web-app/compare/v4.19.1...v4.20.0) (2023-07-04)


### Features

* **project:** add variable for GA ([fa0e0d7](https://github.com/jwplayer/ott-web-app/commit/fa0e0d75e20ea506bb2ebde92f9744e1645cab16))



## [4.19.1](https://github.com/jwplayer/ott-web-app/compare/v4.19.0...v4.19.1) (2023-06-20)


Expand Down
2 changes: 1 addition & 1 deletion docs/backend-services.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Backend dependencies and architecture

The application is built as a single page web app that can run without its own dedicated backend. This is useful for
hosting it with a very simple, static host, like github pages. The server serves the static web content and the frontend
hosting it with a very simple, static host. The server serves the static web content and the frontend
calls the [JW Player Delivery API](https://developer.jwplayer.com/jwplayer/docs) directly.
However, for additional functionality, the application can also connect to other backends to provide user
accounts / authentication, subscription management, and checkout flows.
Expand Down
6 changes: 0 additions & 6 deletions docs/build-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,3 @@ It is recommended that this value be provided via a .env.local file or a github

If you are using pre-compiled builds instead of building the code yourself, you can also set this value with the [playerLicenseKey ini setting](initialization-file.md#playerLicenseKey).
Keep in mind, if the [playerLicenseKey ini setting](initialization-file.md#playerLicenseKey) is provided, it will be used even if the `APP_PLAYER_LICENSE_KEY` environment variable is set.

### APP_GITHUB_PUBLIC_BASE_URL

This value is used to set the URL of links in the app correctly when running on [github pages](easy-deployments.md#github-pages).
By default, if `APP_GITHUB_PUBLIC_BASE_URL` is empty, the value will be based on the `git remote get-url origin` command.
You can also pass your own `APP_GITHUB_PUBLIC_BASE_URL` envvar by running `APP_GITHUB_PUBLIC_BASE_URL=/my-base/ yarn deploy:github`.
39 changes: 39 additions & 0 deletions docs/content-types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# What are content types?

In order to map data coming from the JWP delivery pipeline to the correct screen components in the app,
we use the concept of 'content types'.
Basically, a content type is simply a custom parameter named 'contentType' on a media item with a value defining which type the media is (movie, trailer, series, etc.)

In the app, content types often map to specific screens (see [screenMapping.ts](src/screenMapping.ts) and [MediaScreenRouter.tsx](src/pages/ScreenRouting/MediaScreenRouter.tsx).)
Each content type screen often expects different metadata attached to the media item's custom parameters.

# Using content types in the JWP dashboard

To help ensure that content editors use the right content types and custom parameters, the JWP dashboard has a content type feature.
You can upload the schema for the content types that your app expects.
Content editors will then be able to choose a content type for each media item and will see the expected metadata when they are editing the item on the dashboard.

> Note: Content types on the JWP dashboard requires a specific entitlement. Please speak with your account rep to enable this feature for your account.
## Uploading content types to the dashboard

In order to quickly upload the content types, you can use the yarn script included with this repository as so:

`yarn load-content-types --site-id=<site id>`

By default, the script will load the content types that the vanilla web app expects found in [content-types.json](scripts/content-types/content-types.json).
You can modify this file in your fork of the web app code or optionally specify another file to load by adding a `--source-file=<file path>` param to the yarn script call.

### Content type upload file definition

The upload file should be a json property with the schemas defined as an array on the `schemas` property on the root object.
Please refer to [content-types.json](scripts/content-types/content-types.json) and the JWP documentation for the schema format.

To avoid unnecessary duplication the file also allows some basic abstraction.
You can define reused fields and sections as key-value entries on the `fields` and `sections` properties respectively.
Then you can include these reusable entities by putting their string key into schemas the same way that you would for inline fields or sections.
There are many examples in the included [content-types.json](scripts/content-types/content-types.json)

> Note: Although the upload file allows you to define reused fields and sections, when these are uploaded they become distinct copies for each instance in the schemas where they are used.
> That means that changing fields and sections via the api after they are uploaded must be done individually for each schema.
> Alternatively, you can re-upload and overwrite the existing schemas, but use caution because you will lose any other manual changes you have made.
25 changes: 0 additions & 25 deletions docs/easy-deployments.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ The instructions in this document will help you deploy your fork of the ott-web-
## Supported Platforms

- [Google Firebase](#google-firebase): Free, easy to use [web hosting service](https://firebase.google.com/) with [integrations](https://firebase.google.com/docs/hosting/github-integration) to deploy directly from github
- [GitHub Pages](#github-pages): Static hosting [directly from a repository](https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pages) though with some limitations

### Google Firebase

Expand All @@ -25,27 +24,3 @@ First, in your fork, you will need to update the project ID in [.firebaserc](.fi
The easiest way to deploy is to use the [Firebase-Github integration](https://firebase.google.com/docs/hosting/github-integration). You can find the action [.yml specifications here](https://github.com/marketplace/actions/deploy-to-firebase-hosting) to deploy to a preview channel for each PR and to the live channel for each merge to your main branch. If you want to manually setup the work, you can find those instructions [here](https://github.com/FirebaseExtended/action-hosting-deploy/blob/main/docs/service-account.md).

You can also manually deploy using the Firebase CLI, as described [here](https://firebase.google.com/docs/hosting/quickstart).

### Github Pages

#### Technical Limitations

Github pages is bare bones static hosting, not optimized for single page apps. This means that urls do not automatically redirect to index.html. For this reason, the Github deploy scripts configure the application to use [hash routing](https://v5.reactrouter.com/web/api/HashRouter), which may be undesirable for production applications.

Github pages also has some [usage limits](https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pages#usage-limits). These limits are determined by Github and are likely to change and evolve, but at the moment they are primarily on the repo size, the bandwidth, and the number of builds per hour. After reviewing the current Github pages limits, if you anticipate exceeding these, you should consider other paid hosting solutions.

#### Usage Instructions

1. (Optional) If you need a customization option, review `yarn deploy:github --help`.
2. Confirm that you can [build this project from source](./build-from-source.md). Be sure to install optional dependencies.
3. Enable the [Github Pages feature](https://docs.github.com/en/pages/getting-started-with-github-pages) for the `gh-pages` branch in your repository.
4. Run `yarn deploy:github`. Be sure to follow the instructions that appear on the screen. If you want to connect your github deployment to a custom domain remember to add `--custom-domain=mydomain.com`.

### Technical Documentation

The `yarn deploy:github` command executes a simple nodejs script located in `scripts/deploy-github.js`. The script executes the following commands:

1. Runs `yarn build` with [`APP_GITHUB_PUBLIC_BASE_URL`](build-from-source.md#APP_GITHUB_PUBLIC_BASE_URL) envvar.
2. Runs `yarn gh-pages -o origin -d build`.<br /><br />You can change the remote from _origin_ to _myremote_ by running `yarn deploy:github --github-remote=myremote`. The `yarn deploy:github` command uses the GitHub remote to compute the default value for `APP_GITHUB_PUBLIC_BASE_URL`.

> **TIP**: Before each of the previous steps, the script will ask if you want to continue. You can prevent these confirmation inquiries by providing `--build` or `--deploy` arguments to `yarn deploy:github`.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jw-ott-webapp",
"version": "4.19.1",
"version": "4.22.0",
"main": "index.js",
"repository": "https://github.com/jwplayer/ott-web-app.git",
"author": "JW Player",
Expand Down Expand Up @@ -36,7 +36,7 @@
"codecept-serve:mobile": "yarn codecept:mobile ; yarn serve-report:mobile",
"codecept-serve:desktop": "yarn codecept:desktop ; yarn serve-report:desktop",
"pre-commit": "depcheck && lint-staged && TZ=UTC yarn test-commit",
"deploy:github": "node ./scripts/deploy-github.js"
"load-content-types": "npx ts-node ./scripts/content-types/load-content-types"
},
"dependencies": {
"@adyen/adyen-web": "^5.42.1",
Expand Down Expand Up @@ -110,14 +110,15 @@
"postcss-scss": "^4.0.4",
"prettier": "^2.8.8",
"react-app-polyfill": "^3.0.0",
"read": "^2.1.0",
"sass": "^1.49.10",
"stylelint": "^13.13.1",
"stylelint-config-recommended-scss": "^4.3.0",
"stylelint-declaration-strict-value": "^1.7.12",
"stylelint-order": "^4.1.0",
"stylelint-scss": "^3.20.0",
"timezone-mock": "^1.3.4",
"ts-node": "^10.7.0",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.1.0",
"typescript": "^4.3.4",
"vi-fetch": "^0.8.0",
Expand Down
Loading

0 comments on commit c52b13e

Please sign in to comment.