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

fix: resolving internal links into share spaces and shared files #9821

Merged
merged 5 commits into from
Oct 31, 2023

Conversation

JammingBen
Copy link
Collaborator

@JammingBen JammingBen commented Oct 17, 2023

Description

Aligns the resolving of public and internal links. When openLinksWithDefaultApp is enabled, links will now always resolve into the default app. Before, this was only working for some links and only under specific circumstances.

Related Issue

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

@JammingBen JammingBen self-assigned this Oct 17, 2023
@update-docs
Copy link

update-docs bot commented Oct 17, 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.

@JammingBen JammingBen force-pushed the fix-internal-share-space-resolving branch 2 times, most recently from c7563e7 to 611cc85 Compare October 17, 2023 14:44
@JammingBen JammingBen marked this pull request as ready for review October 18, 2023 06:15
@JammingBen JammingBen force-pushed the fix-internal-share-space-resolving branch 2 times, most recently from 18197bd to 8c6da63 Compare October 30, 2023 09:12
@@ -55,6 +56,7 @@ import { useGroupingSettings } from '@ownclouders/web-pkg'
import SharesNavigation from 'web-app-files/src/components/AppBar/SharesNavigation.vue'
import { useGettext } from 'vue3-gettext'
import { useStore } from '@ownclouders/web-pkg'
import { useOpenWithDefaultApp } from '../../composables/openWithDefaultApp'
Copy link
Member

Choose a reason for hiding this comment

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

There also is a index.ts file which is supposed to export all folders in the composables directory. With that it would be possible to import all composables at the same time from the composables folder. Looks like there are more folders missing in the index.ts file - could be cleaned up in a followup, but for the new composable openWithDefaultApp it would be nice if you could use that pattern already. :-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point, fixed here for the useOpenWithDefaultApp composable. We need to be careful with the imports still, sometimes unit tests require these specific imports to be able to mock stuff and to avoid circular imports.

space: space
}

const defaultEditorAction = getDefaultEditorAction(fileActionsOptions)
Copy link
Member

Choose a reason for hiding this comment

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

always nice to see how composables can actually be used in other composables... that turned out nice 💪

Copy link
Member

@dschmidt dschmidt Oct 31, 2023

Choose a reason for hiding this comment

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

apparently "composables" weren't named that way by accident ;-)

@@ -103,11 +103,11 @@ Feature: link
| resource |
| lorem.txt |
When "Brian" opens the public link "textLink"
Then for "Brian" file "shareToBrian.txt" should be selected
And "Brian" closes the file viewer
Copy link
Member

Choose a reason for hiding this comment

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

Hm, I get that this is somehow an implicit verification step of being in a file viewer... but reads super weird. What do you think about introducing a generic step for Then "Brian" is in a file viewer or the like? @ScharfViktor any hints here?

Copy link
Contributor

Choose a reason for hiding this comment

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

You are right, the open public link step does not contain any checking, and close file viewer just clicks the close button.
need implement step that we can ensure that text editor was opened. A step should be implemented to ensure that the text editor has been opened.

added to my TODO list

Copy link
Member

Choose a reason for hiding this comment

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

Not necessarily the text editor. I think for a first step it's already sufficient to have a check for any editor / viewer. That's already fulfilled if the close button in the top bar is present. So with the implementation that @JammingBen chose the tests are doing what they should... but they are hard to understand from just reading the Gherkin.

@JammingBen JammingBen force-pushed the fix-internal-share-space-resolving branch from 09ceeb2 to 723f54d Compare October 31, 2023 09:26
@sonarcloud
Copy link

sonarcloud bot commented Oct 31, 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 4 Code Smells

84.4% 84.4% Coverage
0.0% 0.0% Duplication

@JammingBen JammingBen merged commit 91ef1c1 into master Oct 31, 2023
4 checks passed
@delete-merged-branch delete-merged-branch bot deleted the fix-internal-share-space-resolving branch October 31, 2023 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants