How to use the plywood.findByName function in plywood

To help you get started, we’ve selected a few plywood 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 hortonworks / streamline / pivot / src / client / applications / pivot-application / pivot-application.tsx View on Github external
getSelectedItemFromHash(items: (DataCube | Collection)[], hash: string, viewType: ViewType): DataCube | Collection {
    // can change header from hash
    var parts = this.parseHash(hash);
    var itemName = parts[viewType === COLLECTION ? 1 : 0];

    return findByName(items, itemName);
  }
github geo-opensource / pivot / src / client / applications / pivot-application / pivot-application.tsx View on Github external
getSelectedItemFromHash(items: (DataCube | Collection)[], hash: string, viewType: ViewType): DataCube | Collection {
    // can change header from hash
    var parts = this.parseHash(hash);
    var itemName = parts[viewType === COLLECTION ? 1 : 0];

    return findByName(items, itemName);
  }
github geo-opensource / pivot / src / client / views / settings-view / data-cube-edit / data-cube-edit.tsx View on Github external
openModal(name: string) {
    this.setState({
      modal: findByName(this.modals, name)
    });
  }
github geo-opensource / pivot / src / common / models / app-settings / app-settings.ts View on Github external
public getDataCube(dataCubeName: string): DataCube {
    return findByName(this.dataCubes, dataCubeName);
  }
github geo-opensource / pivot / src / common / models / app-settings / app-settings.ts View on Github external
public getCluster(clusterName: string): Cluster {
    return findByName(this.clusters, clusterName);
  }
github geo-opensource / pivot / src / common / models / app-settings / app-settings.ts View on Github external
constructor(parameters: AppSettingsValue) {
    const {
      version,
      clusters,
      customization,
      dataCubes,
      linkViewConfig,
      collections
    } = parameters;

    for (var dataCube of dataCubes) {
      if (dataCube.clusterName === 'native') continue;
      if (!findByName(clusters, dataCube.clusterName)) {
        throw new Error(`data cube '${dataCube.name}' refers to an unknown cluster '${dataCube.clusterName}'`);
      }
    }

    this.version = version || 0;
    this.clusters = clusters;
    checkNamedArrayUnique(this.clusters);
    this.customization = customization;
    this.dataCubes = dataCubes;
    checkNamedArrayUnique(this.dataCubes);
    this.linkViewConfig = linkViewConfig;
    this.collections = collections;
    checkNamedArrayUnique(this.collections);
  }