Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJFET-00041e-WB for pgadmin-hackers@arkaria.postgresql.org; Fri, 09 Jun 2017 08:25:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dJFET-0000Cd-IW for pgadmin-hackers@arkaria.postgresql.org; Fri, 09 Jun 2017 08:25:25 +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 1dJFET-0000CR-2t for pgadmin-hackers@postgresql.org; Fri, 09 Jun 2017 08:25:25 +0000 Received: from mail-it0-x22e.google.com ([2607:f8b0:4001:c0b::22e]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dJFEM-000459-1W for pgadmin-hackers@postgresql.org; Fri, 09 Jun 2017 08:25:24 +0000 Received: by mail-it0-x22e.google.com with SMTP id m62so134174389itc.0 for ; Fri, 09 Jun 2017 01:25:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgadmin-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=LJpNbzEBV/rmkOOZ6Lv6xYGWNgBB6YH5SP4CBwtYL2c=; b=nMGd1m3IJFvc8qc9UmC1vxxBy041Z4+OSHZV7bZQkeR0Nrdk55KCQ3FpR5+VTNilEF HKVYnlFHCaZtZspB9HyFtA9rtM2iUhk3AvgDZkAynYUlBpqxaButG2yzXijoSWwNm5oj jIAQaOvcyYv79rYc7F4QU7LQAhf+RAVmtVYuKp68HPNyrhAlj2C1Y6x3jE2uRQsLdpGK XEwHv77gTui2GvlRtUJQpCn2J2w8cVNiS+2+b+olF69l/wTqiEv5ABGeq/eLVV5yH/ee 4JDL/RE4xHnDUyesFQx3m5yY27uVOhfZzlVE2ngpHc8OTX+5cbNGgPKqeJxHYJ5VWI+j hb5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=LJpNbzEBV/rmkOOZ6Lv6xYGWNgBB6YH5SP4CBwtYL2c=; b=Dj09EPuIkX5OskFPzU4A3jeA48YlXLxvc0NcL4H8VA/Iravuj3g7CP/znBjkx4JODj bBMZOrpwHjPPbKP2Sf/RfMdYDTogmL87tIq12iVwOqHz/RmX142aaoceVYYPEMqb8/Ss pNRc8Nxo7z1WrOxmmdrNNEIpbrLFQ3+L6+yWz8CHDPth3f1pNDm6jYBRMBqO59rCsyR9 F+ONKgOEZx0I8iGfgyC1E9zG9pq/cc6bfg6dMC1TbGNfWHXXNqRRuwRsYhFXakxS/T88 17BdyEGi9Y4K9tkjxzTXPP4x5SZ4rF1ocwg0logLiTEpHJ4oJQ3HZoAGJknNvwyt6Ais Xb7g== X-Gm-Message-State: AODbwcA7VpxbueluzfWMa/BGudoSIX6OE4F5xJVedaC1kFmR37s7lI7x 245MNOR90W4EmMxwSCj4ZBZtaUZcmmE0 X-Received: by 10.36.31.74 with SMTP id d71mr9169405itd.85.1496996716386; Fri, 09 Jun 2017 01:25:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.174.147 with HTTP; Fri, 9 Jun 2017 01:25:15 -0700 (PDT) In-Reply-To: References: From: Dave Page Date: Fri, 9 Jun 2017 09:25:15 +0100 Message-ID: Subject: Re: Re: [pgAdmin4][Patch][Feature #1971]: Remember column sizes between executions of the same query in the query tool To: Surinder Kumar Cc: Shruti B Iyer , pgadmin-hackers , Matthew Kleiman Content-Type: text/plain; charset="UTF-8" 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 Thanks, applied. On Fri, Jun 9, 2017 at 8:39 AM, Surinder Kumar wrote: > Hi > > As the patch "Improvements to Query Results" > is merged, the columns width in edit grid needs some adjustments as > 'checkboxes' are removed from columns. > > PFA patch. > > On Thu, Jun 8, 2017 at 5:12 PM, Dave Page wrote: >> >> Nice! Thanks, patch applied. >> >> On Wed, Jun 7, 2017 at 4:03 PM, Surinder Kumar >> wrote: >> > PFA patch after rebase >> > >> > On Wed, Jun 7, 2017 at 6:26 PM, Surinder Kumar >> > wrote: >> >> >> >> Hi >> >> >> >> Please find rebased patch. >> >> >> >> On Wed, Jun 7, 2017 at 6:15 PM, Dave Page wrote: >> >>> >> >>> Hi, >> >>> >> >>> Could you rebase this please? >> >>> >> >>> Thanks. >> >>> >> >>> On Tue, Jun 6, 2017 at 9:22 AM, Surinder Kumar >> >>> wrote: >> >>> > Hi All, >> >>> > >> >>> > Please find updated patch which includes Jasmine test cases for >> >>> > functions >> >>> > getHash and calculateColumnWidth >> >>> > >> >>> > Thanks, >> >>> > Surinder >> >>> > >> >>> > On Mon, Jun 5, 2017 at 11:38 PM, Shruti B Iyer >> >>> > wrote: >> >>> >> >> >>> >> Hi Surinder! >> >>> >> >> >>> >> We reviewed this patch. The changes look good and we especially >> >>> >> like >> >>> >> that >> >>> >> you have extracted out the new utility functions and the >> >>> >> epicRandomString >> >>> >> function too. >> >>> >> >> >>> >> This patch will likely affect the Query Results patch that is >> >>> >> currently >> >>> >> under review. In order to assist either us or yourself when making >> >>> >> a >> >>> >> merge >> >>> >> between these patches, it would help to have jasmine unit testing >> >>> >> for >> >>> >> the >> >>> >> two new functions, getHash and calculate_column_width. >> >>> >> >> >>> >> Also, we suggest that you rename calculate_column_width to >> >>> >> calculateColumnWidth for consistency with javascript code style. >> >>> >> >> >>> >> Thanks, >> >>> >> Shruti and Matt >> >>> >> >> >>> >> On Mon, Jun 5, 2017 at 9:16 AM Surinder Kumar >> >>> >> wrote: >> >>> >>> >> >>> >>> Staged changes are missed in previous patch, so please ignore. >> >>> >>> Please find attached updated patch. >> >>> >>> >> >>> >>> On Mon, Jun 5, 2017 at 4:29 PM, Surinder Kumar >> >>> >>> wrote: >> >>> >>>> >> >>> >>>> Hi >> >>> >>>> >> >>> >>>> This patch contains two fixes: >> >>> >>>> >> >>> >>>> 1) In Query/tool or Edit grid, the width of table column header >> >>> >>>> is >> >>> >>>> fixed >> >>> >>>> depending on the column type(int, boolean, char etc.) due to >> >>> >>>> which >> >>> >>>> the >> >>> >>>> column name or type appears cut from right and doesn't looks good >> >>> >>>> from user >> >>> >>>> point of view. The main concern was to display as much as the >> >>> >>>> content of >> >>> >>>> column should be displayed. >> >>> >>>> >> >>> >>>> Now the width of column is decided using the text length of >> >>> >>>> column >> >>> >>>> name >> >>> >>>> or column type so that the column takes exact width it required >> >>> >>>> and >> >>> >>>> it don't >> >>> >>>> appears cut. >> >>> >>>> >> >>> >>>> 2) Remember column size after re-running a query. >> >>> >>>> >> >>> >>>> The approach is to extract table name from the query executed and >> >>> >>>> use it >> >>> >>>> to store its columns width. >> >>> >>>> Whenever the column(s) width of a table is adjusted, the >> >>> >>>> corresponding >> >>> >>>> values are updated into the object and used every time the same >> >>> >>>> query is >> >>> >>>> executed. >> >>> >>>> >> >>> >>>> If a query is executed for e.g: >> >>> >>>> >> >>> >>>> SELECT generate_series(1, 1000) as id, generate_series(1, 1000) >> >>> >>>> as >> >>> >>>> name, >> >>> >>>> generate_series(1, 1000) as age >> >>> >>>> >> >>> >>>> it >> >>> >>>> displays 3 columns >> >>> >>>> but don't have any table name. In that case, >> >>> >>>> i use a hash generator function which returns unique hash for a >> >>> >>>> query >> >>> >>>> written in query editor and adjusted column(s) width are stored >> >>> >>>> against that >> >>> >>>> hash in object. >> >>> >>>> >> >>> >>>> Is there any way to get temporary table name(avoiding unique >> >>> >>>> hash) >> >>> >>>> for >> >>> >>>> such queries ? >> >>> >>>> >> >>> >>>> Also, Moved utilities functions into pgadmin/static/utils.js >> >>> >>>> >> >>> >>>> Please find attached patch and review. >> >>> >>>> >> >>> >>>> Thanks, >> >>> >>>> Surinder Kumar >> >>> >>> >> >>> >>> >> >>> >>> >> >>> >>> -- >> >>> >>> Sent via pgadmin-hackers mailing list >> >>> >>> (pgadmin-hackers@postgresql.org) >> >>> >>> To make changes to your subscription: >> >>> >>> http://www.postgresql.org/mailpref/pgadmin-hackers >> >>> > >> >>> > >> >>> > >> >>> > >> >>> > -- >> >>> > Sent via pgadmin-hackers mailing list >> >>> > (pgadmin-hackers@postgresql.org) >> >>> > To make changes to your subscription: >> >>> > http://www.postgresql.org/mailpref/pgadmin-hackers >> >>> > >> >>> >> >>> >> >>> >> >>> -- >> >>> Dave Page >> >>> Blog: http://pgsnake.blogspot.com >> >>> Twitter: @pgsnake >> >>> >> >>> EnterpriseDB UK: http://www.enterprisedb.com >> >>> The Enterprise PostgreSQL Company >> >> >> >> >> > >> >> >> >> -- >> Dave Page >> Blog: http://pgsnake.blogspot.com >> Twitter: @pgsnake >> >> EnterpriseDB UK: http://www.enterprisedb.com >> The Enterprise PostgreSQL Company > > -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers