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

feat: add location picker into embed mode #9863

Merged
merged 1 commit into from
Oct 30, 2023

Conversation

LukasHirt
Copy link
Collaborator

Description

Add a new query param called embed-target which is then added into the configuration.options object as embedTarget. When this parameter has value location, it switches the embed mode into location picker. In location picker, resources cannot be selected (checkboxes to do so are hidden), share action is hidden and select action emits the currentFolder instead.

Related Issue

Motivation and Context

Enable picking location to e.g. upload files into instead of only selecting resources.

How Has This Been Tested?

  • test environment: local
  • test case 1: run web UI with mode=embed&embed-target=location query params

Screenshots (if appropriate):

The empty space above files (where create and upload actions would be) will be filled with create folder action once #9853 is merged.

localhost_9200_files_spaces_personal_einstein_fileId=91b3fbd1-7964-4fbf-9d9c-0b94c6962fea%244c510ada-c86b-4815-8820-42cdf82c3d51%214c510ada-c86b-4815-8820-42cdf82c3d51 items-per-page=100 files-spaces-generic-view-mode=resource-table tiles-s

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@update-docs
Copy link

update-docs bot commented Oct 25, 2023

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@LukasHirt LukasHirt marked this pull request as ready for review October 25, 2023 15:24
@LukasHirt
Copy link
Collaborator Author

@JammingBen @dschmidt ping for review 🙏

Copy link
Collaborator

@JammingBen JammingBen left a comment

Choose a reason for hiding this comment

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

Minor nitpick, rest LGTM 👍

How many configs regarding the embed mode do you expect in the future? Does it make sense to move the config into a nested object embed, which then holds all the options like enabled, target etc.? For the current 2 IMO we can leave it as it is, but if there is more to come I'd prefer an object.


const selectedFiles = computed<Resource[]>(() => {
if (isLocationPicker.value) return [store.getters['Files/currentFolder']]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Project specific code style thing: but please don't use this short syntax for early returns. We unanimously voted against it in the team because it gets overlooked quite easily.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed. Btw, there is an eslint rule that can enforce this if that's something interesting for you https://eslint.org/docs/latest/rules/curly

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for the hint, that would a good idea to have indeed!

@LukasHirt
Copy link
Collaborator Author

How many configs regarding the embed mode do you expect in the future? Does it make sense to move the config into a nested object embed, which then holds all the options like enabled, target etc.? For the current 2 IMO we can leave it as it is, but if there is more to come I'd prefer an object.

I do not expect any more options.

@sonarcloud
Copy link

sonarcloud bot commented Oct 27, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

88.9% 88.9% Coverage
0.0% 0.0% Duplication

@JammingBen JammingBen merged commit 81eb6a5 into owncloud:master Oct 30, 2023
4 checks passed
ownclouders pushed a commit that referenced this pull request Oct 30, 2023
feat: add location picker into embed mode
@LukasHirt LukasHirt deleted the feat/location-picker branch November 17, 2023 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants