[ACA-3897] Extendable viewer navigation (#2109)

* [ACA-3897] Extendable viewer navigation

* Update app.extensions.json
This commit is contained in:
Dharan
2021-05-07 15:54:18 +05:30
committed by GitHub
parent cd5ccc4c4d
commit 6700830c9d
5 changed files with 33 additions and 0 deletions

View File

@@ -28,4 +28,9 @@ export interface ViewerRules {
* Checks if user can preview the node.
*/
canPreview?: string;
/**
* Shows navigation options
*/
showNavigation?: string;
}

View File

@@ -497,4 +497,17 @@ export class AppExtensionService implements RuleContext {
return true;
}
canShowViewerNavigation(node: NodeEntry) {
const rules = this.viewerRules;
if (this.isRuleDefined(rules.showNavigation)) {
const showNavigation = this.evaluateRule(rules.showNavigation, node);
if (!showNavigation) {
return false;
}
}
return true;
}
}