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

web-app-external: view mode - #9879

Merged
JammingBen merged 11 commits into
masterfrom
web-app-external-view-mode
Nov 10, 2023
Merged

JammingBen merged 11 commits into
masterfrom
web-app-external-view-mode

Conversation

@dschmidt

@dschmidt dschmidt commented Oct 27, 2023 •

Copy link
Copy Markdown
Member

Description

Open non-personal files in "view" (readonly) mode when enabled via config: editor.openAsPreview.

Based on the logic implemented by CERN this currently is the case for all files in shares and public links.

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

@update-docs

update-docs Bot commented Oct 27, 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.

@dschmidt
dschmidt force-pushed the web-app-external-view-mode branch 2 times, most recently from 92554e5 to 052a40b Compare October 27, 2023 15:58
Comment thread packages/web-app-external/src/App.vue Resolved
Comment thread packages/web-app-external/src/App.vue Resolved
Comment thread packages/web-app-external/src/App.vue Resolved
@micbar

micbar commented Oct 27, 2023

Copy link
Copy Markdown
Contributor

Our product supports editing in a public link share. We must do this based on the share permissions

@dschmidt

dschmidt commented Oct 27, 2023 •

Copy link
Copy Markdown
Member Author

Our product supports editing in a public link share. We must do this based on the share permissions

This is not about forbidding it completely, it's just about opening files in shares/public links in read only mode by default - the user can then click edit and switch to edit mode given they have the permission to do edit the file

@micbar

micbar commented Oct 27, 2023

Copy link
Copy Markdown
Contributor

Hmm i would expect only one smart open action which always uses the highest possible permission.

@dschmidt

Copy link
Copy Markdown
Member Author

Yeah, so config option to make it opt in.

Why I pinged you tho: is Office365 as wopi app name fixed or is that configurable?

@micbar

micbar commented Oct 27, 2023

Copy link
Copy Markdown
Contributor

Configurable in the app provider

@dschmidt dschmidt changed the title web-app-external: view mode wip: web-app-external: view mode Oct 28, 2023
@dschmidt
dschmidt force-pushed the web-app-external-view-mode branch from b083464 to ea802d5 Compare November 8, 2023 18:11
@dschmidt dschmidt changed the title wip: web-app-external: view mode web-app-external: view mode Nov 9, 2023
@JammingBen
JammingBen requested a review from kulmann November 9, 2023 13:52
const loadAppUrl = useTask(function* () {
const loadAppUrl = useTask(function* (signal, viewMode: string) {
try {
if (props.isReadOnly && viewMode === 'write') {

@lookacat lookacat Nov 9, 2023 •

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.

would it make sense to create an enum for the viewMode since its used at multiple locations?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

seems overkill to me tbh. In theory we could also support more modes which are defined by the backend... this is just some specific handling for an edge case

Comment thread packages/web-app-external/src/App.vue Resolved
@dschmidt
dschmidt force-pushed the web-app-external-view-mode branch from e2a6b61 to 05ed300 Compare November 9, 2023 18:23
Comment thread packages/web-app-external/src/App.vue Resolved
@sonarqubecloud

Copy link
Copy Markdown

SonarCloud Quality Gate failed.    Quality Gate failed

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

62.5% 62.5% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@JammingBen
JammingBen merged commit a2da2bf into master Nov 10, 2023
@delete-merged-branch
delete-merged-branch Bot deleted the web-app-external-view-mode branch November 10, 2023 11:22
ownclouders pushed a commit that referenced this pull request Nov 10, 2023
* web-app-external: open files in shares and public links in view mode by default

* Simplify logic by not handling everything in a watcher

* Show error popup when trying to switch to edit mode for read-only files

* Simplify logic some more

* Remove obsolete unref

* Remove console output

* Implement feature flag

* run linter

* test: fix unit tests

* add config to dev docs

* fixup! add config to dev docs

---------

Co-authored-by: Jannik Stehle <[email protected]>
return
}

debugger

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.

@dschmidt you forgot to delete it
Screenshot 2023-11-16 at 15 55 50

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.

I'll drop it in my PR

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

doh 😂

AlexAndBear pushed a commit that referenced this pull request Dec 13, 2023
* web-app-external: open files in shares and public links in view mode by default

* Simplify logic by not handling everything in a watcher

* Show error popup when trying to switch to edit mode for read-only files

* Simplify logic some more

* Remove obsolete unref

* Remove console output

* Implement feature flag

* run linter

* test: fix unit tests

* add config to dev docs

* fixup! add config to dev docs

---------

Co-authored-by: Jannik Stehle <[email protected]>
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.

O365: Open Non "Personal" Documents in View Mode per Default

7 participants