Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aIrU8-0000zP-QD for pgadmin-hackers@arkaria.postgresql.org; Tue, 12 Jan 2016 05:27:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aIrU8-0005bE-48 for pgadmin-hackers@arkaria.postgresql.org; Tue, 12 Jan 2016 05:27:12 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aIrTt-0005MO-LY for pgadmin-hackers@postgresql.org; Tue, 12 Jan 2016 05:26:57 +0000 Received: from mail-pa0-x230.google.com ([2607:f8b0:400e:c03::230]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aIrTq-0006M9-Bf for pgadmin-hackers@postgresql.org; Tue, 12 Jan 2016 05:26:56 +0000 Received: by mail-pa0-x230.google.com with SMTP id yy13so240883736pab.3 for ; Mon, 11 Jan 2016 21:26:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type; bh=i1MvoE19Zo0mlWYuYujrHvDN3eK8nQV7bgvgakq9/14=; b=RmH65qMGME9Gp+7AkjL1d2B+TyMif3Qxqal2jApU2LoPMqI2cQ4ciYpsUrXvNklfyb XDT5kI+FC6ptmcJQKG7PCbJpkeosoh+YYFCn5sp6TPXP0IHCQrBvvA53eQTCnAN2FHcK mqdIlaEC3yvmwWOYcMzR/NRSrPiEdPCHeewnnBRvmyYLtNf+SYy/Nbvb6qJ79XxFdN3F dJb5HcodivG84eiGNeqqSep7wolovW7yEdmuNuufhtHdzFzjkSrNHoOiHdtE+tQocAHC ghonqgm/eOCsR2XKDdVKnbvL+5/zkB+JratSNJmfkSNO7beQYJa7fcVRvfw/+Rsi7Z68 TmAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type; bh=i1MvoE19Zo0mlWYuYujrHvDN3eK8nQV7bgvgakq9/14=; b=Yy3f52o1bi5hQi9GAJQtOXQZlzjIgqYZwNdu63EikPMP2wPstcE+rvxlcsiaLKVU9L OA/W2yC+zJuZOrNmK8sGBVnFiGgu5RXcbwlQliFvHYhbBLoPznj5JVnWO4KNhuN9es9X MnMBhT0ZqBN25Umw7Xwt+HRUHassRwCWFIz2N8C4xePQ1qb3uOOF1p6VI9kht49SwxjL oguJXBAlBqFrY8zN1VxOOQn4/KK5AxVlxOX3PtRV4Z0jWW/OWD59t50/MrEwXdXi6RhL d+2NDCy5pDYqgpdExQBJ0XEN1gAgeHuPcshlOFMuVzQXyo2w0drdboxX4TpHFYXUBDf1 dDtw== X-Gm-Message-State: ALoCoQlCV1HyXuZNQLgzun5jgcLhTd58+Q8m4KXuOToLwWgyGzWP1sUV0QtEAjsDl4fBjiLCiA0NCgyAFhKmCGTI40oB/ul2Vtva/B++M5QT5HHypd9QjO2XlZ7QrL9J9CuXExDmsUByQwUgHEhYtofk+MP2KLjKVPWZ5LxL2A/OpoxCiFI+NRnSwv4mYT9yNoGC6Lwhie5zNwykEB0io4JUtcxCyQgaJA== X-Received: by 10.67.5.228 with SMTP id cp4mr7359842pad.29.1452576413077; Mon, 11 Jan 2016 21:26:53 -0800 (PST) Received: from [172.24.35.244] ([59.162.78.200]) by smtp.gmail.com with ESMTPSA id f12sm122538971pat.20.2016.01.11.21.26.51 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Jan 2016 21:26:52 -0800 (PST) Subject: Re: PATCH: Select2 control fix [ pgAdmin4 ] To: Ashesh Vashi References: <56939D79.60805@enterprisedb.com> <5694892A.3030805@enterprisedb.com> Cc: pgadmin-hackers From: Murtuza Zabuawala Message-ID: <56948E99.1080108@enterprisedb.com> Date: Tue, 12 Jan 2016 10:56:49 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <5694892A.3030805@enterprisedb.com> Content-Type: multipart/mixed; boundary="------------020303030801000109060906" X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org This is a multi-part message in MIME format. --------------020303030801000109060906 Content-Type: multipart/alternative; boundary="------------050903000804030101040004" --------------050903000804030101040004 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi Ashesh, Can you please try applying given updated patch, I have manually converted file line ending to Unix format. Regards, Murtuza On Tuesday 12 January 2016 10:33 AM, Murtuza Zabuawala wrote: > Hi Ashesh, > > I am not sure what's wrong here as I'm able to apply the given patch > with latest pull. > > murtuza@debian ~/PROJECT/pgadmin4 $ git pull > Already up-to-date. > murtuza@debian ~/PROJECT/pgadmin4 $ patch -p1 < > Fix_select2_disabled_property.patch > patching file web/pgadmin/browser/static/js/node.ui.js > murtuza@debian ~/PROJECT/pgadmin4 $ git diff > diff --git a/web/pgadmin/browser/static/js/node.ui.js > b/web/pgadmin/browser/static/js/node.ui.js > index 76839c6..b5fa3e2 100644 > > > And here are my git settings, > > murtuza@debian ~/PROJECT/pgadmin4 $ git config -l > core.editor=vim > core.autocrlf=input > core.repositoryformatversion=0 > core.filemode=true > core.bare=false > core.logallrefupdates=true > remote.origin.url=http://git.postgresql.org/git/pgadmin4.git > remote.origin.fetch=+refs/heads/*:refs/remotes/origin/* > branch.master.remote=origin > branch.master.merge=refs/heads/master > > > Regards, > Murtuza > > > > On Monday 11 January 2016 09:36 PM, Ashesh Vashi wrote: >> Hi Murtuza, >> >> I am not able to apply the patch. >> Can you please rebase the patch? >> >> (Also - please set the proper line endings in your git repository.) >> >> -- >> >> Thanks & Regards, >> >> Ashesh Vashi >> EnterpriseDB INDIA: Enterprise PostgreSQL Company >> >> >> >> /http://www.linkedin.com/in/asheshvashi/ >> >> >> On Mon, Jan 11, 2016 at 5:48 PM, Murtuza Zabuawala >> wrote: >> >> Hi, >> >> Please find minor patch to fix issue in select2 control. >> >> Issue: We were not able to apply 'disabled' property from schema >> model on select2 control. >> >> >> Regards, >> Murtuza >> >> >> -- >> Sent via pgadmin-hackers mailing list >> (pgadmin-hackers@postgresql.org) >> To make changes to your subscription: >> http://www.postgresql.org/mailpref/pgadmin-hackers >> >> > --------------050903000804030101040004 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit Hi Ashesh,

Can you please try applying given updated patch, I have manually converted file line ending to Unix format.


Regards,
Murtuza

On Tuesday 12 January 2016 10:33 AM, Murtuza Zabuawala wrote:
Hi Ashesh,

I am not sure what's wrong here as I'm able to apply the given patch with latest pull.

murtuza@debian ~/PROJECT/pgadmin4 $ git pull
Already up-to-date.
murtuza@debian ~/PROJECT/pgadmin4 $ patch -p1 < Fix_select2_disabled_property.patch
patching file web/pgadmin/browser/static/js/node.ui.js
murtuza@debian ~/PROJECT/pgadmin4 $ git diff
diff --git a/web/pgadmin/browser/static/js/node.ui.js b/web/pgadmin/browser/static/js/node.ui.js
index 76839c6..b5fa3e2 100644


And here are my git settings,

murtuza@debian ~/PROJECT/pgadmin4 $ git config -l
core.editor=vim
core.autocrlf=input
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=http://git.postgresql.org/git/pgadmin4.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master



Regards,
Murtuza



On Monday 11 January 2016 09:36 PM, Ashesh Vashi wrote:
Hi Murtuza,

I am not able to apply the patch.
Can you please rebase the patch?

(Also -  please set the proper line endings in your git repository.)

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company


http://www.linkedin.com/in/asheshvashi


On Mon, Jan 11, 2016 at 5:48 PM, Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote:
Hi,

Please find minor patch to fix issue in select2 control.

Issue: We were not able to apply 'disabled' property from schema model on select2 control.


Regards,
Murtuza


--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers




--------------050903000804030101040004-- --------------020303030801000109060906 Content-Type: text/x-patch; name="Fix_select2_disabled_property_UPDATED.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="Fix_select2_disabled_property_UPDATED.patch" diff --git a/web/pgadmin/browser/static/js/node.ui.js b/web/pgadmin/browser/static/js/node.ui.js index 76839c6..b5fa3e2 100644 --- a/web/pgadmin/browser/static/js/node.ui.js +++ b/web/pgadmin/browser/static/js/node.ui.js @@ -139,7 +139,21 @@ function($, _, pgAdmin, Backbone, Backform, Alertify, Node) { Backform.SelectControl.prototype.render.apply(this, arguments); var d = this.field.toJSON(), - select2_opts = _.defaults({}, d.select2, this.defaults.select2); + select2_opts = _.defaults({}, d.select2, this.defaults.select2), + evalF = function(f, d, m) { + return (_.isFunction(f) ? !!f.apply(d, [m]) : !!f); + }; + + /* + * If select2 options do not have any disabled property on this field + * and schema has disabled property then we need to apply it + */ + + if(!_.has(select2_opts, 'disabled') && (d && d.disabled)) { + _.extend(select2_opts, { + disabled: evalF(d.disabled, d, this.model) + }); + } /* * Add empty option as Select2 requires any empty '