Skip to content

Commit 2bffcfa

Browse files
committed
fix: remove unused INFRA_CONFIG_NOT_SUPPORTED_BY_BUILD_X_LIST constant and update filtering logic
1 parent 1980dc5 commit 2bffcfa

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/Pages/GlobalConfigurations/BuildInfra/constants.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,3 @@ export const DEFAULT_TOLERANCE_OPERATOR = BuildInfraToleranceOperatorType.EQUALS
256256
export const INFRA_CONFIG_NOT_SUPPORTED_BY_BUILD_X: Partial<Record<BuildInfraConfigTypes, true>> = {
257257
[BuildInfraConfigTypes.BUILD_TIMEOUT]: true,
258258
}
259-
260-
export const INFRA_CONFIG_NOT_SUPPORTED_BY_BUILD_X_LIST: Readonly<BuildInfraConfigTypes[]> = Object.keys(
261-
INFRA_CONFIG_NOT_SUPPORTED_BY_BUILD_X,
262-
) as BuildInfraConfigTypes[]

src/Pages/GlobalConfigurations/BuildInfra/utils.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import {
4040
CREATE_PROFILE_BASE_VALUE,
4141
BUILD_INFRA_DEFAULT_PLATFORM_NAME,
4242
BUILD_INFRA_LATEST_API_VERSION,
43-
INFRA_CONFIG_NOT_SUPPORTED_BY_BUILD_X_LIST,
43+
INFRA_CONFIG_NOT_SUPPORTED_BY_BUILD_X,
4444
} from './constants'
4545
import { getUniqueId } from '../../../Shared'
4646

@@ -301,9 +301,9 @@ export const getBuildInfraProfilePayload = (
301301
// Deleting un-supported locators in case target platform is not default platform
302302
Object.entries(configurations).forEach(([platformName, platformConfigurations]) => {
303303
if (platformName !== BUILD_INFRA_DEFAULT_PLATFORM_NAME) {
304-
INFRA_CONFIG_NOT_SUPPORTED_BY_BUILD_X_LIST.forEach((locator) => {
305-
configurations[platformName] = platformConfigurations.filter((config) => config.key !== locator)
306-
})
304+
configurations[platformName] = platformConfigurations.filter(
305+
(config) => !INFRA_CONFIG_NOT_SUPPORTED_BY_BUILD_X[config.key],
306+
)
307307
}
308308
})
309309

0 commit comments

Comments
 (0)