Re: [pgadmin-hackers] [PATCH] Tables node (pgAdmin4)

2016-04-28 Thread Harshal Dhumal
-- 
*Harshal Dhumal*
*Software Engineer *



EenterpriseDB 

On Thu, Apr 28, 2016 at 2:22 PM, Dave Page  wrote:

>
>
> > On 27 Apr 2016, at 13:43, Thom Brown  wrote:
> >
> > On 27 April 2016 at 10:22, Harshal Dhumal
> >  wrote:
> >>
> >> Hi,
> >>
> >> PFA attached patches for table node and all table child nodes.
> >>
> >> This patch includes below nodes,
> >>
> >> 1) Table node  -- Initial patch by Murtuza,
> constraints compatibility by Harshal.
> >> 2) Column node   -- by Murtuza.
> >> 3) Index node  -- by Murtuza.
> >> 4) Trigger node-- by Murtuzz.
> >> 6) Rules node  -- by Surinder.
> >> 7) Constraints nodes:
> >>  i]  Index Constraint -- Initial patch by Harshal,
> Integration with table node by Murtuza.
> >>  ii] Foreign key-- Initial patch and
> Integration with table node by Harshal.
> >>  iii] Check constraint-- Initial patch and
> Integration with table node by Harshal.
> >>  iv] Exclusion constraint   -- Initial patch and
> Integration with table node by Harshal.
> >>
> >> Please apply patches in following order as all of them depends on each
> other.
> >>
> >> Order:  Table Node > Index constraint ---> remaining patches in any
> order.
> >
> > Nice work.  Here's some initial feedback from a very quick play around.
> >
> > On the Create table editor, in the Advance tab (which should probably
> > be labelled "Advanced"), the Like section should grey out the "With *"
> > values if no relation is selected in the drop-down box.
> >
> > The way primary keys are defined are kinda awkward.  It might be
> > useful to provide some kind of checkbox on the initial column list
> > that tells it which columns are involved in the primary key, then the
> > user could just select which ones they want.  If they want to refine
> > it, they could edit it in the Constraints > Primary Key section.
>
> If the design we did has been properly followed (I can't check right now),
> then that's exactly how it should be working. Harshal?
>

I can't comment on entire table node ui design as I haven't worked on it
except the constraints nodes.

In constraints nodes I can see that order of some properties in tabs is not
same as that of design (this can be easily changed by reordering schema
properties of constraints node).

And also currently there is no support to show two or more controls inline
in dialog and where in design for e.g In Unique key constraint under
columns tab the "Order" and "Null's order" are shown inline (there are many
of like this). So all controls are rendered on separate row which is not as
per design.


> Arun Kollan and I spent a lot of time redesigning the table dialogue to
> make it as quick and efficient to use as possible. There will likely be
> minor deviations from that design to ensure consistency with the way other
> parts of the app have turned out, but the basic principles should be there.
>
> >
> > I'm getting weird spacing in the SQL output.  Here's an example:
> >
> > CREATE UNLOGGED TABLE public.test
> > (
> >id integer COLLATE pg_catalog."de_DE.utf8" NOT NULL DEFAULT -1,
> >stuff text COLLATE pg_catalog."C.UTF-8" DEFAULT "hello",
> >CONSTRAINT pk PRIMARY KEY (id, stuff) WITH (FILLFACTOR=33) DEFERRABLE
> > )
> > WITH (
> >OIDS = TRUE,
> >FILLFACTOR = 88,
> >autovacuum_enabled = TRUE,
> >autovacuum_analyze_scale_factor = 0.33,
> >autovacuum_analyze_threshold = 30,
> >autovacuum_freeze_max_age = 333,
> >autovacuum_vacuum_cost_delay = 30,
> >autovacuum_vacuum_cost_limit = 3,
> >autovacuum_vacuum_scale_factor = 0.33,
> >autovacuum_vacuum_threshold = 33,
> >autovacuum_freeze_min_age = 330,
> >autovacuum_freeze_table_age = 33300
> > )
> > TABLESPACE pg_default;
> >
> > ALTER TABLE public.test
> >OWNER to thom;
> > GRANT ALL ON TABLE public.test TO thom;
> >
> >
> > COMMENT ON TABLE public.test
> >IS 'This is just a test table';
> >
> > COMMENT ON COLUMN public.test.id
> >IS 'the main ID';
> >
> > ALTER TABLE public.test
> >ALTER COLUMN id
> >SET (n_distinct='0.2');
> > COMMENT ON CONSTRAINT pk ON public.test
> >IS 'primary key test'
> >
> > Note there are 2 blank lines after the GRANT ALL ON TABLE line, and
> > none before the COMMENT ON CONSTRAINT line.
> >
> > This SQL fails because collations aren't allowed on integer columns,
> > and the DEFAULT value for the column named stuff doesn't quote it as a
> > string literal, so it's looking for a column called "hello".
> >
> > There's also no way to view the autovacuum options I defined other
> > than the SQL pane.
> >
> > Thom
> >
> >
> > --
> > Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> > To make changes 

[pgadmin-hackers][pgAdmin4][Patch]: Remove default extraclass from the SqlFieldControl

2016-04-28 Thread Surinder Kumar
Hi,

The *SqlFieldControl* is setting default height for textarea, which is not
needed.
It should expand as needed as similar in *SqlTabControl*.

Please find the attached patch, review it.

Thanks
Surinder Kumar


remove_default_height_in_SqlFieldControl.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers][pgAdmin4][Patch]: File Manager & Backform FileControl

2016-04-28 Thread Neel Patel
Hi Surinder,

Please find additional comments as below.

1.  In Windows OS, when we try to open the dialog with default preference
value then it gives error as below.

2016-04-28 13:07:44,716: ERROR  pgadmin:Exception on
/file_manager/filemanager/2530270/ [POST]
Traceback (most recent call last):
  File "C:\Projects\venv_python_2_7\Lib\site-packages\flask\app.py", line
1817, in wsgi_app
response = self.full_dispatch_request()
  File "C:\Projects\venv_python_2_7\Lib\site-packages\flask\app.py", line
1477, in full_dispatch_request
rv = self.handle_user_exception(e)
  File "C:\Projects\venv_python_2_7\Lib\site-packages\flask\app.py", line
1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
  File "C:\Projects\venv_python_2_7\Lib\site-packages\flask\app.py", line
1475, in full_dispatch_request
rv = self.dispatch_request()
  File "C:\Projects\venv_python_2_7\Lib\site-packages\flask\app.py", line
1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
  File "C:\Projects\venv_python_2_7\Lib\site-packages\flask_login.py", line
758, in decorated_view
return func(*args, **kwargs)
  File "C:\Projects\pgadmin4\web\pgadmin\misc\file_manager\__init__.py",
line 629, in file_manager
return getattr(myFilemanager, mode)(**kwargs)
  File "C:\Projects\pgadmin4\web\pgadmin\misc\file_manager\__init__.py",
line 421, in getfolder
filelist = self.list_filesystem(dir, path, trans_data, file_type)
  File "C:\Projects\pgadmin4\web\pgadmin\misc\file_manager\__init__.py",
line 331, in list_filesystem
for f in sorted(os.listdir(orig_path)):
WindowsError: [Error 161] The specified path is invalid: '//*.*'


2. Folder having write only permission should not allow to read the
directory. Same way read only permission folder should not allow to create
the folder. Currently it gives below error.

   PermissionError: [Errno 13] Permission denied:
'/home/neel/Projects/pgadmin4_file_manager/write_only_premission/'

3. In Windows OS, when we open the file manager dialog, no directories
listed though we have directories in the folder. Due to that we are not
able to
test all the functionality in windows. Once we fix this issue then we
test all the functionality in windows OS.

   We debug the issue and found that issue is with the json response which
includes the HTML tags.

4. In Windows OS, file manager dialog have issue with layout. We are
getting some margin at top before buttons.

5. When we give any special characters to folder name that it gives error
saying "Folder does not exist".
Same is applicable when we give dialog_type to create_file

6. In create_file mode, after giving the filename it should display the
name of the file to text control.

7. In create_file mode, when user gives the filename and click on the any
blank area of dialog then name is getting cleared.

8. When we upload the new file through file manager then it is not showing
in the list though we have selected "All files" options.

9. When we rename the folder in "Table mode" then font-family gets changed.
It is not happened in "Grid" mode.

10. When we try to download the file then it goes into loop and opens up
20-30 dialogs at the same time.

11. "Rename" button is enabled even though we have not selected the
files/folder to rename and when we click on the "Rename" button it gives
below
 error.

TypeError: orig_value is undefined
12. "Delete" button is enabled even though we have not selected the
files/folder to delete and when we click on the "Delete" button it gives
below error.
 TypeError: path is undefined

Do let us know if you have queries.

Thanks,
Neel Patel

On Wed, Apr 27, 2016 at 9:15 PM, Neel Patel 
wrote:

> Hi Surinder,
>
> I have applied the patch file and below are some observations.
>
>- When we create the new folder and hit the enter then we are getting
>the below error.
>
>   TypeError: argument of type 'NoneType' is not iterable
>
>- I have just added the new control in "Import" dialog and observed
>that new control is getting added in new tab called "General". I think it
>should not create the new "General" tab.
>- "Select" and "Cancel" buttons font is different then other dialogs.
>
>
> Thanks,
> Neel Patel
>
> On Wed, Apr 27, 2016 at 6:18 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> The patch is for *File Manager and Backform FileControl*.
>>
>> *File Manager:* It allows user to store their files at one place. The
>> user can set path to this directory in preferences which file manger will
>> use.
>>
>> It will be used by various modules of pgAdmin4 such as
>> *import data from file, query tool, backup & recovery tool* so on.. It
>> allows user to perform various operations such as:
>>
>>- File deletion
>>- File upload
>>- Create new directory
>>- File rename
>>- File download and
>>- List files & folders in list 

Re: [pgadmin-hackers] [PATCH] Tables node (pgAdmin4)

2016-04-28 Thread Dave Page


> On 27 Apr 2016, at 13:43, Thom Brown  wrote:
> 
> On 27 April 2016 at 10:22, Harshal Dhumal
>  wrote:
>> 
>> Hi,
>> 
>> PFA attached patches for table node and all table child nodes.
>> 
>> This patch includes below nodes,
>> 
>> 1) Table node  -- Initial patch by Murtuza, 
>> constraints compatibility by Harshal.
>> 2) Column node   -- by Murtuza.
>> 3) Index node  -- by Murtuza.
>> 4) Trigger node-- by Murtuzz.
>> 6) Rules node  -- by Surinder.
>> 7) Constraints nodes:
>>  i]  Index Constraint -- Initial patch by Harshal, 
>> Integration with table node by Murtuza.
>>  ii] Foreign key-- Initial patch and Integration 
>> with table node by Harshal.
>>  iii] Check constraint-- Initial patch and Integration 
>> with table node by Harshal.
>>  iv] Exclusion constraint   -- Initial patch and Integration 
>> with table node by Harshal.
>> 
>> Please apply patches in following order as all of them depends on each other.
>> 
>> Order:  Table Node > Index constraint ---> remaining patches in any 
>> order.
> 
> Nice work.  Here's some initial feedback from a very quick play around.
> 
> On the Create table editor, in the Advance tab (which should probably
> be labelled "Advanced"), the Like section should grey out the "With *"
> values if no relation is selected in the drop-down box.
> 
> The way primary keys are defined are kinda awkward.  It might be
> useful to provide some kind of checkbox on the initial column list
> that tells it which columns are involved in the primary key, then the
> user could just select which ones they want.  If they want to refine
> it, they could edit it in the Constraints > Primary Key section.

If the design we did has been properly followed (I can't check right now), then 
that's exactly how it should be working. Harshal?

Arun Kollan and I spent a lot of time redesigning the table dialogue to make it 
as quick and efficient to use as possible. There will likely be minor 
deviations from that design to ensure consistency with the way other parts of 
the app have turned out, but the basic principles should be there.

> 
> I'm getting weird spacing in the SQL output.  Here's an example:
> 
> CREATE UNLOGGED TABLE public.test
> (
>id integer COLLATE pg_catalog."de_DE.utf8" NOT NULL DEFAULT -1,
>stuff text COLLATE pg_catalog."C.UTF-8" DEFAULT "hello",
>CONSTRAINT pk PRIMARY KEY (id, stuff) WITH (FILLFACTOR=33) DEFERRABLE
> )
> WITH (
>OIDS = TRUE,
>FILLFACTOR = 88,
>autovacuum_enabled = TRUE,
>autovacuum_analyze_scale_factor = 0.33,
>autovacuum_analyze_threshold = 30,
>autovacuum_freeze_max_age = 333,
>autovacuum_vacuum_cost_delay = 30,
>autovacuum_vacuum_cost_limit = 3,
>autovacuum_vacuum_scale_factor = 0.33,
>autovacuum_vacuum_threshold = 33,
>autovacuum_freeze_min_age = 330,
>autovacuum_freeze_table_age = 33300
> )
> TABLESPACE pg_default;
> 
> ALTER TABLE public.test
>OWNER to thom;
> GRANT ALL ON TABLE public.test TO thom;
> 
> 
> COMMENT ON TABLE public.test
>IS 'This is just a test table';
> 
> COMMENT ON COLUMN public.test.id
>IS 'the main ID';
> 
> ALTER TABLE public.test
>ALTER COLUMN id
>SET (n_distinct='0.2');
> COMMENT ON CONSTRAINT pk ON public.test
>IS 'primary key test'
> 
> Note there are 2 blank lines after the GRANT ALL ON TABLE line, and
> none before the COMMENT ON CONSTRAINT line.
> 
> This SQL fails because collations aren't allowed on integer columns,
> and the DEFAULT value for the column named stuff doesn't quote it as a
> string literal, so it's looking for a column called "hello".
> 
> There's also no way to view the autovacuum options I defined other
> than the SQL pane.
> 
> Thom
> 
> 
> -- 
> 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


Re: [pgadmin-hackers] [PATCH] Tables node (pgAdmin4)

2016-04-28 Thread Thom Brown
On 27 April 2016 at 14:34, Thom Brown  wrote:
> On 27 April 2016 at 13:43, Thom Brown  wrote:
>> On 27 April 2016 at 10:22, Harshal Dhumal
>>  wrote:
>>>
>>> Hi,
>>>
>>> PFA attached patches for table node and all table child nodes.
>>>
>>> This patch includes below nodes,
>>>
>>> 1) Table node  -- Initial patch by Murtuza, 
>>> constraints compatibility by Harshal.
>>> 2) Column node   -- by Murtuza.
>>> 3) Index node  -- by Murtuza.
>>> 4) Trigger node-- by Murtuzz.
>>> 6) Rules node  -- by Surinder.
>>> 7) Constraints nodes:
>>>   i]  Index Constraint -- Initial patch by Harshal, 
>>> Integration with table node by Murtuza.
>>>   ii] Foreign key-- Initial patch and 
>>> Integration with table node by Harshal.
>>>   iii] Check constraint-- Initial patch and Integration 
>>> with table node by Harshal.
>>>   iv] Exclusion constraint   -- Initial patch and Integration 
>>> with table node by Harshal.
>>>
>>> Please apply patches in following order as all of them depends on each 
>>> other.
>>>
>>> Order:  Table Node > Index constraint ---> remaining patches in any 
>>> order.
>>>
>>>
>>
>> Nice work.  Here's some initial feedback from a very quick play around.
>>
>> On the Create table editor, in the Advance tab (which should probably
>> be labelled "Advanced"), the Like section should grey out the "With *"
>> values if no relation is selected in the drop-down box.
>>
>> The way primary keys are defined are kinda awkward.  It might be
>> useful to provide some kind of checkbox on the initial column list
>> that tells it which columns are involved in the primary key, then the
>> user could just select which ones they want.  If they want to refine
>> it, they could edit it in the Constraints > Primary Key section.
>>
>> I'm getting weird spacing in the SQL output.  Here's an example:
>>
>> CREATE UNLOGGED TABLE public.test
>> (
>> id integer COLLATE pg_catalog."de_DE.utf8" NOT NULL DEFAULT -1,
>> stuff text COLLATE pg_catalog."C.UTF-8" DEFAULT "hello",
>> CONSTRAINT pk PRIMARY KEY (id, stuff) WITH (FILLFACTOR=33) DEFERRABLE
>> )
>> WITH (
>> OIDS = TRUE,
>> FILLFACTOR = 88,
>> autovacuum_enabled = TRUE,
>> autovacuum_analyze_scale_factor = 0.33,
>> autovacuum_analyze_threshold = 30,
>> autovacuum_freeze_max_age = 333,
>> autovacuum_vacuum_cost_delay = 30,
>> autovacuum_vacuum_cost_limit = 3,
>> autovacuum_vacuum_scale_factor = 0.33,
>> autovacuum_vacuum_threshold = 33,
>> autovacuum_freeze_min_age = 330,
>> autovacuum_freeze_table_age = 33300
>> )
>> TABLESPACE pg_default;
>>
>> ALTER TABLE public.test
>> OWNER to thom;
>> GRANT ALL ON TABLE public.test TO thom;
>>
>>
>> COMMENT ON TABLE public.test
>> IS 'This is just a test table';
>>
>> COMMENT ON COLUMN public.test.id
>> IS 'the main ID';
>>
>> ALTER TABLE public.test
>> ALTER COLUMN id
>> SET (n_distinct='0.2');
>> COMMENT ON CONSTRAINT pk ON public.test
>> IS 'primary key test'
>>
>> Note there are 2 blank lines after the GRANT ALL ON TABLE line, and
>> none before the COMMENT ON CONSTRAINT line.
>>
>> This SQL fails because collations aren't allowed on integer columns,
>> and the DEFAULT value for the column named stuff doesn't quote it as a
>> string literal, so it's looking for a column called "hello".
>>
>> There's also no way to view the autovacuum options I defined other
>> than the SQL pane.
>
> A couple more:
>
> If I go to create a new table, give it a name, select a table to
> inherit from, and then do nothing else, I get an error:
>
> ERROR: syntax error at or near "INHERITS"
> LINE 2: INHERITS (test)
> ^
>
> This is because no column list was provided, and in this case, an
> empty one would be needed.  So instead of:
>
> CREATE TABLE public.test2
> (
> )
> INHERITS (test)
> WITH (
> OIDS = FALSE
> )
> TABLESPACE pg_default;
>
> It should be:
>
> CREATE TABLE public.test2
> INHERITS (test)
> WITH (
> OIDS = FALSE
> )
> TABLESPACE pg_default;

