From c9ef8c3015d505208ddba6be7f2b665c6c32ef9e Mon Sep 17 00:00:00 2001 From: Parth Raiyani Date: Sun, 17 Mar 2024 21:40:18 +0530 Subject: [PATCH] Removed Group download as option from coolwsd.xml Signed-off-by: Parth Raiyani Change-Id: I47c07ed88d68de5fc65b2e5e1e0896bc2a082131 --- .gitpod-files/coolwsd-gitpod.xml | 1 - browser/html/cool.html.m4 | 2 - .../src/control/Control.NotebookbarCalc.js | 70 +-------------- .../src/control/Control.NotebookbarImpress.js | 76 +---------------- .../src/control/Control.NotebookbarWriter.js | 85 +------------------ browser/test/load.js | 1 - coolwsd.xml.in | 1 - wsd/COOLWSD.cpp | 1 - wsd/FileServer.cpp | 2 - 9 files changed, 4 insertions(+), 235 deletions(-) diff --git a/.gitpod-files/coolwsd-gitpod.xml b/.gitpod-files/coolwsd-gitpod.xml index d8b45d54f1..2a8bf278f2 100644 --- a/.gitpod-files/coolwsd-gitpod.xml +++ b/.gitpod-files/coolwsd-gitpod.xml @@ -47,7 +47,6 @@ - true 120 900 diff --git a/browser/html/cool.html.m4 b/browser/html/cool.html.m4 index 1931eb8254..d406472baf 100644 --- a/browser/html/cool.html.m4 +++ b/browser/html/cool.html.m4 @@ -310,7 +310,6 @@ m4_ifelse(MOBILEAPP,[true], window.frameAncestors = ''; window.socketProxy = false; window.tileSize = 256; - window.groupDownloadAsForNb = 'true' window.uiDefaults = {}; window.useIntegrationTheme = 'false'; window.checkFileInfoOverride = {}; @@ -342,7 +341,6 @@ m4_ifelse(MOBILEAPP,[true], window.frameAncestors = decodeURIComponent('%FRAME_ANCESTORS%'); window.socketProxy = %SOCKET_PROXY%; window.tileSize = 256; - window.groupDownloadAsForNb = %GROUP_DOWNLOAD_AS%; window.uiDefaults = %UI_DEFAULTS%; window.checkFileInfoOverride = %CHECK_FILE_INFO_OVERRIDE%; window.deeplEnabled = %DEEPL_ENABLED%; diff --git a/browser/src/control/Control.NotebookbarCalc.js b/browser/src/control/Control.NotebookbarCalc.js index ea1a4ca0c4..481145682f 100644 --- a/browser/src/control/Control.NotebookbarCalc.js +++ b/browser/src/control/Control.NotebookbarCalc.js @@ -203,7 +203,7 @@ L.Control.NotebookbarCalc = L.Control.NotebookbarWriter.extend({ }); } - if (!!window.groupDownloadAsForNb && !this._map['wopi'].HideExportOption) { + if (!this._map['wopi'].HideExportOption) { content.push({ 'id': 'downloadas:DownloadAsMenu', 'command': 'downloadas', @@ -212,74 +212,6 @@ L.Control.NotebookbarCalc = L.Control.NotebookbarWriter.extend({ 'text': _('Download'), 'accessibility': { focusBack: true, combination: 'DA', de: null } }); - } else if (!this._map['wopi'].HideExportOption) { - content.push( - { - 'id': 'file-downloadas-ods-downloadas-csv', - 'type': 'container', - 'children': [ - { - 'id': 'downloadas-ods', - 'type': 'menubartoolitem', - 'text': _('ODF Spreadsheet (.ods)'), - 'command': '', - 'accessibility': { focusBack: true, combination: 'DS', de: null } - }, - { - 'id': 'downloadas-csv', - 'type': 'menubartoolitem', - 'text': _('CSV File (.csv)'), - 'command': '', - 'accessibility': { focusBack: true, combination: 'DV', de: null } - }, - ], - 'vertical': 'true' - }, - { - 'id': 'file-downloadas-xls-downloadas-xlsx', - 'type': 'container', - 'children': [ - { - 'id': 'downloadas-xls', - 'type': 'menubartoolitem', - 'text': _('Excel 2003 Spreadsheet (.xls)'), - 'command': '', - 'accessibility': { focusBack: true, combination: 'DX', de: null } - }, - { - 'id': 'downloadas-xlsx', - 'type': 'menubartoolitem', - 'text': _('Excel Spreadsheet (.xlsx)'), - 'command': '', - 'accessibility': { focusBack: true, combination: 'DL', de: null } - }, - ], - 'vertical': 'true' - }, - { - 'id': 'file-exportpdf', - 'type': 'container', - 'children': [ - { - 'id': !window.ThisIsAMobileApp ? 'exportdirectpdf' : 'downloadas-pdf', - 'type': 'customtoolitem', - 'text': _('PDF Document (.pdf)'), - 'command': !window.ThisIsAMobileApp ? 'exportdirectpdf' : 'downloadas-pdf', - 'inlineLabel': true, - 'accessibility': { focusBack: true, combination: 'EP', de: null } - }, - { - 'id': 'exportpdf' , - 'type': 'customtoolitem', - 'text': _('PDF Document (.pdf) - Expert'), - 'command': 'exportpdf' , - 'inlineLabel': true, - 'accessibility': { focusBack: true, combination: 'ED', de: null } - }, - ], - 'vertical': 'true' - } - ); } if (!this._map['wopi'].HideRepairOption) { diff --git a/browser/src/control/Control.NotebookbarImpress.js b/browser/src/control/Control.NotebookbarImpress.js index de5bf20275..cf3fa5b6f3 100644 --- a/browser/src/control/Control.NotebookbarImpress.js +++ b/browser/src/control/Control.NotebookbarImpress.js @@ -269,7 +269,7 @@ L.Control.NotebookbarImpress = L.Control.NotebookbarWriter.extend({ }); } - if ((!!window.groupDownloadAsForNb) && !this._map['wopi'].HideExportOption) { + if (!this._map['wopi'].HideExportOption) { content.push({ 'id': 'downloadas:DownloadAsMenu', 'command': 'downloadas', @@ -295,80 +295,6 @@ L.Control.NotebookbarImpress = L.Control.NotebookbarWriter.extend({ 'vertical': 'true' }); } - } else if (!this._map['wopi'].HideExportOption) { - content = content.concat([ - { - 'id': 'file-downloadas-odp-downloadas-odg', - 'type': 'container', - 'children': [ - { - 'id': 'downloadas-odp', - 'class': 'unodownloadas-odp', - 'type': 'menubartoolitem', - 'text': _('ODF Presentation (.odp)'), - 'command': '', - 'accessibility': { focusBack: true, combination: 'DA', de: null } - }, - { - 'id': 'downloadas-odg', - 'class': 'unodownloadas-odg', - 'type': 'menubartoolitem', - 'text': _('ODF Drawing (.odg)'), - 'command': '', - 'accessibility': { focusBack: true, combination: 'DO', de: null } - }, - ], - 'vertical': 'true' - }, - { - 'id': 'file-downloadas-ppt-downloadas-pptx', - 'type': 'container', - 'children': [ - { - 'id': 'downloadas-ppt', - 'class': 'unodownloadas-ppt', - 'type': 'menubartoolitem', - 'text': _('PowerPoint 2003 Presentation (.ppt)'), - 'command': '', - 'accessibility': { focusBack: true, combination: 'DP', de: null } - }, - { - 'id': 'downloadas-pptx', - 'class': 'unodownloadas-pptx', - 'type': 'menubartoolitem', - 'text': _('PowerPoint Presentation (.pptx)'), - 'command': '', - 'accessibility': { focusBack: true, combination: 'DX', de: null } - }, - ], - 'vertical': 'true' - }, - { - 'id': 'file-exportdirectpdf', - 'type': 'container', - 'children': [ - { - 'id': !window.ThisIsAMobileApp ? 'exportdirectpdf' : 'downloadas-pdf', - 'class': 'unoexportpdf', - 'type': 'customtoolitem', - 'text': _('PDF Document (.pdf)'), - 'command': !window.ThisIsAMobileApp ? 'exportdirectpdf' : 'downloadas-pdf', - 'inlineLabel': true, - 'accessibility': { focusBack: true, combination: 'ED', de: null } - }, - { - 'id': 'exportpdf' , - 'class': 'unoexportpdf', - 'type': 'customtoolitem', - 'text': _('PDF Document (.pdf) - Expert'), - 'command': 'exportpdf' , - 'inlineLabel': true, - 'accessibility': { focusBack: true, combination: 'DF', de: null } - }, - ], - 'vertical': 'true' - } - ]); if (!this._map['wopi'].HideRepairOption) { content.push({ 'type': 'container', diff --git a/browser/src/control/Control.NotebookbarWriter.js b/browser/src/control/Control.NotebookbarWriter.js index 5c1e278415..d8962061a2 100644 --- a/browser/src/control/Control.NotebookbarWriter.js +++ b/browser/src/control/Control.NotebookbarWriter.js @@ -137,14 +137,11 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({ var hasSaveAs = !this._map['wopi'].UserCanNotWriteRelative; var hasShare = this._map['wopi'].EnableShare; var hideDownload = this._map['wopi'].HideExportOption; - var hasGroupedDownloadAs = !!window.groupDownloadAsForNb; var hasGroupedSaveAs = window.uiDefaults && window.uiDefaults.saveAsMode === 'group'; var hasRunMacro = !(window.enableMacrosExecution === 'false'); var hasSave = !this._map['wopi'].HideSaveOption; var content = []; - var addRepairToDownloads = hasRepair && !hideDownload; - var addRepairToColumn = hasRepair && (hideDownload || hasGroupedDownloadAs); content = []; @@ -246,7 +243,7 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({ }); } - if (hasGroupedDownloadAs && !hideDownload) { + if (!hideDownload) { content.push({ 'id': 'downloadas:DownloadAsMenu', 'command': 'downloadas', @@ -255,87 +252,9 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({ 'text': !window.ThisIsAMobileApp ? _('Download') : _('Save As'), 'accessibility': { focusBack: true, combination: 'A', de: 'M' } }); - } else if (!hideDownload) { - content.push( - { - 'type': 'container', - 'children': [ - { - 'id': 'downloadas-odt', - 'type': 'menubartoolitem', - 'text': _('ODF Text Document (.odt)'), - 'command': '' - }, - { - 'id': 'downloadas-rtf', - 'type': 'menubartoolitem', - 'text': _('Rich Text (.rtf)'), - 'command': '' - }, - ], - 'vertical': 'true' - }, - { - 'type': 'container', - 'children': [ - { - 'id': 'downloadas-doc', - 'type': 'menubartoolitem', - 'text': _('Word 2003 Document (.doc)'), - 'command': '' - }, - { - 'id': 'downloadas-docx', - 'type': 'menubartoolitem', - 'text': _('Word Document (.docx)'), - 'command': '' - }, - ], - 'vertical': 'true' - }, - { - 'type': 'container', - 'children': [ - { - 'id': !window.ThisIsAMobileApp ? 'exportdirectpdf' : 'downloadas-pdf', - 'type': 'customtoolitem', - 'text': _('PDF Document (.pdf)'), - 'command': !window.ThisIsAMobileApp ? 'exportdirectpdf' : 'downloadas-pdf', - 'inlineLabel': true - }, - { - 'id': 'exportpdf' , - 'type': 'customtoolitem', - 'text': _('PDF Document (.pdf) - Expert'), - 'command': 'exportpdf' , - 'inlineLabel': true - }, - ], - 'vertical': 'true' - }, - { - 'type': 'container', - 'children': [ - { - 'id': !window.ThisIsAMobileApp ? 'exportepub' : 'downloadas-epub', - 'type': 'customtoolitem', - 'text': _('EPUB Document (.epub)'), - 'command': !window.ThisIsAMobileApp ? 'exportepub' : 'downloadas-epub', - 'inlineLabel': true - }, - addRepairToDownloads? { - 'id': 'repair', - 'type': 'menubartoolitem', - 'text': _('Repair'), - 'command': _('Repair') - } : {} - ], - 'vertical': 'true' - } - ); } - if (addRepairToColumn) { + if (hasRepair) { content.push({ 'type': 'container', 'children': [ diff --git a/browser/test/load.js b/browser/test/load.js index f16c22a2b3..a7804b4663 100644 --- a/browser/test/load.js +++ b/browser/test/load.js @@ -91,7 +91,6 @@ data = data.replace(/%IDLE_TIMEOUT_SECS%/g, '1000000'); data = data.replace(/%PROTOCOL_DEBUG%/g, 'true'); data = data.replace(/%FRAME_ANCESTORS%/g, ''); data = data.replace(/%SOCKET_PROXY%/g, 'false'); -data = data.replace(/%GROUP_DOWNLOAD_AS%/g, 'false'); data = data.replace(/%UI_DEFAULTS%/g, '{}'); data = data.replace(/%HEXIFY_URL%/g, '""'); data = data.replace(/%CHECK_FILE_INFO_OVERRIDE%/g, 'false'); diff --git a/coolwsd.xml.in b/coolwsd.xml.in index 6b3004a555..91fd87c688 100644 --- a/coolwsd.xml.in +++ b/coolwsd.xml.in @@ -75,7 +75,6 @@ - true 300 900 diff --git a/wsd/COOLWSD.cpp b/wsd/COOLWSD.cpp index ec001e5d2a..595eea7cbf 100644 --- a/wsd/COOLWSD.cpp +++ b/wsd/COOLWSD.cpp @@ -2022,7 +2022,6 @@ void COOLWSD::innerInitialize(Application& self) { "per_document.batch_priority", "5" }, { "per_document.pdf_resolution_dpi", "96" }, { "per_document.redlining_as_comments", "false" }, - { "per_view.group_download_as", "true" }, { "per_view.idle_timeout_secs", "900" }, { "per_view.out_of_focus_timeout_secs", "120" }, { "per_view.custom_os_info", "" }, diff --git a/wsd/FileServer.cpp b/wsd/FileServer.cpp index 01494bd056..ba23fdad1f 100644 --- a/wsd/FileServer.cpp +++ b/wsd/FileServer.cpp @@ -1236,8 +1236,6 @@ FileServerRequestHandler::ResourceAccessDetails FileServerRequestHandler::prepro else Poco::replaceInPlace(preprocess, std::string("%BROWSER_LOGGING%"), std::string()); - const auto groupDownloadAs = stringifyBoolFromConfig(config, "per_view.group_download_as", true); - Poco::replaceInPlace(preprocess, std::string("%GROUP_DOWNLOAD_AS%"), groupDownloadAs); const unsigned int outOfFocusTimeoutSecs = config.getUInt("per_view.out_of_focus_timeout_secs", 60); Poco::replaceInPlace(preprocess, std::string("%OUT_OF_FOCUS_TIMEOUT_SECS%"), std::to_string(outOfFocusTimeoutSecs)); const unsigned int idleTimeoutSecs = config.getUInt("per_view.idle_timeout_secs", 900);