Fix "Configured size limit exceeded" warning on Web UI

Suppress size limit warning in 'refresh' command.

Ticket: https://pagure.io/freeipa/issue/7603
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Serhii Tsymbaliuk 2019-01-09 15:43:33 +01:00
parent 5ee687408b
commit ef7a903761
No known key found for this signature in database
GPG Key ID: 632C7F5C1BC85519
4 changed files with 38 additions and 2 deletions

View File

@ -1105,5 +1105,14 @@ rpc.extract_objects = function(values) {
return values;
};
/**
* Server side error/warning codes
*
* Add new errors from ipalib.messages only if necessary.
*/
rpc.errors = {
search_result_truncated: 13017
};
return rpc;
});

View File

@ -291,7 +291,8 @@ IPA.search_facet = function(spec, no_init) {
name: that.get_search_command_name(),
entity: that.managed_entity.name,
method: 'find',
args: args
args: args,
suppress_warnings: [rpc.errors.search_result_truncated]
});
command.set_options(that.get_refresh_command_options());

View File

@ -5021,7 +5021,7 @@ IPA.entity_select_widget = function(spec) {
method: 'find',
args: [filter],
options: that.filter_options,
suppress_warnings: [13017]
suppress_warnings: [rpc.errors.search_result_truncated]
});
var no_members = metadata.get('@mc-opt:' + cmd.get_command() + ':no_members');
if (no_members) {

View File

@ -164,6 +164,32 @@ class test_config(UI_driver):
self.fill_input(size_limit_s, def_val)
self.facet_button_click('save')
@screenshot
def test_size_limit_notification(self):
"""
Test if no notification is shown when size limit exceeded
"""
self.init_app()
self.navigate_to_entity(config_data.ENTITY)
size_limit_s = 'ipasearchrecordslimit'
def_val = self.get_field_value(size_limit_s)
self.fill_input(size_limit_s, '10')
self.facet_button_click('save')
self.navigate_to_entity('cert')
# wait for a half sec for notification to appear
self.wait(0.5)
warning = self.find_by_selector('div.notification-area .alert-warning')
try:
assert not warning, "Warning present: {}".format(warning.text)
finally:
# restore previous value
self.navigate_to_entity(config_data.ENTITY)
self.fill_input(size_limit_s, def_val)
self.facet_button_click('save')
@screenshot
def test_time_limits(self):
"""