Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ailHg-0002e9-Gs for pgadmin-hackers@arkaria.postgresql.org; Wed, 23 Mar 2016 16:05:24 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ailHf-0005zM-LJ for pgadmin-hackers@arkaria.postgresql.org; Wed, 23 Mar 2016 16:05:23 +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_2) (envelope-from ) id 1ailHR-0005Rr-GI for pgadmin-hackers@postgresql.org; Wed, 23 Mar 2016 16:05:09 +0000 Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1ailHK-0004Tg-5O for pgadmin-hackers@postgresql.org; Wed, 23 Mar 2016 16:05:09 +0000 Received: by mail-wm0-x22f.google.com with SMTP id r129so142656215wmr.1 for ; Wed, 23 Mar 2016 09:05:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=jO9GBdw1Uib2kMvSnoSkEQv9jLXz38qf5JpzufGBRZg=; b=X7JXKMvPAzoTRhw2hD6LaG2BRn1sUrI4Ste0ehPmF8D52aIyK2NrRmTdXedALG9Bro 6tUuCg6QDW8ekOwgwvEtDAyNALLX7rc8exEabPD0DVkpZtcBai/J2f7xFzFrSDulcfDY sNsIsUyAtg20YE1dFhWv7Bt9C9LRknzonB81/HQGH+KcxVg7XPIeWHoTBJyS7vVg3bHw ruBNME4iVuchB5hHsa/VeLNM4eGl6lmryxggSv+TzAfaxFV1lKYWqdfq5AFUmTva7B4o x3xJ3KZHSZu2Tu0SCb+3aYvb3bVtzUkkzVNctXBIB9GGCs2RdxtbF3PE1JnvxC3lOGyJ x8yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=jO9GBdw1Uib2kMvSnoSkEQv9jLXz38qf5JpzufGBRZg=; b=CWv3ZyvzhdiQGXSVK45H2yCfalEegaQgTHrxWFdmvM5ZaPf0M0Z5jKC4Dja9OfJgyF h7cqB7vJ6BBJNTLERecSehoayLKwzA740CZsHO8+YWPHupaW4CXRvKPmegNKLG85NvG8 54nbqI/OVGmlJa7/lY5/HyDMskxsjTuhg/TVnzIZ8Z0BEMytj6jxPl4cKvHSxae8UE8v 6dI9tNih8D4C/VkIhVmA5QbJBDaSNSGBnTMr7GOAxU4r0tkfFlfzkA53DeZBjPhBGhqD DgTiAKgvQIFxre+xYg1WDQo8N02gWfDRKlm2rfn3FCTKpspnHTkkBNYdaHzHbL2JRVPJ uY0A== X-Gm-Message-State: AD7BkJIOl5IBazEgDDw112ZD61VBZssG6aq3thRgW+1fCmCkUHp5uEh/J9hezQgV7KS3c1421vFRTUcijMsmYox6 X-Received: by 10.28.130.67 with SMTP id e64mr27660045wmd.6.1458749101002; Wed, 23 Mar 2016 09:05:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.55.74 with HTTP; Wed, 23 Mar 2016 09:04:31 -0700 (PDT) In-Reply-To: References: From: Surinder Kumar Date: Wed, 23 Mar 2016 21:34:31 +0530 Message-ID: Subject: Re: Control for displaying "auto vacuum" fields into grid To: Dave Page Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary=001a1144360efb667b052eb97d79 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 --001a1144360efb667b052eb97d79 Content-Type: text/plain; charset=UTF-8 Hi, On Fri, Mar 18, 2016 at 8:58 PM, Dave Page wrote: > On Fri, Mar 18, 2016 at 10:37 AM, Surinder Kumar > wrote: > > Hi, > > > > PFA control for displaying auto vacuum fields into grid. This control is > > common for > > Materialized View Node and Table Node. > > > > Usage: > > > > { > > id: 'vacuum_table', label: '{{ _("Vacuum Table") }}', > > model: VacuumTableModel, editable: false, type: 'collection', > > canEdit: true, group: '{{ _("Table") }}', > > mode: ['edit', 'create'], url: 'get_vacuum_defaults', > > control: Backform.VacuumCollectionControl.extend({ > > grid_columns :[ > > { > > name: 'label', label: '{{ _("Label") }}', > > cell: 'string', editable: false > > }, > > { > > name: 'value', label: '{{ _("Value") }}', > > cellFunction: cellFunction, editable: function(m) { > > if(m.handler.has('autovacuum_enabled')) { > > return m.handler.get('autovacuum_enabled'); > > } > > return !m.handler.isNew(); > > } > > }, > > { > > name: 'setting', label: '{{ _("Default value") }}', > > cellFunction: cellFunction, editable: false > > } > > ] > > }), > > > > > > When using this control, provide following parameters in schema: > > 1. model > > 2. url - to fetch default values for auto vacuum fields. > > 3. grid columns - Name of the columns to display in the grid. > > > > > > Please review the patch. > > It's hard to review this without being able to test. Do you have a > simple test case? > I have submitted patch for materialized view which is using this control. so you can test it in materialized view. > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > --001a1144360efb667b052eb97d79 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,


On Fri, Mar 18, 2016 at 8:58 PM, Dave Page <dpage@p= gadmin.org> wrote:
On Fri, Mar = 18, 2016 at 10:37 AM, Surinder Kumar
<su= rinder.kumar@enterprisedb.com> wrote:
> Hi,
>
> PFA control for displaying auto vacuum fields into grid. This control = is
> common for
> Materialized View Node and Table Node.
>
> Usage:
>
> {
>=C2=A0 =C2=A0id: 'vacuum_table', label: '{{ _("Vacuum = Table") }}',
>=C2=A0 =C2=A0model: VacuumTableModel, editable: false, type: 'colle= ction',
>=C2=A0 =C2=A0canEdit: true, group: '{{ _("Table") }}'= ,
>=C2=A0 =C2=A0mode: ['edit', 'create'], url: 'get_va= cuum_defaults',
>=C2=A0 =C2=A0control: Backform.VacuumCollectionControl.extend({
>=C2=A0 =C2=A0 =C2=A0grid_columns :[
>=C2=A0 =C2=A0 =C2=A0 =C2=A0{
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0name: 'label', label: '{{= _("Label") }}',
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cell: 'string', editable: fal= se
>=C2=A0 =C2=A0 =C2=A0 =C2=A0},
>=C2=A0 =C2=A0 =C2=A0 =C2=A0{
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0name: 'value', label: '{{= _("Value") }}',
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cellFunction: cellFunction, editable:= function(m) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if(m.handler.has('autovacu= um_enabled')) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return m.handler.get(&#= 39;autovacuum_enabled');
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return !m.handler.isNew();
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>=C2=A0 =C2=A0 =C2=A0 =C2=A0},
>=C2=A0 =C2=A0 =C2=A0 =C2=A0{
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0name: 'setting', label: '= {{ _("Default value") }}',
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cellFunction: cellFunction, editable:= false
>=C2=A0 =C2=A0 =C2=A0 =C2=A0}
>=C2=A0 =C2=A0 =C2=A0]
>=C2=A0 =C2=A0}),
>
>
> When using this control, provide following parameters in schema:
> 1. model
> 2. url - to fetch default values for auto vacuum fields.
> 3. grid columns - Name of the columns to display in the grid.
>
>
> Please review the patch.

It's hard to review this without being able to test. Do you= have a
simple test case?

I have submitted patc= h for materialized view which is using this control. so you can test it in = materialized view.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--001a1144360efb667b052eb97d79--