Re: [patch] Refactor: clipboard, translations, jasmine

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Atira Odhner <aodhner(at)pivotal(dot)io>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [patch] Refactor: clipboard, translations, jasmine
Date: 2017-03-10 10:30:48
Message-ID: CA+OCxoy5XvPw05XCGjC-rU_PM+JVhg9ZCrK8Ta=qA83paCtzuQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi

On Thu, Mar 9, 2017 at 9:56 PM, Atira Odhner <aodhner(at)pivotal(dot)io> wrote:
> Hi Dave,
>
> We've split these changes up into separate patches, added docs, pulled
> jasmine out of the packaged app, and enabled running from the commandline:
>
> Add jasmine
> - it runs with karma from the commandline
> - it is outside of the /web folder so that tests and test dependencies
> are excluded from the packaged app.

Actually that's not an issue - the package builds will (in most cases
now) remove the test directories, and will only include files that are
in GIT anyway. Please move everything under web/regression as right
now it's cluttering up the root directory which doesn't make sense as
it only applies to the web/ code.

>
> Enable refactoring javascript with translations:
> - Create a translations.js and translate.js which uses flask to pull in
> translations, but
> lets us have the flask template rendering confined to that one
> file,
> enabling us to test javascript files that rely on translations

OK.

> Refactor copying text to clipboard into a separate file (this
> demonstrates use of translate.js)

I would have applied that, except that it relied on the tests :-(

> remove some dead code from sqleditor

Thanks, I've applied that.

> Change quotes in sqleditor to make it valid js independent of flask (it
> makes our IDE happy)
>
>> - The changes to the translation mechanism need discussion. How will
>> it work? What do developers have to do differently? When will the
>> changes it allows be implemented?
>
>
> Instead of using flask to render translations into javascript, developers
> will need to require "translate" and use it in much the same way as the
> flask _ method. So, for example, translate("My name is %(name)s.", {name:
> "Tira"}) would replace {{ _("My name is %(name)s.", {name: "Tira"}) }}

OK.

> We would like to start on these changes right away! We refactored the
> clipboard functionality out of sqleditor.js and used this translate
> functionality. The resulting file is now testable javascript.

If you can update the location of the files per my comment above, I
can get it committed. Note that the update to libraries.txt is no
longer needed, as we will neither include the additional JS modules in
the GIT repo or packages.

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

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

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2017-03-10 12:32:45 pgAdmin website commit: Release 1.3.
Previous Message Dave Page 2017-03-10 10:27:21 pgAdmin 4 commit: Remove some dead code.