Sha256: 7ebf39a96431ffd394782bcb07d00418452b48e74376279066d1608e632c1dff

Contents?: true

Size: 1.38 KB

Versions: 12

Compression:

Stored size: 1.38 KB

Contents

import { FormGroup, Radio } from '@patternfly/react-core';
import { translate as __ } from 'foremanReact/common/I18n';
import PropTypes from 'prop-types';
import React from 'react';
import { helpLabel } from '../form/FormHelpers';

export const QueryType = ({ isTypeStatic, setIsTypeStatic }) => (
  <>
    <FormGroup
      label={__('Query type')}
      fieldId="query-type-static"
      labelIcon={helpLabel(
        __('Type has impact on when is the query evaluated to hosts.'),
        'query-type'
      )}
    >
      <Radio
        ouiaId="query-type-static"
        isChecked={isTypeStatic}
        name="query-type"
        onChange={() => setIsTypeStatic(true)}
        id="query-type-static"
        label={__('Static query')}
        body={__('evaluates just after you submit this form')}
      />
    </FormGroup>
    <FormGroup fieldId="query-type-dynamic">
      <Radio
        ouiaId="query-type-dynamic"
        isChecked={!isTypeStatic}
        name="query-type"
        onChange={() => setIsTypeStatic(false)}
        id="query-type-dynamic"
        label={__('Dynamic query')}
        body={__(
          "evaluates just before the execution is started, so if it's planned in future, targeted hosts set may change before it"
        )}
      />
    </FormGroup>
  </>
);

QueryType.propTypes = {
  isTypeStatic: PropTypes.bool.isRequired,
  setIsTypeStatic: PropTypes.func.isRequired,
};

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
foreman_remote_execution-14.1.1 webpack/JobWizard/steps/Schedule/QueryType.js
foreman_remote_execution-14.1.0 webpack/JobWizard/steps/Schedule/QueryType.js
foreman_remote_execution-14.0.2 webpack/JobWizard/steps/Schedule/QueryType.js
foreman_remote_execution-14.0.1 webpack/JobWizard/steps/Schedule/QueryType.js
foreman_remote_execution-13.2.6 webpack/JobWizard/steps/Schedule/QueryType.js
foreman_remote_execution-14.0.0 webpack/JobWizard/steps/Schedule/QueryType.js
foreman_remote_execution-13.2.5 webpack/JobWizard/steps/Schedule/QueryType.js
foreman_remote_execution-13.2.4 webpack/JobWizard/steps/Schedule/QueryType.js
foreman_remote_execution-13.2.3 webpack/JobWizard/steps/Schedule/QueryType.js
foreman_remote_execution-13.2.2 webpack/JobWizard/steps/Schedule/QueryType.js
foreman_remote_execution-13.2.1 webpack/JobWizard/steps/Schedule/QueryType.js
foreman_remote_execution-13.2.0 webpack/JobWizard/steps/Schedule/QueryType.js