Sha256: 723232bd83f761fa95038b7070684d4400181f697af3f12adc1f0dc313b7c1bb

Contents?: true

Size: 1.4 KB

Versions: 7

Compression:

Stored size: 1.4 KB

Contents

import {
  selectAPIResponse,
  selectAPIStatus,
  selectAPIErrorMessage,
} from 'foremanReact/redux/API/APISelectors';

import {
  JOB_TEMPLATES,
  JOB_CATEGORIES,
  JOB_TEMPLATE,
} from './JobWizardConstants';

export const selectJobTemplatesStatus = state =>
  selectAPIStatus(state, JOB_TEMPLATES);

export const filterJobTemplates = templates =>
  templates?.filter(template => !template.snippet) || [];

export const selectJobTemplates = state =>
  filterJobTemplates(selectAPIResponse(state, JOB_TEMPLATES)?.results);

export const selectJobCategories = state =>
  selectAPIResponse(state, JOB_CATEGORIES).job_categories || [];

export const selectJobCategoriesStatus = state =>
  selectAPIStatus(state, JOB_CATEGORIES);

export const selectCategoryError = state =>
  selectAPIErrorMessage(state, JOB_CATEGORIES);

export const selectAllTemplatesError = state =>
  selectAPIErrorMessage(state, JOB_TEMPLATES);

export const selectTemplateError = state =>
  selectAPIErrorMessage(state, JOB_TEMPLATE);

export const selectJobTemplate = state =>
  selectAPIResponse(state, JOB_TEMPLATE);

export const selectEffectiveUser = state =>
  selectAPIResponse(state, JOB_TEMPLATE).effective_user;

export const selectAdvancedTemplateInputs = state =>
  selectAPIResponse(state, JOB_TEMPLATE).advanced_template_inputs || [];

export const selectTemplateInputs = state =>
  selectAPIResponse(state, JOB_TEMPLATE).template_inputs || [];

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
foreman_remote_execution-4.8.0 webpack/JobWizard/JobWizardSelectors.js
foreman_remote_execution-4.5.6 webpack/JobWizard/JobWizardSelectors.js
foreman_remote_execution-4.5.5 webpack/JobWizard/JobWizardSelectors.js
foreman_remote_execution-4.5.4 webpack/JobWizard/JobWizardSelectors.js
foreman_remote_execution-4.7.0 webpack/JobWizard/JobWizardSelectors.js
foreman_remote_execution-4.5.3 webpack/JobWizard/JobWizardSelectors.js
foreman_remote_execution-4.5.2 webpack/JobWizard/JobWizardSelectors.js