How to use the @alfresco/adf-extensions.ContentActionType.menu function in @alfresco/adf-extensions

To help you get started, we’ve selected a few @alfresco/adf-extensions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Alfresco / alfresco-content-app / src / app / extensions / extension.service.ts View on Github external
private buildMenu(actionRef: ContentActionRef): ContentActionRef {
    if (
      actionRef.type === ContentActionType.menu &&
      actionRef.children &&
      actionRef.children.length > 0
    ) {
      const children = actionRef.children
        .filter(action => this.filterByRules(action))
        .map(action => this.buildMenu(action));

      actionRef.children = children
        .map(action => {
          let disabled = false;

          if (action.rules && action.rules.enabled) {
            disabled = !this.extensions.evaluateRule(
              action.rules.enabled,
              this
            );
github Alfresco / alfresco-content-app / src / app / extensions / extension.service.ts View on Github external
.map(action => {
        if (action.type === ContentActionType.menu) {
          const copy = this.copyAction(action);
          if (copy.children && copy.children.length > 0) {
            copy.children = copy.children
              .filter(childAction => this.filterByRules(childAction))
              .reduce(reduceSeparators, []);
          }
          return copy;
        }
        return action;
      })
      .reduce(reduceEmptyMenus, [])

@alfresco/adf-extensions

Provides extensibility support for ADF applications.

Apache-2.0
Latest version published 22 days ago

Package Health Score

87 / 100
Full package analysis