Sha256: e0e89da2c2f1a7fd9d23e5f9c573567b5fbc630617ed5cf0c4eff2a939378788

Contents?: true

Size: 1.29 KB

Versions: 55

Compression:

Stored size: 1.29 KB

Contents

import React, { useEffect } from 'react';
import PropTypes from 'prop-types';
import { TextInput, FormGroup, ValidatedOptions } from '@patternfly/react-core';
import { translate as __ } from 'foremanReact/common/I18n';
import { RepeatDaily } from './RepeatDaily';
import { noop } from '../../../helpers';

export const RepeatMonth = ({ repeatData, setRepeatData, setValid }) => {
  const { days, at } = repeatData;
  useEffect(() => {
    if (days && at) {
      setValid(true);
    } else {
      setValid(false);
    }
    return () => setValid(true);
  }, [setValid, days, at]);
  return (
    <>
      <FormGroup label={__('Days')} isRequired>
        <TextInput
          isRequired
          validated={days ? ValidatedOptions.noval : ValidatedOptions.error}
          aria-label="days"
          placeholder="1,2..."
          type="text"
          value={repeatData.days || ''}
          onChange={newTime => {
            setRepeatData({ ...repeatData, days: newTime });
          }}
        />
      </FormGroup>
      <RepeatDaily
        repeatData={repeatData}
        setRepeatData={setRepeatData}
        setValid={noop}
      />
    </>
  );
};

RepeatMonth.propTypes = {
  repeatData: PropTypes.object.isRequired,
  setRepeatData: PropTypes.func.isRequired,
  setValid: PropTypes.func.isRequired,
};

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
foreman_remote_execution-12.0.7 webpack/JobWizard/steps/Schedule/RepeatMonth.js
foreman_remote_execution-10.1.3 webpack/JobWizard/steps/Schedule/RepeatMonth.js
foreman_remote_execution-13.0.0 webpack/JobWizard/steps/Schedule/RepeatMonth.js
foreman_remote_execution-12.0.5 webpack/JobWizard/steps/Schedule/RepeatMonth.js
foreman_remote_execution-12.0.4 webpack/JobWizard/steps/Schedule/RepeatMonth.js
foreman_remote_execution-12.0.1 webpack/JobWizard/steps/Schedule/RepeatMonth.js
foreman_remote_execution-12.0.2 webpack/JobWizard/steps/Schedule/RepeatMonth.js
foreman_remote_execution-11.1.3 webpack/JobWizard/steps/Schedule/RepeatMonth.js
foreman_remote_execution-10.1.2 webpack/JobWizard/steps/Schedule/RepeatMonth.js
foreman_remote_execution-12.0.0 webpack/JobWizard/steps/Schedule/RepeatMonth.js
foreman_remote_execution-10.1.1 webpack/JobWizard/steps/Schedule/RepeatMonth.js
foreman_remote_execution-11.1.1 webpack/JobWizard/steps/Schedule/RepeatMonth.js
foreman_remote_execution-11.1.0 webpack/JobWizard/steps/Schedule/RepeatMonth.js
foreman_remote_execution-10.1.0 webpack/JobWizard/steps/Schedule/RepeatMonth.js
foreman_remote_execution-8.3.3 webpack/JobWizard/steps/Schedule/RepeatMonth.js
foreman_remote_execution-8.3.2 webpack/JobWizard/steps/Schedule/RepeatMonth.js
foreman_remote_execution-11.0.0 webpack/JobWizard/steps/Schedule/RepeatMonth.js
foreman_remote_execution-10.0.7 webpack/JobWizard/steps/Schedule/RepeatMonth.js
foreman_remote_execution-8.3.1 webpack/JobWizard/steps/Schedule/RepeatMonth.js
foreman_remote_execution-10.0.6 webpack/JobWizard/steps/Schedule/RepeatMonth.js