Skip to content

Commit

Permalink
Merge branch 'main' into hotkey-library-replace
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnei committed May 23, 2024
2 parents 5b04561 + 7ad6825 commit 6961c16
Show file tree
Hide file tree
Showing 739 changed files with 24,356 additions and 25,765 deletions.
4 changes: 2 additions & 2 deletions .crowdin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ base_path: .
preserve_hierarchy: true

files:
- source: '/app/src/i18n/org/opencastproject/adminui/languages/lang-en_US.json'
translation: '/app/src/i18n/org/opencastproject/adminui/languages/lang-%locale_with_underscore%.json'
- source: '/src/i18n/org/opencastproject/adminui/languages/lang-en_US.json'
translation: '/src/i18n/org/opencastproject/adminui/languages/lang-%locale_with_underscore%.json'
2 changes: 1 addition & 1 deletion .github/build-release.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Build integrated version
cd ../app
cd ..
rm -rf build/
export PUBLIC_URL=/admin-ui
CI=false npm run build
Expand Down
11 changes: 1 addition & 10 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,9 @@ updates:

# Javascript
- package-ecosystem: npm
directory: "/"
schedule:
interval: monthly
time: "04:00"
open-pull-requests-limit: 15
labels:
- dependencies
- package-ecosystem: npm
directory: "/app"
directory: /
schedule:
interval: monthly
time: "04:00"
open-pull-requests-limit: 15
labels:
- dependencies
6 changes: 2 additions & 4 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@ jobs:

- name: download dependencies
run: npm ci
working-directory: ./app

- name: create release tarball
run: ../.github/build-release.sh
working-directory: ./app
run: ./.github/build-release.sh

- name: create new release
uses: softprops/action-gh-release@v2
with:
files: ./app/oc-admin-ui-*.tar.gz
files: ./oc-admin-ui-*.tar.gz
draft: true
fail_on_unmatched_files: true
generate_release_notes: true
28 changes: 28 additions & 0 deletions .github/workflows/crowdin-deploy-keys.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy Crowdin keys

on:
push:
branches:
- main

concurrency:
group: crowdin-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy-translation-keys:
if: github.repository_owner == 'opencast'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: prepare crowdin client
run: |
wget --quiet https://artifacts.crowdin.com/repo/deb/crowdin3.deb
sudo dpkg -i crowdin3.deb
- name: upload translation source
env:
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
run: |
crowdin upload sources --config .crowdin.yaml -b main
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Test build

on:
push:
branches-ignore:
- 'dependabot/**'
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4

- name: get node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: download dependencies
run: npm ci

- name: build project
env:
CI: false
run: npm run build
4 changes: 2 additions & 2 deletions .github/workflows/update-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ jobs:
crowdin download --config .crowdin.yaml -b admin-ui-picard
- name: add new translations
run: |
git add /app/src/i18n/org/opencastproject/adminui/languages/
git add /src/i18n/org/opencastproject/adminui/languages/
- name: update language list
working-directory: /app/src/i18n/org/opencastproject/adminui/languages/
working-directory: /src/i18n/org/opencastproject/adminui/languages/
run: |
echo -n '[ "' > locales.json
echo -n ??-??.json | sed 's/ */", "/g' >> locales.json
Expand Down
23 changes: 0 additions & 23 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,2 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

.vscode
16 changes: 0 additions & 16 deletions .vscode/launch.json

This file was deleted.

134 changes: 55 additions & 79 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,126 +1,102 @@
Opencast Admin UI
=====================
=================

The Opencast Admin UI is a graphical interface included by Opencast to give
admins an easy way of managing their Opencast instance.
The Opencast Admin UI is a graphical interface included with Opencast
that allows admins to easily manage their Opencast instance.

Development and testing
-----------------------

Quickstart
----------
Commands to hack into your console to get to testing pull requests ASAP:
To get a local copy of the admin UI to test or develop on, you can do the following:

```console
```sh
git clone [email protected]:opencast/opencast-admin-interface.git opencast-admin-interface-demo
cd opencast-admin-interface-demo
git switch my-branch # or otherwise check out, pull, merge, etc. whatever branch you want to test/hack on
npm ci
cd app
npm ci
cd ..
npm run proxy-server http://stable.opencast.org opencast_system_account CHANGE_ME
```

Open a second tab:

```
npm run client
```

Open a third tab to checkout the pull request you want to test. You need to know the pull request number!:
You can now run a local instance of the UI by saying

```sh
npm start
```
git fetch origin pull/{PULL REQUEST NUMBER HERE}/head:some-branch-name-of-your-choosing
git checkout some-branch-name-of-your-choosing
```

Development
-------

Before starting, get the project dependencies by running `npm ci` beforehand both in the root and `/app` directory.

To test with real data run:
This runs a development server at `http://localhost:3000`, serving a development build
of the admin UI, and automatically opens a browser tab pointed to it.
The build and the browser tab should automatically refresh on every change you make
to the codebase.
By default, this server also replies mock data to the various requests
the UI would normally send to the Opencast backend.

npm run proxy-server http://stable.opencast.org *opencast_digest_username* *opencast_digest_password*
Not all functionality of the admin UI works in this mode. If you need to test
with real data, or need the ability to change it, you can rely on the
proxy functionality of said development server, instead of running the static file server. Run:

This will start a proxy server at localhost:5000. It will automatically proxy
requests to a Opencast instance at http://stable.opencast.org. You can change
the url to at a different Opencast if you wish (e.g. http://localhost.8080 for
a local Opencast installation). Note that `http` is required.

You can then start the client in a different tab by running:

npm run client

This will start a client server in the development mode.
Open [http://localhost:3000](localhost:3000) to view it in the browser.

--------
```sh
PROXY=1 npm start
```

Alternatively you can spin up a mock instance of the admin ui with:
This assumes you have an Opencast instance running at `http://localhost:8080`
to which the development server will then proxy all the backend request,
authenticating them as user `admin` with password `opencast`.

npm start
If you want to work with a different Opencast and/or user, you can change the command thusly:

This uses mock data instead of a real Opencast. This means certain features will
not work when using this mode.
```sh
PROXY_TARGET=https://develop.opencast.org npm start
```

### Alternative ports
Here, `PROXY_TARGET` is the target URL of the Opencast instance you want to test against.
This can also be a local one like `http://localhost:8080`.

The static file server and the proxy server serve their content
on the port 5000. If this is used already (as it is on macOS)
you can specify an alternative port in the `PORT` environment variable,
for example:
By default, this tries to authenticate backend requests using HTTP Basic Auth
as user `admin` with the default password `opencast`.
If you want to authenticate using different credentials, you can specify them
in the `PROXY_AUTH` variable in the format `user:password`, as in

PORT=5001 npm run proxy-server ...
```sh
PROXY_TARGET=http://localhost:8080 PROXY_AUTH=jdoe:aligator3 npm run client
```

Note that you need to specify the same port when running the client,
this time in the `PROXY_PORT` variable:
Note that `PROXY=1` is not required if you specify either `PROXY_TARGET` or `PROXY_AUTH`.

PROXY_PORT=5001 npm run client
Similarly, if you want to change the port the development server itself runs at,
you can specify an alternative port in the `PORT` environment variable.

How to cut a release for Opencast
---------------------------------

1. [NOT YET FUNCTIONAL] (Optional) Run the [Update translations](https://github.com/opencast/opencast-editor/actions/workflows/update-translations.yml) workflow, to make sure all changes from crowdin are included in the next release.
1. [NOT YET FUNCTIONAL] (Optional) Run the [Update translations](https://github.com/opencast/opencast-admin-interface/actions/workflows/update-translations.yml/actions/workflows/update-translations.yml) workflow to ensure all changes from crowdin are included in the next release.
1. Switch to the commit you want to turn into the release
1. Create and push a new tag
```bash
DATE=$(date +%Y-%m-%d)
git tag -m Release -s "$DATE"
git push upstream "$DATE":"$DATE"

```sh
DATE=$(date +%Y-%m-%d)
git tag -m Release -s "$DATE"
git push upstream "$DATE":"$DATE"
```
1. Wait for the [Create release draft](https://github.com/opencast/opencast-editor/actions/workflows/create-release.yml)

1. Wait for the [Create release draft](https://github.com/opencast/opencast-admin-interface/actions/workflows/create-release.yml)
workflow to finish
- It will create a new [GitHub release draft](https://github.com/opencast/opencast-editor/releases)
- It will create a new [GitHub release draft](https://github.com/opencast/opencast-admin-interface/releases)
- Review and publish the draft
1. Submit a pull request against Opencast
- [Update the release](https://github.com/opencast/opencast/blob/b2bea8822b95b8692bb5bbbdf75c9931c2b7298a/modules/admin-ui-interface/pom.xml#L16-L17)
- [Adjust the documentation](https://github.com/opencast/opencast/blob/b2bea8822b95b8692bb5bbbdf75c9931c2b7298a/docs/guides/admin/docs/modules/admin-ui.md)
if necessary
- Verify that the new release runs in Opencast, then create the pull request.



Opencast API used by the Admin UI
-------------
The Admin UI accesses all endpoints in Opencast located under

* `/admin-ng/*`

If you want to use current version of the frontend with an earlier Opencast
version, you will have to cherry pick the relevant commits from the Opencast
repository yourself.



Translating the Admin UI
-------------
You can help translating the editor to your language on [crowdin.com/project/opencast-admin-interface](https://crowdin.com/project/opencast-admin-interface). Simply request to join the project on Crowdin and start translating. If you are interested in translating a language which is not a target language right now, please create [a GitHub issue](https://github.com/opencast/opencast-admin-interface/issues) and we will add the language.

This project follows the general form of [Opencast's Localization Process](https://docs.opencast.org/develop/developer/#participate/localization/), especially regarding what happens when you need to [change an existing translation key](https://docs.opencast.org/develop/developer/#participate/localization/#i-need-to-update-the-wording-of-the-source-translation-what-happens). Any questions not answered there should be referred to the mailing lists!
------------------------

You can help translate the Opencast Admin UI to your language on [crowdin.com/project/opencast-admin-interface](https://crowdin.com/project/opencast-admin-interface). Simply request to join the project on Crowdin and start translating. If you are interested in translating a language that is not a target language right now, please create [a GitHub issue](https://github.com/opencast/opencast-admin-interface/issues) and we will add the language.

This project follows the general form of [Opencast's Localization Process](https://docs.opencast.org/develop/developer/#participate/localization/), especially regarding what happens when you need to [change an existing translation key](https://docs.opencast.org/develop/developer/#participate/localization/#i-need-to-update-the-wording-of-the-source-translation-what-happens). Any questions not answered there should be referred to the mailing lists!

Configuration
-------------

The Admin UI frontend cannot be directly configured. Rather, it adapts to the
various configurations in the Opencast backend. TODO: Throw in some links to the
docs, which ones?
23 changes: 0 additions & 23 deletions app/.gitignore

This file was deleted.

Loading

0 comments on commit 6961c16

Please sign in to comment.