@finos/legend-data-cube
Version:
41 lines • 1.39 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { makeObservable, observable, action } from 'mobx';
import { DocumentationPanel } from '../../components/core/DataCubeDocumentationPanel.js';
export class DataCubeDocumentationService {
_engine;
_layoutService;
display;
currentEntry;
constructor(engine, layoutService) {
makeObservable(this, {
currentEntry: observable,
setCurrentEntry: action,
});
this._engine = engine;
this._layoutService = layoutService;
this.display = this._layoutService.newDisplay('Documentation', () => _jsx(DocumentationPanel, {}), {
x: -50,
y: -50,
width: 400,
height: 400,
minWidth: 300,
minHeight: 200,
center: false,
});
}
getEntry(key) {
return this._engine.getDocumentationEntry(key);
}
setCurrentEntry(entry) {
this.currentEntry = entry;
}
shouldDisplayDocumentationEntry(entry) {
return (
/**
* Since we're displaying the documentation entry, we want only user-friendly docs
* and discard anything that doesn't come with a title, or does not have any content
*/
Boolean(entry.title && (entry.text ?? entry.markdownText)));
}
}
//# sourceMappingURL=DataCubeDocumentationService.js.map