How to use the conseiljs.ConseilSortDirection.DESC function in conseiljs

To help you get started, we’ve selected a few conseiljs 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 Cryptonomic / Arronax / src / reducers / app / thunks.ts View on Github external
if (fields.length > 0) {
      fields.forEach(field=> {
        const column = attributes.find(attr => attr.name === field);
        if (column) { columns.push(column); }
      });
    } else {
      columns = [...sortedAttributes];
    }

    if (orderBy.length > 0) {
      sorts = orderBy.map(o => { return { orderBy: o.field, order: o.direction } });
    } else {
      // adding the default sort
      sorts = [{
        orderBy: levelColumn.name,
        order: ConseilSortDirection.DESC
      }];
      query = addOrdering(query, sorts[0].orderBy, sorts[0].order);
    }
    // initFilters
    filters = predicates.map(predicate => {
      const selectedAttribute = attributes.find(attr => attr.name === predicate.field);
      const isLowCardinality = selectedAttribute.cardinality !== undefined && selectedAttribute.cardinality < CARDINALITY_NUMBER;
      if (isLowCardinality) {
        cardinalityPromises.push(
          dispatch(initCardinalityValues(platform, entity, network, selectedAttribute.name, serverInfo))
        );
      }
      const operatorType = getOperatorType(selectedAttribute.dataType);

      let operator = predicate.operation;
      if (predicate.inverse) {
github Cryptonomic / Arronax / src / containers / CustomTable / index.tsx View on Github external
handleRequestSort = async (orderBy: string) => {
    const { selectedSort, selectedEntity, onSetSort, onSubmitQuery } = this.props;
    let order = ConseilSortDirection.DESC;
    if (selectedSort.orderBy === orderBy && selectedSort.order === 'desc') {
      order = ConseilSortDirection.ASC;
    }
    const sorts: Sort[] = [{ orderBy, order }];
    await onSetSort(selectedEntity, sorts);
    onSubmitQuery();
  };