Skip to content
This repository was archived by the owner on Jul 14, 2026. It is now read-only.

feat: add location picker into embed mode - #9863

Merged
JammingBen merged 1 commit into
owncloud:masterfrom
LukasHirt:feat/location-picker
Oct 30, 2023
Merged

feat: add location picker into embed mode#9863
JammingBen merged 1 commit into
owncloud:masterfrom
LukasHirt:feat/location-picker

Conversation

@LukasHirt

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

update-docs Bot commented Oct 25, 2023

Copy link
Copy Markdown

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 force-pushed the feat/location-picker branch from 8a645c5 to 0d6e39f Compare October 25, 2023 15:24
@LukasHirt
LukasHirt marked this pull request as ready for review October 25, 2023 15:24
@LukasHirt

Copy link
Copy Markdown
Collaborator Author

@JammingBen @dschmidt ping for review 🙏

@JammingBen JammingBen left a comment

Copy link
Copy Markdown
Contributor

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 { isLocationPicker } = useEmbedMode()

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

Copy link
Copy Markdown
Contributor

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

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

@LukasHirt
LukasHirt force-pushed the feat/location-picker branch from 0d6e39f to d01153c Compare October 27, 2023 13:44
@sonarqubecloud

Copy link
Copy Markdown

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
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants