1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-19 13:54:25 +01:00

[bug] unable to create oauth2 sso

[bug] application failed when sso activated
[bug] missing translations in oauth2 forms
This commit is contained in:
Sylvain 2019-02-14 12:25:37 +01:00
parent 0d0c378b33
commit 9f765009a8
4 changed files with 15 additions and 26 deletions

View File

@ -1,5 +1,10 @@
# Changelog Fab Manager
- Refactored rake tasks to use namespaces and descriptions
- Fix a bug: unable to create a new oAuth 2.0 provider
- Fix a bug: application in unavailable if a SSO is active
- Fixed missing translations in authentication providers form
## v2.8.3 2019 January 29
- Added user's manual (fr)

View File

@ -411,10 +411,10 @@ Application.Controllers.controller('ApplicationController', ['$rootScope', '$sco
}).result['finally'](null).then(function () { growl.info(_t('you_will_receive_in_a_moment_an_email_with_instructions_to_reset_your_password')); });
}
});
// otherwise the user just closed the modal
<% end %>
};
// otherwise the user just closed the modal
<% end %>
/**
* Detect if the current page (tab/window) is active of put as background.

View File

@ -92,6 +92,7 @@ Application.Directives.directive('disableAnimation', ['$animate', ($animate) =>
/**
* Isolate a form's scope from its parent : no nested validation
* @see https://stackoverflow.com/a/37481846/1039377
*/
Application.Directives.directive('isolateForm', [ () =>
({
@ -100,30 +101,13 @@ Application.Directives.directive('isolateForm', [ () =>
link (scope, elm, attrs, ctrl) {
if (!ctrl) { return; }
// Do a copy of the controller
const ctrlCopy = {};
angular.copy(ctrl, ctrlCopy);
const parentForm = ctrl.$$parentForm; // Note this uses private API
if (!parentForm) {
return;
}
// Get the form's parent
const parent = elm.parent().controller('form');
// Remove parent link to the controller
parent.$removeControl(ctrl);
// Replace form controller with a "isolated form"
const isolatedFormCtrl = {
$setValidity (validationToken, isValid, control) {
ctrlCopy.$setValidity(validationToken, isValid, control);
return parent.$setValidity(validationToken, true, ctrl);
},
$setDirty () {
elm.removeClass('ng-pristine').addClass('ng-dirty');
ctrl.$dirty = true;
return ctrl.$pristine = false;
}
};
return angular.extend(ctrl, isolatedFormCtrl);
// Remove this form from parent controller
parentForm.$removeControl(ctrl);
}
})

View File

@ -19,7 +19,7 @@ class AuthProvider < ActiveRecord::Base
before_create :set_initial_state
def build_providable(params)
def build_providable(params, _assignment_options)
raise "Unknown providable_type: #{providable_type}" unless PROVIDABLE_TYPES.include?(providable_type)
self.providable = providable_type.constantize.new(params)