Skip to content

Commit 0e5734e

Browse files
Fix review comments.
1 parent 34fad53 commit 0e5734e

5 files changed

Lines changed: 21 additions & 21 deletions

File tree

docs/en_US/restore_dialog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ restore process:
2727

2828
* Select *Custom or tar* to restore from a custom archive file to create a
2929
copy of the backed-up object.
30+
* Select *Plain* to restore a plain SQL backup. When selecting this option
31+
all the other options will not be applicable.
3032
* Select *Directory* to restore from a compressed directory-format archive.
3133

3234
* Enter the complete path to the backup file in the *Filename* field.

web/pgadmin/static/js/SchemaView/FormViewTab.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ import PropTypes from 'prop-types';
1515

1616
export default function FormViewTab({tabGroup, idx, tabValue, ...props}) {
1717
const accessPath = [tabGroup.id];
18-
const [, setRefreshKey] = useState(0);
18+
const [refreshKey, setRefreshKey] = useState(0);
1919
const subscriberManager = useSchemaStateSubscriber(setRefreshKey);
2020
const schemaState = useContext(SchemaStateContext);
2121
const options = useFieldOptions(accessPath, schemaState, subscriberManager);
2222

2323
return (
2424
<Tab
25-
key={tabGroup.id}
25+
key={refreshKey}
2626
label={tabGroup.label}
2727
data-test={tabGroup.id}
2828
iconPosition='start'

web/pgadmin/tools/restore/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def set_multiple(key, param, data, args, driver, conn, with_schema=True):
265265

266266
def get_restore_util_args(data, manager, server, driver, conn, filepath):
267267
"""
268-
add args to the list.
268+
return the args for the command
269269
:param data: Data.
270270
:param manager: Manager.
271271
:param server: Server.
@@ -354,12 +354,10 @@ def get_restore_util_args(data, manager, server, driver, conn, filepath):
354354

355355
def get_sql_util_args(data, manager, server, filepath):
356356
"""
357-
add args to the list.
357+
return the args for the command
358358
:param data: Data.
359359
:param manager: Manager.
360360
:param server: Server.
361-
:param driver: Driver.
362-
:param conn: Connection.
363361
:param filepath: File.
364362
:return: args list.
365363
"""

web/pgadmin/tools/restore/static/js/restore.ui.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ export default class RestoreSchema extends BaseUISchema {
344344
this.treeNodeInfo = treeNodeInfo;
345345
this.pgBrowser = pgBrowser;
346346

347-
this.formaOptions = this.getFormatOptions();
347+
this.formatOptions = this.getFormatOptions();
348348
}
349349

350350
get idAttribute() {
@@ -381,7 +381,7 @@ export default class RestoreSchema extends BaseUISchema {
381381
label: gettext('Format'),
382382
disabled: false,type: 'select',
383383
controlProps: { allowClear: false, width: '100%' },
384-
options: this.formaOptions,
384+
options: this.formatOptions,
385385
depChange: (state) => {
386386
if(state.format == 'plain') {
387387
return {

web/pgadmin/tools/restore/tests/test_restore_create_job_unit_test.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class RestoreCreateJobTest(BaseTestGenerator):
4141
database='postgres'
4242
),
4343
url=RESTORE_JOB_URL,
44-
expected_cmd='/psql',
44+
expected_cmd='psql',
4545
expected_cmd_opts=['--file'],
4646
not_expected_cmd_opts=[],
4747
expected_exit_code=[0, None]
@@ -68,7 +68,7 @@ class RestoreCreateJobTest(BaseTestGenerator):
6868
database='postgres'
6969
),
7070
url=RESTORE_JOB_URL,
71-
expected_cmd='/pg_restore',
71+
expected_cmd='pg_restore',
7272
expected_cmd_opts=['--verbose'],
7373
not_expected_cmd_opts=[],
7474
expected_exit_code=[0, None]
@@ -95,7 +95,7 @@ class RestoreCreateJobTest(BaseTestGenerator):
9595
database='postgres'
9696
),
9797
url=RESTORE_JOB_URL,
98-
expected_cmd='/pg_restore',
98+
expected_cmd='pg_restore',
9999
expected_cmd_opts=['--verbose', '--format=d'],
100100
not_expected_cmd_opts=[],
101101
expected_exit_code=[0, None]
@@ -127,7 +127,7 @@ class RestoreCreateJobTest(BaseTestGenerator):
127127
only_schema=True
128128
),
129129
url=RESTORE_JOB_URL,
130-
expected_cmd='/pg_restore',
130+
expected_cmd='pg_restore',
131131
expected_cmd_opts=['--verbose', '--jobs', '2',
132132
'--section=pre-data', '--section=data',
133133
'--section=post-data'],
@@ -161,7 +161,7 @@ class RestoreCreateJobTest(BaseTestGenerator):
161161
dns_owner=True
162162
),
163163
url=RESTORE_JOB_URL,
164-
expected_cmd='/pg_restore',
164+
expected_cmd='pg_restore',
165165
expected_cmd_opts=['--verbose', '--data-only'],
166166
not_expected_cmd_opts=[],
167167
# Below options should be enabled once we fix the issue #3368
@@ -193,7 +193,7 @@ class RestoreCreateJobTest(BaseTestGenerator):
193193
only_data=False
194194
),
195195
url=RESTORE_JOB_URL,
196-
expected_cmd='/pg_restore',
196+
expected_cmd='pg_restore',
197197
expected_cmd_opts=['--no-owner',
198198
'--no-tablespaces',
199199
'--no-privileges'],
@@ -227,7 +227,7 @@ class RestoreCreateJobTest(BaseTestGenerator):
227227
only_data=False
228228
),
229229
url=RESTORE_JOB_URL,
230-
expected_cmd='/pg_restore',
230+
expected_cmd='pg_restore',
231231
expected_cmd_opts=['--no-comments', '--no-publications',
232232
'--no-subscriptions', '--no-security-labels'],
233233
not_expected_cmd_opts=[],
@@ -259,7 +259,7 @@ class RestoreCreateJobTest(BaseTestGenerator):
259259
dns_table_access_method=True
260260
),
261261
url=RESTORE_JOB_URL,
262-
expected_cmd='/pg_restore',
262+
expected_cmd='pg_restore',
263263
expected_cmd_opts=['--no-table-access-method'],
264264
not_expected_cmd_opts=[],
265265
expected_exit_code=[0, None],
@@ -291,7 +291,7 @@ class RestoreCreateJobTest(BaseTestGenerator):
291291
if_exists=True,
292292
),
293293
url=RESTORE_JOB_URL,
294-
expected_cmd='/pg_restore',
294+
expected_cmd='pg_restore',
295295
expected_cmd_opts=['--create', '--clean',
296296
'--single-transaction', '--if-exists'],
297297
not_expected_cmd_opts=[],
@@ -321,7 +321,7 @@ class RestoreCreateJobTest(BaseTestGenerator):
321321
only_schema=False
322322
),
323323
url=RESTORE_JOB_URL,
324-
expected_cmd='/pg_restore',
324+
expected_cmd='pg_restore',
325325
expected_cmd_opts=['--enable-row-security',
326326
'--no-data-for-failed-tables'],
327327
not_expected_cmd_opts=[],
@@ -349,7 +349,7 @@ class RestoreCreateJobTest(BaseTestGenerator):
349349
only_schema=False
350350
),
351351
url=RESTORE_JOB_URL,
352-
expected_cmd='/pg_restore',
352+
expected_cmd='pg_restore',
353353
expected_cmd_opts=['--disable-triggers'],
354354
not_expected_cmd_opts=[],
355355
expected_exit_code=[0, None]
@@ -376,7 +376,7 @@ class RestoreCreateJobTest(BaseTestGenerator):
376376
exit_on_error=True,
377377
),
378378
url=RESTORE_JOB_URL,
379-
expected_cmd='/pg_restore',
379+
expected_cmd='pg_restore',
380380
expected_cmd_opts=['--exit-on-error',
381381
'--use-set-session-authorization'],
382382
not_expected_cmd_opts=[],
@@ -403,7 +403,7 @@ class RestoreCreateJobTest(BaseTestGenerator):
403403
exclude_schema="sch*"
404404
),
405405
url=RESTORE_JOB_URL,
406-
expected_cmd='/pg_restore',
406+
expected_cmd='pg_restore',
407407
expected_cmd_opts=['--exclude-schema', 'sch*'],
408408
not_expected_cmd_opts=[],
409409
expected_exit_code=[0, None]

0 commit comments

Comments
 (0)