Sha256: d39aee85129f80fa2e1da381f124716e8e0d1d145578127d6769e2d321695fbc

Contents?: true

Size: 748 Bytes

Versions: 18

Compression:

Stored size: 748 Bytes

Contents

import { STATUS } from 'foremanReact/constants';
import { deepPropsToCamelCase } from 'foremanReact/common/helpers';
import {
  selectAPIStatus,
  selectAPIResponse,
} from 'foremanReact/redux/API/APISelectors';

import { WEBHOOK_API_REQUEST_KEY } from '../../constants';

export const selectWebhookValues = state =>
  deepPropsToCamelCase(selectAPIResponse(state, WEBHOOK_API_REQUEST_KEY)) || {};

export const selectWebhookTemplateId = state =>
  selectWebhookValues(state)?.webhookTemplate?.id || 0;

const selectWebhooksEditPageStatus = state =>
  selectAPIStatus(state, WEBHOOK_API_REQUEST_KEY);

export const selectIsLoading = state => {
  const status = selectWebhooksEditPageStatus(state);
  return !status || status === STATUS.PENDING;
};

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
foreman_webhooks-4.0.0 webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookEditModalSelectors.js
foreman_webhooks-3.2.3 webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookEditModalSelectors.js
foreman_webhooks-3.2.2 webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookEditModalSelectors.js
foreman_webhooks-3.1.1 webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookEditModalSelectors.js
foreman_webhooks-3.2.1 webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookEditModalSelectors.js
foreman_webhooks-3.2.0 webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookEditModalSelectors.js
foreman_webhooks-3.1.0 webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookEditModalSelectors.js
foreman_webhooks-3.0.5 webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookEditModalSelectors.js
foreman_webhooks-2.0.3 webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookEditModalSelectors.js
foreman_webhooks-3.0.4 webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookEditModalSelectors.js
foreman_webhooks-2.0.2 webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookEditModalSelectors.js
foreman_webhooks-3.0.3 webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookEditModalSelectors.js
foreman_webhooks-3.0.2 webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookEditModalSelectors.js
foreman_webhooks-3.0.1 webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookEditModalSelectors.js
foreman_webhooks-2.0.1 webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookEditModalSelectors.js
foreman_webhooks-3.0.0 webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookEditModalSelectors.js
foreman_webhooks-2.0.0 webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookEditModalSelectors.js
foreman_webhooks-1.1.0 webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/Components/WebhookEditModalSelectors.js