Correction, these should be the other way around.

Thom


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] PATCH: Added Note Backform control (pgAdmin4).

2016-04-28 Thread Ashesh Vashi
Checked-in with some more twicks (resolved a typo in my modified patch).

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



*http://www.linkedin.com/in/asheshvashi*


On Thu, Apr 28, 2016 at 11:31 AM, Ashesh Vashi <
ashesh.va...@enterprisedb.com> wrote:

> I've update the patch a little bit.
> Please test it at your end.
>
> --
>
> Thanks & Regards,
>
> Ashesh Vashi
> EnterpriseDB INDIA: Enterprise PostgreSQL Company
> 
>
>
> *http://www.linkedin.com/in/asheshvashi*
> 
>
> On Wed, Apr 27, 2016 at 6:19 PM, Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> This patch will allow us to provide annotate(s) on Form/Dialog.
>>
>> Use in schema:
>>
>> id: 'server_note', label: '{{ _('Note') }}',
>> text: '{{ _('The backup format will be PLAIN') }}',
>> type: 'note'
>>
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: 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
>>
>>
>


[pgadmin-hackers] pgAdmin 4 commit: Added a new control for rendering the notes to be use

2016-04-28 Thread Ashesh Vashi
Added a new control for rendering the notes to be used by different
tools/utitilities dialog.

Modified a little bit by Ashesh Vashi.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=dac514a4ae340e4042fa5a1f57540afad8bb8d97
Author: Murtuza Zabuawala 

Modified Files
--
web/pgadmin/browser/templates/browser/js/messages.js |  3 ++-
web/pgadmin/static/css/overrides.css | 18 ++
web/pgadmin/static/js/backform.pgadmin.js| 18 +-
3 files changed, 37 insertions(+), 2 deletions(-)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] PATCH: Added Note Backform control (pgAdmin4).

2016-04-28 Thread Ashesh Vashi
I've update the patch a little bit.
Please test it at your end.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



*http://www.linkedin.com/in/asheshvashi*


On Wed, Apr 27, 2016 at 6:19 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> This patch will allow us to provide annotate(s) on Form/Dialog.
>
> Use in schema:
>
> id: 'server_note', label: '{{ _('Note') }}',
> text: '{{ _('The backup format will be PLAIN') }}',
> type: 'note'
>
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: 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
>
>


note_conrol_v2.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers