diff --git a/src/screens/Connectors/ConnectorUtils.res b/src/screens/Connectors/ConnectorUtils.res index 8fccb2a2d..7b3024007 100644 --- a/src/screens/Connectors/ConnectorUtils.res +++ b/src/screens/Connectors/ConnectorUtils.res @@ -1794,3 +1794,12 @@ let updateMetaData = (~metaData) => { | false => () } } + +let sortByDisableField = (arr: array<'a>, getDisabledStatus: 'a => bool) => { + arr->Array.sort((a, b) => + LogicUtils.numericArraySortComperator( + getDisabledStatus(a) ? 1.0 : 0.0, + getDisabledStatus(b) ? 1.0 : 0.0, + ) + ) +} diff --git a/src/screens/Connectors/FraudAndRisk/FRMSelect.res b/src/screens/Connectors/FraudAndRisk/FRMSelect.res index e0355b4ff..26cbfdcc0 100644 --- a/src/screens/Connectors/FraudAndRisk/FRMSelect.res +++ b/src/screens/Connectors/FraudAndRisk/FRMSelect.res @@ -117,6 +117,7 @@ let make = () => { let previousData = frmList->Array.map(ConnectorListMapper.getProcessorPayloadType) setFilteredFRMData(_ => previousData->Array.map(Nullable.make)) setPreviouslyConnectedData(_ => previousData->Array.map(Nullable.make)) + ConnectorUtils.sortByDisableField(previousData, connectorPayload => connectorPayload.disabled) let arr: array = frmList->Array.map( paymentMethod => paymentMethod diff --git a/src/screens/Connectors/PMAuthenticationProcessor/PMAuthenticationConnectorList.res b/src/screens/Connectors/PMAuthenticationProcessor/PMAuthenticationConnectorList.res index 6dc13a7bc..e84eb73ef 100644 --- a/src/screens/Connectors/PMAuthenticationProcessor/PMAuthenticationConnectorList.res +++ b/src/screens/Connectors/PMAuthenticationProcessor/PMAuthenticationConnectorList.res @@ -37,6 +37,8 @@ let make = () => { item.connector_type->ConnectorUtils.connectorTypeStringToTypeMapper === PMAuthProcessor ) + ConnectorUtils.sortByDisableField(connectorsList, connectorPayload => connectorPayload.disabled) + setConfiguredConnectors(_ => connectorsList) setFilteredConnectorData(_ => connectorsList->Array.map(Nullable.make)) setScreenState(_ => Success) diff --git a/src/screens/Connectors/PaymentProcessor/ConnectorList.res b/src/screens/Connectors/PaymentProcessor/ConnectorList.res index 6cbc663f8..927c73ea3 100644 --- a/src/screens/Connectors/PaymentProcessor/ConnectorList.res +++ b/src/screens/Connectors/PaymentProcessor/ConnectorList.res @@ -22,6 +22,7 @@ let make = () => { let connectorsList = connectorListFromRecoil->getProcessorsListFromJson(~removeFromList=ConnectorTypes.FRMPlayer) connectorsList->Array.reverse + ConnectorUtils.sortByDisableField(connectorsList, connectorPayload => connectorPayload.disabled) setFilteredConnectorData(_ => connectorsList->Array.map(Nullable.make)) setPreviouslyConnectedData(_ => connectorsList->Array.map(Nullable.make)) setConfiguredConnectors(_ => diff --git a/src/screens/Connectors/PayoutProcessor/PayoutProcessorList.res b/src/screens/Connectors/PayoutProcessor/PayoutProcessorList.res index ce24b160c..b030277c6 100644 --- a/src/screens/Connectors/PayoutProcessor/PayoutProcessorList.res +++ b/src/screens/Connectors/PayoutProcessor/PayoutProcessorList.res @@ -24,6 +24,7 @@ let make = () => { item.connector_type->ConnectorUtils.connectorTypeStringToTypeMapper === PayoutProcessor ) connectorsList->Array.reverse + ConnectorUtils.sortByDisableField(connectorsList, connectorPayload => connectorPayload.disabled) setFilteredConnectorData(_ => connectorsList->Array.map(Nullable.make)) setPreviouslyConnectedData(_ => connectorsList->Array.map(Nullable.make)) setConfiguredConnectors(_ => diff --git a/src/screens/Connectors/TaxProcessor/TaxProcessorList.res b/src/screens/Connectors/TaxProcessor/TaxProcessorList.res index ed72dd39a..9d799ab48 100644 --- a/src/screens/Connectors/TaxProcessor/TaxProcessorList.res +++ b/src/screens/Connectors/TaxProcessor/TaxProcessorList.res @@ -37,6 +37,8 @@ let make = () => { item.connector_type->ConnectorUtils.connectorTypeStringToTypeMapper === TaxProcessor ) + ConnectorUtils.sortByDisableField(connectorsList, connectorPayload => connectorPayload.disabled) + setConfiguredConnectors(_ => connectorsList) setFilteredConnectorData(_ => connectorsList->Array.map(Nullable.make)) setScreenState(_ => Success) diff --git a/src/screens/Connectors/ThreeDsProcessors/ThreeDsConnectorList.res b/src/screens/Connectors/ThreeDsProcessors/ThreeDsConnectorList.res index 224caa2cc..b46c7b82e 100644 --- a/src/screens/Connectors/ThreeDsProcessors/ThreeDsConnectorList.res +++ b/src/screens/Connectors/ThreeDsProcessors/ThreeDsConnectorList.res @@ -39,6 +39,8 @@ let make = () => { AuthenticationProcessor ) + ConnectorUtils.sortByDisableField(connectorsList, connectorPayload => connectorPayload.disabled) + setConfiguredConnectors(_ => connectorsList) setFilteredConnectorData(_ => connectorsList->Array.map(Nullable.make)) setScreenState(_ => Success)