Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dIaLb-00019r-Cl for pgadmin-hackers@arkaria.postgresql.org; Wed, 07 Jun 2017 12:46:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dIaLa-0000yT-Rs for pgadmin-hackers@arkaria.postgresql.org; Wed, 07 Jun 2017 12:46:02 +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_2) (envelope-from ) id 1dIaLa-0000yE-DP for pgadmin-hackers@postgresql.org; Wed, 07 Jun 2017 12:46:02 +0000 Received: from mail-it0-x234.google.com ([2607:f8b0:4001:c0b::234]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dIaLX-0007sy-Jj for pgadmin-hackers@postgresql.org; Wed, 07 Jun 2017 12:46:01 +0000 Received: by mail-it0-x234.google.com with SMTP id r63so6110600itc.1 for ; Wed, 07 Jun 2017 05:45:59 -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=VXz7nsZ4miZKh3s2BVmlnuHQF46R8245wtxpRVHoHB8=; b=vEldWZGZ9EBtUv0EVIpl+gllMWACKFXNbpdsQpeL0rUUyu2wZ02IDMeS+U0HvAfX3L C94ywuAuEfu2FfhL63hY3CbIJNdfLmmcOddx8Ptu+v6kqakLiaHJMUlXSKZrtRQODJbu Dt9xb9YC/PMy+l3fovNg8sViNT2G5+5ToU0SZJTGXSUmm1JAsDNnXlDHZGymF4V5VQVx kCaZeoV8f8Bqr6B6M1a3mkvlXT8UJJwhFerTNx4slVsHvWhNulysdUxHKFU1ylZz3vOE cJ+mSJnjv8s5r3FyzWo0190oDRFPIui8HACoZB8qe0WMDrsuX/xCF7sjxok84dBYZbVF EKOw== 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=VXz7nsZ4miZKh3s2BVmlnuHQF46R8245wtxpRVHoHB8=; b=HqiwT7tQqJCJYpnMBEKFathnJjgl5GFpfRWB9RBEKyinKooZwAamYB5RcZzA79EKJ9 18/PUxifvQsO42YTkgWeBY43gw5df6KR40df/JffnVE/YR279RkJyohNYAVT4uWu6532 15rhmpPX3ag3Ic+Hfsb3tUIlrT6yDlDTvyxAk75oQXWuPSdHmlFWaMf/de+N63oX+US6 e9DumiETc5axqQ1C/bpOYZe//SdiCB/mB1nMT12WgaqtfPV0wSWDj5nsSihT7654ve4L Wt/Mw3Absz1ei3f4AYvKMNfAsunnN8Z1Ontn/6To0L1l38DIAWlSYUFy1ZFwSJLBk+jm V6Cw== X-Gm-Message-State: AODbwcDc5HbqMPCJgMgL9ZAIQBfmDSww4XVIK9Vgvg/KS53MsgZAnTf8 gA6lUOngrMumZPr7LuTXhfolHFP1dSvE X-Received: by 10.36.163.69 with SMTP id p66mr2354120ite.85.1496839558412; Wed, 07 Jun 2017 05:45:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.174.147 with HTTP; Wed, 7 Jun 2017 05:45:57 -0700 (PDT) In-Reply-To: References: From: Dave Page Date: Wed, 7 Jun 2017 13:45:57 +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 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 -- Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers