mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 01:17:37 -02:30
fix empty template message after expanding
This commit is contained in:
@@ -12,9 +12,17 @@ function atSyntaxHighlightController ($scope, AngularCodeMirror) {
|
|||||||
}
|
}
|
||||||
$scope.value = $scope.value || $scope.default;
|
$scope.value = $scope.value || $scope.default;
|
||||||
|
|
||||||
|
initCodeMirror();
|
||||||
|
|
||||||
|
$scope.$watch(varName, () => {
|
||||||
|
$scope.value = $scope[varName];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function initCodeMirror () {
|
||||||
$scope.varName = varName;
|
$scope.varName = varName;
|
||||||
$scope[varName] = $scope.value;
|
$scope[varName] = $scope.value;
|
||||||
const codeMirror = AngularCodeMirror($scope.disabled);
|
const codeMirror = AngularCodeMirror(!!$scope.disabled);
|
||||||
codeMirror.addModes({
|
codeMirror.addModes({
|
||||||
jinja2: {
|
jinja2: {
|
||||||
mode: $scope.mode,
|
mode: $scope.mode,
|
||||||
@@ -34,10 +42,6 @@ function atSyntaxHighlightController ($scope, AngularCodeMirror) {
|
|||||||
lineNumbers: true,
|
lineNumbers: true,
|
||||||
mode: $scope.mode,
|
mode: $scope.mode,
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.$watch(varName, () => {
|
|
||||||
$scope.value = $scope[varName];
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vm.name = $scope.name;
|
vm.name = $scope.name;
|
||||||
@@ -48,6 +52,9 @@ function atSyntaxHighlightController ($scope, AngularCodeMirror) {
|
|||||||
angular.element(document).ready(() => {
|
angular.element(document).ready(() => {
|
||||||
init();
|
init();
|
||||||
});
|
});
|
||||||
|
$scope.$on('reset-code-mirror', () => {
|
||||||
|
initCodeMirror();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
atSyntaxHighlightController.$inject = [
|
atSyntaxHighlightController.$inject = [
|
||||||
|
|||||||
@@ -153,6 +153,14 @@ export default ['Rest', 'Wait', 'NotificationsFormObject',
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.$watch('customize_messages', (value) => {
|
||||||
|
if (value) {
|
||||||
|
$scope.$broadcast('reset-code-mirror', {
|
||||||
|
customize_messages: $scope.customize_messages,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$scope.emailOptionsChange = function () {
|
$scope.emailOptionsChange = function () {
|
||||||
if ($scope.email_options === 'use_ssl') {
|
if ($scope.email_options === 'use_ssl') {
|
||||||
if ($scope.use_ssl) {
|
if ($scope.use_ssl) {
|
||||||
|
|||||||
@@ -237,6 +237,14 @@ export default ['Rest', 'Wait',
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.$watch('customize_messages', (value) => {
|
||||||
|
if (value) {
|
||||||
|
$scope.$broadcast('reset-code-mirror', {
|
||||||
|
customize_messages: $scope.customize_messages,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$scope.emailOptionsChange = function () {
|
$scope.emailOptionsChange = function () {
|
||||||
if ($scope.email_options === 'use_ssl') {
|
if ($scope.email_options === 'use_ssl') {
|
||||||
if ($scope.use_ssl) {
|
if ($scope.use_ssl) {
|
||||||
|
|||||||
@@ -598,7 +598,7 @@ export default ['i18n', function(i18n) {
|
|||||||
rows: 2,
|
rows: 2,
|
||||||
},
|
},
|
||||||
start_body: {
|
start_body: {
|
||||||
label: i18n._('Start Body'),
|
label: i18n._('Start Expanded Message'),
|
||||||
class: 'Form-formGroup--fullWidth',
|
class: 'Form-formGroup--fullWidth',
|
||||||
type: 'syntax_highlight',
|
type: 'syntax_highlight',
|
||||||
mode: 'jinja2',
|
mode: 'jinja2',
|
||||||
@@ -615,7 +615,7 @@ export default ['i18n', function(i18n) {
|
|||||||
rows: 2,
|
rows: 2,
|
||||||
},
|
},
|
||||||
success_body: {
|
success_body: {
|
||||||
label: i18n._('Success Body'),
|
label: i18n._('Success Expanded Message'),
|
||||||
class: 'Form-formGroup--fullWidth',
|
class: 'Form-formGroup--fullWidth',
|
||||||
type: 'syntax_highlight',
|
type: 'syntax_highlight',
|
||||||
mode: 'jinja2',
|
mode: 'jinja2',
|
||||||
@@ -632,7 +632,7 @@ export default ['i18n', function(i18n) {
|
|||||||
rows: 2,
|
rows: 2,
|
||||||
},
|
},
|
||||||
error_body: {
|
error_body: {
|
||||||
label: i18n._('Error Body'),
|
label: i18n._('Error Expanded Message'),
|
||||||
class: 'Form-formGroup--fullWidth',
|
class: 'Form-formGroup--fullWidth',
|
||||||
type: 'syntax_highlight',
|
type: 'syntax_highlight',
|
||||||
mode: 'jinja2',
|
mode: 'jinja2',
|
||||||
|
|||||||
Reference in New Issue
Block a user