Repository navigation
Description
When opening a shared text file, the files_sharing app checks whether an app to load the text file is available and only loads the text file preview otherwise. See apps/files_sharing/js/public.js:155.
So far, the check only checks for the app files_texteditor, which is the original texteditor app. But nowadays there's also the new text app. Wouldn't it make sense to check for this app as well?
If you consider this a valid bugreport I can open a pull request. The patch would be as simple as:
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -152,7 +152,8 @@ OCA.Sharing.PublicApp = {
img.attr('src', $('#downloadURL').val());
imgcontainer.appendTo('#imgframe');
} else if (mimetype.substr(0, mimetype.indexOf('/')) === 'text' && window.btoa) {
- if (OC.appswebroots['files_texteditor'] !== undefined) {
+ if (OC.appswebroots['files_texteditor'] !== undefined ||
+ OC.appswebroots['text'] !== undefined) {
// the text editor handles the previewing
return;
}I tested the patch and it results in faster loading of shared text files, as the preview view is not loaded before the text app view.
Steps to reproduce
- Install latest Nextcloud with viewer and text app, but without files_texteditor app.
- Create a text file, share it via link and open the link.
- Watch the preview being loaded and then the text app being loaded afterwards.
Expected behaviour
In my eyes, loading the preview is superfluous. I
Actual behaviour
First, the files_sharing app loads its internal preview of the text file, then the text app agin loads the text file.
Server configuration
Nextcloud version: 19 beta4
List of activated apps:
App list
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Enabled:
- accessibility: 1.5.0
- cloud_federation_api: 1.2.0
- comments: 1.9.0
- contactsinteraction: 1.0.0
- dav: 1.15.0
- federatedfilesharing: 1.9.0
- federation: 1.9.0
- files: 1.14.0
- files_sharing: 1.11.0
- files_trashbin: 1.9.0
- files_versions: 1.12.0
- lookup_server_connector: 1.7.0
- oauth2: 1.7.0
- provisioning_api: 1.9.0
- settings: 1.1.0
- sharebymail: 1.9.0
- systemtags: 1.9.0
- text: 3.0.1
- theming: 1.10.0
- twofactor_backupcodes: 1.8.0
- updatenotification: 1.9.0
- viewer: 1.3.0
- workflowengine: 2.1.0
Disabled:
- admin_audit
- encryption
- files_external
- testing
- user_ldap
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Activity
kesselb commentedon Apr 23, 2020
Mind to open a pull request? Looks reasonable to me.
Don't load text file preview when text app is available (Fixes: nextc…
Don't load text file preview when text app is available (Fixes: nextc…
mejo- commentedon Apr 24, 2020
@kesselb: Sure, here you go: #20629 😊
Don't load text file preview when text app is available (Fixes: nextc…
Merge pull request #20629 from mejo-/files_sharing_preview_text
Don't load text file preview when text app is available (Fixes: #20615)
Don't load text file preview when text app is available (Fixes: #20615)
Merge pull request #20996 from nextcloud/backport/20629/stable18
Merge pull request #21028 from nextcloud/backport/20629/stable19