[pgAdmin][RM4482][RM4483] Backup dialog issues for directory format

Aditya Toshniwal <[email protected]>
Newsgroups gmane.comp.db.postgresql.pgadmin.devel
Message-ID <CAM9w-_m4XOxWgh7NjmX7WSyQTaHje2dOwFETfgzu1WSK3jyPdw@mail.gmail.com>
Hi Hackers,

Attached is a patch to fix a couple of issues on the backup dialog related
to directory format:
4482 - Backup dialog ignores compression ratio for directory format
4483 - Backup dialog does not allow jobs parameter when using directory
format

Kindly review.

-- 
Thanks and Regards,
Aditya Toshniwal
Sr. Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"
RM4482_4483.patch (application/octet-stream, 1.5 KB)
diff --git a/web/pgadmin/tools/backup/__init__.py b/web/pgadmin/tools/backup/__init__.py
index f4e442f8e..2cc6f2979 100644
--- a/web/pgadmin/tools/backup/__init__.py
+++ b/web/pgadmin/tools/backup/__init__.py
@@ -386,8 +386,10 @@ def create_backup_objects_job(sid):
             set_param('blobs', '--blobs')
         elif data['format'] == 'plain':
             args.extend(['--format=p'])
+            set_value('ratio', '--compress')
         elif data['format'] == 'directory':
             args.extend(['--format=d'])
+            set_value('ratio', '--compress')
 
     if 'only_data' in data and data['only_data']:
         set_param('only_data', '--data-only')
diff --git a/web/pgadmin/tools/backup/static/js/backup.js b/web/pgadmin/tools/backup/static/js/backup.js
index ae31cef3b..ebc45a7c1 100644
--- a/web/pgadmin/tools/backup/static/js/backup.js
+++ b/web/pgadmin/tools/backup/static/js/backup.js
@@ -178,7 +178,10 @@ define([
       type: 'int',
       min: 0,
       max: 9,
-      disabled: false,
+      deps: ['format'],
+      disabled: function(m) {
+        return (m.get('format') === 'tar');
+      },
       visible: function(m) {
         if (!_.isUndefined(m.get('type')) && m.get('type') === 'server')
           return false;
@@ -207,7 +210,7 @@ define([
       type: 'int',
       deps: ['format'],
       disabled: function(m) {
-        return !(m.get('format') === 'Directory');
+        return !(m.get('format') === 'directory');
       },
       visible: function(m) {
         if (!_.isUndefined(m.get('type')) && m.get('type') === 'server')
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.