From 80038940a8147a83535a746d5e6e1c60cd334a2c Mon Sep 17 00:00:00 2001 From: Nick Muerdter <12112+GUI@users.noreply.github.com> Date: Wed, 24 Jan 2024 21:21:58 -0700 Subject: [PATCH] Provide message for making admin changes. --- config/schema.cue | 3 ++- src/api-umbrella/admin-ui/app/styles/_base.scss | 4 ++++ .../admin-ui/app/templates/admin-groups/index.hbs | 2 ++ src/api-umbrella/admin-ui/app/templates/admins/index.hbs | 2 ++ src/api-umbrella/admin-ui/app/templates/api-scopes/index.hbs | 2 ++ .../app/templates/components/admin-groups/record-form.hbs | 4 ++++ .../admin-ui/app/templates/components/admins/record-form.hbs | 4 ++++ .../app/templates/components/api-scopes/record-form.hbs | 4 ++++ src/api-umbrella/web-app/actions/admin/sessions.lua | 1 + 9 files changed, 25 insertions(+), 1 deletion(-) diff --git a/config/schema.cue b/config/schema.cue index b4a6bc551..ae6b43798 100644 --- a/config/schema.cue +++ b/config/schema.cue @@ -884,7 +884,8 @@ import "path" override_public_http_proto?: "http" | "https" override_public_https_proto?: "http" | "https" - contact_url?: string + contact_url: string | *"/contact/" + admin_contact_url: string | *"/contact/" http_proxy?: string https_proxy?: string diff --git a/src/api-umbrella/admin-ui/app/styles/_base.scss b/src/api-umbrella/admin-ui/app/styles/_base.scss index 34aa1a9d0..42e599c51 100644 --- a/src/api-umbrella/admin-ui/app/styles/_base.scss +++ b/src/api-umbrella/admin-ui/app/styles/_base.scss @@ -151,3 +151,7 @@ a:hover { .ui-pnotify-text p:last-of-type { margin-bottom: 0px; } + +.alert a { + text-decoration: underline; +} diff --git a/src/api-umbrella/admin-ui/app/templates/admin-groups/index.hbs b/src/api-umbrella/admin-ui/app/templates/admin-groups/index.hbs index ccf4b99e7..f6648e405 100644 --- a/src/api-umbrella/admin-ui/app/templates/admin-groups/index.hbs +++ b/src/api-umbrella/admin-ui/app/templates/admin-groups/index.hbs @@ -4,6 +4,8 @@
Add New Admin Group
+{{else}} +
Contact us to make adminstrator changes.
{{/if}} diff --git a/src/api-umbrella/admin-ui/app/templates/admins/index.hbs b/src/api-umbrella/admin-ui/app/templates/admins/index.hbs index 7b7407048..49f37fe27 100644 --- a/src/api-umbrella/admin-ui/app/templates/admins/index.hbs +++ b/src/api-umbrella/admin-ui/app/templates/admins/index.hbs @@ -4,6 +4,8 @@
Add New Admin
+{{else}} +
Contact us to make adminstrator changes.
{{/if}} diff --git a/src/api-umbrella/admin-ui/app/templates/api-scopes/index.hbs b/src/api-umbrella/admin-ui/app/templates/api-scopes/index.hbs index a23cfd061..272306a9d 100644 --- a/src/api-umbrella/admin-ui/app/templates/api-scopes/index.hbs +++ b/src/api-umbrella/admin-ui/app/templates/api-scopes/index.hbs @@ -4,6 +4,8 @@
Add New API Scope
+{{else}} +
Contact us to make adminstrator changes.
{{/if}} diff --git a/src/api-umbrella/admin-ui/app/templates/components/admin-groups/record-form.hbs b/src/api-umbrella/admin-ui/app/templates/components/admin-groups/record-form.hbs index 951b80f72..bcca86a26 100644 --- a/src/api-umbrella/admin-ui/app/templates/components/admin-groups/record-form.hbs +++ b/src/api-umbrella/admin-ui/app/templates/components/admin-groups/record-form.hbs @@ -1,4 +1,8 @@
+ {{#unless this.currentAdmin.permissions.admin_manage}} +
Contact us to make adminstrator changes.
+ {{/unless}} +
diff --git a/src/api-umbrella/admin-ui/app/templates/components/admins/record-form.hbs b/src/api-umbrella/admin-ui/app/templates/components/admins/record-form.hbs index b2e9f277e..6e22815fd 100644 --- a/src/api-umbrella/admin-ui/app/templates/components/admins/record-form.hbs +++ b/src/api-umbrella/admin-ui/app/templates/components/admins/record-form.hbs @@ -1,4 +1,8 @@
+ {{#unless this.currentAdmin.permissions.admin_manage}} +
Contact us to make adminstrator changes.
+ {{/unless}} + diff --git a/src/api-umbrella/admin-ui/app/templates/components/api-scopes/record-form.hbs b/src/api-umbrella/admin-ui/app/templates/components/api-scopes/record-form.hbs index 305eeff32..2d89cce44 100644 --- a/src/api-umbrella/admin-ui/app/templates/components/api-scopes/record-form.hbs +++ b/src/api-umbrella/admin-ui/app/templates/components/api-scopes/record-form.hbs @@ -1,4 +1,8 @@
+ {{#unless this.currentAdmin.permissions.admin_manage}} +
Contact us to make adminstrator changes.
+ {{/unless}} + diff --git a/src/api-umbrella/web-app/actions/admin/sessions.lua b/src/api-umbrella/web-app/actions/admin/sessions.lua index f7c5fa6c5..7bf53ded0 100644 --- a/src/api-umbrella/web-app/actions/admin/sessions.lua +++ b/src/api-umbrella/web-app/actions/admin/sessions.lua @@ -208,6 +208,7 @@ function _M.auth(self) response["authenticated"] = true response["analytics_timezone"] = json_null_default(config["analytics"]["timezone"]) response["username_is_email"] = json_null_default(config["web"]["admin"]["username_is_email"]) + response["admin_contact_url"] = json_null_default(config["admin_contact_url"]) response["local_auth_enabled"] = json_null_default(local_auth_enabled) response["password_length_min"] = json_null_default(config["web"]["admin"]["password_length_min"]) response["api_umbrella_version"] = json_null_default(API_UMBRELLA_VERSION)