pgAdmin 4 commit: Fixed calendar opening issue on the exception tab ins

2020-04-06 Thread Akshay Joshi
Fixed calendar opening issue on the exception tab inside the schedules tab of 
pgAgent. Fixes #4512

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=4f71dae598e5b26fed32193618606a3f3563c670
Author: Aditya Toshniwal 

Modified Files
--
docs/en_US/release_notes_4_21.rst   | 1 +
web/pgadmin/static/js/backgrid.pgadmin.js   | 4 
web/pgadmin/static/scss/_pgadmin.style.scss | 4 ++--
3 files changed, 7 insertions(+), 2 deletions(-)



pgAdmin 4 commit: Fixed tab key navigation issue for parameters in tabl

2020-04-06 Thread Akshay Joshi
Fixed tab key navigation issue for parameters in table dialog. Fixes #5275

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=8ceeb392683ab6c3c845a8572e47377813325b84
Author: Pradip Parkale 

Modified Files
--
docs/en_US/release_notes_4_21.rst  |  1 +
.../servers/databases/schemas/static/js/schema.js  | 18 +-
web/pgadmin/browser/static/js/node.js  | 11 +++
3 files changed, 29 insertions(+), 1 deletion(-)



Re: [pgAdmin][RM4512] PgAgent Jobs: The Calendar is not opening properly on the Exception tab inside schedules tab

2020-04-06 Thread Akshay Joshi
Thanks, patch applied.

On Fri, Apr 3, 2020 at 6:02 PM Aditya Toshniwal <
aditya.toshni...@enterprisedb.com> wrote:

> Hi Hackers,
>
> Attached is a small patch fixes the Calendar opening issue on the
> Exception tab inside the schedules tab.
> This is the only solution I found. The datetimepicker package does not
> provide any way to place the DOM in the body. The solution is will display
> the picker completely but you need to scroll a bit.
>
> Please review.
>
> --
> Thanks and Regards,
> Aditya Toshniwal
> pgAdmin Hacker | Sr. Software Engineer | EnterpriseDB India | Pune
> "Don't Complain about Heat, Plant a TREE"
>


-- 
*Thanks & Regards*
*Akshay Joshi*

*Sr. Software Architect*
*EnterpriseDB Software India Private Limited*
*Mobile: +91 976-788-8246*


Re: [PgAdmin][RM5275] Accessibilty :Tab navigation is not working for table>> parameters.

2020-04-06 Thread Akshay Joshi
Thanks, patch applied.

On Fri, Apr 3, 2020 at 9:15 PM Pradip Parkale <
pradip.park...@enterprisedb.com> wrote:

> Hi Hackers,
>
> Please find an attached patch for key navigation in Table >> Parameter. I
> have added a key down event to handle the key navigation.
>
>
> --
> Thanks & Regards,
> Pradip Parkale
> QMG, EnterpriseDB Corporation
>


-- 
*Thanks & Regards*
*Akshay Joshi*

*Sr. Software Architect*
*EnterpriseDB Software India Private Limited*
*Mobile: +91 976-788-8246*


[pgAdmin][RM4206]: Grant wizard does not close when we press ESC key

2020-04-06 Thread Pradip Parkale
Hi Hackers,

Please find the attached patch to close the Grant Wizard when the ESC key
is pressed.

-- 
Thanks & Regards,
Pradip Parkale
QMG, EnterpriseDB Corporation


RM4206.patch
Description: Binary data


Re: [pgAdmin][RM2172] Search Objects Functionality

2020-04-06 Thread Khushboo Vashi
Hi Aditya,

Please resend the rebased patch, it does not apply.

Thanks,
Khushboo

On Fri, Apr 3, 2020 at 2:44 PM Aditya Toshniwal <
aditya.toshni...@enterprisedb.com> wrote:

