Skip to content

Commit

Permalink
Merge branch 'main' into 385-always-add-current-user-to-acl
Browse files Browse the repository at this point in the history
  • Loading branch information
schuettloeffel-elsa committed May 24, 2024
2 parents 84d71b0 + 25b79b3 commit 7173e68
Show file tree
Hide file tree
Showing 738 changed files with 24,454 additions and 25,724 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.

116 changes: 44 additions & 72 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,85 +1,68 @@
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.

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

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:

```bash
npm run client
```
You can now run a local instance of the UI by saying

Open a third tab to checkout the pull request you want to test. You need to know the pull request number!:

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

Development
-------
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.

Before starting, get the project dependencies by running `npm ci` beforehand both in the root and `/app` directory.
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:

To test with real data run:

```shell
npm run proxy-server http://stable.opencast.org *opencast_digest_username* *opencast_digest_password*
```sh
PROXY=1 npm start
```

This will start a proxy server at localhost:5000. It will automatically proxy
requests to an Opencast instance at http://stable.opencast.org. You can change the URL to a different Opencast if you wish (e.g., http://localhost.8080 for
a local Opencast installation). Note that `http` is required.
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`.

You can then start the client in a different tab by running:
If you want to work with a different Opencast and/or user, you can change the command thusly:

```shell
npm run client
```sh
PROXY_TARGET=https://develop.opencast.org npm start
```

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

--------
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`.

Alternatively, you can spin up a mock instance of the admin ui with:
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

```shell
npm start
```sh
PROXY_TARGET=http://localhost:8080 PROXY_AUTH=jdoe:aligator3 npm run client
```

This uses mock data instead of a real Opencast. This means certain features will
not work when using this mode.

### Alternative ports
Note that `PROXY=1` is not required if you specify either `PROXY_TARGET` or `PROXY_AUTH`.

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:

PORT=5001 npm run proxy-server ...

Note that you need to specify the same port when running the client,
this time in the `PROXY_PORT` variable:

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
---------------------------------
Expand All @@ -88,10 +71,10 @@ How to cut a release for Opencast
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-admin-interface/actions/workflows/create-release.yml)
Expand All @@ -104,19 +87,8 @@ How to cut a release for Opencast
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 the 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 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.

Expand Down
23 changes: 0 additions & 23 deletions app/.gitignore

This file was deleted.

Loading

0 comments on commit 7173e68

Please sign in to comment.