Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide file-extension or complete filename in file content endpoint #958

Closed
inkhey opened this issue Sep 24, 2018 · 12 comments
Closed

Provide file-extension or complete filename in file content endpoint #958

inkhey opened this issue Sep 24, 2018 · 12 comments
Assignees
Labels
backend issue related to backend developpement /apps manually tested the fix has been tested and verified by QA team
Projects

Comments

@inkhey
Copy link
Contributor

inkhey commented Sep 24, 2018

Describe the bug
Frontend is unable to get file complete filename with extension

Expected behavior
file content endpoint should return file extension or complete filename in endpoint.

@inkhey inkhey added backend issue related to backend developpement /apps to sort need first level analyse and release association labels Sep 24, 2018
@inkhey inkhey self-assigned this Sep 24, 2018
@inkhey
Copy link
Contributor Author

inkhey commented Sep 24, 2018

@Skylsmoi Which information do you think is better ? complete filename or just file_extension.
filename pattern is "{label}{file_extension}" (file extension contain dot), so you can create it easily from both file_extension and label.

@inkhey
Copy link
Contributor Author

inkhey commented Oct 10, 2018

There is also some trouble with ui for both frontend and webdav.

1.File extension is required also in workspace content endpoint to be able to distinct 2 File with same label but different file extension in frontend.
This means that we should decided what we provided if content is not of type file. Actually, file extension is .html for both page and thread. This information is useful for webdav but meaningless in web-ui.

Should we show another tab " file_extension" in frontend or having a specific behaviour for some type of file ?

2.
There also a conflict and clarity problem. If user can't create both toto.html file and toto thread in webui, that's a weird behaviour, but allowing this create conflict in webdav because we juste can't have 2 "toto.html" file in same folder.

Solution proposed to this issue:

  • Using specific sub file extension to reduced a lot conflict issue, something like ".{content_type_slug}.html" (ex: .thread.html).

  • Renaming file on the fly, if content type name already exist, rename it to something like "nameofthefile_X" (x is a number). Issue of this kind in webdav should be anyway already handled by webdav file explorer itself.

@inkhey
Copy link
Contributor Author

inkhey commented Oct 10, 2018

After some discussion with @Skylsmoi and Luc, it's seems more convenient to use both strategy for conflict issue:

  • Renaming new content label on the fly if filename is already used instead of raising error.
  • Specific file extension for tracim specific file to easily allow thread and page with same name (this may also help frontend) instead of weird auto-renaming.

This means also:

For UI issue, easy solution is to show always file extension, unless tracim specific file extension is used. (need an endpoint to make frontend know which are tracim_specific file extension).

@tracim
Copy link
Collaborator

tracim commented Oct 10, 2018

Could you give some examples, please? Just to be sure to understand correctly

@Skylsmoi
Copy link
Collaborator

Skylsmoi commented Oct 10, 2018

notation: filename [type] "label"

  • workspace:
    • trouble.jpg [file] "trouble (.jpg)"
    • solution.htmldoc.html [html-doc] "solution"
  • user upload a file trouble.jpg
  • file gets renamed trouble_0.jpg
  • workspace:
    • trouble.jpg [file] "trouble"
    • solution.htmldoc.html [html-doc] "solution"
    • trouble_0.jpg [file] "trouble_0"
  • user upload a file solution.odt
  • workspace:
    • trouble.jpg [file] "trouble (.jpg)"
    • solution.htmldoc.html [html-doc] "solution"
    • trouble_0.jpg [file] "trouble_0 (.jpg)"
    • solution.odt [file] "solution (.odt)"
  • user uplaod a file trouble.zip
  • workspace:
    • trouble.jpg [file] "trouble (.jpg)"
    • solution.htmldoc.html [html-doc] "solution"
    • trouble_0.jpg [file] "trouble_0 (.jpg)"
    • solution.odt [file] "solution (.odt)"
    • trouble.zip [file] "trouble (.zip)"
  • user create a thread with "trouble
  • workspace:
    • trouble.jpg [file] "trouble (.jpg)"
    • solution.htmldoc.html [html-doc] "solution"
    • trouble_0.jpg [file] "trouble_0 (.jpg)"
    • solution.odt [file] "solution (.odt)"
    • trouble.zip [file] "trouble (.zip)"
    • trouble.thread.html [thread] "trouble"
  • user create a thread with "trouble
    • trouble.jpg [file] "trouble (.jpg)"
    • solution.htmldoc.html [html-doc] "solution"
    • trouble_0.jpg [file] "trouble_0 (.jpg)"
    • solution.odt [file] "solution (.odt)"
    • trouble.zip [file] "trouble (.zip)"
    • trouble_1.thread.html [thread] "trouble_1"

@inkhey
Copy link
Contributor Author

inkhey commented Oct 10, 2018

Some example of behaviour, as i see it with modification:
Considering we apply renaming for all content.

creating a new htmldoc named "test"
-> label: test, filename: test.htmldoc.html

creating another htmldoc named "test
-> label: test_0, filename: test_0.htmldoc.html

creating another htmldoc named "test"
-> label: test_1, filename: test_1.htmldoc.html

creating a thread named "test"
-> label: test, filename: test.thread.html

uploading a file with filename "test.html"
-> label: test, filename: test.html (not same as test.htmldoc.html)

Weird case : uploading a file with filename "test.htmldoc.html"
-> label: test.page_0, filename: test.page_0.html

not sure about behaviour for this one :
creating another htmldoc named "test_0"
-> label: test_2, filename: test_2.htmldoc.html (because test_1 already exist)

@tracim
Copy link
Collaborator

tracim commented Oct 10, 2018

note : page content type does not exist. its html-document. So the filename should be for example :

  • test_1.html-doc.html (the best in my point of view - more explicit technically)
  • test_1.doc.html (maybe better for end user)

@inkhey
Copy link
Contributor Author

inkhey commented Oct 10, 2018

Personally i prefer either :

  • test_1.html-document.html (html-document is type slug ! idea is to use always type slug here for all type)
    or
  • test_1.document.html (or something else but without trouble with the ".doc" format ).

@inkhey inkhey removed the to sort need first level analyse and release association label Oct 10, 2018
@inkhey inkhey added this to the TracimV2 - V2.0 milestone Oct 10, 2018
@inkhey inkhey added this to In progress in Tracim V2.0 Oct 10, 2018
@inkhey inkhey moved this from In progress to Need test in Tracim V2.0 Oct 10, 2018
@inkhey inkhey moved this from Need test to In merge request in Tracim V2.0 Oct 10, 2018
@inkhey inkhey moved this from In merge request to In progress in Tracim V2.0 Oct 10, 2018
@inkhey
Copy link
Contributor Author

inkhey commented Oct 15, 2018

tracim/tracim_v2#90 use actually both .document.html and .thread.html .

@inkhey inkhey moved this from In progress to In merge request in Tracim V2.0 Oct 15, 2018
@tracim
Copy link
Collaborator

tracim commented Oct 15, 2018

So... I resume the strategy to implement:

For now, specific extensions will be:

  • .document.html
  • .document.md
  • .thread.html

@lebouquetin lebouquetin moved this from In merge request to Need test in Tracim V2.0 Oct 16, 2018
@PhilippeAccorsi PhilippeAccorsi moved this from Need test to Test in progress in Tracim V2.0 Oct 17, 2018
@PhilippeAccorsi
Copy link
Collaborator

Can I test something?

@PhilippeAccorsi PhilippeAccorsi added the manually tested the fix has been tested and verified by QA team label Oct 19, 2018
@PhilippeAccorsi
Copy link
Collaborator

Verified.

Tracim V2.0 automation moved this from Test in progress to Done Oct 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend issue related to backend developpement /apps manually tested the fix has been tested and verified by QA team
Projects
No open projects
Tracim V2.0
  
Done
Development

No branches or pull requests

3 participants