Skip to content

Commit aae7eda

Browse files
committed
fix: configurabe webdav mime types
1 parent 74e1e56 commit aae7eda

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ module.exports = function () {
202202
### Others
203203

204204
- `enablePDFConversion`: Set to `true` to enable docx/odt to pdf conversion. Make sure the backend is enabled aswell.
205+
- `enableWebDAV`: Set to `true` to enable docx/xlsx editing with WebDAV. Make sure the backend is enabled aswell.
206+
- `allowedWebDAVMimeTypes`: Sets the allowed editable mime types (default: docx, xlsx). Make sure the list is the same as in the backend.
205207
- `namespace`: Set to API namespace
206208
- `zipDownloadHost`: Set if the ZIP download is different
207209
- `zipDownloadNamespace`: Set if the ZIP download is namespaced

addon/components/single-document-details.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ export default class SingleDocumentDetailsComponent extends Component {
3333
}
3434

3535
get isWordProcessingFormat() {
36-
return [
37-
"application/vnd.oasis.opendocument.text",
38-
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
39-
].includes(this.args.document.latestFile?.value?.mimeType);
36+
return this.config.allowedWebDAVMimeTypes.includes(
37+
this.args.document.latestFile?.value?.mimeType,
38+
);
4039
}
4140

4241
get displayWebDAVButton() {

addon/services/alexandria-config.js

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ export default class AlexandriaConfigService extends Service {
88

99
enablePDFConversion = false;
1010
enableWebDAV = false;
11+
allowedWebDAVMimeTypes = [
12+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
13+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
14+
];
1115

1216
markIcons = {};
1317

0 commit comments

Comments
 (0)