How to use the selector/selectors.getActiveTargets function in selector

To help you get started, we’ve selected a few selector 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 dsheiko / puppetry / src / service / TestGenerator.js View on Github external
this.interactive = {
      sids: [],
      targets: {}
    };
    this.schema = schema;
    this.suite = { ...suite };
    this.projectDirectory = projectDirectory;
    this.outputDirectory = outputDirectory;
    this.snippets = { targets: {}, groups: {}, ...snippets };
    this.env = env;
    this.options = options;
    this.runner = runner; // RUNNER_PUPPETRY when embedded

    this.allTargets = Object.values({ ...sharedTargets, ...snippets.targets, ...targets });
    // resolve css prop
    this.normalizedTargets = mapSelectors( getActiveTargets( this.allTargets ) )
      //.filter( entry => !entry.ref )
      .reduce( ( carry, entry ) => {
        carry[ entry.target ] = entry;
        return carry;
      }, {});

    this.targets = this.allTargets.reduce( ( carry, entry ) => {
      carry[ entry.target ] = entry.selector;
      return carry;
    }, {});

  }
github dsheiko / puppetry / src / component / AppLayout / Main / EditableCell / TargetSelectorCell.jsx View on Github external
render() {
    const { placeholder, dataIndex, record, prefixIcon, className, type, targets } = this.props,
          { getFieldDecorator } = this.props.form,
          { editing } = record,
          inputOtherProps = type ? { type } : {},
          value = record[ dataIndex ],
          ref = this.state.hasOwnProperty( "ref" ) ? this.state.ref : record.ref,
          activeTargets = getActiveTargets( targets ).filter( target => target.target !== record.target );

    return (
      <div>
        {
          editing ? (
            <form>
              
                { getFieldDecorator( dataIndex, {
                  initialValue: value,
                  rules: [
                    {
                      validator: ruleValidateNotEmptyString
                    },
                    {
                      transform: ( value ) =&gt; value.trim()
                    }</form></div>