> Hi Hackers,
>
> Attached is the updated patch.
> With this,
> 1) I've displayed the rows count detail at the bottom of the dialog. This
> will help in both cases, when there are rows and when there are none.
> 2) As discussed, a user can now apply object types dropdown filter on
> already loaded data.
> 3) I've not made changes for the multilevel partition icon because it
> would be too much to do for an icon. We're already showing the type name in
> the grid. Adding extra SQL joins and making the query slower for the icon
> is not desirable.
> 4) Fixed some gettext issues as mentioned in the review.
>
> Please review.
>
>
> On Thu, Apr 2, 2020 at 5:54 PM Aditya Toshniwal <
> aditya.toshni...@enterprisedb.com> wrote:
>
>> Hi Khushboo,
>>
>> On Thu, Apr 2, 2020 at 4:49 PM Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>>
>>>
>>> On Thu, Apr 2, 2020 at 4:30 PM Aditya Toshniwal <
>>> aditya.toshni...@enterprisedb.com> wrote:
>>>
 Hi Khushboo,

 Thank you for reviewing.


 On Thu, Apr 2, 2020 at 4:09 PM Khushboo Vashi <
 khushboo.va...@enterprisedb.com> wrote:

> Hi Aditya,
>
> Review comments:
>
> *UI:*
>
> 1. When no object is found, the default message should be given,
> currently no message displayed.
> 2. Can we have a tooltip on the row "Double click to locate the object
> in the browser" ?
> 3. Full stop is missing in the message column objects are disabled in
> the browser. You can enable them in the preferences dialog ( :D )
> and also, we should start the statement with the capital letter.
> 4. If possible, use the multilevel partition table symbol same as the
> browser tree.
> 5. gettext is missing from the search grid header.
>
 I'll fix all above.

> 6. Suggestion: The search button should be at the end (after type
> combobox).  The current position of the controls suggest that search for
> the objects and then filter it out but that's not the case.
>
 I've actually kept the most frequently used controls together. The
 probability of using the types filter is less and a user would generally go
 for full search. This is how even we generally do. We search first and then
 apply filter if required

>>> Right, so type based search on slickgrid data would be useful.
>>>
>> 👍
>>
>>> After changing the type, we have to click on the search button.
> In the current positioning, we should fetch all the records from the
> backend and then filter those out depending on the type at the client side
> only, so that will reduce the server requests and slickgrid is efficient 
> it
> do so.
>
 I'll look into this. My only concern is the data may be outdated, but I
 agree to filter in slickgrid on type change. The user can hit search again
 if required.

>>>
> *Backend:*
>
> 1. We do have the list of blueprint, so we can use that list instead
> of taking the hard coe list in the init method of SearchObjectsHelper
> class.
>
 The reason is, we do not support all objects for search objects. Only
 objects under a database are supported. The probability of node type change
 is very less.

>>> True but we can maintain the skip list (which would be less) and we do
>>> have bluprint start with NODE, so it will be easier to fetch.
>>>
>> I would prefer the "in" list rather than "skip" list. Each time a new
>> node is added to pgAdmin, we will have to update the skip list in search
>> objects. With the "in" list, search objects has better control.
>>
>>> 2. While searching the object, we create an object of SearchObjectsHelper
> on each request. We can create it once while initializing and utilize it 
> on
> every search.
>
 The intention is to keep SearchObjectsHelper stateless. The object is
 created based on the request data and it is easier to maintain
 independently.

>
> Note: The functionality is working fine.
>
 Great. Thanks.

>
> Thanks,
> Khushboo
>
>
>
>
>
> On Thu, Apr 2, 2020 at 9:31 AM Khushboo Vashi <
> khushboo.va...@enterprisedb.com> wrote:
>
>>
>>
>> On Wed, Apr 1, 2020 at 6:00 PM Akshay Joshi <
>> akshay.jo...@enterprisedb.com> wrote:
>>
>>> Hi Khushboo,
>>>
>>> Can you please review it.
>>>
>> I am on it.
>>
>>>
>>> On Mon, Mar 30, 2020 at 2:39 PM Aditya Toshniwal <
>>> aditya.toshni...@enterprisedb.com> wrote:
>>>
 Hi Hackers,

 Attached is the patch to implement search objects functionality in
 pgadmin.
 The feature will allow a user to search for any object in a
 database.
 Highligh

Re: [pgAdmin][RM4206]: Grant wizard does not close when we press ESC key

2020-04-06 Thread Akshay Joshi
Hi Pradip

Patch not working, please check one more time.

On Mon, Apr 6, 2020 at 2:20 PM Pradip Parkale <
pradip.park...@enterprisedb.com> wrote:

> Hi Hackers,
>
> Please find the attached patch to close the Grant Wizard when the ESC key
> is pressed.
>
> --
> Thanks & Regards,
> Pradip Parkale
> QMG, EnterpriseDB Corporation
>


-- 
*Thanks & Regards*
*Akshay Joshi*

*Sr. Software Architect*
*EnterpriseDB Software India Private Limited*
*Mobile: +91 976-788-8246*


pgAdmin 4 commit: Added LDAP authentication support. Fixes #2186

2020-04-06 Thread Akshay Joshi
Added LDAP authentication support. Fixes #2186

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=f77aa3284f93a4ea07ea5df8e12fcb60a7248142
Author: Khushboo Vashi 

Modified Files
--
docs/en_US/release_notes_4_21.rst  |   1 +
requirements.txt   |   1 +
web/config.py  |  59 
web/migrations/versions/7fedf8531802_.py   |  51 
web/pgAdmin4.py|  12 +
web/pgadmin/__init__.py|   3 +-
web/pgadmin/authenticate/__init__.py   | 156 ++
web/pgadmin/authenticate/internal.py   |  98 +++
web/pgadmin/authenticate/ldap.py   | 186 
web/pgadmin/authenticate/registry.py   |  65 +
web/pgadmin/browser/__init__.py|  92 --
web/pgadmin/browser/templates/browser/index.html   |   2 +
.../templates/browser/macros/gravatar_icon.macro   |   2 +-
web/pgadmin/browser/tests/test_change_password.py  |   1 +
web/pgadmin/browser/tests/test_ldap_login.py   |  89 ++
.../browser/tests/test_ldap_with_mocking.py|  84 ++
web/pgadmin/model/__init__.py  |   6 +-
web/pgadmin/templates/security/fields.html |  11 +
web/pgadmin/templates/security/login_user.html |   4 +-
web/pgadmin/templates/security/panel.html  |   2 +-
web/pgadmin/tools/user_management/__init__.py  |  99 +--
.../user_management/static/js/user_management.js   | 317 ++---
.../templates/user_management/js/current_user.js   |   3 +-
.../python_test_utils/csrf_test_client.py  |   4 +-
web/regression/runtests.py |   7 +
web/regression/test_config.json.in |  43 +++
26 files changed, 1238 insertions(+), 160 deletions(-)



Re: [pgAdmin4][Patch] - RM 2186 - Support external authentication sources [LDAP]

2020-04-06 Thread Akshay Joshi
Thanks, patch applied.

On Fri, Apr 3, 2020 at 2:37 PM Khushboo Vashi <
khushboo.va...@enterprisedb.com> wrote:

> Hi,
>
> Please find the attached updated patch.
>
> On Fri, Apr 3, 2020 at 1:50 PM Akshay Joshi 
> wrote:
>
>> Hi Khushboo
>>
>> Some more review comments:
>>
>>- Fix one small PEP8 issue.
>>
>> Fixed.
>
>>
>>- If ipAddress or Port is not set in the configuration file then
>>browser showing the following data, it should be shown proper error 
>> message
>>on the login page
>>   - {"success":0,"errormsg":"Port could not be cast to integer value
>>   as ''","info":"","result":null,"data":null}
>>
>> Fixed.
>
>>
>>- Disable the Username field in the User Management dialog if the
>>authentication source is set to internal.
>>
>> Done.
>
>>
>>- API Test cases are failing if LDAP related settings are not
>>provided in the test_config.json file. If the configuration is not 
>> provided
>>then LDAP tests should be skipped.
>>
>> Fixed.
>
>> @Dave, I have tested and done the code review. Can you please do it once
>> as well, whenever Khushboo will fix and send the updated patch?
>>
>> Thanks,
> Khushboo
>
>>
>> On Thu, Apr 2, 2020 at 7:00 PM Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>> Hi Akshay,
>>>
>>> Please find the attached updated patch.
>>>
>>> On Thu, Apr 2, 2020 at 4:55 PM Akshay Joshi <
>>> akshay.jo...@enterprisedb.com> wrote:
>>>
 Hi Khushboo

 Following are the initial review comments (GUI):

 *Desktop Mode: *

- KeyError: '_auth_source_manager_obj' in desktop mode. (*Note*
error occurs when the patch has applied and server mode is False.)

 Fixed.
>>>
 *Server Mode:*

 AUTHENTICATION_SOURCES = ['internal']


- Try to add a new user with the same email address, it throws a
unique key constraint error. Validation was there previously before 
 saving
it.

 Fixed.
>>>
 AUTHENTICATION_SOURCES = ['internal', 'ldap']

- Try to add a new user with the same email address, it throws
unique key constraint error which should not it may possible that the 
 user
has the same email address for internal and ldap.

 If the source is internal, it will not allow but with ldap, we can add
>>> the user with the same email id.
>>>
 AUTHENTICATION_SOURCES = ['ldap']

- If ipAddress or Port is not set in the configuration file then
browser showing the following data, it should be shown proper error 
 message
on the login page
   - {"success":0,"errormsg":"Port could not be cast to integer
   value as ''","info":"","result":null,"data":null}

 Done
>>>

- If IP address and port is provided but it is wrong, it shows the
following error, can we make a generic error message? Also clicking on 
 the
Close button on that error message is not working.
[image: Screenshot 2020-04-02 at 4.23.55 PM.png]

 I will look into the close button issue as it is an existing issue.
>>>

-
- IP address and port of LDAP server are correct, give wrong user
name and password, it shows error "Error binding to the LDAP Server: 
 None".
Please correct the appropriate error message.

 Fixed.
>>>

- All the configuration parameter is correct and tries to log in on
LDAP server using username (*not email address*) and password got 
 following
error:

 current_user.email.split('@')[0] if config.SERVER_MODE is True
 AttributeError: 'NoneType' object has no attribute 'split'.

 Fixed.
>>>
 Not able to test due to the above error. Please fix and resend the
 patch.

>>>
>>> Thanks,
>>> Khushboo
>>>
>>> Thanks,
>>> Khushboo
>>>

 On Thu, Apr 2, 2020 at 2:06 PM Khushboo Vashi <
 khushboo.va...@enterprisedb.com> wrote:

> Hi,
>
> Resending the patch.
> Missed the requirements.txt file in the previous patch.
>
> Thanks,
> Khushboo
>
> On Wed, Apr 1, 2020 at 5:38 PM Khushboo Vashi <
> khushboo.va...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Please find the attached updated patch which includes the review
>> comments given in the review meeting:
>>
>> 1. Do not store password for ldap user in sqlite database
>> 2. Forgot Password : Give error to ldap users
>> 3. User Management dialog changes
>> 4. Authentication source display besides username / email after login
>>
>> Thanks,
>> Khushboo
>>
>>
>> On Tue, Mar 24, 2020 at 3:20 PM Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>> Please disregard my previous patch, attached the updated patch. :)
>>>
>>>
>>> On Tue, Mar 24, 2020 at 10:32 AM Khushboo Vashi <
>>> khushboo.va...@enterprisedb.com> wrote:
>>>
 Plea

Project server upgrades

2020-04-06 Thread Dave Page
The webserver and developer servers for the pgAdmin project are going to
have OS upgrades this afternoon. There maybe some downtime as a result.

Regards, Dave.

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

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


[pgAdmin][RM3988] Cursor disappears in Query Editor

2020-04-06 Thread Aditya Toshniwal
Hi Hackers,

Attached is a small patch to fix a cursor issue in the query editor.
The cursor disappears for some of the characters when zoomed out.

Please review.

-- 
Thanks and Regards,
Aditya Toshniwal
pgAdmin Hacker | Sr. Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"


RM3988.patch
Description: Binary data


pgAdmin 4 commit: Added search object functionality. Fixes #2172

2020-04-06 Thread Akshay Joshi
Added search object functionality. Fixes #2172

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=e1f990190eb626678067a30289685fd47231f86c
Author: Aditya Toshniwal 

Modified Files
--
docs/en_US/getting_started.rst |3 +
docs/en_US/images/search_objects.png   |  Bin 0 -> 188209 bytes
docs/en_US/images/toolbar.png  |  Bin 38057 -> 42931 bytes
docs/en_US/release_notes_4_21.rst  |1 +
docs/en_US/search_objects.rst  |   34 +
docs/en_US/toolbar.rst |4 +-
.../browser/register_browser_preferences.py|   15 +
.../databases/extensions/static/js/extension.js|2 +-
.../templates/packages/ppas/12_plus/nodes.sql  |   11 +
.../constraints/index_constraint/__init__.py   |4 +-
.../schemas/tables/partitions/__init__.py  |7 +-
.../partitions/tests/test_backend_supported.py |   10 +-
.../templates/catalog/pg/macros/catalogs.sql   |   18 +
.../templates/catalog/ppas/macros/catalogs.sql |   21 +-
.../server_groups/servers/roles/static/js/role.js  |1 +
web/pgadmin/browser/static/js/collection.js|   15 +-
web/pgadmin/browser/static/js/keyboard.js  |   11 +
web/pgadmin/browser/static/js/node.js  |   25 +-
web/pgadmin/browser/static/js/toolbar.js   |   12 +
web/pgadmin/browser/templates/browser/index.html   |2 +-
web/pgadmin/static/bundle/slickgrid.js |2 +-
web/pgadmin/static/css/style.css   |3 +-
web/pgadmin/static/js/alertify.pgadmin.defaults.js |3 +-
web/pgadmin/static/js/alertify/dialog.js   |   33 +
web/pgadmin/static/js/alertify/dialog_factory.js   |   13 +
web/pgadmin/static/js/alertify/dialog_wrapper.js   |6 +-
.../js/slickgrid/plugins/slick.autocolumnsize.js   |4 +-
web/pgadmin/static/js/tree/tree.js |  132 ++-
web/pgadmin/static/js/utils.js |3 +-
web/pgadmin/static/scss/_alert.scss|   17 +-
web/pgadmin/static/scss/_webcabin.pgadmin.scss |2 +-
web/pgadmin/tools/search_objects/__init__.py   |   87 ++
.../search_objects/static/js/search_objects.js |   90 ++
.../static/js/search_objects_dialog.js |   40 +
.../static/js/search_objects_dialog_wrapper.js |  649 +++
.../static/scss/_search_objects.scss   |  122 ++
.../search_objects/sql/pg/10_plus/search.sql   |  435 +++
.../search_objects/sql/pg/11_plus/search.sql   |  452 
.../search_objects/sql/pg/default/search.sql   |  367 ++
.../search_objects/sql/ppas/10_plus/search.sql |  493 
.../search_objects/sql/ppas/12_plus/search.sql |  516 +
.../search_objects/sql/ppas/default/search.sql |  437 +++
web/pgadmin/tools/search_objects/tests/__init__.py |0
.../tools/search_objects/tests/test_api_search.py  |   75 ++
.../tools/search_objects/tests/test_api_types.py   |   47 +
.../tests/test_search_objects_helper.py|  117 ++
web/pgadmin/tools/search_objects/utils.py  |  131 +++
.../tools/sqleditor/static/css/sqleditor.css   |2 +-
web/regression/javascript/fake_endpoints.js|2 +
.../search_objects/search_objects_dialog_spec.js   |  155 +++
.../search_objects_dialog_wrapper_spec.js  |  545 +
web/regression/javascript/tree/tree_fake.js|3 +
web/regression/javascript/tree/tree_spec.js|   98 +-
web/webpack.config.js  |3 +-
web/webpack.shim.js|2 +
web/webpack.test.config.js |1 +
web/yarn.lock  | 1223 +---
57 files changed, 5990 insertions(+), 516 deletions(-)



Re: [pgAdmin][RM2172] Search Objects Functionality

2020-04-06 Thread Akshay Joshi
Thanks, patch applied. Fixed some minor issues.


On Mon, Apr 6, 2020 at 3:52 PM Aditya Toshniwal <
aditya.toshni...@enterprisedb.com> wrote:

> Hi Hackers,
>
> Please find the attached rebased patch.
>
> On Mon, Apr 6, 2020 at 3:22 PM Khushboo Vashi <
> khushboo.va...@enterprisedb.com> wrote:
>
>> Hi Aditya,
>>
>> Please resend the rebased patch, it does not apply.
>>
>> Thanks,
>> Khushboo
>>
>> On Fri, Apr 3, 2020 at 2:44 PM Aditya Toshniwal <
>> aditya.toshni...@enterprisedb.com> wrote:
>>
>>> Hi Hackers,
>>>
>>> Attached is the updated patch.
>>> With this,
>>> 1) I've displayed the rows count detail at the bottom of the dialog.
>>> This will help in both cases, when there are rows and when there are none.
>>> 2) As discussed, a user can now apply object types dropdown filter on
>>> already loaded data.
>>> 3) I've not made changes for the multilevel partition icon because it
>>> would be too much to do for an icon. We're already showing the type name in
>>> the grid. Adding extra SQL joins and making the query slower for the icon
>>> is not desirable.
>>> 4) Fixed some gettext issues as mentioned in the review.
>>>
>>> Please review.
>>>
>>>
>>> On Thu, Apr 2, 2020 at 5:54 PM Aditya Toshniwal <
>>> aditya.toshni...@enterprisedb.com> wrote:
>>>
 Hi Khushboo,

 On Thu, Apr 2, 2020 at 4:49 PM Khushboo Vashi <
 khushboo.va...@enterprisedb.com> wrote:

>
>
> On Thu, Apr 2, 2020 at 4:30 PM Aditya Toshniwal <
> aditya.toshni...@enterprisedb.com> wrote:
>
>> Hi Khushboo,
>>
>> Thank you for reviewing.
>>
>>
>> On Thu, Apr 2, 2020 at 4:09 PM Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>> Hi Aditya,
>>>
>>> Review comments:
>>>
>>> *UI:*
>>>
>>> 1. When no object is found, the default message should be given,
>>> currently no message displayed.
>>> 2. Can we have a tooltip on the row "Double click to locate the
>>> object in the browser" ?
>>> 3. Full stop is missing in the message column objects are disabled
>>> in the browser. You can enable them in the preferences dialog ( :D )
>>> and also, we should start the statement with the capital letter.
>>> 4. If possible, use the multilevel partition table symbol same as
>>> the browser tree.
>>> 5. gettext is missing from the search grid header.
>>>
>> I'll fix all above.
>>
>>> 6. Suggestion: The search button should be at the end (after type
>>> combobox).  The current position of the controls suggest that search for
>>> the objects and then filter it out but that's not the case.
>>>
>> I've actually kept the most frequently used controls together. The
>> probability of using the types filter is less and a user would generally 
>> go
>> for full search. This is how even we generally do. We search first and 
>> then
>> apply filter if required
>>
> Right, so type based search on slickgrid data would be useful.
>
 👍

> After changing the type, we have to click on the search button.
>>> In the current positioning, we should fetch all the records from the
>>> backend and then filter those out depending on the type at the client 
>>> side
>>> only, so that will reduce the server requests and slickgrid is 
>>> efficient it
>>> do so.
>>>
>> I'll look into this. My only concern is the data may be outdated, but
>> I agree to filter in slickgrid on type change. The user can hit search
>> again if required.
>>
>
>>> *Backend:*
>>>
>>> 1. We do have the list of blueprint, so we can use that list instead
>>> of taking the hard coe list in the init method of SearchObjectsHelper
>>> class.
>>>
>> The reason is, we do not support all objects for search objects. Only
>> objects under a database are supported. The probability of node type 
>> change
>> is very less.
>>
> True but we can maintain the skip list (which would be less) and we do
> have bluprint start with NODE, so it will be easier to fetch.
>
 I would prefer the "in" list rather than "skip" list. Each time a new
 node is added to pgAdmin, we will have to update the skip list in
 search objects. With the "in" list, search objects has better control.

> 2. While searching the object, we create an object of SearchObjectsHelper
>>> on each request. We can create it once while initializing and utilize 
>>> it on
>>> every search.
>>>
>> The intention is to keep SearchObjectsHelper stateless. The object
>> is created based on the request data and it is easier to maintain
>> independently.
>>
>>>
>>> Note: The functionality is working fine.
>>>
>> Great. Thanks.
>>
>>>
>>> Thanks,
>>> Khushboo
>>>
>>>
>>>
>>>
>>>
>>> On Thu, Apr 2, 2020 at 9:31 AM Khushboo Vashi <
>>> khushboo.va...

