Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aIr7o-0007yS-Il for pgadmin-hackers@arkaria.postgresql.org; Tue, 12 Jan 2016 05:04:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aIr7n-0002Ai-Hn for pgadmin-hackers@arkaria.postgresql.org; Tue, 12 Jan 2016 05:04:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aIr7Z-0001vs-CF for pgadmin-hackers@postgresql.org; Tue, 12 Jan 2016 05:03:53 +0000 Received: from mail-pa0-x233.google.com ([2607:f8b0:400e:c03::233]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aIr7Q-00067A-Oe for pgadmin-hackers@postgresql.org; Tue, 12 Jan 2016 05:03:52 +0000 Received: by mail-pa0-x233.google.com with SMTP id ho8so72428782pac.2 for ; Mon, 11 Jan 2016 21:03:44 -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=+cxcNDhNTMC9vw26EJBJT8wWrxslphMnUP1Oukvse0A=; b=SDfmflXeX3tg75i7J5J/sCKCdAvFsTnYKxbOiExmBtbrWsWlqvoBTO7rpTwKf3mnbi jbF81M4YvEvOeu/6MOHUBGFQt9/zARSiPA/yq9RaavkrmvfeQJxxnlnScDhG0jHCv52P +N/o5OOhHKU+DUhV3WjqyKjnT5GeTjnTvSznWz/Ge9kx8HJvkYrwwnzkhYEyUFOjNx7x 8q3VAmaiCfoMimBtUuB/WZWXzfbCVmvcWrjVK6lZNSPpr87cipl4lT+GJBV4Xb2tshtA Xdiu884619/bFe61mxlW9sRkRg2xEsPxQzNx5+ECKI6RU8KVdjBOuoxjUDsE04j5PLoF Qq5g== 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=+cxcNDhNTMC9vw26EJBJT8wWrxslphMnUP1Oukvse0A=; b=S13XT4NNHKTQ9Qf/WQVvaIOXG02Bu1n8VoIZHKj/JV8cqECdR/PpmAXiYP81X98K+F oli0D4fVddWxPx9fdOkMdPxhvkC9hMgHOTc3tPV8MbZLyN9CflKVvjw4/gdBOPHs7inn zAoxg8AXwkrcWRPdGc1FvQXkOhuoH3rPpSGQbW7uYzNLVtm647+FuzGVc8mOQ0RT9oY+ 03bqVC+oEfn9UsyRlZKUn0U6NHTA8HMABcx0RiazdiO8vb4hmOTYc9E70ayfKOBxnl/i zUooyFmsDydhpkg7KMuJcGeo28EJcrXuWEtKF1Nkt06MiiS/6CLsQSGxBoZJ86doSTaE Sn9w== X-Gm-Message-State: ALoCoQmTB26ISkeiJc+2xhZntmFEpj2Z04PDrI/GEq93+AOS5vvUwI0qAI5qDcibL9iD+xgi+zgHhFf1mHtzXDCg4ZokYXXGZ7+0/f66SbOx65ZAgwXglzYSRw7ETbCC+ykmGbr+Td/acvj3aviXoc9/kerCAzRE1VDMms5jQ8fU7kDdWVZqIzkQ0kDaBmTohFUvutrurAxFJHFUNQDxeK4lKQkcdbZXBQ== X-Received: by 10.66.186.170 with SMTP id fl10mr15863179pac.134.1452575022176; Mon, 11 Jan 2016 21:03:42 -0800 (PST) Received: from [172.24.35.244] ([59.162.78.200]) by smtp.gmail.com with ESMTPSA id m75sm26786373pfj.38.2016.01.11.21.03.40 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Jan 2016 21:03:41 -0800 (PST) Subject: Re: PATCH: Select2 control fix [ pgAdmin4 ] To: Ashesh Vashi References: <56939D79.60805@enterprisedb.com> Cc: pgadmin-hackers From: Murtuza Zabuawala Message-ID: <5694892A.3030805@enterprisedb.com> Date: Tue, 12 Jan 2016 10:33:38 +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: Content-Type: multipart/mixed; boundary="------------050200030606040101060100" 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. --------------050200030606040101060100 Content-Type: multipart/alternative; boundary="------------090502010305060308060704" --------------090502010305060308060704 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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 > > --------------090502010305060308060704 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit 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



--------------090502010305060308060704-- --------------050200030606040101060100 Content-Type: text/x-patch; name="Fix_select2_disabled_property.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="Fix_select2_disabled_property.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 '