Skip to content

Commit

Permalink
Provide message for making admin changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
GUI committed Jan 25, 2024
1 parent 2514244 commit 8003894
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config/schema.cue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/api-umbrella/admin-ui/app/styles/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,7 @@ a:hover {
.ui-pnotify-text p:last-of-type {
margin-bottom: 0px;
}

.alert a {
text-decoration: underline;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<div class="button-actions button-actions-down">
<LinkTo @route="admin_groups.new" class="btn btn-primary"><FaIcon @icon="plus" /> Add New Admin Group</LinkTo>
</div>
{{else}}
<div class="alert alert-primary"><a href="{{this.session.data.authenticated.admin_contact_url}}">Contact us</a> to make adminstrator changes.</div>
{{/if}}

<AdminGroups::IndexTable />
2 changes: 2 additions & 0 deletions src/api-umbrella/admin-ui/app/templates/admins/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<div class="button-actions button-actions-down">
<LinkTo @route="admins.new" class="btn btn-primary"><FaIcon @icon="plus" /> Add New Admin</LinkTo>
</div>
{{else}}
<div class="alert alert-primary"><a href="{{this.session.data.authenticated.admin_contact_url}}">Contact us</a> to make adminstrator changes.</div>
{{/if}}

<Admins::IndexTable />
2 changes: 2 additions & 0 deletions src/api-umbrella/admin-ui/app/templates/api-scopes/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<div class="button-actions button-actions-down">
<LinkTo @route="api_scopes.new" class="btn btn-primary"><FaIcon @icon="plus" /> Add New API Scope</LinkTo>
</div>
{{else}}
<div class="alert alert-primary"><a href="{{this.session.data.authenticated.admin_contact_url}}">Contact us</a> to make adminstrator changes.</div>
{{/if}}

<ApiScopes::IndexTable />
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<div ...attributes>
{{#unless this.currentAdmin.permissions.admin_manage}}
<div class="alert alert-primary"><a href="{{this.session.data.authenticated.admin_contact_url}}">Contact us</a> to make adminstrator changes.</div>
{{/unless}}

<ErrorMessages @model={{this.model}} />

<form {{on "submit" this.submitForm}}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<div ...attributes>
{{#unless this.currentAdmin.permissions.admin_manage}}
<div class="alert alert-primary"><a href="{{this.session.data.authenticated.admin_contact_url}}">Contact us</a> to make adminstrator changes.</div>
{{/unless}}

<ErrorMessages @model={{this.model}} />

<form {{on "submit" this.submitForm}}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<div ...attributes>
{{#unless this.currentAdmin.permissions.admin_manage}}
<div class="alert alert-primary"><a href="{{this.session.data.authenticated.admin_contact_url}}">Contact us</a> to make adminstrator changes.</div>
{{/unless}}

<ErrorMessages @model={{this.model}} />

<form {{on "submit" this.submitForm}}>
Expand Down
1 change: 1 addition & 0 deletions src/api-umbrella/web-app/actions/admin/sessions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8003894

Please sign in to comment.