mirror of
https://github.com/documize/community.git
synced 2025-07-19 13:19:43 +02:00
Display Keycloak settings outcome on save
Errors detected and displayed.
This commit is contained in:
parent
628a633a0a
commit
ce9d314837
2 changed files with 10 additions and 3 deletions
|
@ -32,6 +32,7 @@ export default Component.extend(Notifier, {
|
|||
KeycloakPublicKeyError: empty('keycloakConfig.publicKey'),
|
||||
KeycloakAdminUserError: empty('keycloakConfig.adminUser'),
|
||||
KeycloakAdminPasswordError: empty('keycloakConfig.adminPassword'),
|
||||
keycloakFailure: '',
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
|
@ -91,6 +92,8 @@ export default Component.extend(Notifier, {
|
|||
let provider = this.get('authProvider');
|
||||
let config = this.get('authConfig');
|
||||
|
||||
this.set('keycloakFailure', '');
|
||||
|
||||
switch (provider) {
|
||||
case constants.AuthProvider.Documize:
|
||||
config = {};
|
||||
|
@ -148,10 +151,10 @@ export default Component.extend(Notifier, {
|
|||
if (data.authProvider === constants.AuthProvider.Keycloak) {
|
||||
this.get('onSync')().then((response) => {
|
||||
if (response.isError) {
|
||||
this.set('keycloakFailure', response.message);
|
||||
console.log(response.message); // eslint-disable-line no-console
|
||||
data.authProvider = constants.AuthProvider.Documize;
|
||||
this.get('onSave')(data).then(() => {
|
||||
});
|
||||
this.get('onSave')(data).then(() => {});
|
||||
} else {
|
||||
if (data.authProvider === this.get('appMeta.authProvider')) {
|
||||
console.log(response.message); // eslint-disable-line no-console
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<div class="form-group row">
|
||||
<label for="keycloak-realm" class="col-sm-2 col-form-label">Keycloak Realm</label>
|
||||
<div class="col-sm-10">
|
||||
{{input id="keycloak-realm" type="text" value=keycloakConfig.realm class=(if keycloakRealmError 'form-control is-invalid' 'form-control')}}
|
||||
{{input id="keycloak-realm" type="text" value=keycloakConfig.realm class=(if KeycloakRealmError 'form-control is-invalid' 'form-control')}}
|
||||
<small class="form-text text-muted">e.g. main</small>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -96,4 +96,8 @@
|
|||
{{/if}}
|
||||
<div class="btn btn-success mt-4" {{action 'onSave'}}>Save</div>
|
||||
</form>
|
||||
|
||||
{{#if (gt keycloakFailure.length 0)}}
|
||||
<p class="admin-setting-failure my-3">Keycloak connection failed: {{keycloakFailure}}</p>
|
||||
{{/if}}
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue