Skip to content

Commit 8b464b6

Browse files
grnd-altelzody
authored andcommitted
enh: set ooxml as default doc_format
Signed-off-by: grnd-alt <github@belakkaf.net>
1 parent 108afb9 commit 8b464b6

9 files changed

Lines changed: 10 additions & 5 deletions

File tree

cypress/e2e/share-link.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const otherUser = new User(randHash(), randHash())
1010

1111
describe.skip('Public sharing of office documents', () => {
1212
before(function() {
13+
cy.nextcloudTestingAppConfigSet('richdocuments', 'doc_format', '')
1314
cy.createUser(shareOwner)
1415
cy.createUser(otherUser)
1516

cypress/e2e/talk.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ describe('Talk integraiton integration', function() {
1111
cy.nextcloudTestingAppConfigSet('files', 'watermark_text', '{userId}')
1212
cy.nextcloudTestingAppConfigSet('files', 'watermark_shareTalkPublic', 'no')
1313
cy.nextcloudTestingAppConfigSet('richdocuments', 'uiDefaults-UIMode', 'notebookbar')
14+
cy.nextcloudTestingAppConfigSet('richdocuments', 'doc_format', '')
1415
}
1516

1617
before(function() {

cypress/e2e/templates.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ describe('Global templates', function() {
99

1010
let randUser
1111
before(function() {
12+
cy.nextcloudTestingAppConfigSet('richdocuments', 'doc_format', '')
1213
cy.createRandomUser().then(user => {
1314
randUser = user
1415
cy.createFolder(randUser, 'Templates-user')

lib/AppConfig.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class AppConfig {
3939
'watermark_allTagsList' => [],
4040
'watermark_linkTagsList' => [],
4141
'token_ttl' => 36000, // 10 hours
42+
'doc_format' => 'ooxml',
4243
];
4344

4445
public const WATERMARK_APP_NAMESPACE = 'files';

lib/Listener/RegisterTemplateFileCreatorListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function handle(Event $event): void {
3939
}
4040

4141
$templateManager = $event->getTemplateManager();
42-
$ooxml = $this->config->getAppValue(Application::APPNAME, 'doc_format', '') === 'ooxml';
42+
$ooxml = $this->config->getAppValue(Application::APPNAME, 'doc_format', 'ooxml') === 'ooxml';
4343
$appPath = $this->appManager->getAppPath('richdocuments');
4444

4545
$templateManager->registerTemplateFileCreator(function () use ($ooxml, $appPath) {

lib/Service/SlideDeckService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(
4141
public function generateSlideDeck(?string $userId, string $presentationText) {
4242
$rawModelOutput = $this->runLLMQuery($userId, $presentationText);
4343

44-
$ooxml = $this->config->getAppValue(Application::APPNAME, 'doc_format', '') === 'ooxml';
44+
$ooxml = $this->config->getAppValue(Application::APPNAME, 'doc_format', 'ooxml') === 'ooxml';
4545
$format = $ooxml ? 'pptx' : 'odp';
4646
$emptyPresentation = $this->getBlankPresentation($format);
4747

lib/Settings/Admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function getForm(): TemplateResponse {
4545
'wopi_allowlist' => $this->config->getAppValue('richdocuments', 'wopi_allowlist'),
4646
'edit_groups' => $this->config->getAppValue('richdocuments', 'edit_groups'),
4747
'use_groups' => $this->config->getAppValue('richdocuments', 'use_groups'),
48-
'doc_format' => $this->config->getAppValue('richdocuments', 'doc_format'),
48+
'doc_format' => $this->config->getAppValue('richdocuments', 'doc_format', 'ooxml'),
4949
'external_apps' => $this->config->getAppValue('richdocuments', 'external_apps'),
5050
'canonical_webroot' => $this->config->getAppValue('richdocuments', 'canonical_webroot'),
5151
'disable_certificate_verification' => $this->config->getAppValue('richdocuments', 'disable_certificate_verification', '') === 'yes',

lib/TemplateManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ private function getEmptyTemplateDir() {
413413
* @return array
414414
*/
415415
public function formatNodeReturn(File $template) {
416-
$ooxml = $this->config->getAppValue(Application::APPNAME, 'doc_format', '') === 'ooxml';
416+
$ooxml = $this->config->getAppValue(Application::APPNAME, 'doc_format', 'ooxml') === 'ooxml';
417417
$documentType = $this->flipTypes()[$template->getMimeType()];
418418
return [
419419
'id' => $template->getId(),
@@ -442,7 +442,7 @@ public function isTemplate($fileId) {
442442
}
443443

444444
public function formatEmpty(File $template) {
445-
$ooxml = $this->config->getAppValue(Application::APPNAME, 'doc_format', '') === 'ooxml';
445+
$ooxml = $this->config->getAppValue(Application::APPNAME, 'doc_format', 'ooxml') === 'ooxml';
446446
$documentType = $this->flipTypes()[$template->getMimeType()];
447447
return [
448448
'id' => $template->getId(),

src/components/AdminSettings.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ export default {
532532
fonts: [],
533533
hasSettingIframeSupport: false,
534534
setting_iframe_url: '',
535+
doc_format: null,
535536
},
536537
accessToken: '',
537538
accessTokenTTL: '',

0 commit comments

Comments
 (0)