How to use the selector/selectors.getActiveEnvironment 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 / component / AppLayout / TestReport.jsx View on Github external
run = async () => {
    const { project, environment } = this.props,
          // options from Report modal like interactiveMode, updateSnapshot
          options = this.props.options || {};
    this.props.action.saveSuite();
    this.props.action.resetCommandFailures();
    try {
      // contains file:line:col from error report
      this.reportedFailures = [];
      this.runtimeTemp = getRuntimeTestPath();
      this.setState({ loading: true });
      const activeEnv = getActiveEnvironment( project.environments, environment ),
            specList = await exportProject(
              this.props.projectDirectory,
              this.runtimeTemp,
              this.props.checkedList,
              {
                headless: ( options.interactiveMode ? false : this.props.headless ),
                launcherArgs: this.props.launcherArgs,
                ...options
              },
              this.props.snippets,
              project.targets,
              {
                variables: getSelectedVariables( project.variables, activeEnv ),
                environment
              }
            ),
github dsheiko / puppetry / src / component / Global / SelectEnv.jsx View on Github external
render() {
      const { environments, environment } = this.props,
            activeEnv = getActiveEnvironment( environments, environment );

      return ( <div>
        <span>
          
        </span>
        <select placeholder="Select a environment" style="{{">
            option.props.children.toLowerCase().indexOf( input.toLowerCase() ) &gt;= 0
          }
        &gt;</select></div>
github dsheiko / puppetry / src / component / AppLayout / Settings / Variables / VariablesPane.jsx View on Github external
render() {
    const { project, selector } = this.props,
          activeEnv = selectors.getActiveEnvironment( project.environments, this.state.activeEnv ),
          variables = selector.getVariableDataTable( activeEnv );

    return (
      
        <p>
    Here we can define a set of environment dependent variables. For an instance, we can declare a separate
    target app URL for every environment (test.acme.com, stage.acme.com, www.acme.com).
    Before running/exporting test project we specify the desired environment and the corresponding template
    tags in test cases will be replaced with the value (URL) given for that environment.
        </p>
        <p></p>
        <br>
        <div>
          <span>
            
          </span></div>
github dsheiko / puppetry / src / component / AppLayout / Project / Variables / VariablesPane.jsx View on Github external
render() {
    const { environments, selector } = this.props,
          activeEnv = selectors.getActiveEnvironment( environments, this.state.activeEnv ),
          variables = selector.getVariableDataTable( activeEnv );
        
    return (
      
        <p>
    Here we can define a set of environment dependent variables. For an instance, we can declare a separate
    target app URL for every environment (test.acme.com, stage.acme.com, www.acme.com).
    Before running/exporting test project we specify the desired environment and the corresponding template
    tags in test cases will be replaced with the value (URL) given for that environment.
        </p>
        <p></p>
        <br>
        <div>
          <span>
            Environment
          </span></div>
github dsheiko / puppetry / src / component / Modal / ExportProjectModal.jsx View on Github external
setTimeout( async () => {
      const activeEnv = getActiveEnvironment( project.environments, environment ),
            envDto = {
              variables: getSelectedVariables( project.variables, activeEnv ),
              environment: activeEnv
            },
            browserOptions = this.getBrowserOptions(),
            launcherOptions = {
              headless: browserOptions.headless,
              incognito: browserOptions.incognito,
              ignoreHTTPSErrors: browserOptions.ignoreHTTPSErrors,
              launcherArgs: browserOptions.launcherArgs,
              devtools: browserOptions.devtools
            };

      this.props.action.saveSettings({ exportDirectory: selectedDirectory });
      let filename;
      try {