Skip to content

Commit

Permalink
Region Replication - refresh code mirror after load
Browse files Browse the repository at this point in the history
when replication type is already set to Remote,
the code mirror component renders too soon and thus renders without data

adding an explicit ui-refresh, to trigger a refresh once the data is loaded

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1656066
  • Loading branch information
himdel committed Dec 17, 2018
1 parent f75dffb commit e1bdeac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ManageIQ.angular.app.controller('pglogicalReplicationFormController', ['$http', '$scope', 'pglogicalReplicationFormId', 'miqService', '$q', function($http, $scope, pglogicalReplicationFormId, miqService, $q) {
ManageIQ.angular.app.controller('pglogicalReplicationFormController', ['$http', '$scope', 'pglogicalReplicationFormId', 'miqService', '$q', '$timeout', function($http, $scope, pglogicalReplicationFormId, miqService, $q, $timeout) {
var init = function() {
$scope.pglogicalReplicationModel = {
replication_type: 'none',
Expand Down Expand Up @@ -316,6 +316,10 @@ ManageIQ.angular.app.controller('pglogicalReplicationFormController', ['$http',
$scope.afterGet = true;
$scope.modelCopy = angular.copy( $scope.pglogicalReplicationModel );
miqService.sparkleOff();

$timeout(function() {
$scope.codeMirrorRefresh = true;
});
}

init();
Expand Down
1 change: 1 addition & 0 deletions app/views/ops/_settings_replication_tab.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
= _('Excluded Tables')
%br
%textarea{"ui-codemirror" => "",
"ui-refresh" => "codeMirrorRefresh",
:name => "exclusion_list",
'ng-model' => 'pglogicalReplicationModel.exclusion_list',
'checkchange' => ''}
Expand Down

0 comments on commit e1bdeac

Please sign in to comment.