diff --git a/src/OrganizationIntegration/OrganizationIntegrationCreate/OrganizationIntegrationCreate.js b/src/OrganizationIntegration/OrganizationIntegrationCreate/OrganizationIntegrationCreate.js index 2ce8fe34..24977710 100644 --- a/src/OrganizationIntegration/OrganizationIntegrationCreate/OrganizationIntegrationCreate.js +++ b/src/OrganizationIntegration/OrganizationIntegrationCreate/OrganizationIntegrationCreate.js @@ -1,7 +1,9 @@ -import React from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; -import { useHistory, useLocation } from 'react-router-dom'; +import { + useHistory, + useLocation, +} from 'react-router-dom'; import { LoadingPane, @@ -14,22 +16,22 @@ import { useAcqMethods, useIntegrationConfigMutation, } from '../../common/hooks'; - import { + CONNECTION_MODES, EDI_CODE_TYPES, + EXPORT_TYPES, FILE_FORMAT, FTP_TYPES, + INTEGRATION_TYPE, TRANSMISSION_METHOD, TRANSMISSION_MODES, - CONNECTION_MODES, - INTEGRATION_TYPE, } from '../constants'; +import { OrganizationIntegrationForm } from '../OrganizationIntegrationForm'; import { buildAvailableAccounts, findDefaultIntegration, getDefaultEdiNamingConvention, } from '../utils'; -import { OrganizationIntegrationForm } from '../OrganizationIntegrationForm'; // should be removed after lotus release const buildInitialValues = (organization, withMigration) => { @@ -37,7 +39,7 @@ const buildInitialValues = (organization, withMigration) => { return { schedulePeriod: 'NONE', - type: 'EDIFACT_ORDERS_EXPORT', + type: EXPORT_TYPES.claims, exportTypeSpecificParameters: { vendorEdiOrdersExportConfig: { vendorId: organization.id, diff --git a/src/OrganizationIntegration/OrganizationIntegrationForm/IntegrationInfoForm/IntegrationInfoForm.js b/src/OrganizationIntegration/OrganizationIntegrationForm/IntegrationInfoForm/IntegrationInfoForm.js index 832fc713..aa487e18 100644 --- a/src/OrganizationIntegration/OrganizationIntegrationForm/IntegrationInfoForm/IntegrationInfoForm.js +++ b/src/OrganizationIntegration/OrganizationIntegrationForm/IntegrationInfoForm/IntegrationInfoForm.js @@ -21,6 +21,7 @@ import { import { validateRequired } from '@folio/stripes-acq-components'; import { + EXPORT_TYPES, FILE_FORMAT, INTEGRATION_TYPE, TRANSMISSION_METHOD, @@ -67,11 +68,13 @@ export const IntegrationInfoForm = ({ switch (value) { case INTEGRATION_TYPE.ordering: { + change('type', EXPORT_TYPES.edifactOrders); change('exportTypeSpecificParameters.vendorEdiOrdersExportConfig.transmissionMethod', TRANSMISSION_METHOD.ftp); change('exportTypeSpecificParameters.vendorEdiOrdersExportConfig.fileFormat', FILE_FORMAT.edi); break; } case INTEGRATION_TYPE.claiming: { + change('type', EXPORT_TYPES.claims); change('exportTypeSpecificParameters.vendorEdiOrdersExportConfig.ediSchedule', null); break; } diff --git a/src/OrganizationIntegration/constants.js b/src/OrganizationIntegration/constants.js index 5d96627f..b6c7ab3e 100644 --- a/src/OrganizationIntegration/constants.js +++ b/src/OrganizationIntegration/constants.js @@ -38,6 +38,11 @@ export const EDI_NAMING_TOKENS = { numberSequence: 'numberSequence', }; +export const EXPORT_TYPES = { + edifactOrders: 'EDIFACT_ORDERS_EXPORT', + claims: 'CLAIMS', +}; + export const INTEGRATION_TYPE = { claiming: 'Claiming', ordering: 'Ordering',