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

Add config to select source directories #2319

Merged
merged 13 commits into from Feb 15, 2024
Merged

Conversation

artonge
Copy link
Collaborator

@artonge artonge commented Feb 6, 2024

Fix #141

TODO

  • Ensure mobiles clients are also restricting photos source.

Changes

  • Add a photosSourceFolder config, defaulting to /Photos
  • Rewrite UserConfig mixin into a Vuex store and remove the usage of the mixin everywhere.
  • Use the new photosSourceFolder option in the photos search request
  • Add UI to update photosSourceFolder
  • Update UI to set photosLocation to match design mockups
  • Update the timelines when photosSourceFolder gets updated
  • Unrelated fix: update photosLocationFolder when photosLocation is updated

Limitations

Screenshots

Defaults Edited Root folder
Screenshot from 2024-02-08 10-29-16 Screenshot from 2024-02-08 10-29-33 Screenshot from 2024-02-08 10-29-06

@artonge artonge self-assigned this Feb 6, 2024
@artonge artonge added enhancement New feature or request php PHP related ticket javascript Javascript related ticket 2. developing Work in progress labels Feb 6, 2024
@artonge artonge added this to the Nextcloud 29 milestone Feb 6, 2024
@artonge artonge changed the base branch from master to enh/migrate-to-webdav-v5 February 6, 2024 13:54
@artonge artonge force-pushed the artonge/feat/photos_locations branch 4 times, most recently from 5597abb to 6c75718 Compare February 7, 2024 11:54
@artonge artonge marked this pull request as ready for review February 7, 2024 12:01
@artonge artonge added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Feb 7, 2024
@artonge artonge force-pushed the artonge/feat/photos_locations branch 2 times, most recently from 7d742cd to 1de2b1f Compare February 7, 2024 16:46
Copy link
Member

@nimishavijay nimishavijay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great! :) Only really small comments:

  • For the media folders: "Choose a different folder" --> "Add folder" (updated the mockup after you started working on the PR, my bad)
  • how would people be able to remove folders? (eg. would the file picker component allow multiselect, so people can unselect folders?)
  • Unsure about the wording "Root folder" we could maybe change the icon to a home icon or change the wording to something else, any suggestions @nextcloud/designers? :)

@jancborchardt
Copy link
Member

  • Unsure about the wording "Root folder" we could maybe change the icon to a home icon or change the wording to something else, any suggestions @nextcloud/designers? :)

As discussed, the "root" folder should be "Home" and use the home house icon that we also use in the breadcrumbs in Files.

@artonge
Copy link
Collaborator Author

artonge commented Feb 8, 2024

* For the media folders: "Choose a different folder" --> "Add folder" (updated the [mockup](https://github.com/nextcloud/photos/issues/141#issuecomment-1927554553) after you started working on the PR, my bad)
* how would people be able to remove folders? (eg. would the file picker component allow multiselect, so people can unselect folders?)

As stated, this PR does not support the selection of multiple source folders for now. The day we can search in multiple folders, I will follow your above recommendations :).

* Unsure about the wording "Root folder" we could maybe change the icon to a home icon or change the wording to something else, any suggestions @nextcloud/designers? :)

Updated !

src/views/Timeline.vue Outdated Show resolved Hide resolved
@artonge artonge force-pushed the artonge/feat/photos_locations branch from 1de2b1f to 042082c Compare February 8, 2024 09:41
Copy link
Member

@nimishavijay nimishavijay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! In that case, only change "Media folders" to "Media folder" (folder is singular, not plural :) ) approving to not block! :)

@artonge artonge force-pushed the artonge/feat/photos_locations branch from 042082c to 4a6986c Compare February 8, 2024 14:58
@artonge artonge force-pushed the artonge/feat/photos_locations branch 5 times, most recently from 0943774 to bd9b7a2 Compare February 13, 2024 17:23
Comment on lines +70 to +89
subname() {
const slashesCount = (this.path.match(/\//g) ?? []).length

switch (slashesCount) {
case 1:
return ''
case 2:
return this.path.split('/').splice(0, 2).join('/')
default:
return this.path.split('/').splice(0, 3).join('/')
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this sorcery? 😁

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To properly display the path of the folder. Let me add a comment.

Full path Displayed path
/ Home
/a nothing
/a/b /a
/a/b/c /a/b

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More comments the better :)

Signed-off-by: Louis Chemineau <louis@chmn.me>
Signed-off-by: Louis Chemineau <louis@chmn.me>
Signed-off-by: Louis Chemineau <louis@chmn.me>
Signed-off-by: Louis Chemineau <louis@chmn.me>
Signed-off-by: Louis Chemineau <louis@chmn.me>
Signed-off-by: Louis Chemineau <louis@chmn.me>
Signed-off-by: Louis Chemineau <louis@chmn.me>
Signed-off-by: Louis Chemineau <louis@chmn.me>
Signed-off-by: Louis Chemineau <louis@chmn.me>
Signed-off-by: Louis Chemineau <louis@chmn.me>
Signed-off-by: Louis Chemineau <louis@chmn.me>
Signed-off-by: Louis Chemineau <louis@chmn.me>
@artonge
Copy link
Collaborator Author

artonge commented Feb 15, 2024

Added some comments and a better error handling when the folder does not exist.

Signed-off-by: Louis Chemineau <louis@chmn.me>
@artonge artonge force-pushed the artonge/feat/photos_locations branch from bd9b7a2 to b110ae7 Compare February 15, 2024 15:25
@artonge artonge merged commit f45f8d3 into master Feb 15, 2024
34 checks passed
@artonge artonge deleted the artonge/feat/photos_locations branch February 15, 2024 15:51
@szaimen
Copy link
Contributor

szaimen commented Feb 15, 2024

🎉🎉🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement New feature or request javascript Javascript related ticket php PHP related ticket 🍀 2024-Spring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🖼️📂 Limit Photos to a single folder + subtree
6 participants