How to use the conseiljs.ConseilOperator.ISNULL 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
selectedFilters.forEach((filter: Filter) => {
    if ((filter.operator === ConseilOperator.BETWEEN || filter.operator === ConseilOperator.IN || filter.operator === 'notin') && filter.values.length === 1) {
      return true;
    }

    if (filter.operator !== ConseilOperator.ISNULL && filter.operator !== 'isnotnull' && (filter.values.length === 0 || filter.values[0].length === 0)) {
        return true;
    }

    let isInvert = false;
    let operator: any = filter.operator;
    if (filter.operator === 'isnotnull') {
      isInvert = true;
      operator = ConseilOperator.ISNULL;
    } else if (filter.operator === 'noteq') {
      operator = ConseilOperator.EQ;
      isInvert = true;
    } else if (filter.operator === 'notstartWith') {
      operator = ConseilOperator.STARTSWITH;
      isInvert = true;
    } else if (filter.operator === 'notendWith') {
      operator = ConseilOperator.ENDSWITH;
      isInvert = true;
    } else if (filter.operator === 'notin') {
      operator = ConseilOperator.IN;
      isInvert = true;
    }

    if (filter.operatorType === 'dateTime') { // HACK
        query = addPredicate(query, filter.name, operator, filter.values.map(v => parseInt(v)), isInvert);
github Cryptonomic / Arronax / src / reducers / app / thunks.ts View on Github external
selectedFilters.forEach((filter: Filter) => {
    if ((filter.operator === ConseilOperator.BETWEEN || filter.operator === ConseilOperator.IN || filter.operator === 'notin') && filter.values.length === 1) {
      return true;
    }

    if (filter.operator !== ConseilOperator.ISNULL && filter.operator !== 'isnotnull' && (filter.values.length === 0 || filter.values[0].length === 0)) {
        return true;
    }

    let isInvert = false;
    let operator: any = filter.operator;
    if (filter.operator === 'isnotnull') {
      isInvert = true;
      operator = ConseilOperator.ISNULL;
    } else if (filter.operator === 'noteq') {
      operator = ConseilOperator.EQ;
      isInvert = true;
    } else if (filter.operator === 'notstartWith') {
      operator = ConseilOperator.STARTSWITH;
      isInvert = true;
    } else if (filter.operator === 'notendWith') {
      operator = ConseilOperator.ENDSWITH;
github Cryptonomic / Arronax / src / components / ValueInput / index.tsx View on Github external
attribute={attribute}
          value={values[0]}
          onChange={val => changeRange(val, 0)}
        />
        <hr>
        {t('components.valueInput.and')}
        <hr>
         changeRange(val, 1)}
        /&gt;
      
    );
  } else if (operator === ConseilOperator.ISNULL || operator === 'isnotnull') {
    return null;
  } else if (operator === ConseilOperator.IN || operator === 'notin') {
    const newValue = values.join(', ');

    return (
       changeList(val)}
      /&gt;
    );
  }
  return (
github Cryptonomic / Arronax / src / reducers / app / thunks.ts View on Github external
filters = predicates.map(predicate =&gt; {
      const selectedAttribute = attributes.find(attr =&gt; attr.name === predicate.field);
      const isLowCardinality = selectedAttribute.cardinality !== undefined &amp;&amp; selectedAttribute.cardinality &lt; 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) {
        if (predicate.operation === ConseilOperator.ISNULL) {
          operator = 'isnotnull';
        } else if (predicate.operation === ConseilOperator.EQ) {
          operator = 'noteq';
        } else if (predicate.operation === ConseilOperator.STARTSWITH) {
          operator = 'notstartWith';
        } else if (predicate.operation === ConseilOperator.ENDSWITH) {
          operator = 'notendWith';
        } else if (predicate.operation === ConseilOperator.IN) {
            operator = 'notin';
        }
      }

      return {
        name: predicate.field,
        operator,
        values: predicate.set,
github Cryptonomic / Arronax / src / reducers / app / thunks.ts View on Github external
const initFilters = predicates.map(predicate =&gt; {
      const selectedAttribute = attributes[entity].find(attr =&gt; attr.name === predicate.field);
      const isLowCardinality = selectedAttribute.cardinality !== undefined &amp;&amp; selectedAttribute.cardinality &lt; 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) {
        if (predicate.operation === ConseilOperator.ISNULL) {
          operator = 'isnotnull';
        } else if (predicate.operation === ConseilOperator.EQ) {
          operator = 'noteq';
        } else if (predicate.operation === ConseilOperator.STARTSWITH) {
          operator = 'notstartWith';
        } else if (predicate.operation === ConseilOperator.ENDSWITH) {
          operator = 'notendWith';
        } else if (predicate.operation === ConseilOperator.IN) {
            operator = 'notin';
        }
      }
  
      return {
        name: predicate.field,
        operator,
        values: predicate.set,
github Cryptonomic / Arronax / src / components / FilterPanel / index.tsx View on Github external
selectedEntity,
      attributes,
      filters,
      operators,
      availableValues,
      onSubmit,
      t
    } = this.props;
    const entityName = selectedEntity.replace(/_/gi, ' ').slice(0, -1);

    const filterLength = filters.length;
    let disableAddFilter = true;
    const lastFilter: any = filterLength &gt; 0 ? filters[filterLength - 1] : {};
    if (filterLength === 0) {
      disableAddFilter = false;
    } else if (lastFilter.operator === ConseilOperator.ISNULL || lastFilter.operator === 'isnotnull') {
      disableAddFilter = false;
    } else if(lastFilter.operator === ConseilOperator.BETWEEN) {
      disableAddFilter = lastFilter.values.length !== 2;
    } else if (lastFilter.values[0] !== '') {
      disableAddFilter = false;
    }
    const newAttributes = attributes.filter((attr: any) =&gt; { return !attr.cardinality || attr.cardinality &gt; 1; });

    return (
      
        
          {filters.map((filter: Filter, index) =&gt; {
            const filterAttr = newAttributes.find(attr =&gt; attr.name === filter.name);
            return (