public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin][RM4855] Renaming a file removes the file extension
6+ messages / 2 participants
[nested] [flat]

* [pgAdmin][RM4855] Renaming a file removes the file extension
@ 2020-09-28 12:37 Aditya Toshniwal <[email protected]>
  2020-10-08 12:56 ` Re: [pgAdmin][RM4855] Renaming a file removes the file extension Akshay Joshi <[email protected]>
  0 siblings, 1 reply; 6+ messages in thread

From: Aditya Toshniwal @ 2020-09-28 12:37 UTC (permalink / raw)
  To: pgadmin-hackers

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"


Attachments:

  [application/octet-stream] RM4855.patch (1.6K, 3-RM4855.patch)
  download | inline diff:
diff --git a/web/pgadmin/misc/file_manager/static/js/utility.js b/web/pgadmin/misc/file_manager/static/js/utility.js
index 78dfe8126..3494b127c 100644
--- a/web/pgadmin/misc/file_manager/static/js/utility.js
+++ b/web/pgadmin/misc/file_manager/static/js/utility.js
@@ -867,7 +867,7 @@ define([
         $('.fileinfo #contents li div').on('blur dblclick', 'input', function(e) {
           e.stopPropagation();
 
-          var old_name = decodeURI($(this).siblings('span').attr('title'));
+          var old_name = decodeURI($(this).siblings('div').find('.less_text').attr('title'));
           newvalue = old_name.substring(0, old_name.indexOf('.'));
           var last = getFileExtension(old_name),
             file_data, new_name, file_path, full_name;
@@ -945,7 +945,7 @@ define([
         $('.fileinfo table#contents tr td div').on(
           'blur dblclick', 'input',
           function(e) {
-            var old_name = decodeURI($(this).siblings('span').attr('title')),
+            var old_name = decodeURI($(this).siblings('div').find('.less_text').attr('title')),
               new_value = old_name.substring(0, old_name.indexOf('.')),
               last = getFileExtension(old_name);
             if (old_name.indexOf('.') == 0) {
@@ -974,8 +974,7 @@ define([
 
                 if (new_value !== new_name) {
                   renameItem(file_data);
-                  var parent = file_path.split('/').reverse().slice(2).reverse().join('/') + '/';
-                  getFolderInfo(parent);
+                  getFolderInfo($('.currentpath').val());
                 }
               }
             } else {


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [pgAdmin][RM4855] Renaming a file removes the file extension
  2020-09-28 12:37 [pgAdmin][RM4855] Renaming a file removes the file extension Aditya Toshniwal <[email protected]>
@ 2020-10-08 12:56 ` Akshay Joshi <[email protected]>
  2020-10-08 13:03   ` Re: [pgAdmin][RM4855] Renaming a file removes the file extension Aditya Toshniwal <[email protected]>
  0 siblings, 1 reply; 6+ messages in thread

From: Akshay Joshi @ 2020-10-08 12:56 UTC (permalink / raw)
  To: Aditya Toshniwal <[email protected]>; +Cc: pgadmin-hackers

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*


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [pgAdmin][RM4855] Renaming a file removes the file extension
  2020-09-28 12:37 [pgAdmin][RM4855] Renaming a file removes the file extension Aditya Toshniwal <[email protected]>
  2020-10-08 12:56 ` Re: [pgAdmin][RM4855] Renaming a file removes the file extension Akshay Joshi <[email protected]>
@ 2020-10-08 13:03   ` Aditya Toshniwal <[email protected]>
  2020-10-09 06:23     ` Re: [pgAdmin][RM4855] Renaming a file removes the file extension Akshay Joshi <[email protected]>
  0 siblings, 1 reply; 6+ messages in thread

From: Aditya Toshniwal @ 2020-10-08 13:03 UTC (permalink / raw)
  To: Akshay Joshi <[email protected]>; +Cc: pgadmin-hackers

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"


Attachments:

  [application/octet-stream] RM4855.part2.patch (688B, 3-RM4855.part2.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 268d8d727..8e53e85c6 100644
--- a/web/pgadmin/misc/file_manager/static/js/create_dialogue.js
+++ b/web/pgadmin/misc/file_manager/static/js/create_dialogue.js
@@ -157,9 +157,7 @@ module.exports =  Alertify.dialog('createModeDlg', function() {
           sep = '\\';
         }
 
-        if ((!newFile.includes('.') ||
-            newFile.split('.').pop().includes(sep)) &&
-            ext != '*') {
+        if (ext != '*') {
           newFile = newFile + '.' + ext;
           $('.storage_dialog #uploader .input-path').val(newFile);
         }


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [pgAdmin][RM4855] Renaming a file removes the file extension
  2020-09-28 12:37 [pgAdmin][RM4855] Renaming a file removes the file extension Aditya Toshniwal <[email protected]>
  2020-10-08 12:56 ` Re: [pgAdmin][RM4855] Renaming a file removes the file extension Akshay Joshi <[email protected]>
  2020-10-08 13:03   ` Re: [pgAdmin][RM4855] Renaming a file removes the file extension Aditya Toshniwal <[email protected]>
@ 2020-10-09 06:23     ` Akshay Joshi <[email protected]>
  2020-10-12 12:24       ` Re: [pgAdmin][RM4855] Renaming a file removes the file extension Aditya Toshniwal <[email protected]>
  0 siblings, 1 reply; 6+ messages in thread

From: Akshay Joshi @ 2020-10-09 06:23 UTC (permalink / raw)
  To: Aditya Toshniwal <[email protected]>; +Cc: pgadmin-hackers

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*


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [pgAdmin][RM4855] Renaming a file removes the file extension
  2020-09-28 12:37 [pgAdmin][RM4855] Renaming a file removes the file extension Aditya Toshniwal <[email protected]>
  2020-10-08 12:56 ` Re: [pgAdmin][RM4855] Renaming a file removes the file extension Akshay Joshi <[email protected]>
  2020-10-08 13:03   ` Re: [pgAdmin][RM4855] Renaming a file removes the file extension Aditya Toshniwal <[email protected]>
  2020-10-09 06:23     ` Re: [pgAdmin][RM4855] Renaming a file removes the file extension Akshay Joshi <[email protected]>
@ 2020-10-12 12:24       ` Aditya Toshniwal <[email protected]>
  2020-10-12 12:34         ` Re: [pgAdmin][RM4855] Renaming a file removes the file extension Akshay Joshi <[email protected]>
  0 siblings, 1 reply; 6+ messages in thread

From: Aditya Toshniwal @ 2020-10-12 12:24 UTC (permalink / raw)
  To: Akshay Joshi <[email protected]>; +Cc: pgadmin-hackers

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);
         }


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [pgAdmin][RM4855] Renaming a file removes the file extension
  2020-09-28 12:37 [pgAdmin][RM4855] Renaming a file removes the file extension Aditya Toshniwal <[email protected]>
  2020-10-08 12:56 ` Re: [pgAdmin][RM4855] Renaming a file removes the file extension Akshay Joshi <[email protected]>
  2020-10-08 13:03   ` Re: [pgAdmin][RM4855] Renaming a file removes the file extension Aditya Toshniwal <[email protected]>
  2020-10-09 06:23     ` Re: [pgAdmin][RM4855] Renaming a file removes the file extension Akshay Joshi <[email protected]>
  2020-10-12 12:24       ` Re: [pgAdmin][RM4855] Renaming a file removes the file extension Aditya Toshniwal <[email protected]>
@ 2020-10-12 12:34         ` Akshay Joshi <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Akshay Joshi @ 2020-10-12 12:34 UTC (permalink / raw)
  To: Aditya Toshniwal <[email protected]>; +Cc: pgadmin-hackers

Thanks, patch applied.

On Mon, Oct 12, 2020 at 5:55 PM Aditya Toshniwal <
[email protected]> wrote:

> 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"
>


-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Sr. Software Architect*
*EDB Postgres <http://edbpostgres.com>*

*Mobile: +91 976-788-8246*


^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2020-10-12 12:34 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-09-28 12:37 [pgAdmin][RM4855] Renaming a file removes the file extension Aditya Toshniwal <[email protected]>
2020-10-08 12:56 ` Akshay Joshi <[email protected]>
2020-10-08 13:03   ` Aditya Toshniwal <[email protected]>
2020-10-09 06:23     ` Akshay Joshi <[email protected]>
2020-10-12 12:24       ` Aditya Toshniwal <[email protected]>
2020-10-12 12:34         ` Akshay Joshi <[email protected]>

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