Unsaved changes dialog internally inconsistent

https://fedorahosted.org/freeipa/ticket/4926

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
Gabe
2015-05-05 06:33:27 -06:00
committed by Petr Vobornik
parent 37784625eb
commit d1a0474d18
8 changed files with 31 additions and 27 deletions

View File

@@ -453,8 +453,8 @@ exp.facet_policies = IPA.facet_policies = function(spec) {
* - sets name, title, label if not present * - sets name, title, label if not present
* - adds default actions and related buttons * - adds default actions and related buttons
* - refresh * - refresh
* - reset * - revert
* - update * - save
* - adds dirty state evaluator * - adds dirty state evaluator
* *
* @member details * @member details
@@ -472,21 +472,21 @@ exp.details_facet_pre_op = function(spec, context) {
spec.actions = spec.actions || []; spec.actions = spec.actions || [];
spec.actions.unshift( spec.actions.unshift(
'refresh', 'refresh',
'reset', 'revert',
'update'); 'save');
spec.control_buttons = spec.control_buttons || []; spec.control_buttons = spec.control_buttons || [];
if (!spec.no_update) { if (!spec.no_update) {
spec.control_buttons.unshift( spec.control_buttons.unshift(
{ {
name: 'reset', name: 'revert',
label: '@i18n:buttons.reset', label: '@i18n:buttons.revert',
icon: 'fa-undo' icon: 'fa-undo'
}, },
{ {
name: 'update', name: 'save',
label: '@i18n:buttons.update', label: '@i18n:buttons.save',
icon: 'fa-upload' icon: 'fa-upload'
}); });
} }
@@ -1404,8 +1404,8 @@ exp.refresh_action = IPA.refresh_action = function(spec) {
exp.reset_action = IPA.reset_action = function(spec) { exp.reset_action = IPA.reset_action = function(spec) {
spec = spec || {}; spec = spec || {};
spec.name = spec.name || 'reset'; spec.name = spec.name || 'revert';
spec.label = spec.label || '@i18n:buttons.reset'; spec.label = spec.label || '@i18n:buttons.revert';
spec.enable_cond = spec.enable_cond || ['dirty']; spec.enable_cond = spec.enable_cond || ['dirty'];
var that = IPA.action(spec); var that = IPA.action(spec);
@@ -1426,8 +1426,8 @@ exp.reset_action = IPA.reset_action = function(spec) {
exp.update_action = IPA.update_action = function(spec) { exp.update_action = IPA.update_action = function(spec) {
spec = spec || {}; spec = spec || {};
spec.name = spec.name || 'update'; spec.name = spec.name || 'save';
spec.label = spec.label || '@i18n:buttons.update'; spec.label = spec.label || '@i18n:buttons.save';
spec.needs_confirm = spec.needs_confirm !== undefined ? spec.needs_confirm : false; spec.needs_confirm = spec.needs_confirm !== undefined ? spec.needs_confirm : false;
spec.enable_cond = spec.enable_cond || ['dirty']; spec.enable_cond = spec.enable_cond || ['dirty'];
@@ -2007,8 +2007,8 @@ exp.register = function() {
var f = reg.facet; var f = reg.facet;
a.register('refresh', exp.refresh_action); a.register('refresh', exp.refresh_action);
a.register('reset', exp.reset_action); a.register('revert', exp.reset_action);
a.register('update', exp.update_action); a.register('save', exp.update_action);
a.register('object', exp.object_action); a.register('object', exp.object_action);
a.register('enable', exp.enable_action); a.register('enable', exp.enable_action);
a.register('disable', exp.disable_action); a.register('disable', exp.disable_action);
@@ -2026,4 +2026,4 @@ exp.register = function() {
phases.on('registration', exp.register); phases.on('registration', exp.register);
return exp; return exp;
}); });

View File

@@ -1961,7 +1961,7 @@ IPA.dns.record_type_table_widget = function(spec) {
dialog.create_button({ dialog.create_button({
name: 'modify', name: 'modify',
label: '@i18n:buttons.update', label: '@i18n:buttons.save',
click: function() { click: function() {
dialog.modify(); dialog.modify();
} }

View File

@@ -754,8 +754,8 @@ IPA.dirty_dialog = function(spec) {
}; };
that.create_button({ that.create_button({
name: 'update', name: 'save',
label: '@i18n:buttons.update', label: '@i18n:buttons.save',
click: function() { click: function() {
that.facet.update(function() { that.facet.update(function() {
that.close(); that.close();
@@ -765,8 +765,8 @@ IPA.dirty_dialog = function(spec) {
}); });
that.create_button({ that.create_button({
name: 'reset', name: 'revert',
label: '@i18n:buttons.reset', label: '@i18n:buttons.revert',
click: function() { click: function() {
that.facet.reset(); that.facet.reset();
that.close(); that.close();

View File

@@ -81,7 +81,9 @@
"reset_password_and_login": "Reset Password and Login", "reset_password_and_login": "Reset Password and Login",
"restore": "Restore", "restore": "Restore",
"retry": "Retry", "retry": "Retry",
"revert": "Revert",
"revoke": "Revoke", "revoke": "Revoke",
"save": "Save",
"set": "Set", "set": "Set",
"unapply": "Un-apply", "unapply": "Un-apply",
"update": "Update", "update": "Update",

View File

@@ -33,4 +33,4 @@ $DIR/build.sh webui
# don't stop at error. Some dependency errors are expected. # don't stop at error. Some dependency errors are expected.
$DIR/compile.sh --release lib --layer freeipa/core --output $IPA_DIR/core.js $DIR/compile.sh --release lib --layer freeipa/core --output $IPA_DIR/core.js
$DIR/compile.sh --release lib --layer freeipa/app --output $IPA_DIR/app.js $DIR/compile.sh --release lib --layer freeipa/app --output $IPA_DIR/app.js
$DIR/clean.sh $DIR/clean.sh

View File

@@ -223,7 +223,9 @@ class i18n_messages(Command):
"reset_password_and_login": _("Reset Password and Login"), "reset_password_and_login": _("Reset Password and Login"),
"restore": _("Restore"), "restore": _("Restore"),
"retry": _("Retry"), "retry": _("Retry"),
"revert": _("Revert"),
"revoke": _("Revoke"), "revoke": _("Revoke"),
"save": _("Save"),
"set": _("Set"), "set": _("Set"),
"unapply": ("Un-apply"), "unapply": ("Un-apply"),
"update": _("Update"), "update": _("Update"),

View File

@@ -39,13 +39,13 @@ class test_realmdomains(UI_driver):
# add # add
self.add_multivalued('associateddomain', 'itest.bar') self.add_multivalued('associateddomain', 'itest.bar')
self.facet_button_click('update') self.facet_button_click('save')
self.dialog_button_click('force') self.dialog_button_click('force')
self.wait_for_request() self.wait_for_request()
# delete # delete
self.del_multivalued('associateddomain', 'itest.bar') self.del_multivalued('associateddomain', 'itest.bar')
self.facet_button_click('update') self.facet_button_click('save')
self.dialog_button_click('force') self.dialog_button_click('force')
self.wait_for_request() self.wait_for_request()
self.wait_for_request() self.wait_for_request()

View File

@@ -1218,7 +1218,7 @@ class UI_driver(object):
new_count = len(self.get_rows()) new_count = len(self.get_rows())
self.assert_row_count(count, new_count) self.assert_row_count(count, new_count)
def mod_record(self, entity, data, facet='details', facet_btn='update'): def mod_record(self, entity, data, facet='details', facet_btn='save'):
""" """
Mod record Mod record
@@ -1243,7 +1243,7 @@ class UI_driver(object):
add_facet_btn='add', add_facet_btn='add',
add_dialog_btn='add', add_dialog_btn='add',
add_dialog_name='add', add_dialog_name='add',
update_btn='update', update_btn='save',
breadcrumb=None, breadcrumb=None,
navigate=True, navigate=True,
delete=True): delete=True):
@@ -1461,7 +1461,7 @@ class UI_driver(object):
# update # update
self.assert_rule_tables_enabled(t_list, False) self.assert_rule_tables_enabled(t_list, False)
self.facet_button_click('update') self.facet_button_click('save')
self.wait_for_request(n=3, d=0.3) self.wait_for_request(n=3, d=0.3)
self.assert_rule_tables_enabled(t_list, False) self.assert_rule_tables_enabled(t_list, False)
@@ -1480,7 +1480,7 @@ class UI_driver(object):
for cat in categories: for cat in categories:
self.check_option(cat, '') self.check_option(cat, '')
self.assert_rule_tables_enabled(t_list, True) self.assert_rule_tables_enabled(t_list, True)
self.facet_button_click('update') self.facet_button_click('save')
self.wait_for_request(n=3, d=0.3) self.wait_for_request(n=3, d=0.3)
self.assert_rule_tables_enabled(t_list, True) self.assert_rule_tables_enabled(t_list, True)