public inbox for [email protected]  
help / color / mirror / Atom feed
From: Aditya Toshniwal <[email protected]>
To: Akshay Joshi <[email protected]>
Cc: pgadmin-hackers <[email protected]>
Subject: Re: [pgAdmin][RM4855] Renaming a file removes the file extension
Date: Mon, 12 Oct 2020 17:54:53 +0530
Message-ID: <CAM9w-_kH1u5Z8W0wyM386Ohh0CuK38=CwV0XDoUnVs2L_dGzKQ@mail.gmail.com> (raw)
In-Reply-To: <CANxoLDf6H2ffQ0OeyMbyJoqBCO3HEti1M-zo-p8=2VkGQ99_7g@mail.gmail.com>
References: <CAM9w-_=xWqbhhM2ZL1KZf1aQVmTDqpRLJfgzOt9gUfG6RzR3ng@mail.gmail.com>
	<CANxoLDdEd9bC3YmMZb8Q-D-zOhBysbNmRCxHsPckbTS4Q=Mjkw@mail.gmail.com>
	<CAM9w-_nTDOJTEYmptU2-DRJMCa9w9_g02Z4sz18KORuktQ4vNw@mail.gmail.com>
	<CANxoLDf6H2ffQ0OeyMbyJoqBCO3HEti1M-zo-p8=2VkGQ99_7g@mail.gmail.com>

Hi Hackers,

Attached is a patch to improve this further. It will skip adding the
extension if the file already has the extension selected from the format
dropdown.
Please review.

On Fri, Oct 9, 2020 at 11:53 AM Akshay Joshi <[email protected]>
wrote:

> Thanks, patch applied.
>
> On Thu, Oct 8, 2020 at 6:34 PM Aditya Toshniwal <
> [email protected]> wrote:
>
>> Hi,
>>
>> Attached patch will add the .sql when saving a file and and format -> sql
>> selected, no matter what the file name is.
>> Please review.
>>
>> On Thu, Oct 8, 2020 at 6:27 PM Akshay Joshi <
>> [email protected]> wrote:
>>
>>> Thanks, patch applied.
>>>
>>> On Mon, Sep 28, 2020 at 6:08 PM Aditya Toshniwal <
>>> [email protected]> wrote:
>>>
>>>> Hi Hackers,
>>>>
>>>> Attached is the patch to fix a bug where extension file extension is
>>>> stripped on renaming a file.
>>>> Pleasure review.
>>>>
>>>> --
>>>> Thanks,
>>>> Aditya Toshniwal
>>>> pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com*
>>>> <http://edbpostgres.com;
>>>> "Don't Complain about Heat, Plant a TREE"
>>>>
>>>
>>>
>>> --
>>> *Thanks & Regards*
>>> *Akshay Joshi*
>>> *pgAdmin Hacker | Sr. Software Architect*
>>> *EDB Postgres <http://edbpostgres.com>*
>>>
>>> *Mobile: +91 976-788-8246*
>>>
>>
>>
>> --
>> Thanks,
>> Aditya Toshniwal
>> pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com*
>> <http://edbpostgres.com;
>> "Don't Complain about Heat, Plant a TREE"
>>
>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
> *pgAdmin Hacker | Sr. Software Architect*
> *EDB Postgres <http://edbpostgres.com>*
>
> *Mobile: +91 976-788-8246*
>


-- 
Thanks,
Aditya Toshniwal
pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com*
<http://edbpostgres.com;
"Don't Complain about Heat, Plant a TREE"


Attachments:

  [application/octet-stream] RM4855.part3.patch (792B, 3-RM4855.part3.patch)
  download | inline diff:
diff --git a/web/pgadmin/misc/file_manager/static/js/create_dialogue.js b/web/pgadmin/misc/file_manager/static/js/create_dialogue.js
index c7e4b6b60..634742a0d 100644
--- a/web/pgadmin/misc/file_manager/static/js/create_dialogue.js
+++ b/web/pgadmin/misc/file_manager/static/js/create_dialogue.js
@@ -151,7 +151,9 @@ module.exports =  Alertify.dialog('createModeDlg', function() {
            there is a . already but it's not following the last /, AND the
            extension isn't *, then we add the extension.
          */
-        if (ext != '*') {
+        if ((!newFile.includes('.') ||
+            newFile.split('.').pop() != ext) &&
+            ext != '*') {
           newFile = newFile + '.' + ext;
           $('.storage_dialog #uploader .input-path').val(newFile);
         }


view thread (6+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: [pgAdmin][RM4855] Renaming a file removes the file extension
  In-Reply-To: <CAM9w-_kH1u5Z8W0wyM386Ohh0CuK38=CwV0XDoUnVs2L_dGzKQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox