Skip to content

Commit

Permalink
[FIX] fix cased when there was no source folder to search on
Browse files Browse the repository at this point in the history
  • Loading branch information
benwillig committed Feb 28, 2024
1 parent 4ed1e37 commit 84f1ca8
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions cmis_web/static/src/cmis_document/cmis_document.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,11 @@ export class CmisDocumentField extends CmisSessionComponent {

getSrcFolderIdentifiers() {
const linkDocumentSrcFolders = this.props.linkDocumentSrcFolders;
return JSON.parse(this.props.record.data[linkDocumentSrcFolders]);
let folders = [];
if (linkDocumentSrcFolders) {
folders = JSON.parse(this.props.record.data[linkDocumentSrcFolders]);
}
return folders;
}

renameObject(cmisObject) {
Expand Down Expand Up @@ -264,19 +268,21 @@ CmisDocumentField.components = {CmisActions};
CmisDocumentField.props = {
...standardFieldProps,
backend: propsCmisBackend,
linkDocumentSrcFolders: [
{
type: String,
optional: true,
},
],
linkDocumentSrcFolders: {
type: String,
optional: true,
},
};

CmisDocumentField.extractProps = ({field, attrs}) => {
return {
let res = {
backend: field.backend,
linkDocumentSrcFolders: attrs.options.linkDocumentSrcFolders,
};
}
let linkDocumentSrcFolders = attrs.options.linkDocumentSrcFolders;
if (linkDocumentSrcFolders) {
res["linkDocumentSrcFolders"] = linkDocumentSrcFolders;
}
return res;
};

registry.category("fields").add("cmis_document", CmisDocumentField);

0 comments on commit 84f1ca8

Please sign in to comment.