public inbox for [email protected]
help / color / mirror / Atom feedFrom: Rahul Shirsat <[email protected]>
To: Dave Page <[email protected]>
Cc: pgadmin-hackers <[email protected]>
Subject: Re: [patch][pgAdmin] Fix for pgadmin4-linux-qa #1651 failure
Date: Tue, 29 Jun 2021 09:08:13 +0530
Message-ID: <CAKtn9dOWXDQo9K_HuqGOmhq=AeVVzcE8d=J+8obRj014G=0jxQ@mail.gmail.com> (raw)
In-Reply-To: <CA+OCxoxE+OK3_KW_vu_pWY4+t5qyH985_Znp7v+uA2vmYRo2BQ@mail.gmail.com>
References: <CAKtn9dP2TmBCqHxV0szjdmCEVLbJwBNXA6rsumoOKeQJG1qyUw@mail.gmail.com>
<CA+OCxoxE+OK3_KW_vu_pWY4+t5qyH985_Znp7v+uA2vmYRo2BQ@mail.gmail.com>
I feel gettext sometimes won't escape the characters as it should be.
I now tried to escape those using some utils.
Please find the updated patch.
On Mon, Jun 28, 2021 at 9:33 PM Dave Page <[email protected]> wrote:
> Hi
>
> On Mon, Jun 28, 2021 at 4:57 PM Rahul Shirsat <
> [email protected]> wrote:
>
>> Hi Hackers,
>>
>> Please find the attached patch for fixation of jenkins failure.
>>
>
> That won't work - you can't include variables (or string building
> operations) in the first argument to gettext calls, as there won't be any
> way to extract a complete message into the catalogs. The way it's being
> done at the moment is correct (I don't know why it's failing, but it's the
> correct way to structure the gettext calls).
>
> --
> Dave Page
> Blog: https://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EDB: https://www.enterprisedb.com
>
>
--
*Rahul Shirsat*
Senior Software Engineer | EnterpriseDB Corporation.
Attachments:
[application/octet-stream] jenkins_failure_fix_v2.patch (3.8K, 3-jenkins_failure_fix_v2.patch)
download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js b/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js
index 557e44b7a..4c2cb04ab 100644
--- a/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js
+++ b/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js
@@ -748,6 +748,41 @@ define('pgadmin.node.role', [
// set default role operation as reassign
this.view.model.set({'role_op': 'reassign'});
},
+ confirmDialog: function(data, url) {
+
+ var roleOp = data.role_op,
+ confirmBoxTitle = utils.titleize(roleOp),
+ title = utils.sprintf('%s Objects', confirmBoxTitle),
+ msg = utils.sprintf('Are you sure you wish to %s all the objects owned by the selected role?', roleOp);
+
+ alertify.confirm(
+ gettext(title),
+ gettext(msg),
+ function() {
+ axios.post(
+ url,
+ data
+ ).then(function (response) {
+ if(response.data)
+ alertify.success(response.data.info);
+ }).catch(function (error) {
+ try {
+ const err = error.response.data;
+ alertify.alert(
+ gettext('Role reassign/drop failed.'),
+ err.errormsg
+ );
+ } catch (e) {
+ console.warn(e.stack || e);
+ }
+ });
+ },
+ function() { return true; }
+ ).set('labels', {
+ ok: gettext('Yes'),
+ cancel: gettext('No'),
+ });
+ },
// Callback functions when click on the buttons of the alertify dialogs
callback: function(e) {
if (e.button.element.name == 'dialog_help') {
@@ -757,38 +792,8 @@ define('pgadmin.node.role', [
return;
}
if (e.button.text === gettext('OK')) {
-
- let roleReassignData = this.view.model.toJSON(),
- roleOp = roleReassignData.role_op,
- confirmBoxTitle = utils.titleize(roleOp);
-
- alertify.confirm(
- gettext('%s Objects', confirmBoxTitle),
- gettext('Are you sure you wish to %s all the objects owned by the selected role?', roleOp),
- function() {
- axios.post(
- finalUrl,
- roleReassignData
- ).then(function (response) {
- if(response.data)
- alertify.success(response.data.info);
- }).catch(function (error) {
- try {
- const err = error.response.data;
- alertify.alert(
- gettext('Role reassign/drop failed.'),
- err.errormsg
- );
- } catch (e) {
- console.warn(e.stack || e);
- }
- });
- },
- function() { return true; }
- ).set('labels', {
- ok: gettext('Yes'),
- cancel: gettext('No'),
- });
+ let roleReassignData = this.view.model.toJSON();
+ this.confirmDialog(roleReassignData, finalUrl);
}
},
};
view thread (22+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: [patch][pgAdmin] Fix for pgadmin4-linux-qa #1651 failure
In-Reply-To: <CAKtn9dOWXDQo9K_HuqGOmhq=AeVVzcE8d=J+8obRj014G=0jxQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox