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

Photos: Add a link from the Files tab to the file folder #2926

Merged

Conversation

alexislefebvre
Copy link
Contributor

@alexislefebvre alexislefebvre commented Nov 20, 2022

This PR adds a button to link from the “Files” tab to the directory which contain the file:

image

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:

  • Features and enhancements are fully implemented so that they can be released at any time without additional work
  • Automated unit and/or acceptance tests have been added to ensure the changes work as expected and to reduce repetitive manual work - it looks like tests should go there https://github.com/photoprism/photoprism/blob/develop/frontend/tests/acceptance/acceptance-public/photos.js but I don't know how to test this feature
  • User interface changes are fully responsive and have been tested on all major browsers and various devices
  • Database-related changes are compatible with SQLite and MariaDB
  • Translations will be updated
  • Documentation has been / will be updated
  • Contributor License Agreement (CLA) has been signed

@lastzero
Copy link
Member

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);
Copy link

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.

Copy link
Contributor Author

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.

@lastzero
Copy link
Member

@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 :)

@lastzero lastzero changed the title add a link from files tab to folder Photos: Add a link from the Files tab to the corresponding folder Jun 13, 2023
@lastzero lastzero added the ux Impacts User Experience label Jun 13, 2023
@lastzero lastzero merged commit 9e316a2 into photoprism:develop Jun 13, 2023
@lastzero lastzero changed the title Photos: Add a link from the Files tab to the corresponding folder Photos: Add a link from the Files tab to the file folder Jun 13, 2023
lastzero added a commit that referenced this pull request Jun 13, 2023
Signed-off-by: Michael Mayer <michael@photoprism.app>
@lastzero lastzero added please-test Ready for acceptance test merged Changes should be tested again after they have been integrated enhancement Refactoring, improvement or maintenance task labels Jun 13, 2023
@lastzero
Copy link
Member

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!

@lastzero
Copy link
Member

@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?

folder-button

Not sure what's best, so I value everyone's opinion on this! 🤗

lastzero added a commit that referenced this pull request Jun 14, 2023


Also changes the button label from "Folder" to "File Browser".

Signed-off-by: Michael Mayer <michael@photoprism.app>
@lastzero lastzero added released Available in the stable release and removed please-test Ready for acceptance test labels Jun 15, 2023
@alexislefebvre alexislefebvre deleted the add-link-from-file-to-folder branch June 16, 2023 09:20
@alexislefebvre
Copy link
Contributor Author

It works, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Refactoring, improvement or maintenance task merged Changes should be tested again after they have been integrated released Available in the stable release ux Impacts User Experience
Projects
Status: Release 🌈
Development

Successfully merging this pull request may close these issues.

None yet

3 participants