-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Photos: Add a link from the Files tab to the file folder #2926
Photos: Add a link from the Files tab to the file folder #2926
Conversation
661cea1
to
c1deef3
Compare
c1deef3
to
0ae12f4
Compare
Thanks! Seems like a great quick win. Going to review & merge this as soon as possible. |
const fileName = file.Name; | ||
const folder = fileName.substring(0, fileName.lastIndexOf('/')); | ||
|
||
return(this.config.baseUri + '/library/index/files/' + folder); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, you can use template literals with ` like this:
return `${this.config.baseUri}/library/index/files/${file.name.substring(0, file.name.lastIndexOf('/'))}`;
See the mozilla doc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that it's easier to read with 2 variables.
@alexislefebvre Thank you for waiting so patiently! There is some more work needed to release it. For example, the URL should be generated using the frontend router, e.g. like in this commit. I will be happy to do this for you after the merge :) |
Signed-off-by: Michael Mayer <michael@photoprism.app>
You can now help test this with our preview build and on our public demo. An overview of all changes can be found in the Release Notes at docs.photoprism.app/release-notes/#development-preview. Please note that for now, the "Show Folder" button is only displayed when experimental features are enabled! |
@alexislefebvre Note that the button label is not final yet. I've used "Folder" with an icon for now, since there is already a translation for it. We could alternatively use "Show Folder", "Open Folder", "Browse" or "Browse Folder" - or just change the icon e.g. https://fonts.google.com/icons?icon.query=folder? Not sure what's best, so I value everyone's opinion on this! 🤗 |
It works, thanks! |
This PR adds a button to link from the “Files” tab to the directory which contain the file:
Since it's a link, users can open it in another tab or the current tab, depending how they click on it.
And the dog will be happy.
It's the first time I write Vue code, please let me know if something needs to be changed.
Acceptance Criteria: