RM4069 - Append the file suffix to filenames when needed in the File Create dialogue.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

RM4069 - Append the file suffix to filenames when needed in the File Create dialogue.

Dave Page-7
Here's a small patch for $SUBJECT. 

I'd normally commit something like this directly but wanted some thoughts on the fact that it introduces a third method for figuring out what path separator to use to the file manager code:

1) We get it from the config file (which is actually a template)
2) We look at what's already in an existing path

and now:

3) We use navigator.platform 

I could use method 1 here, but it would add quite a bit more code (unless there's a simple way of importing the config object from utility.js that is beyond my limited JS-fu).

Method 2 can't be used as there may not be a path to look at.

Any thoughts on this issue, and tidying up 1 & 2 in general?

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

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

RM_4069.diff (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: RM4069 - Append the file suffix to filenames when needed in the File Create dialogue.

Khushboo Vashi
Hi Dave,

On Thu, Mar 14, 2019 at 5:01 PM Dave Page <[hidden email]> wrote:
Here's a small patch for $SUBJECT. 

I'd normally commit something like this directly but wanted some thoughts on the fact that it introduces a third method for figuring out what path separator to use to the file manager code:

1) We get it from the config file (which is actually a template)
2) We look at what's already in an existing path

and now:

3) We use navigator.platform 

I could use method 1 here, but it would add quite a bit more code (unless there's a simple way of importing the config object from utility.js that is beyond my limited JS-fu).

Method 2 can't be used as there may not be a path to look at.

Any thoughts on this issue, and tidying up 1 & 2 in general?
Importing config object from the utility.js would be easy if we have written the code in such a way.
Here the main purpose is to get the path separator on the basis of the OS and that is easily available through JS, so I would prefer the way you have used it.
We can also write the code which will call the backend and load the config which will be used in the File Manager module if that config will be used extensively but that is not the case.

Thanks,
Khushboo

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

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Reply | Threaded
Open this post in threaded view
|

Re: RM4069 - Append the file suffix to filenames when needed in the File Create dialogue.

Dave Page-7
Hi

On Thu, Mar 14, 2019 at 1:00 PM Khushboo Vashi <[hidden email]> wrote:
Hi Dave,

On Thu, Mar 14, 2019 at 5:01 PM Dave Page <[hidden email]> wrote:
Here's a small patch for $SUBJECT. 

I'd normally commit something like this directly but wanted some thoughts on the fact that it introduces a third method for figuring out what path separator to use to the file manager code:

1) We get it from the config file (which is actually a template)
2) We look at what's already in an existing path

and now:

3) We use navigator.platform 

I could use method 1 here, but it would add quite a bit more code (unless there's a simple way of importing the config object from utility.js that is beyond my limited JS-fu).

Method 2 can't be used as there may not be a path to look at.

Any thoughts on this issue, and tidying up 1 & 2 in general?
Importing config object from the utility.js would be easy if we have written the code in such a way.
Here the main purpose is to get the path separator on the basis of the OS and that is easily available through JS, so I would prefer the way you have used it.
We can also write the code which will call the backend and load the config which will be used in the File Manager module if that config will be used extensively but that is not the case.

Yeah - sounds like your thought echo mine.

I'll see about cleaning some of the rest of it up to use navigator.platform.

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

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