Merge pull request #1973 from kensible/1940-formButtons

Confirm/proceed action on right, cancel on left
This commit is contained in:
kensible
2016-05-19 09:21:35 -04:00
20 changed files with 98 additions and 93 deletions

View File

@@ -429,6 +429,10 @@ input[type='radio']:checked:before {
height: 30px; height: 30px;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
button:last-of-type {
margin-left: 20px;
}
} }
.Form-button{ .Form-button{
@@ -443,7 +447,6 @@ input[type='radio']:checked:before {
.Form-saveButton{ .Form-saveButton{
background-color: @submit-button-bg; background-color: @submit-button-bg;
margin-right: 20px;
color: @submit-button-text; color: @submit-button-text;
text-transform: uppercase; text-transform: uppercase;
transition: background-color 0.2s; transition: background-color 0.2s;

View File

@@ -124,18 +124,18 @@ export default function() {
}, },
buttons: { buttons: {
launch: {
label: 'Save',
ngClick: 'launchJob()',
ngDisabled: true,
'class': 'Form-buttonDefault Form-button'
},
reset: { reset: {
ngClick: 'formReset()', ngClick: 'formReset()',
ngDisabled: true, ngDisabled: true,
label: 'Reset', label: 'Reset',
'class': 'Form-buttonDefault Form-button' 'class': 'Form-buttonDefault Form-button'
} },
launch: {
label: 'Save',
ngClick: 'launchJob()',
ngDisabled: true,
'class': 'Form-buttonDefault Form-button'
}
}, },
related: {} related: {}

View File

@@ -65,13 +65,13 @@ export default function(){
} }
}, },
buttons: { buttons: {
cancel: {
ngClick: 'formCancel()'
},
save: { save: {
ngClick: 'formSave()', //$scope.function to call on click, optional ngClick: 'formSave()', //$scope.function to call on click, optional
ngDisabled: "host_form.$invalid"//true //Disable when $pristine or $invalid, optional and when can_edit = false, for permission reasons ngDisabled: "host_form.$invalid"//true //Disable when $pristine or $invalid, optional and when can_edit = false, for permission reasons
}, }
cancel: {
ngClick: 'formCancel()'
}
} }
}; };
} }

View File

@@ -406,13 +406,13 @@ export default
}, },
buttons: { buttons: {
cancel: {
ngClick: 'formCancel()',
},
save: { save: {
label: 'Save', label: 'Save',
ngClick: 'formSave()', //$scope.function to call on click, optional ngClick: 'formSave()', //$scope.function to call on click, optional
ngDisabled: true //Disable when $pristine or $invalid, optional ngDisabled: true //Disable when $pristine or $invalid, optional
},
cancel: {
ngClick: 'formCancel()',
} }
}, },

View File

@@ -295,12 +295,12 @@ export default
}, },
buttons: { buttons: {
save: {
ngClick: 'saveGroup()'
},
cancel: { cancel: {
ngClick: 'formCancel()' ngClick: 'formCancel()'
} },
save: {
ngClick: 'saveGroup()'
}
}, },
related: { related: {

View File

@@ -3,7 +3,7 @@
* *
* All Rights Reserved * All Rights Reserved
*************************************************/ *************************************************/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:HostGroups * @name forms.function:HostGroups
@@ -41,13 +41,13 @@ export default
}, },
buttons: { //for now always generates <button> tags buttons: { //for now always generates <button> tags
save: {
ngClick: 'formSave()',
ngDisabled: true
},
reset: { reset: {
ngClick: 'formReset()', ngClick: 'formReset()',
ngDisabled: true ngDisabled: true
},
save: {
ngClick: 'formSave()',
ngDisabled: true
} }
}, },

View File

@@ -81,13 +81,13 @@ export default
}, },
buttons: { buttons: {
save: {
ngClick: 'formSave()',
ngDisabled: true
},
cancel: { cancel: {
ngClick: 'formCancel()', ngClick: 'formCancel()',
ngDisabled: true ngDisabled: true
},
save: {
ngClick: 'formSave()',
ngDisabled: true
} }
}, },

View File

@@ -68,12 +68,12 @@ export default
}, },
buttons: { buttons: {
cancel: {
ngClick: 'formCancel()'
},
save: { save: {
ngClick: 'formSave()', ngClick: 'formSave()',
ngDisabled: true ngDisabled: true
},
cancel: {
ngClick: 'formCancel()'
} }
}, },

View File

@@ -320,12 +320,12 @@ export default
}, },
buttons: { //for now always generates <button> tags buttons: { //for now always generates <button> tags
cancel: {
ngClick: 'formCancel()'
},
save: { save: {
ngClick: 'formSave()', //$scope.function to call on click, optional ngClick: 'formSave()', //$scope.function to call on click, optional
ngDisabled: "job_templates_form.$invalid || can_edit!==true"//true //Disable when $pristine or $invalid, optional and when can_edit = false, for permission reasons ngDisabled: "job_templates_form.$invalid || can_edit!==true"//true //Disable when $pristine or $invalid, optional and when can_edit = false, for permission reasons
},
cancel: {
ngClick: 'formCancel()'
} }
}, },

View File

@@ -36,13 +36,13 @@ export default
}, },
buttons: { //for now always generates <button> tags buttons: { //for now always generates <button> tags
cancel: {
ngClick: 'formCancel()'
},
save: { save: {
ngClick: 'formSave()', //$scope.function to call on click, optional ngClick: 'formSave()', //$scope.function to call on click, optional
ngDisabled: true //Disable when $pristine or $invalid, optional ngDisabled: true //Disable when $pristine or $invalid, optional
}, }
cancel: {
ngClick: 'formCancel()'
}
}, },
related: { related: {

View File

@@ -221,12 +221,12 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
}, },
buttons: { buttons: {
cancel: {
ngClick: 'formCancel()'
},
save: { save: {
ngClick: 'formSave()', ngClick: 'formSave()',
ngDisabled: true ngDisabled: true
},
cancel: {
ngClick: 'formCancel()'
} }
}, },

View File

@@ -49,13 +49,13 @@ export default
}, },
buttons: { buttons: {
cancel: {
ngClick: 'formCancel()'
},
save: { save: {
ngClick: 'formSave()', ngClick: 'formSave()',
ngDisabled: true ngDisabled: true
}, }
cancel: {
ngClick: 'formCancel()'
}
}, },
related: { related: {

View File

@@ -105,12 +105,12 @@ export default
}, },
buttons: { buttons: {
cancel: {
ngClick: 'formCancel()'
},
save: { save: {
ngClick: 'formSave()', ngClick: 'formSave()',
ngDisabled: true ngDisabled: true
},
cancel: {
ngClick: 'formCancel()'
} }
}, },

View File

@@ -822,11 +822,11 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', listGenerator.name
// Create the modal // Create the modal
$('#group-modal-dialog').dialog({ $('#group-modal-dialog').dialog({
buttons: { buttons: {
'Cancel': function() {
modal_scope.cancelModal();
},
'Save': function () { 'Save': function () {
modal_scope.saveGroup(); modal_scope.saveGroup();
},
'Cancel': function() {
modal_scope.cancelModal();
} }
}, },
modal: true, modal: true,

View File

@@ -62,12 +62,12 @@ export default function() {
}, },
buttons: { //for now always generates <button> tags buttons: { //for now always generates <button> tags
cancel: {
ngClick: 'formCancel()',
},
save: { save: {
ngClick: 'formSave()', //$scope.function to call on click, optional ngClick: 'formSave()', //$scope.function to call on click, optional
ngDisabled: true //Disable when $pristine or $invalid, optional ngDisabled: true //Disable when $pristine or $invalid, optional
},
cancel: {
ngClick: 'formCancel()',
} }
} }
}; };

View File

@@ -304,17 +304,17 @@ export default
} }
}, },
buttons: { buttons: {
submit_question: {
ngClick: 'submitQuestion($event)',
ngDisabled: true,
'class': 'btn btn-sm Form-saveButton',
label: '{{editQuestionIndex === null ? "ADD" : "UPDATE"}}'
},
question_cancel : { question_cancel : {
label: 'Cancel', label: 'Cancel',
'class' : 'btn btn-default Form-cancelButton', 'class' : 'btn btn-default Form-cancelButton',
ngClick: 'generateAddQuestionForm()', ngClick: 'generateAddQuestionForm()',
ngDisabled: 'survey_question_form.$pristine' ngDisabled: 'survey_question_form.$pristine'
},
submit_question: {
ngClick: 'submitQuestion($event)',
ngDisabled: true,
'class': 'btn btn-sm Form-saveButton',
label: '{{editQuestionIndex === null ? "ADD" : "UPDATE"}}'
} }
} }

