Re: [pgAdmin][RM-6133]: [React] Port schema diff to React

From: Aditya Toshniwal <aditya(dot)toshniwal(at)enterprisedb(dot)com>
To: Nikhil Mohite <nikhil(dot)mohite(at)enterprisedb(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [pgAdmin][RM-6133]: [React] Port schema diff to React
Date: 2022-09-05 12:09:45
Message-ID: CAM9w-_nRG2o+51SvLeuR3az8YwDKV8pY74OdFpu0Je5XAJ9t2w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi Nikhil,

Few comments:
1. remove commented code

// it('SchemaDiff Module', () => {
+ // // let baseUrl = url_for('schema_diff.initialize');
+ // // networkMock.onGet(url_for('debugger.start_listener',
{'trans_id': params.transId})).reply(200,
{'success':1,'errormsg':'','info':'','result':null,'data':{'status':true,'result':2}});
+ // // console.log('URL:: ', url_for('schema_diff.initialize', {}));
+ // networkMock.onGet(url_for('schema_diff.initialize', {})).reply(200,
+ // {
+ // 'success':1,

2. Do not use jquery to bind events.

+ if(window.opener) {
+ $(window).on('unload', function(ev) {

3. Functions like these which do not use state setters can be moved
outside the component for better readability/performance.

+ function generateFinalScript(script_array, scriptHeader, script_body) {
+ _.each(Object.keys(script_array).reverse(), function (s) {
+ if (script_array[s].length > 0) {

4. Use gettext

+export const FILTER_NAME = {
+ IDENTICAL : 'Identical',
+ DIFFERENT :'Different',

5. This is not used anywhere. You can remove it:

def script():
"""render the required javascript"""
return Response(
- response=render_template("schema_diff/js/schema_diff.js", _=gettext),
+ response=render_templ

On Mon, Sep 5, 2022 at 4:09 PM Nikhil Mohite <nikhil(dot)mohite(at)enterprisedb(dot)com>
wrote:

> Hi Hackers,
>
> Please find attached the patch for RM-6133
> <https://redmine.postgresql.org/issues/6133> : [React] Port schema diff
> to React.
> This patch also included the changes for removing SlickGrid from pgAdmin.
>
> --
> *Thanks & Regards,*
> *Nikhil Mohite*
> *Senior Software Engineer.*
> *EDB Postgres* <https://www.enterprisedb.com/>
> *Mob.No: +91-7798364578.*
>

--
Thanks,
Aditya Toshniwal
pgAdmin Hacker | Software Architect | *edbpostgres.com*
<http://edbpostgres.com>
"Don't Complain about Heat, Plant a TREE"

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Akshay Joshi 2022-09-05 13:03:58 Re: [pgAdmin][RM-6133]: [React] Port schema diff to React
Previous Message Nikhil Mohite 2022-09-05 10:04:22 [pgAdmin][RM-6133]: [React] Port schema diff to React