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

[SQL-250] UI no longer cares about HTML #414

Merged
merged 4 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Version of LRS Admin UI to use

LRS_ADMIN_UI_VERSION ?= v0.1.20
LRS_ADMIN_UI_VERSION ?= v0.1.21
LRS_ADMIN_UI_LOCATION ?= https://github.com/yetanalytics/lrs-admin-ui/releases/download/${LRS_ADMIN_UI_VERSION}/lrs-admin-ui.zip
LRS_ADMIN_ZIPFILE ?= lrs-admin-ui-${LRS_ADMIN_UI_VERSION}.zip

Expand Down
2 changes: 1 addition & 1 deletion doc/endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The response body contains a newly generated JSON Web Token (JWT) on success. A

#### Misc Admin Routes

- `GET http://example.org/admin/env`: Get select environment variables about the configuration which may aid in client-side operations. Currently returns a map containing the configuration variables `urlPrefix` and `enableStmtHtml`.
- `GET http://example.org/admin/env`: Get select environment variables about the configuration which may aid in client-side operations.
- `DELETE http://example.org/admin/agents`: Runs a *hard delete* of all records of an actor, and associated records (statements, attachments, etc). Intended for privacy purposes like GDPR. Body should be a JSON object of form `{"actor-ifi":<actor-ifi>}`. Disabled unless the configuration variable enableAdminDeleteActor to be set to `true`.

### Reaction Management Routes
Expand Down
2 changes: 1 addition & 1 deletion doc/env_vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ These config vars enable and configure browser security response headers from th
| `LRSQL_ENABLE_ADMIN_DELETE_ACTOR` | `enableAdminDeleteActor` | Whether or not to enable the route and UI for deleting actors and related documents | `false` |
| `LRSQL_ENABLE_ADMIN_UI` | `enableAdminUi` | Whether or not to serve the administrative UI at `/admin` | `true` |
| `LRSQL_ENABLE_ADMIN_STATUS` | `enableAdminStatus` | Whether or not to serve admin system status data that queries the database. | `true` |
| `LRSQL_ENABLE_STMT_HTML` | `enableStmtHtml` | Whether or not HTML data is returned in the LRS HTTP response. If `false` disables HTML rendering even if `LRSQL_ENABLE_ADMIN_UI` is `true`. In that case the UI will not display the Statement Browser feature. | `true` |
| `LRSQL_ENABLE_STMT_HTML` | `enableStmtHtml` | Whether or not HTML data is returned in the LRS HTTP response if the Accept type is specified as text/html. If `false` disables HTML rendering regardless of Accept type. | `true` |
| `LRSQL_ADMIN_LANGUAGE` | `adminLanguage` | Allows override of default RFC5646 language code (`en-US`). May require that you add new language map entries to `resources/lrsql/localization/language.json` to add a new language. | `en-US` |

[<- Back to Index](index.md)
2 changes: 0 additions & 2 deletions src/main/lrsql/admin/interceptors/ui.clj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
:enter
(fn get-env [ctx]
(let [{url-prefix ::i/path-prefix
enable-stmt-html ::i/statement-html?
oidc-env ::oidc-i/admin-env} ctx]
(assoc ctx
:response
Expand All @@ -42,7 +41,6 @@
(merge
(cond-> {:url-prefix url-prefix
:proxy-path proxy-path
:enable-stmt-html (some? enable-stmt-html)
:enable-admin-delete-actor enable-admin-delete-actor
:enable-admin-status enable-admin-status
:enable-reactions enable-reactions
Expand Down
3 changes: 1 addition & 2 deletions src/test/lrsql/admin/route_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@
(let [{:keys [status body]} (get-env content-type)
edn-body (u/parse-json body)]
(is (= 200 status))
(is (= (get edn-body "url-prefix") "/xapi"))
(is (= (get edn-body "enable-stmt-html") true))))
(is (= (get edn-body "url-prefix") "/xapi"))))
(testing "create account with username `myname` and password `swordfish`"
(let [{:keys [status
body]} (create-account headers req-body)
Expand Down
Loading