diff --git a/src/ve-app/pane-left/left-pane.component.ts b/src/ve-app/pane-left/left-pane.component.ts index 0d7b7f3bd..605231c12 100644 --- a/src/ve-app/pane-left/left-pane.component.ts +++ b/src/ve-app/pane-left/left-pane.component.ts @@ -19,6 +19,7 @@ import { left_default_buttons } from './left-buttons.config'; import { VeComponentOptions, VePromise, VeQService } from '@ve-types/angular'; import { + DocumentObject, ElementObject, ElementsRequest, ElementsResponse, @@ -355,9 +356,8 @@ class LeftPaneController implements angular.IComponentController { projectId: this.treeApi.projectId, }; this.elementSvc.getElement(reqOb).then((root) => { - // TODO this call is taking a long time that keeps the tree from being visible, need - // to see if it can be moved to a resolve or faster - /*if (this.apiSvc.isDocument(root) && this.$state.includes('**.present.**')) { + // TODO this call may take a long time that keeps the tree from being visible? + if (this.apiSvc.isDocument(root) && this.$state.includes('**.present.**')) { this.viewSvc .getDocumentMetadata({ elementId: root.id, @@ -367,7 +367,7 @@ class LeftPaneController implements angular.IComponentController { .then((result) => { this.treeApi.numberingDepth = result.numberingDepth this.treeApi.numberingSeparator = result.numberingSeparator - this.treeApi.startChapter = (root as DocumentObject)._startChapter + this.treeApi.startChapter = Number.isInteger((root as DocumentObject)._startChapter) ? (root as DocumentObject)._startChapter : 1 @@ -375,12 +375,12 @@ class LeftPaneController implements angular.IComponentController { (root as DocumentObject)._childViews = [] resolve(root) }, reject) - } else {*/ + } else { this.treeApi.numberingDepth = 0; this.treeApi.numberingSeparator = '.'; this.treeApi.startChapter = 1; resolve(root); - //} + } }, reject); } else { resolve(null); diff --git a/src/ve-utils/mms-api-client/View.service.ts b/src/ve-utils/mms-api-client/View.service.ts index 931db9dcd..491fd0dd5 100644 --- a/src/ve-utils/mms-api-client/View.service.ts +++ b/src/ve-utils/mms-api-client/View.service.ts @@ -34,7 +34,7 @@ import { PresentationReference, ElementsResponse, GenericResponse, - BasicResponse, + BasicResponse, TaggedValueObject, } from '@ve-types/mms'; import { TreeBranch, View2NodeMap } from '@ve-types/tree'; @@ -1427,7 +1427,7 @@ export class ViewService extends BaseApiService { return res; } values.forEach((value) => { - if (value.type !== 'LiteralString' || !value.value) return; + if (!value.value) return; res.push(value.value as string); }); return res; @@ -1469,18 +1469,14 @@ export class ViewService extends BaseApiService { const elementIds = [ `${reqOb.elementId}_asi-slot-${this.schemaSvc.getValue('DOCUMENT_IDS', 'Header', this.schema)}`, //header `${reqOb.elementId}_asi-slot-${this.schemaSvc.getValue('DOCUMENT_IDS', 'Footer', this.schema)}`, //footer - `${reqOb.elementId}_asi-slot-${this.schemaSvc.getValue( - 'DOCUMENT_IDS', - 'NumDepth', - this.schema - )}`, //numbering depth + `${reqOb.elementId}_asi-slot-${this.schemaSvc.getValue('DOCUMENT_IDS', 'NumDepth', this.schema)}`, //numbering depth `${reqOb.elementId}_asi-slot-${this.schemaSvc.getValue('DOCUMENT_IDS', 'NumSep', this.schema)}`, //numbering separator ]; const metaReqOb: ElementsRequest = Object.assign(reqOb, { elementId: elementIds, }); this.elementSvc - .getElements(metaReqOb, weight) + .getElements(metaReqOb, weight) .then( (data) => { if (data.length === 0) { @@ -1488,7 +1484,7 @@ export class ViewService extends BaseApiService { } for (let i = 0; i < data.length; i++) { const prop = data[i]; - const feature: string = prop.definingFeatureId ? prop.definingFeatureId : null; + const feature: string = prop.tagDefinitionId ? prop.tagDefinitionId : null; const value: LiteralObject[] = prop.value ? prop.value : null; if (!feature || !value || !Array.isArray(value)) { continue;