Skip to content

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

Merged
lastzero merged 1 commit into
photoprism:developfrom
alexisLefebvre:add-link-from-file-to-folder
Jun 13, 2023
Merged

Photos: Add a link from the Files tab to the file folder#2926
lastzero merged 1 commit into
photoprism:developfrom
alexisLefebvre:add-link-from-file-to-folder

Conversation

@alexisLefebvre

@alexisLefebvre alexisLefebvre commented Nov 20, 2022

Copy link
Copy Markdown
Contributor

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

@alexisLefebvre
alexisLefebvre force-pushed the add-link-from-file-to-folder branch from 661cea1 to c1deef3 Compare November 20, 2022 15:30
@alexisLefebvre
alexisLefebvre force-pushed the add-link-from-file-to-folder branch from c1deef3 to 0ae12f4 Compare November 20, 2022 15:48
@lastzero

Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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 manual testing & feedback merged Changes are merged, but may require further testing enhancement labels Jun 13, 2023
@lastzero

Copy link
Copy Markdown
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
Copy Markdown
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 a stable release and removed please-test Ready for manual testing & feedback labels Jun 15, 2023
@alexisLefebvre
alexisLefebvre deleted the add-link-from-file-to-folder branch June 16, 2023 09:20
@alexisLefebvre

Copy link
Copy Markdown
Contributor Author

It works, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged Changes are merged, but may require further testing released Available in a stable release ux Impacts User Experience

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants