azure ad add edit

This commit is contained in:
Westly Wright 2018-05-15 11:55:22 -07:00
parent 4391288465
commit e47a96f993
No known key found for this signature in database
GPG Key ID: 4FAB3D8673DC54A3
4 changed files with 19 additions and 9 deletions

View File

@ -23,7 +23,7 @@ export default Controller.extend({
//new //new
azureADConfig: alias('model.azureADConfig'), azureADConfig: alias('model.azureADConfig'),
isEnabled: alias('azureADConfig.enabled'), isEnabled: alias('azureADConfig.enabled'),
// isEnabled: true, editing: false,
mode: 'global', mode: 'global',
modeClass: 'span-4', modeClass: 'span-4',
@ -36,6 +36,11 @@ export default Controller.extend({
}), }),
actions: { actions: {
edit() {
set(this, 'editing', true);
},
toggleMode() { toggleMode() {
if (get(this, 'mode') === 'global') { if (get(this, 'mode') === 'global') {
@ -59,6 +64,7 @@ export default Controller.extend({
this.send('clearError'); this.send('clearError');
const model = get(this, 'azureADConfig'); const model = get(this, 'azureADConfig');
const enabled = get(this, 'azureADConfig.enabled');
model.setProperties({ model.setProperties({
accessMode: 'unrestricted', accessMode: 'unrestricted',
@ -70,13 +76,13 @@ export default Controller.extend({
set(this, 'errors', errors); set(this, 'errors', errors);
set(this, 'testing', false); set(this, 'testing', false);
model.set('enabled', false); model.set('enabled', enabled);
} else { } else {
set(this, 'testing', true); set(this, 'testing', true);
delete model.enabled; // delete model.enabled;
model.doAction('testAndApply', { model.doAction('testAndApply', {
azureAdConfig: model, azureAdConfig: model,
@ -89,7 +95,7 @@ export default Controller.extend({
}).catch((err) => { }).catch((err) => {
set(model, 'enabled', false); set(model, 'enabled', enabled);
this.send('gotError', err); this.send('gotError', err);

View File

@ -35,7 +35,10 @@
<section class=""> <section class="">
<div class="clearfix"> <div class="clearfix">
<div class="pull-right"> <div class="pull-right mt-10">
<button class="btn btn-sm bg-primary" {{action "edit"}}>
{{t 'generic.edit'}}
</button>
<button class="btn btn-sm right-divider-btn bg-error" {{action "disable"}}> <button class="btn btn-sm right-divider-btn bg-error" {{action "disable"}}>
{{t 'authPage.azuread.enabled.promptDisable'}} {{t 'authPage.azuread.enabled.promptDisable'}}
</button> </button>
@ -69,7 +72,7 @@
{{/if}} {{/if}}
{{#unless isEnabled}} {{#if (or (not isEnabled) editing)}}
<section class="box mt-30"> <section class="box mt-30">
<div class="row"> <div class="row">
@ -164,5 +167,6 @@
</div> </div>
</div> </div>
</section> </section>
{{/unless}} {{/if}}
{{/accordion-list}} {{/accordion-list}}

View File

@ -10,7 +10,7 @@ export default Controller.extend({
drivers: computed(function() { drivers: computed(function() {
return [ return [
{route: 'security.authentication.activedirectory', label: 'Active Directory', css: 'activedirectory', available: this.hasRecord('activedirectoryconfig') }, {route: 'security.authentication.activedirectory', label: 'Active Directory', css: 'activedirectory', available: this.hasRecord('activedirectoryconfig') },
// {route: 'security.authentication.azuread', label: 'Azure AD', css: 'azuread', available: this.hasRecord('azureadconfig') }, {route: 'security.authentication.azuread', label: 'Azure AD', css: 'azuread', available: this.hasRecord('azureadconfig') },
{route: 'security.authentication.github', label: 'GitHub', css: 'github', available: this.hasRecord('githubconfig') }, {route: 'security.authentication.github', label: 'GitHub', css: 'github', available: this.hasRecord('githubconfig') },
// {route: 'security.authentication.openldap', label: 'OpenLDAP', css: 'openldap', available: this.hasRecord('openldapconfig') }, // {route: 'security.authentication.openldap', label: 'OpenLDAP', css: 'openldap', available: this.hasRecord('openldapconfig') },
// {route: 'security.authentication.shibboleth', label: 'Shibboleth', css: 'shibboleth', available: this.hasRecord('shibbolethconfig') }, // {route: 'security.authentication.shibboleth', label: 'Shibboleth', css: 'shibboleth', available: this.hasRecord('shibbolethconfig') },

View File

@ -473,7 +473,7 @@ authPage:
header: 'Danger Zone&trade;' header: 'Danger Zone&trade;'
warning: '<b class="text-danger">Caution:</b> Disabling access control will give complete control over {appName} to anyone that can reach this page or the API.' warning: '<b class="text-danger">Caution:</b> Disabling access control will give complete control over {appName} to anyone that can reach this page or the API.'
reallyDisable: 'Are you sure? Click again to really disable access control' reallyDisable: 'Are you sure? Click again to really disable access control'
promptDisable: Disable access control promptDisable: Disable Azure AD
configure: configure:
header: '1. Configure Azure AD Account' header: '1. Configure Azure AD Account'
adminAccountUsername: adminAccountUsername: