mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-09 23:15:58 -06:00
Fixed jasmine test cases and added some missing messages for disabled menus.
This commit is contained in:
parent
65d9f88c63
commit
9e90350e44
@ -49,21 +49,21 @@ define('pgadmin.node.package', [
|
||||
applies: ['object', 'context'], callback: 'show_obj_properties',
|
||||
category: 'create', priority: 4, label: gettext('Package...'),
|
||||
icon: 'wcTabIcon icon-package', data: {action: 'create', check: true,
|
||||
'data_disabled': gettext('This option is only available on EPAS servers.')},
|
||||
data_disabled: gettext('This option is only available on EPAS servers.')},
|
||||
enable: 'canCreate',
|
||||
},{
|
||||
name: 'create_package', node: 'package', module: this,
|
||||
applies: ['object', 'context'], callback: 'show_obj_properties',
|
||||
category: 'create', priority: 4, label: gettext('Package...'),
|
||||
icon: 'wcTabIcon icon-package', data: {action: 'create', check: true,
|
||||
'data_disabled': gettext('This option is only available on EPAS servers.')},
|
||||
data_disabled: gettext('This option is only available on EPAS servers.')},
|
||||
enable: 'canCreate',
|
||||
},{
|
||||
name: 'create_package', node: 'schema', module: this,
|
||||
applies: ['object', 'context'], callback: 'show_obj_properties',
|
||||
category: 'create', priority: 4, label: gettext('Package...'),
|
||||
icon: 'wcTabIcon icon-package', data: {action: 'create', check: true,
|
||||
'data_disabled': gettext('This option is only available on EPAS servers.')},
|
||||
data_disabled: gettext('This option is only available on EPAS servers.')},
|
||||
enable: 'canCreate',
|
||||
},
|
||||
]);
|
||||
|
@ -48,21 +48,21 @@ define('pgadmin.node.synonym', [
|
||||
applies: ['object', 'context'], callback: 'show_obj_properties',
|
||||
category: 'create', priority: 4, label: gettext('Synonym...'),
|
||||
icon: 'wcTabIcon icon-synonym', data: {action: 'create', check: true,
|
||||
'data_disabled': gettext('This option is only available on EPAS servers.')},
|
||||
data_disabled: gettext('This option is only available on EPAS servers.')},
|
||||
enable: 'canCreate',
|
||||
},{
|
||||
name: 'create_synonym', node: 'synonym', module: this,
|
||||
applies: ['object', 'context'], callback: 'show_obj_properties',
|
||||
category: 'create', priority: 4, label: gettext('Synonym...'),
|
||||
icon: 'wcTabIcon icon-synonym', data: {action: 'create', check: true,
|
||||
'data_disabled': gettext('This option is only available on EPAS servers.')},
|
||||
data_disabled: gettext('This option is only available on EPAS servers.')},
|
||||
enable: 'canCreate',
|
||||
},{
|
||||
name: 'create_synonym', node: 'schema', module: this,
|
||||
applies: ['object', 'context'], callback: 'show_obj_properties',
|
||||
category: 'create', priority: 4, label: gettext('Synonym...'),
|
||||
icon: 'wcTabIcon icon-synonym', data: {action: 'create', check: true,
|
||||
'data_disabled': gettext('This option is only available on EPAS servers.')},
|
||||
data_disabled: gettext('This option is only available on EPAS servers.')},
|
||||
enable: 'canCreate',
|
||||
},
|
||||
]);
|
||||
|
@ -55,28 +55,28 @@ define('pgadmin.node.compound_trigger', [
|
||||
applies: ['object', 'context'], callback: 'show_obj_properties',
|
||||
category: 'create', priority: 4, label: gettext('Compound Trigger...'),
|
||||
icon: 'wcTabIcon icon-compound_trigger', data: {action: 'create', check: true,
|
||||
'data_disabled': gettext('This option is only available on EPAS servers.')},
|
||||
data_disabled: gettext('This option is only available on EPAS servers.')},
|
||||
enable: 'canCreate',
|
||||
},{
|
||||
name: 'create_compound_trigger', node: 'compound_trigger', module: this,
|
||||
applies: ['object', 'context'], callback: 'show_obj_properties',
|
||||
category: 'create', priority: 4, label: gettext('Compound Trigger...'),
|
||||
icon: 'wcTabIcon icon-compound_trigger', data: {action: 'create', check: true,
|
||||
'data_disabled': gettext('This option is only available on EPAS servers.')},
|
||||
data_disabled: gettext('This option is only available on EPAS servers.')},
|
||||
enable: 'canCreate',
|
||||
},{
|
||||
name: 'create_compound_trigger_onTable', node: 'table', module: this,
|
||||
applies: ['object', 'context'], callback: 'show_obj_properties',
|
||||
category: 'create', priority: 4, label: gettext('Compound Trigger...'),
|
||||
icon: 'wcTabIcon icon-compound_trigger', data: {action: 'create', check: true,
|
||||
'data_disabled': gettext('This option is only available on EPAS servers.')},
|
||||
data_disabled: gettext('This option is only available on EPAS servers.')},
|
||||
enable: 'canCreate',
|
||||
},{
|
||||
name: 'create_compound_trigger_onPartition', node: 'partition', module: this,
|
||||
applies: ['object', 'context'], callback: 'show_obj_properties',
|
||||
category: 'create', priority: 4, label: gettext('Compound Trigger...'),
|
||||
icon: 'wcTabIcon icon-compound_trigger', data: {action: 'create', check: true,
|
||||
'data_disabled': gettext('This option is only available on EPAS servers.')},
|
||||
data_disabled: gettext('This option is only available on EPAS servers.')},
|
||||
enable: 'canCreate',
|
||||
},{
|
||||
name: 'enable_compound_trigger', node: 'compound_trigger', module: this,
|
||||
@ -93,7 +93,7 @@ define('pgadmin.node.compound_trigger', [
|
||||
applies: ['object', 'context'], callback: 'show_obj_properties',
|
||||
category: 'create', priority: 4, label: gettext('Compound Trigger...'),
|
||||
icon: 'wcTabIcon icon-compound_trigger', data: {action: 'create', check: true,
|
||||
'data_disabled': gettext('This option is only available on EPAS servers.')},
|
||||
data_disabled: gettext('This option is only available on EPAS servers.')},
|
||||
enable: 'canCreate',
|
||||
},
|
||||
]);
|
||||
|
@ -73,11 +73,17 @@ function(
|
||||
applies: ['object', 'context'], callback: 'enable_triggers_on_table',
|
||||
category: gettext('Trigger(s)'), priority: 4, label: gettext('Enable All'),
|
||||
icon: 'fa fa-check', enable : 'canCreate_with_trigger_enable',
|
||||
data: {
|
||||
data_disabled: gettext('The selected tree node does not support this option.'),
|
||||
},
|
||||
},{
|
||||
name: 'disable_all_triggers', node: 'partition', module: this,
|
||||
applies: ['object', 'context'], callback: 'disable_triggers_on_table',
|
||||
category: gettext('Trigger(s)'), priority: 4, label: gettext('Disable All'),
|
||||
icon: 'fa fa-times', enable : 'canCreate_with_trigger_disable',
|
||||
data: {
|
||||
data_disabled: gettext('The selected tree node does not support this option.'),
|
||||
},
|
||||
},{
|
||||
name: 'reset_table_stats', node: 'partition', module: this,
|
||||
applies: ['object', 'context'], callback: 'reset_table_stats',
|
||||
|
@ -95,11 +95,17 @@ define('pgadmin.node.table', [
|
||||
applies: ['object', 'context'], callback: 'enable_triggers_on_table',
|
||||
category: gettext('Trigger(s)'), priority: 4, label: gettext('Enable All'),
|
||||
icon: 'fa fa-check', enable : 'canCreate_with_trigger_enable',
|
||||
data: {
|
||||
data_disabled: gettext('The selected tree node does not support this option.'),
|
||||
},
|
||||
},{
|
||||
name: 'disable_all_triggers', node: 'table', module: this,
|
||||
applies: ['object', 'context'], callback: 'disable_triggers_on_table',
|
||||
category: gettext('Trigger(s)'), priority: 4, label: gettext('Disable All'),
|
||||
icon: 'fa fa-times', enable : 'canCreate_with_trigger_disable',
|
||||
data: {
|
||||
data_disabled: gettext('The selected tree node does not support this option.'),
|
||||
},
|
||||
},{
|
||||
name: 'reset_table_stats', node: 'table', module: this,
|
||||
applies: ['object', 'context'], callback: 'reset_table_stats',
|
||||
|
@ -77,14 +77,14 @@ define('pgadmin.node.database', [
|
||||
applies: ['object', 'context'], callback: 'connect_database',
|
||||
category: 'connect', priority: 4, label: gettext('Connect Database...'),
|
||||
icon: 'fa fa-link', enable : 'is_not_connected', data: {
|
||||
'data_disabled': gettext('Selected database is already connected.'),
|
||||
data_disabled: gettext('Selected database is already connected.'),
|
||||
},
|
||||
},{
|
||||
name: 'disconnect_database', node: 'database', module: this,
|
||||
applies: ['object', 'context'], callback: 'disconnect_database',
|
||||
category: 'drop', priority: 5, label: gettext('Disconnect Database...'),
|
||||
icon: 'fa fa-unlink', enable : 'is_connected',data: {
|
||||
'data_disabled': gettext('Selected database is already disconnected.'),
|
||||
data_disabled: gettext('Selected database is already disconnected.'),
|
||||
},
|
||||
},{
|
||||
name: 'generate_erd', node: 'database', module: this,
|
||||
|
@ -49,7 +49,7 @@ define('pgadmin.node.resource_group', [
|
||||
applies: ['object', 'context'], callback: 'show_obj_properties',
|
||||
category: 'create', priority: 4, label: gettext('Resource Group...'),
|
||||
icon: 'wcTabIcon icon-resource_group', data: {action: 'create',
|
||||
'data_disabled': gettext('This option is only available on EPAS servers.')},
|
||||
data_disabled: gettext('This option is only available on EPAS servers.')},
|
||||
/* Function is used to check the server type and version.
|
||||
* Resource Group only supported in PPAS 9.4 and above.
|
||||
*/
|
||||
@ -64,13 +64,13 @@ define('pgadmin.node.resource_group', [
|
||||
applies: ['object', 'context'], callback: 'show_obj_properties',
|
||||
category: 'create', priority: 4, label: gettext('Resource Group...'),
|
||||
icon: 'wcTabIcon icon-resource_group', data: {action: 'create',
|
||||
'data_disabled': gettext('This option is only available on EPAS servers.')},
|
||||
data_disabled: gettext('This option is only available on EPAS servers.')},
|
||||
},{
|
||||
name: 'create_resource_group', node: 'resource_group', module: this,
|
||||
applies: ['object', 'context'], callback: 'show_obj_properties',
|
||||
category: 'create', priority: 4, label: gettext('Resource Group...'),
|
||||
icon: 'wcTabIcon icon-resource_group', data: {action: 'create',
|
||||
'data_disabled': gettext('This option is only available on EPAS servers.')},
|
||||
data_disabled: gettext('This option is only available on EPAS servers.')},
|
||||
},
|
||||
]);
|
||||
},
|
||||
|
@ -90,44 +90,50 @@ define('pgadmin.node.server', [
|
||||
name: 'connect_server', node: 'server', module: this,
|
||||
applies: ['object', 'context'], callback: 'connect_server',
|
||||
category: 'connect', priority: 4, label: gettext('Connect Server'),
|
||||
icon: 'fa fa-link', enable : 'is_not_connected',
|
||||
icon: 'fa fa-link', enable : 'is_not_connected',data: {
|
||||
data_disabled: gettext('Database is already connected.'),
|
||||
},
|
||||
},{
|
||||
name: 'disconnect_server', node: 'server', module: this,
|
||||
applies: ['object', 'context'], callback: 'disconnect_server',
|
||||
category: 'drop', priority: 5, label: gettext('Disconnect Server'),
|
||||
icon: 'fa fa-unlink', enable : 'is_connected',
|
||||
icon: 'fa fa-unlink', enable : 'is_connected',data: {
|
||||
data_disabled: gettext('Database is already disconnected.'),
|
||||
},
|
||||
},{
|
||||
name: 'reload_configuration', node: 'server', module: this,
|
||||
applies: ['tools', 'context'], callback: 'reload_configuration',
|
||||
category: 'reload', priority: 6, label: gettext('Reload Configuration'),
|
||||
icon: 'fa fa-redo-alt', enable : 'enable_reload_config',data: {
|
||||
'data_disabled': gettext('Please select a server from the browser tree to reload the configuration files.'),
|
||||
data_disabled: gettext('Please select a server from the browser tree to reload the configuration files.'),
|
||||
},
|
||||
},{
|
||||
name: 'restore_point', node: 'server', module: this,
|
||||
applies: ['tools', 'context'], callback: 'restore_point',
|
||||
category: 'restore', priority: 9, label: gettext('Add Named Restore Point...'),
|
||||
icon: 'fa fa-anchor', enable : 'is_applicable',data: {
|
||||
'data_disabled': gettext('Please select any server from the browser tree to Add Named Restore Point.'),
|
||||
data_disabled: gettext('Please select any server from the browser tree to Add Named Restore Point.'),
|
||||
},
|
||||
},{
|
||||
name: 'change_password', node: 'server', module: this,
|
||||
applies: ['object'], callback: 'change_password',
|
||||
label: gettext('Change Password...'), priority: 10,
|
||||
icon: 'fa fa-lock', enable : 'is_connected',
|
||||
icon: 'fa fa-lock', enable : 'is_connected',data: {
|
||||
data_disabled: gettext('Please connect server to enable change password. '),
|
||||
},
|
||||
},{
|
||||
name: 'wal_replay_pause', node: 'server', module: this,
|
||||
applies: ['tools', 'context'], callback: 'pause_wal_replay',
|
||||
category: 'wal_replay_pause', priority: 7, label: gettext('Pause Replay of WAL'),
|
||||
icon: 'fa fa-pause-circle', enable : 'wal_pause_enabled',data: {
|
||||
'data_disabled': gettext('Please select a connected database as a Super user and run in Recovery mode to Pause Replay of WAL.'),
|
||||
data_disabled: gettext('Please select a connected database as a Super user and run in Recovery mode to Pause Replay of WAL.'),
|
||||
},
|
||||
},{
|
||||
name: 'wal_replay_resume', node: 'server', module: this,
|
||||
applies: ['tools', 'context'], callback: 'resume_wal_replay',
|
||||
category: 'wal_replay_resume', priority: 8, label: gettext('Resume Replay of WAL'),
|
||||
icon: 'fa fa-play-circle', enable : 'wal_resume_enabled',data: {
|
||||
'data_disabled': gettext('Please select a connected database as a Super user and run in Recovery mode to Resume Replay of WAL.'),
|
||||
data_disabled: gettext('Please select a connected database as a Super user and run in Recovery mode to Resume Replay of WAL.'),
|
||||
},
|
||||
},{
|
||||
name: 'clear_saved_password', node: 'server', module: this,
|
||||
@ -154,7 +160,7 @@ define('pgadmin.node.server', [
|
||||
return false;
|
||||
},
|
||||
data: {
|
||||
'data_disabled': gettext('SSH Tunnel password is not saved for selected server.'),
|
||||
data_disabled: gettext('SSH Tunnel password is not saved for selected server.'),
|
||||
},
|
||||
}]);
|
||||
|
||||
|
@ -150,7 +150,7 @@ define('pgadmin.browser.node', [
|
||||
label: (self.dropAsRemove) ? gettext('Remove %s', self.label) : gettext('Delete/Drop'),
|
||||
data: {
|
||||
'url': 'drop',
|
||||
'data_disabled': gettext('The selected tree node does not support this option.'),
|
||||
data_disabled: gettext('The selected tree node does not support this option.'),
|
||||
},
|
||||
icon: 'fa fa-trash-alt',
|
||||
enable: _.isFunction(self.canDrop) ?
|
||||
@ -233,7 +233,7 @@ define('pgadmin.browser.node', [
|
||||
category: gettext('Scripts'),
|
||||
data: {
|
||||
'script': stype,
|
||||
'data_disabled': gettext('The selected tree node does not support this option.'),
|
||||
data_disabled: gettext('The selected tree node does not support this option.'),
|
||||
},
|
||||
icon: 'fa fa-pencil-alt',
|
||||
enable: self.check_user_permission,
|
||||
|
@ -167,6 +167,9 @@ export function Search() {
|
||||
function handleClickOutside(event) {
|
||||
if (ref.current && !ref.current.contains(event.target)) {
|
||||
let input_element = document.getElementById('live-search-field');
|
||||
if(input_element == null){
|
||||
return;
|
||||
}
|
||||
let input_value = input_element.value;
|
||||
if(input_value && input_value.length > 0){
|
||||
toggleDropdownMenu();
|
||||
|
@ -583,7 +583,7 @@ define([
|
||||
icon: 'fa fa-save',
|
||||
enable: menuUtils.menuEnabledServer,
|
||||
data: {
|
||||
'data_disabled': gettext('Please select any server from the browser tree to take Backup of global objects.'),
|
||||
data_disabled: gettext('Please select any server from the browser tree to take Backup of global objects.'),
|
||||
},
|
||||
}, {
|
||||
name: 'backup_server',
|
||||
@ -595,7 +595,7 @@ define([
|
||||
icon: 'fa fa-save',
|
||||
enable: menuUtils.menuEnabledServer,
|
||||
data: {
|
||||
'data_disabled': gettext('Please select any server from the browser tree to take Server Backup.'),
|
||||
data_disabled: gettext('Please select any server from the browser tree to take Server Backup.'),
|
||||
},
|
||||
}, {
|
||||
name: 'backup_global_ctx',
|
||||
@ -608,7 +608,7 @@ define([
|
||||
icon: 'fa fa-save',
|
||||
enable: menuUtils.menuEnabledServer,
|
||||
data: {
|
||||
'data_disabled': gettext('Please select any database or schema or table from the browser tree to take Backup.'),
|
||||
data_disabled: gettext('Please select any database or schema or table from the browser tree to take Backup.'),
|
||||
},
|
||||
}, {
|
||||
name: 'backup_server_ctx',
|
||||
@ -621,7 +621,7 @@ define([
|
||||
icon: 'fa fa-save',
|
||||
enable: menuUtils.menuEnabledServer,
|
||||
data: {
|
||||
'data_disabled': gettext('Please select any server from the browser tree to take Server Backup.'),
|
||||
data_disabled: gettext('Please select any server from the browser tree to take Server Backup.'),
|
||||
},
|
||||
}, {
|
||||
name: 'backup_object',
|
||||
@ -635,7 +635,7 @@ define([
|
||||
null, pgBrowser.treeMenu, menuUtils.backupSupportedNodes
|
||||
),
|
||||
data: {
|
||||
'data_disabled': gettext('Please select any database or schema or table from the browser tree to take Backup.'),
|
||||
data_disabled: gettext('Please select any database or schema or table from the browser tree to take Backup.'),
|
||||
},
|
||||
}];
|
||||
|
||||
|
@ -114,7 +114,7 @@ define('pgadmin.datagrid', [
|
||||
label: gettext('Query Tool'),
|
||||
icon: 'pg-font-icon icon-query-tool',
|
||||
data:{
|
||||
'data_disabled': gettext('Please select a database from the browser tree to access Query Tool.'),
|
||||
data_disabled: gettext('Please select a database from the browser tree to access Query Tool.'),
|
||||
},
|
||||
}];
|
||||
|
||||
|
@ -40,6 +40,9 @@ export function initialize(gettext, url_for, $, _, pgAdmin, csrfToken, pgBrowser
|
||||
priority: 1,
|
||||
label: gettext('New ERD Project (Beta)'),
|
||||
enable: this.erdToolEnabled,
|
||||
data: {
|
||||
data_disabled: gettext('The selected tree node does not support this option.'),
|
||||
},
|
||||
}];
|
||||
|
||||
pgBrowser.add_menus(menus);
|
||||
|
@ -178,7 +178,7 @@ define([
|
||||
null, pgBrowser.treeMenu, menuUtils.supportedNodes
|
||||
),
|
||||
data: {
|
||||
'data_disabled': gettext('Please select any database, schema or schema objects from the browser tree to access Grant Wizard Tool.'),
|
||||
data_disabled: gettext('Please select any database, schema or schema objects from the browser tree to access Grant Wizard Tool.'),
|
||||
},
|
||||
}];
|
||||
|
||||
|
@ -413,7 +413,7 @@ define([
|
||||
null, pgBrowser.treeMenu, ['table']
|
||||
),
|
||||
data: {
|
||||
'data_disabled': gettext('Please select any table from the browser tree to Import/Export data.'),
|
||||
data_disabled: gettext('Please select any table from the browser tree to Import/Export data.'),
|
||||
},
|
||||
}]);
|
||||
},
|
||||
|
@ -168,6 +168,9 @@ define([
|
||||
enable: supportedNodes.enabled.bind(
|
||||
null, pgBrowser.treeMenu, menuUtils.maintenanceSupportedNodes
|
||||
),
|
||||
data: {
|
||||
data_disabled: gettext('Please select any database from the browser tree to do Maintenance.'),
|
||||
},
|
||||
}];
|
||||
|
||||
// Add supported menus into the menus list
|
||||
@ -185,7 +188,7 @@ define([
|
||||
null, pgBrowser.treeMenu, menuUtils.maintenanceSupportedNodes
|
||||
),
|
||||
data: {
|
||||
'data_disabled': gettext('Please select any database from the browser tree to do Maintenance.'),
|
||||
data_disabled: gettext('Please select any database from the browser tree to do Maintenance.'),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
@ -399,7 +399,7 @@ define('tools.restore', [
|
||||
null, pgBrowser.treeMenu, menuUtils.restoreSupportedNodes
|
||||
),
|
||||
data: {
|
||||
'data_disabled': gettext('Please select any schema or table from the browser tree to Restore data.'),
|
||||
data_disabled: gettext('Please select any schema or table from the browser tree to Restore data.'),
|
||||
},
|
||||
}];
|
||||
|
||||
|
@ -37,7 +37,7 @@ define([
|
||||
priority: 1,
|
||||
label: gettext('Search Objects...'),
|
||||
data: {
|
||||
'data_disabled': gettext('Please select a database from the browser tree to search the database objects.'),
|
||||
data_disabled: gettext('Please select a database from the browser tree to search the database objects.'),
|
||||
},
|
||||
}, {
|
||||
name: 'search_objects',
|
||||
|
Loading…
Reference in New Issue
Block a user