Re: [pgAdmin4][Patch]: RM 5053 - Getting an error while changing the columns in the existing view

2020-04-06 Thread Khushboo Vashi
Hi Akshay,

Please find the attached updated patch.

On Tue, Mar 24, 2020 at 2:47 PM Akshay Joshi 
wrote:

> Hi Khushboo
>
> On Tue, Mar 24, 2020 at 1:47 PM Khushboo Vashi <
> khushboo.va...@enterprisedb.com> wrote:
>
>> Hi Akshay,
>>
>> On Tue, Jan 14, 2020 at 11:47 AM Akshay Joshi <
>> akshay.jo...@enterprisedb.com> wrote:
>>
>>> Hi Khushboo
>>>
>>> Following are the review comments:
>>>
>>>- Fix the PEP8 issue.
>>>- Drop query should be part of the jinja template for consistency.
>>>Currently, it is added through the python file.
>>>
>>> The Delete query is already in the template file, I have just reused the
>> delete call and merged the SQL queries in the python file.
>>
>>>
>>>- Any changes in the view code should not warn the user "Changing
>>>the columns in a view requires dropping" and we should not drop the
>>>view. For example, I have only change the WHERE clause or added 'ORDER 
>>> BY'.
>>>
>>> I have tested but  couldn't reproduce this issue.  Can you please let me
>> know the proper use case?
>>
>
>Create a view with 'SELECT 1;' as code. Then change the code to 'SELECT
> 1234;' and click on the Save button.
>Warning popup is displayed "Changing the columns in a view". Click
> on the 'Yes' button and check the OID of the view. You will get the same
> OID, it means view is not recreated.
>
>
I can reproduce this issue with the given SQL but the problem is as per the
PostgreSQL documentation, (Ref:
https://www.postgresql.org/docs/12/sql-createview.html)

"CREATE OR REPLACE VIEW is similar, but if a view of the same name already
exists, it is replaced. The new query must generate the same columns that
were generated by the existing view query (that is, the same column names
in the same order and with the same data types), but it may add additional
columns to the end of the list. The calculations giving rise to the output
columns may be completely different."

So, I put a check on the columns and if the column is changed, the message
will popup.

In case of the example given by you, the column name is not changed as if
you don't give the column name it will be default and I think view would
have the column names properly.


> I have observed below error in the browser while changing the code:
> view.js:241 Uncaught TypeError: Cannot read property 'replace'
> of undefined
> at child.onChange (view.js:241)
> at HTMLDivElement.dispatch (jquery.js:5237)
> at HTMLDivElement.elemData.handle (jquery.js:5044)
>
> Fixed.

Thanks,
Khushboo

>
>> Thanks,
>> Khushboo
>>
>>>
>>>
>>
>>> On Tue, Jan 14, 2020 at 10:27 AM Khushboo Vashi <
>>> khushboo.va...@enterprisedb.com> wrote:
>>>
 Hi,

 Please find the attached patch for RM #5053 - Getting an error while
 changing the columns in the existing view.

 PostgreSQL doesn't allow to change the view columns. So, while
 performing this task the existing view should be dropped first and then
 recreate it and also user will get a warning first.

 Thanks,
 Khushboo

>>>
>>>
>>> --
>>> *Thanks & Regards*
>>> *Akshay Joshi*
>>>
>>> *Sr. Software Architect*
>>> *EnterpriseDB Software India Private Limited*
>>> *Mobile: +91 976-788-8246*
>>>
>>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
>
> *Sr. Software Architect*
> *EnterpriseDB Software India Private Limited*
> *Mobile: +91 976-788-8246*
>


RM_5053_v1.patch
Description: Binary data


Re: [pgAdmin4][Patch]: RM 5053 - Getting an error while changing the columns in the existing view

2020-04-06 Thread Akshay Joshi
Hi Khushboo

The warning message is not showing up. Please fix and resend the patch.

On Tue, Apr 7, 2020 at 10:00 AM Khushboo Vashi <
khushboo.va...@enterprisedb.com> wrote:

> Hi Akshay,
>
> Please find the attached updated patch.
>
> On Tue, Mar 24, 2020 at 2:47 PM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Hi Khushboo
>>
>> On Tue, Mar 24, 2020 at 1:47 PM Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>> Hi Akshay,
>>>
>>> On Tue, Jan 14, 2020 at 11:47 AM Akshay Joshi <
>>> akshay.jo...@enterprisedb.com> wrote:
>>>
 Hi Khushboo

 Following are the review comments:

- Fix the PEP8 issue.
- Drop query should be part of the jinja template for consistency.
Currently, it is added through the python file.

 The Delete query is already in the template file, I have just reused
>>> the delete call and merged the SQL queries in the python file.
>>>

- Any changes in the view code should not warn the user "Changing
the columns in a view requires dropping" and we should not drop the
view. For example, I have only change the WHERE clause or added 'ORDER 
 BY'.

 I have tested but  couldn't reproduce this issue.  Can you please let
>>> me know the proper use case?
>>>
>>
>>Create a view with 'SELECT 1;' as code. Then change the code to
>> 'SELECT 1234;' and click on the Save button.
>>Warning popup is displayed "Changing the columns in a view". Click
>> on the 'Yes' button and check the OID of the view. You will get the same
>> OID, it means view is not recreated.
>>
>>
> I can reproduce this issue with the given SQL but the problem is as per
> the PostgreSQL documentation, (Ref:
> https://www.postgresql.org/docs/12/sql-createview.html)
>
> "CREATE OR REPLACE VIEW is similar, but if a view of the same name
> already exists, it is replaced. The new query must generate the same
> columns that were generated by the existing view query (that is, the same
> column names in the same order and with the same data types), but it may
> add additional columns to the end of the list. The calculations giving rise
> to the output columns may be completely different."
>
> So, I put a check on the columns and if the column is changed, the message
> will popup.
>
> In case of the example given by you, the column name is not changed as if
> you don't give the column name it will be default and I think view would
> have the column names properly.
>
>
>> I have observed below error in the browser while changing the code:
>> view.js:241 Uncaught TypeError: Cannot read property
>> 'replace' of undefined
>> at child.onChange (view.js:241)
>> at HTMLDivElement.dispatch (jquery.js:5237)
>> at HTMLDivElement.elemData.handle (jquery.js:5044)
>>
>> Fixed.
>
> Thanks,
> Khushboo
>
>>
>>> Thanks,
>>> Khushboo
>>>


>>>
 On Tue, Jan 14, 2020 at 10:27 AM Khushboo Vashi <
 khushboo.va...@enterprisedb.com> wrote:

> Hi,
>
> Please find the attached patch for RM #5053 - Getting an error while
> changing the columns in the existing view.
>
> PostgreSQL doesn't allow to change the view columns. So, while
> performing this task the existing view should be dropped first and then
> recreate it and also user will get a warning first.
>
> Thanks,
> Khushboo
>


 --
 *Thanks & Regards*
 *Akshay Joshi*

 *Sr. Software Architect*
 *EnterpriseDB Software India Private Limited*
 *Mobile: +91 976-788-8246*

>>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>>
>> *Sr. Software Architect*
>> *EnterpriseDB Software India Private Limited*
>> *Mobile: +91 976-788-8246*
>>
>

-- 
*Thanks & Regards*
*Akshay Joshi*

*Sr. Software Architect*
*EnterpriseDB Software India Private Limited*
*Mobile: +91 976-788-8246*