View File

@@ -145,6 +145,13 @@ export default ['Rest', 'ProcessErrors', 'generateList',
// Show pop-up // Show pop-up
buttons = [{ buttons = [{
label: "Cancel",
"class": "btn btn-default",
"id": "lookup-cancel-button",
onClick: function() {
$('#LookupModal-dialog').dialog('close');
}
}, {
label: "Save", label: "Save",
onClick: function() { onClick: function() {
scope.selectAction(); scope.selectAction();
@@ -152,13 +159,6 @@ export default ['Rest', 'ProcessErrors', 'generateList',
//icon: "fa-check", //icon: "fa-check",
"class": "btn btn-primary", "class": "btn btn-primary",
"id": "lookup-save-button" "id": "lookup-save-button"
}, {
label: "Cancel",
"class": "btn btn-default",
"id": "lookup-cancel-button",
onClick: function() {
$('#LookupModal-dialog').dialog('close');
}
}]; }];
if (scope.removeModalReady) { if (scope.removeModalReady) {

View File

@@ -109,6 +109,14 @@ export default
fieldScope.granularity_keep_amount = 1; fieldScope.granularity_keep_amount = 1;
}, },
buttons: [ buttons: [
{
"label": "Cancel",
"onClick": function() {
$(this).dialog('close');
},
"class": "btn btn-default",
"id": "prompt-for-days-facts-cancel"
},
{ {
"label": "Launch", "label": "Launch",
"onClick": function() { "onClick": function() {
@@ -134,15 +142,8 @@ export default
}, },
"class": "btn btn-primary", "class": "btn btn-primary",
"id": "prompt-for-days-facts-launch", "id": "prompt-for-days-facts-launch",
}, }
{ ]
"label": "Cancel",
"onClick": function() {
$(this).dialog('close');
},
"class": "btn btn-default",
"id": "prompt-for-days-facts-cancel"
}]
}); });
if (scope.removePromptForDays) { if (scope.removePromptForDays) {
@@ -198,6 +199,15 @@ export default
scope.prompt_for_days_form.$invalid = false; scope.prompt_for_days_form.$invalid = false;
}, },
buttons: [ buttons: [
{
"label": "Cancel",
"onClick": function() {
$(this).dialog('close');
},
"class": "btn btn-default",
"id": "prompt-for-days-cancel"
},
{ {
"label": "Launch", "label": "Launch",
"onClick": function() { "onClick": function() {
@@ -220,16 +230,8 @@ export default
}, },
"class": "btn btn-primary", "class": "btn btn-primary",
"id": "prompt-for-days-launch" "id": "prompt-for-days-launch"
}, }
{ ]
"label": "Cancel",
"onClick": function() {
$(this).dialog('close');
},
"class": "btn btn-default",
"id": "prompt-for-days-cancel"
}]
}); });
if (scope.removePromptForDays) { if (scope.removePromptForDays) {

View File

@@ -344,12 +344,12 @@ export default function() {
}, },
buttons: { //for now always generates <button> tags buttons: { //for now always generates <button> tags
cancel: {
ngClick: 'formCancel()',
},
save: { save: {
ngClick: 'formSave()', //$scope.function to call on click, optional ngClick: 'formSave()', //$scope.function to call on click, optional
ngDisabled: true //Disable when $pristine or $invalid, optional ngDisabled: true //Disable when $pristine or $invalid, optional
},
cancel: {
ngClick: 'formCancel()',
} }
} }
}; };

View File

@@ -131,13 +131,13 @@ export default function() {
}, },
buttons: { buttons: {
save: {
ngClick: 'formSave()',
ngDisabled: true
},
reset: { reset: {
ngClick: 'formReset()', ngClick: 'formReset()',
ngDisabled: true ngDisabled: true
},
save: {
ngClick: 'formSave()',
ngDisabled: true
} }
}, },