googleinterns / filesystem-in-appsscript

Apache License 2.0
5 stars 1 forks source link

[High Priority - 2] CurrentDirectory (ActiveWorkbook.path) Prompt #22

Closed satviksr closed 4 years ago

satviksr commented 4 years ago

Fixes #14 Note: There are many TODOs, as they are implemented in the next PR. So it shouldn't be a problem.

Have starting migrating CurrentDirectory calls as well but it is not in this PR.

In VBA ActiveWorkbook.path returns the directory of the spreadsheet. This is a heavily used API. The way it works as is below.

  1. ActiveWorkbook.path is stored in DocumentProperties
  2. getActiveWorkbookPath() returns the workbook path. If it is not present, then a prompt is shown with an error message saying, "Enter local path and try again"
  3. The prompt can be triggered by the user as well (No error message shown then)
  4. The prompt has client side validation to validate if the given path is a correct windows/mac complete path.
  5. The prompt also shows some helpful details that should help the user to set the path easily. (See screenshots below)

Prompt with no error message. image

Prompt with error message image

Will not allow relative file paths image

image

Windows File Path validation image

Unix File Path validation image

todo[bot] commented 4 years ago

migrate currentDirectory calls to DirectoryManager

https://github.com/googleinterns/filesystem-in-appsscript/blob/96fd50d73f47c10b21191114d8d86a01b0500006/FileSystem/Workbook.js#L3-L8


This comment was generated by todo based on a todo comment in 96fd50d73f47c10b21191114d8d86a01b0500006 in #22. cc @googleinterns.
todo[bot] commented 4 years ago

Register directory mapping with File Mapper

This mapping is very useful as in most cases this will hande most scenarios


https://github.com/googleinterns/filesystem-in-appsscript/blob/bf253c1154d87bbefb1382ae5137de609c36e47f/FileSystem/Workbook.js#L75-L80


This comment was generated by todo based on a todo comment in bf253c1154d87bbefb1382ae5137de609c36e47f in #22. cc @googleinterns.
todo[bot] commented 4 years ago

Write tests for validation

Tests will be written in the directory API module


https://github.com/googleinterns/filesystem-in-appsscript/blob/21be4750a339077273a84947cb5c80cd9870a32e/FileSystem/Util.js#L78-L83


This comment was generated by todo based on a todo comment in 21be4750a339077273a84947cb5c80cd9870a32e in #22. cc @googleinterns.
todo[bot] commented 4 years ago

Fix file separator depending on FileSystem type

santize "C:\Users/Desktop\" to "C:\Users\Desktop"


https://github.com/googleinterns/filesystem-in-appsscript/blob/b6510105b76c959f5da6dc341288aba04ff1ff04/FileSystem/Util.js#L111-L116


This comment was generated by todo based on a todo comment in b6510105b76c959f5da6dc341288aba04ff1ff04 in #22. cc @googleinterns.