diff --git a/.eslintignore b/.eslintignore deleted file mode 100755 index 4c62c958c8..0000000000 --- a/.eslintignore +++ /dev/null @@ -1,324 +0,0 @@ -.eslintrc.js -vite.config.mts -scripts/ - -# The following files have eslint errors/warnings -src/components/AppSelector/ChartSelector.tsx -src/components/ApplicationGroup/AppGroup.service.ts -src/components/ApplicationGroup/AppGroup.utils.ts -src/components/ApplicationGroup/AppGroupAppFilter.components.tsx -src/components/ApplicationGroup/AppGroupDetailsRoute.tsx -src/components/ApplicationGroup/Constants.ts -src/components/ApplicationGroup/CreateAppGroup.tsx -src/components/ApplicationGroup/Details/EnvCDDetails/EnvCDDetails.tsx -src/components/ApplicationGroup/Details/EnvCIDetails/EnvCIDetails.tsx -src/components/ApplicationGroup/Details/EnvironmentOverview/HibernateModal.tsx -src/components/ApplicationGroup/Details/EnvironmentOverview/HibernateStatusListDrawer.tsx -src/components/ApplicationGroup/Details/EnvironmentOverview/HibernateStatusRow.tsx -src/components/ApplicationGroup/Details/TriggerView/BulkCDTrigger.tsx -src/components/ApplicationGroup/Details/TriggerView/BulkCITrigger.tsx -src/components/ApplicationGroup/Details/TriggerView/EnvTriggerView.tsx -src/components/ApplicationGroup/SearchBar.tsx -src/components/CIPipelineN/AdvancedConfigOptions.tsx -src/components/CIPipelineN/Build.tsx -src/components/CIPipelineN/CIPipeline.tsx -src/components/CIPipelineN/CustomImageTags.tsx -src/components/CIPipelineN/CustomInputOutputVariables.tsx -src/components/CIPipelineN/CustomInputVariableSelect.tsx -src/components/CIPipelineN/EnvironmentList.tsx -src/components/CIPipelineN/InputPluginSelect.tsx -src/components/CIPipelineN/MultiplsPort.tsx -src/components/CIPipelineN/OutputDirectoryPath.tsx -src/components/CIPipelineN/PreBuild.tsx -src/components/CIPipelineN/Sidebar.tsx -src/components/CIPipelineN/TaskDetailComponent.tsx -src/components/CIPipelineN/TaskList.tsx -src/components/CIPipelineN/TaskTypeDetailComponent.tsx -src/components/CIPipelineN/VariableContainer.tsx -src/components/CIPipelineN/ciPipeline.utils.tsx -src/components/ClusterNodes/ClusterEvents.tsx -src/components/ClusterNodes/ClusterManifest.tsx -src/components/ClusterNodes/ClusterNodeEmptyStates.tsx -src/components/ClusterNodes/NodeDetails.tsx -src/components/Jobs/ExpandedRow/ExpandedRow.tsx -src/components/Jobs/JobDetails/JobDetails.tsx -src/components/Jobs/JobsEmptyState.tsx -src/components/Jobs/Service.ts -src/components/Jobs/Utils.ts -src/components/LogViewer/LogViewer.tsx -src/components/app/LogFilter.ts -src/components/app/Overview/EnvironmentList.tsx -src/components/app/Overview/Overview.tsx -src/components/app/Overview/TagChipsContainer.tsx -src/components/app/Overview/utils.tsx -src/components/app/ResourceTreeNodes.tsx -src/components/app/ResponsiveDrawer.tsx -src/components/app/WebWorker.ts -src/components/app/create/CreateApp.tsx -src/components/app/create/validationRules.ts -src/components/app/details/AboutTagEditModal.tsx -src/components/app/details/appDetails/AppMetrics.tsx -src/components/app/details/appDetails/AppStatusCard.tsx -src/components/app/details/appDetails/DeploymentStatusDetailModal.tsx -src/components/app/details/appDetails/GraphsModal.tsx -src/components/app/details/appDetails/IssuesCard.tsx -src/components/app/details/appDetails/SourceInfo.tsx -src/components/app/details/appDetails/index.tsx -src/components/app/details/appDetails/utils.tsx -src/components/app/details/cIDetails/CIDetails.tsx -src/components/app/details/cIDetails/cIDetails.util.tsx -src/components/app/details/cdDetails/CDDetails.tsx -src/components/app/details/cicdHistory/History.components.tsx -src/components/app/details/main.tsx -src/components/app/details/metrics/BenchmarkModal.tsx -src/components/app/details/metrics/DeploymentTable.tsx -src/components/app/details/metrics/DeploymentTableModal.tsx -src/components/app/details/metrics/deploymentMetrics.service.ts -src/components/app/details/metrics/deploymentMetrics.util.tsx -src/components/app/details/testViewer/List.tsx -src/components/app/details/testViewer/TestRunDetails.tsx -src/components/app/details/testViewer/TestRunList.tsx -src/components/app/details/triggerView/EmptyStateCIMaterial.tsx -src/components/app/details/triggerView/MaterialSource.tsx -src/components/app/details/triggerView/ciWebhook.service.ts -src/components/app/details/triggerView/config.ts -src/components/app/details/triggerView/workflow.service.ts -src/components/app/details/triggerView/workflow/Workflow.tsx -src/components/app/details/triggerView/workflow/nodes/TriggerExternalCINode.tsx -src/components/app/details/triggerView/workflow/nodes/TriggerLinkedCINode.tsx -src/components/app/details/triggerView/workflow/nodes/staticNode.tsx -src/components/app/details/triggerView/workflow/nodes/triggerCDNode.tsx -src/components/app/details/triggerView/workflow/nodes/triggerCINode.tsx -src/components/app/details/triggerView/workflow/nodes/triggerPrePostCDNode.tsx -src/components/app/details/triggerView/workflow/nodes/workflow.utils.tsx -src/components/app/grepSSEworker.ts -src/components/app/list-new/AppListService.ts -src/components/app/list-new/GenericAppList.tsx -src/components/app/list-new/HelmAppList.tsx -src/components/app/list/TriggerUrl.tsx -src/components/app/list/appList.modal.ts -src/components/app/list/emptyView/Empty.tsx -src/components/app/list/expandedRow/ExpandedRow.tsx -src/components/bulkEdits/bulkedit.utils.tsx -src/components/cdPipeline/BuildCD.tsx -src/components/cdPipeline/CDPipeline.tsx -src/components/cdPipeline/cdPipeline.service.ts -src/components/cdPipeline/cdpipeline.util.tsx -src/components/cdPipeline/validationRules.ts -src/components/chartRepo/ChartRepo.tsx -src/components/chartRepo/chartRepo.service.tsx -src/components/charts/AdvancedConfig.tsx -src/components/charts/ChartGroupAdvanceDeploy.tsx -src/components/charts/ChartGroupDeployments.tsx -src/components/charts/ChartGroupDetails.tsx -src/components/charts/ChartGroupUpdate.tsx -src/components/charts/ChartHeaderFilters.tsx -src/components/charts/MultiChartSummary.tsx -src/components/charts/chartValues/ChartValues.tsx -src/components/charts/charts.service.ts -src/components/charts/charts.util.tsx -src/components/charts/dialogs/ValuesYamlConfirmDialog.tsx -src/components/charts/list/ChartGroup.tsx -src/components/charts/list/ChartListPopUpRow.tsx -src/components/charts/list/DeployedChartFilters.tsx -src/components/charts/list/DiscoverCharts.tsx -src/components/charts/modal/ChartGroupBasicDeploy.tsx -src/components/charts/modal/CreateChartGroup.tsx -src/components/charts/useChartGroup.ts -src/components/checkList/AllChartsCheck.tsx -src/components/checkList/AllCheckModal.tsx -src/components/checkList/AppCheckList.tsx -src/components/checkList/ChartCheckList.tsx -src/components/checkList/CustomAppDeploy.tsx -src/components/checkList/GlobalAllCheckModal.tsx -src/components/checkList/GlobalChartCheck.tsx -src/components/checkList/SampleAppDeploy.tsx -src/components/checkList/checklist.service.ts -src/components/ciConfig/CIAdvancedConfig.tsx -src/components/ciConfig/CIBuildConfigDiff.tsx -src/components/ciConfig/CIBuildpackBuildOptions.tsx -src/components/ciConfig/CIConfig.tsx -src/components/ciConfig/CIConfig.utils.ts -src/components/ciConfig/CIConfigDiffView.tsx -src/components/ciConfig/CIConfigForm.tsx -src/components/ciConfig/CIContainerRegistryConfig.tsx -src/components/ciConfig/CICreateDockerfileOption.tsx -src/components/ciConfig/CIDockerFileConfig.tsx -src/components/ciConfig/TargetPlatformSelector.tsx -src/components/ciConfig/service.tsx -src/components/ciPipeline/CIPipelineAdvanced.tsx -src/components/ciPipeline/ConfigureWebhook.tsx -src/components/ciPipeline/ExternalCIPipeline.tsx -src/components/ciPipeline/LinkedCIPipelineEdit.tsx -src/components/ciPipeline/LinkedCIPipelineView.tsx -src/components/ciPipeline/Webhook/WebhookDetailsModal.tsx -src/components/ciPipeline/Webhook/webhook.service.ts -src/components/ciPipeline/Webhook/webhook.utils.ts -src/components/ciPipeline/WebhookSelectorCondition.tsx -src/components/ciPipeline/ciPipeline.service.ts -src/components/ciPipeline/validationRules.ts -src/components/cluster/Cluster.tsx -src/components/cluster/ClusterComponentModal.tsx -src/components/cluster/ClusterInfoStepsModal.tsx -src/components/cluster/ClusterInstallStatus.tsx -src/components/cluster/UseNameListDropdown.tsx -src/components/cluster/cluster.service.ts -src/components/cluster/cluster.util.ts -src/components/command/Command.tsx -src/components/command/CommandErrorBoundary.tsx -src/components/command/command.util.ts -src/components/common/Accordian/Accordian.tsx -src/components/common/AppDetailsEmptyState.tsx -src/components/common/Carousel/Carousel.tsx -src/components/common/ContentCard/ContentCard.tsx -src/components/common/Contexts/AppContext.ts -src/components/common/DatePickers/Calender.tsx -src/components/common/DatePickers/DayPickerRangeController.tsx -src/components/common/DeprecatedUpdateWarn.tsx -src/components/common/Description/GenericDescription.tsx -src/components/common/HiddenInput/HiddenInput.tsx -src/components/common/List/List.tsx -src/components/common/MultiSelect/MultiSelect.tsx -src/components/common/Select/Select.tsx -src/components/common/ValidateForm/ValidateForm.tsx -src/components/common/eaEmptyState/EAEmptyState.tsx -src/components/common/edge/rectangularEdge.tsx -src/components/common/edge/straightEdge.tsx -src/components/common/errorBoundary.tsx -src/components/common/formFields/CopyButton.tsx -src/components/common/formFields/Typeahead.tsx -src/components/common/helpers/Helpers.tsx -src/components/common/helpers/compareVersion.ts -src/components/common/helpers/isSubset.ts -src/components/common/helpers/time.ts -src/components/common/helpers/utils.tsx -src/components/common/helpers/workflowURL.ts -src/components/common/hooks/FileReader.ts -src/components/common/icons/Icons.tsx -src/components/common/lineChart/lineChart.tsx -src/components/common/navigation/Navigation.tsx -src/components/dockerRegistry/Docker.tsx -src/components/dockerRegistry/ManageRegistry.tsx -src/components/dockerRegistry/service.tsx -src/components/external-apps/ExternalAppService.ts -src/components/externalArgoApps/ExternalArgoApp.tsx -src/components/externalArgoApps/ExternalArgoAppDetail.tsx -src/components/externalLinks/ExternalLinks.component.tsx -src/components/externalLinks/ExternalLinksCRUD/AddExternalLink.tsx -src/components/externalLinks/ExternalLinksCRUD/ConfigureLinkAction.tsx -src/components/externalLinks/ExternalLinksCRUD/DeleteExternalLinkDialog.tsx -src/components/externalLinks/ExternalLinksCRUD/IdentifierSelector.tsx -src/components/externalLinks/ExternalLinksFilters.tsx -src/components/gitOps/GitOpsConfiguration.tsx -src/components/gitOps/UserGitRepConfiguration.tsx -src/components/gitOps/UserGitRepo.tsx -src/components/gitOps/gitops.service.tsx -src/components/gitOps/gitops.type.ts -src/components/gitProvider/AddGitHostConfigModal.tsx -src/components/gitProvider/GitProvider.tsx -src/components/gitProvider/gitProvider.service.tsx -src/components/gitProvider/gitProvider.util.tsx -src/components/globalConfigurations/GlobalConfiguration.tsx -src/components/globalConfigurations/GlobalConfigurationProvider.tsx -src/components/hostURL/HostURL.tsx -src/components/hyperion/EnvironmentSelect.tsx -src/components/material/MaterialView.tsx -src/components/notifications/AddNotification.tsx -src/components/notifications/ModifyRecipientsModal.tsx -src/components/notifications/NotificationTab.tsx -src/components/notifications/Notifications.tsx -src/components/notifications/notifications.service.ts -src/components/notifications/notifications.util.tsx -src/components/onboardingGuide/GuideCommonHeader.tsx -src/components/onboardingGuide/OnboardingGuide.tsx -src/components/onboardingGuide/onboarding.utils.ts -src/components/project/ProjectList.tsx -src/components/scopedVariables/Descriptor.tsx -src/components/scopedVariables/DescriptorSearchBar.tsx -src/components/scopedVariables/SavedVariables.tsx -src/components/scopedVariables/ScopedVariables.tsx -src/components/scopedVariables/ScopedVariablesEditor.tsx -src/components/scopedVariables/ScopedVariablesLoader.tsx -src/components/scopedVariables/UploadScopedVariables.tsx -src/components/scopedVariables/VariablesList.tsx -src/components/scopedVariables/utils.tsx -src/components/security/AddCveModal.tsx -src/components/security/DeleteCVEModal.tsx -src/components/security/SecurityPolicyApp.tsx -src/components/security/SecurityPolicyCluster.tsx -src/components/security/SecurityPolicyEdit.tsx -src/components/security/SecurityPolicyEnvironment.tsx -src/components/security/SecurityPolicyGlobal.tsx -src/components/security/UpdateSeverityModal.tsx -src/components/security/security.util.tsx -src/components/terminal/TerminalWrapper.tsx -src/components/util/KeyValueFileInput.tsx -src/components/v2/appDetails/ReleaseStatusEmptyState.tsx -src/components/v2/appDetails/SyncError.component.tsx -src/components/v2/appDetails/appDetails.api.ts -src/components/v2/appDetails/ea/EAAppDetail.component.tsx -src/components/v2/appDetails/k8Resource/FilterResource.tsx -src/components/v2/appDetails/k8Resource/nodeDetail/EphemeralContainerDrawer.tsx -src/components/v2/appDetails/k8Resource/nodeDetail/NodeDetailTabs/CustomLogsModal/CustomLogsModal.tsx -src/components/v2/appDetails/k8Resource/nodeDetail/NodeDetailTabs/Terminal.component.tsx -src/components/v2/appDetails/k8Resource/nodeDetail/NodeDetailTabs/terminal/TerminalWrapper.component.tsx -src/components/v2/appDetails/k8Resource/nodeDetail/NodeDetailTabs/terminal/constants.ts -src/components/v2/appDetails/k8Resource/nodeDetail/NodeDetailTabs/terminal/terminal.type.ts -src/components/v2/appDetails/k8Resource/nodeDetail/nodeDetail.api.ts -src/components/v2/appDetails/k8Resource/nodeDetail/nodeDetail.util.tsx -src/components/v2/appDetails/k8Resource/nodeType/NodeTree.component.tsx -src/components/v2/appDetails/k8Resource/nodeType/PodTabSection.tsx -src/components/v2/appDetails/k8Resource/nodeType/nodeType.util.ts -src/components/v2/appDetails/k8Resource/nodeType/useNodeTreeReducer.ts -src/components/v2/appDetails/sourceInfo/EnvironmentSelector.component.tsx -src/components/v2/appDetails/sourceInfo/environmentStatus/AppStatusDetailModal.tsx -src/components/v2/appDetails/sourceInfo/environmentStatus/ConfigStatusModal.component.tsx -src/components/v2/appDetails/sourceInfo/environmentStatus/EnvironmentStatus.component.tsx -src/components/v2/appDetails/sourceInfo/environmentStatus/NotesDrawer.tsx -src/components/v2/appDetails/sourceInfo/rotatePods/RotatePodsModal.component.tsx -src/components/v2/appDetails/sourceInfo/rotatePods/RotateResponseModal.tsx -src/components/v2/appDetails/sourceInfo/scaleWorkloads/ScaleWorkloadsModal.component.tsx -src/components/v2/chartDeploymentHistory/ChartDeploymentHistory.component.tsx -src/components/v2/chartDeploymentHistory/DockerListModal.tsx -src/components/v2/chartDeploymentHistory/chartDeploymentHistory.service.ts -src/components/v2/common/ReactSelect.utils.tsx -src/components/v2/common/ReactSelectCustomization.tsx -src/components/v2/devtronStackManager/AboutDevtronView.tsx -src/components/v2/devtronStackManager/DevtronStackManager.component.tsx -src/components/v2/devtronStackManager/DevtronStackManager.service.tsx -src/components/v2/devtronStackManager/DevtronStackManager.tsx -src/components/v2/devtronStackManager/DevtronStackManager.utils.ts -src/components/v2/headers/ChartHeader.component.tsx -src/components/v2/headers/EAHeader.component.tsx -src/components/v2/index.tsx -src/components/v2/utils/tabUtils/useTab.ts -src/components/v2/utils/useSharedState.ts -src/components/v2/values/ChartValues.component.tsx -src/components/v2/values/chartValuesDiff/ChartRepoSelector.tsx -src/components/v2/values/chartValuesDiff/ChartValuesEditor.tsx -src/components/v2/values/chartValuesDiff/ChartValuesView.component.tsx -src/components/v2/values/chartValuesDiff/ChartValuesView.reducer.ts -src/components/v2/values/chartValuesDiff/ChartValuesView.tsx -src/components/v2/values/chartValuesDiff/ProjectUpdateModal.tsx -src/components/v2/values/common/chartValues.api.ts -src/components/workflowEditor/CreateWorkflow.tsx -src/components/workflowEditor/DeprecatedWarningModal.tsx -src/components/workflowEditor/EmptyWorkflow.tsx -src/components/workflowEditor/NoGitOpsConfiguredWarning.tsx -src/components/workflowEditor/PipelineSelect.tsx -src/components/workflowEditor/Workflow.tsx -src/components/workflowEditor/nodes/CDNode.tsx -src/components/workflowEditor/nodes/CINode.tsx -src/components/workflowEditor/nodes/StaticNode.tsx -src/components/workflowEditor/nodes/WebhookNode.tsx -src/components/workflowEditor/nodes/WebhookTippyCard.tsx -src/components/workflowEditor/workflowEditor.tsx -src/config/constants.ts -src/config/routes.ts -src/config/utils.ts -src/services/fetchWithFullRoute.ts -src/services/service.ts -src/services/service.types.ts -src/util/MurmurHash3.ts -src/util/Subject.ts -src/util/Util.ts diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index b68044fd52..0000000000 --- a/.eslintrc.js +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (c) 2024. Devtron Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -const tsconfigPath = require('./tsconfig.json') - -module.exports = { - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint', 'react', 'prettier', 'import', 'simple-import-sort', '@tanstack/query'], - env: { - browser: true, - es2021: true, - }, - parserOptions: { - ecmaVersion: 2021, - sourceType: 'module', - ecmaFeatures: { - jsx: true, - }, - project: ['./tsconfig.json'], - }, - globals: { - JSX: true, - }, - extends: [ - 'eslint:recommended', - 'plugin:react/recommended', - 'plugin:react/jsx-runtime', - 'plugin:@typescript-eslint/eslint-recommended', - 'airbnb', - 'airbnb/hooks', - 'prettier', - 'plugin:@tanstack/query/recommended', - ], - rules: { - 'prettier/prettier': ['error'], - 'linebreak-style': ['error', 'unix'], - 'no-console': 'warn', - 'no-var': 'error', - 'no-duplicate-imports': 'error', - 'no-shadow': 'off', - '@typescript-eslint/no-shadow': 'warn', - '@typescript-eslint/explicit-function-return-type': 'off', - '@typescript-eslint/explicit-member-accessibility': 'off', - // Since we are using typescript, we can disable the no-unused-vars rule for enum,etc - 'no-unused-vars': 'off', - '@typescript-eslint/no-unused-vars': 'error', - 'react/jsx-filename-extension': [ - 'error', - { - extensions: ['tsx'], - }, - ], - 'react/jsx-props-no-spreading': 'off', - 'react/prefer-stateless-function': 'off', - 'jsx-a11y/click-events-have-key-events': 'off', - 'jsx-a11y/no-static-element-interactions': 'off', - 'jsx-a11y/no-noninteractive-element-interactions': 'off', - 'no-underscore-dangle': 'off', - 'import/no-extraneous-dependencies': [ - 'warn', - { - devDependencies: true, - }, - ], - 'import/no-named-as-default-member': 'off', - 'no-plusplus': [ - 'error', - { - allowForLoopAfterthoughts: true, - }, - ], - // Since we dont use prop-types, we can disable this rule - 'react/require-default-props': 'off', - 'react-hooks/exhaustive-deps': 'off', - 'react/function-component-definition': [ - 'warn', - { - namedComponents: 'arrow-function', - unnamedComponents: 'arrow-function', - }, - ], - 'react/jsx-uses-react': 'off', - 'react/react-in-jsx-scope': 'off', - // additional rules: - '@typescript-eslint/no-floating-promises': 'error', - 'import/prefer-default-export': 'off', - 'import/extensions': [ - 'warn', - 'ignorePackages', - { - js: 'never', - jsx: 'never', - ts: 'never', - tsx: 'never', - }, - ], - // Re-add this while resolving ESLint issues - 'import/no-cycle': 'off', - 'import/prefer-default-export': 'off', - 'no-restricted-exports': 'off', - 'import/named': 'off', - 'no-use-before-define': 'off', - '@typescript-eslint/no-use-before-define': 'error', - 'simple-import-sort/imports': [ - 'error', - { - groups: [ - // Packages `react` related packages and external packages. - ['^react', '^@?\\w'], - // Devtron packages - ['^@devtron-labs'], - // Internal packages. - [...Object.keys(tsconfigPath.compilerOptions.paths).map((alias) => alias.replace('/*', ''))], - // Side effect imports. - ['^\\u0000'], - // Put same-folder imports, `..` and `.` last. Other relative imports. - ['^\\.\\.(?!/?$)', '^\\.\\./?$', '^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'], - // Style imports. - ['^.+\\.?(css|scss)$'], - ], - }, - ], - 'simple-import-sort/exports': 'error', - }, - overrides: [ - { - files: ['*.ts', '*.tsx'], - rules: { - 'no-undef': 'off', - }, - }, - ], - settings: { - react: { - version: 'detect', - }, - 'import/parsers': { - '@typescript-eslint/parser': ['.ts', '.tsx'], - }, - 'import/resolver': { - typescript: { - alwaysTryTypes: true, - }, - node: { - moduleDirectory: ['src', 'node_modules'], - extensions: ['.js', '.jsx', '.ts', '.tsx'], - }, - }, - 'import/ignore': ['\\.png$', '\\.jpg$', '\\.svg$'], - }, - ignorePatterns: ['.eslintrc.cjs', 'vite.config.mts'], -} diff --git a/.lintstagedrc b/.lintstagedrc index 55dd1e0bc3..36836b94c4 100644 --- a/.lintstagedrc +++ b/.lintstagedrc @@ -1,5 +1,5 @@ { "*.{js,jsx,ts,tsx}": [ - "eslint" + "biome check --write --no-errors-on-unmatched --files-ignore-unknown=true" ] } diff --git a/.prettierrc.js b/.prettierrc.js deleted file mode 100644 index add3e92e76..0000000000 --- a/.prettierrc.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2024. Devtron Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -module.exports = { - semi: false, - trailingComma: 'all', - singleQuote: true, - printWidth: 120, - tabWidth: 4, -} diff --git a/.vscode/settings.json b/.vscode/settings.json index f37193fb91..75dc6b982d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,24 +1,21 @@ { - "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.defaultFormatter": "biomejs.biome", "[typescript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.defaultFormatter": "biomejs.biome" }, "[typescriptreact]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.defaultFormatter": "biomejs.biome" }, "[json]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.defaultFormatter": "biomejs.biome" }, - "editor.formatOnSave": false, - "editor.codeActionsOnSave": [ - "source.fixAll.eslint" - ], - "eslint.validate": [ - "typescript", - "typescriptreact" - ], - "prettier.requireConfig": true, + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.fixAll.biome": "explicit" + }, + "prettier.enable": false, + "eslint.enable": false, "[scss]": { "editor.defaultFormatter": "vscode.css-language-features" - }, + } } diff --git a/biome.json b/biome.json new file mode 100644 index 0000000000..ecc8961e40 --- /dev/null +++ b/biome.json @@ -0,0 +1,95 @@ +{ + "$schema": "https://biomejs.dev/schemas/2.4.11/schema.json", + "vcs": { + "enabled": true, + "clientKind": "git", + "useIgnoreFile": true + }, + "formatter": { + "enabled": true, + "indentStyle": "space", + "indentWidth": 4, + "lineWidth": 120 + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true, + "correctness": { + "noUnusedVariables": "error", + "noUndeclaredVariables": "error", + "useExhaustiveDependencies": "off", + "noConstantMathMinMaxClamp": "error", + "noUnusedImports": "error", + "noUnusedFunctionParameters": "error" + }, + "style": { + "useConst": "error", + "useSelfClosingElements": "error", + "noNonNullAssertion": "off", + "noYodaExpression": "error", + "useFragmentSyntax": "error", + "useImportType": "off", + "useLiteralEnumMembers": "off" + }, + "suspicious": { + "useAwait": "error", + "noConsole": "error", + "noShadowRestrictedNames": "error", + "noExplicitAny": "off", + "noVar": "error", + "noArrayIndexKey": "error", + "noEvolvingTypes": "error" + }, + "a11y": { + "noStaticElementInteractions": "error", + "noNoninteractiveElementInteractions": "error", + "useKeyWithClickEvents": "error", + "useButtonType": "error", + "noLabelWithoutControl": "error", + "noAutofocus": "off" + }, + "complexity": { + "useLiteralKeys": "off" + } + } + }, + "javascript": { + "formatter": { + "quoteStyle": "single", + "semicolons": "asNeeded", + "trailingCommas": "all" + } + }, + "assist": { + "enabled": true, + "actions": { + "source": { + "organizeImports": { + "level": "on", + "options": { + "groups": [ + [ + ":URL:", + ":NODE:", + ":BUN:", + ":PACKAGE_WITH_PROTOCOL:", + ":PACKAGE:", + "!@devtron-labs", + "!@devtron-labs/**" + ], + ":BLANK_LINE:", + ["@devtron-labs", "@devtron-labs/**"], + ":BLANK_LINE:", + ["@Images", "@Images/**", "@Shared", "@Shared/**", "@Pages", "@Pages/**"], + ":BLANK_LINE:", + [":PATH:", "!**/*.css", "!**/*.scss"], + ":BLANK_LINE:", + ["**/*.css", "**/*.scss"] + ] + } + } + } + } + } +} diff --git a/package.json b/package.json index bb5bb8e629..e4bb3e539c 100644 --- a/package.json +++ b/package.json @@ -36,8 +36,8 @@ }, "scripts": { "prepare": "husky install", - "lint": "tsc --noEmit && eslint 'src/**/*.{js,jsx,ts,tsx}' --max-warnings 0", - "lint-fix": "eslint 'src/**/*.{js,jsx,ts,tsx}' --fix", + "lint": "tsc --noEmit && biome check src/", + "lint-fix": "biome check --write src/", "start": "vite --open", "dev": "node scripts/secrets-mgr.js", "build": "NODE_OPTIONS=--max_old_space_size=8192 vite build", @@ -57,35 +57,22 @@ "not op_mini all" ], "devDependencies": { + "@biomejs/biome": "2.4.11", "@playwright/test": "^1.32.1", "@sentry/cli": "^2.2.0", - "@tanstack/eslint-plugin-query": "^5.91.4", "@types/node": "^25.5.0", "@types/react": "^19.2.14", "@types/react-dom": "^19.2.3", "@types/react-transition-group": "^4.4.4", "@types/recompose": "^0.30.10", - "@typescript-eslint/eslint-plugin": "8.3.0", - "@typescript-eslint/parser": "8.3.0", "@vitejs/plugin-react": "6.0.1", "env-cmd": "10.1.0", - "eslint": "^8.57.1", - "eslint-config-airbnb": "^19.0.4", - "eslint-config-prettier": "^9.1.0", - "eslint-import-resolver-typescript": "^3.6.1", - "eslint-plugin-import": "^2.29.1", - "eslint-plugin-jsx-a11y": "^6.10.2", - "eslint-plugin-prettier": "^5.1.2", - "eslint-plugin-react": "^7.37.5", - "eslint-plugin-react-hooks": "^5.2.0", - "eslint-plugin-simple-import-sort": "^12.1.1", "husky": "^7.0.4", "json-schema": "^0.4.0", "lint-staged": "12.5.0", "mock-socket": "^9.2.1", "patch-package": "^8.0.0", "postinstall-postinstall": "^2.1.0", - "prettier": "^3.1.1", "react-draggable": "^4.4.5", "sass": "^1.69.7", "sharp": "^0.33.5", diff --git a/src/App.tsx b/src/App.tsx index cb994283c4..e424abe89a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -31,13 +31,14 @@ import { useUserEmail, } from '@devtron-labs/devtron-fe-common-lib' -import { useVersionUpdateReload } from '@Components/common/hooks/useVersionUpdate' -import { VersionUpdateProps } from '@Components/common/hooks/useVersionUpdate/types' import ActivateLicense from '@Pages/License/ActivateLicense' import { ErrorBoundary, getApprovalModalTypeFromURL, importComponentFromFELibrary } from './components/common' import { validateToken } from './services/service' +import { useVersionUpdateReload } from '@Components/common/hooks/useVersionUpdate' +import { VersionUpdateProps } from '@Components/common/hooks/useVersionUpdate/types' + import './css/application.scss' const NavigationRoutes = lazy(() => import('./components/common/navigation/NavigationRoutes')) @@ -56,10 +57,7 @@ const App = () => { const navigate = useNavigate() const isDirectApprovalNotification = - location.pathname && - location.pathname.includes('approve') && - location.search && - location.search.includes(`?token=${approvalToken}`) + location.pathname?.includes('approve') && location.search?.includes(`?token=${approvalToken}`) const customThemeClassName = location.pathname.startsWith(ROUTER_URLS.NETWORK_STATUS_INTERFACE.ROOT) ? 'custom-theme-override' : '' diff --git a/src/Pages-Devtron-2.0/ApplicationManagement/ApplicationManagementRouter.tsx b/src/Pages-Devtron-2.0/ApplicationManagement/ApplicationManagementRouter.tsx index 3876803fc0..1196595f03 100644 --- a/src/Pages-Devtron-2.0/ApplicationManagement/ApplicationManagementRouter.tsx +++ b/src/Pages-Devtron-2.0/ApplicationManagement/ApplicationManagementRouter.tsx @@ -3,14 +3,15 @@ import { Navigate, Route, Routes } from 'react-router-dom' import { BASE_ROUTES } from '@devtron-labs/devtron-fe-common-lib' -import { importComponentFromFELibrary } from '@Components/common' -import { DevtronAppRouter } from '@Components/common/navigation/NavRoutes.components' import AppConfig from '@Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig' import { OffendingPipelineModalAppView } from '@Pages/GlobalConfigurations/PluginPolicy/OffendingPipelineModal' import { Configurations } from './Configurations' import { ApplicationManagementOverview } from './Overview' +import { importComponentFromFELibrary } from '@Components/common' +import { DevtronAppRouter } from '@Components/common/navigation/NavRoutes.components' + const BulkEdit = lazy(() => import('@Components/bulkEdits/BulkEdits')) const AppGroupRoute = lazy(() => import('@Components/ApplicationGroup/AppGroupRoute')) diff --git a/src/Pages-Devtron-2.0/ApplicationManagement/Configurations/ConfigurationsRouter.tsx b/src/Pages-Devtron-2.0/ApplicationManagement/Configurations/ConfigurationsRouter.tsx index 07e3628b79..cb25b78145 100644 --- a/src/Pages-Devtron-2.0/ApplicationManagement/Configurations/ConfigurationsRouter.tsx +++ b/src/Pages-Devtron-2.0/ApplicationManagement/Configurations/ConfigurationsRouter.tsx @@ -103,7 +103,7 @@ export const Configurations = () => { /> } /> - {...serverMode === SERVER_MODE.FULL && window._env_.ENABLE_SCOPED_VARIABLES + {...(serverMode === SERVER_MODE.FULL && window._env_.ENABLE_SCOPED_VARIABLES ? [ { element={} />, ] - : []} + : [])} { const { appTheme } = useTheme() const performanceLevels = Object.values(PerformanceLevel) diff --git a/src/Pages-Devtron-2.0/ApplicationManagement/Overview/BuildDeploymentMetrics/PipelineTriggerInsights.tsx b/src/Pages-Devtron-2.0/ApplicationManagement/Overview/BuildDeploymentMetrics/PipelineTriggerInsights.tsx index f393434ecf..bd2d47279e 100644 --- a/src/Pages-Devtron-2.0/ApplicationManagement/Overview/BuildDeploymentMetrics/PipelineTriggerInsights.tsx +++ b/src/Pages-Devtron-2.0/ApplicationManagement/Overview/BuildDeploymentMetrics/PipelineTriggerInsights.tsx @@ -19,8 +19,6 @@ import { useStateFilters, } from '@devtron-labs/devtron-fe-common-lib' -import { SORT_ORDER_OPTIONS, TIME_WINDOW, TIME_WINDOW_SELECT_OPTIONS } from '@PagesDevtron2.0/Shared' - import { DEFAULT_TIME_WINDOW } from '../constants' import { SectionLoadingCard } from '../Overview.components' import { useGetPipelineInsights } from '../services' @@ -28,6 +26,8 @@ import { PipelineType } from '../types' import { MIN_X_AXIS_VALUE } from './constants' import { getPipelineInsightsChartTooltip } from './tooltipUtils' +import { SORT_ORDER_OPTIONS, TIME_WINDOW, TIME_WINDOW_SELECT_OPTIONS } from '@PagesDevtron2.0/Shared' + const PipelineTriggerInsights = () => { const [selectedWindowOption, setSelectedWindowOption] = useState(DEFAULT_TIME_WINDOW) const [pipelineType, setPipelineType] = useState(PipelineType.BUILD) diff --git a/src/Pages-Devtron-2.0/ApplicationManagement/Overview/BuildDeploymentMetrics/TriggerBuildTimeChart.tsx b/src/Pages-Devtron-2.0/ApplicationManagement/Overview/BuildDeploymentMetrics/TriggerBuildTimeChart.tsx index ca09873eb6..358fc63ffe 100644 --- a/src/Pages-Devtron-2.0/ApplicationManagement/Overview/BuildDeploymentMetrics/TriggerBuildTimeChart.tsx +++ b/src/Pages-Devtron-2.0/ApplicationManagement/Overview/BuildDeploymentMetrics/TriggerBuildTimeChart.tsx @@ -11,8 +11,6 @@ import { SelectPickerVariantType, } from '@devtron-labs/devtron-fe-common-lib' -import { TIME_WINDOW, TIME_WINDOW_SELECT_OPTIONS } from '@PagesDevtron2.0/Shared' - import { DEFAULT_TIME_WINDOW } from '../constants' import { ChartHeaderTab, SectionLoadingCard } from '../Overview.components' import { useGetBuildDeploymentActivity, useGetBuildDeploymentActivityDetailed } from '../services' @@ -21,6 +19,8 @@ import { parseMinutesInDayHourUnit } from '../utils' import { getAvgBuildTimeTooltip, getBuildDeploymentTriggerTooltip } from './tooltipUtils' import { NoBuildDeploymentTriggeredProps } from './types' +import { TIME_WINDOW, TIME_WINDOW_SELECT_OPTIONS } from '@PagesDevtron2.0/Shared' + const NoBuildDeploymentTriggered = ({ isDeploymentTriggerChart }: NoBuildDeploymentTriggeredProps) => (
(Object.entries(DORA_METRICS_LABEL_MAP) as [PerformanceLevel, string][]).find(([, value]) => value === label)?.[0] diff --git a/src/Pages-Devtron-2.0/ApplicationManagement/Overview/Overview.tsx b/src/Pages-Devtron-2.0/ApplicationManagement/Overview/Overview.tsx index 6ca98465ee..d3cdc3f3ff 100644 --- a/src/Pages-Devtron-2.0/ApplicationManagement/Overview/Overview.tsx +++ b/src/Pages-Devtron-2.0/ApplicationManagement/Overview/Overview.tsx @@ -1,10 +1,10 @@ -import { importComponentFromFELibrary } from '@Components/common' - import { BuildDeploymentMetrics } from './BuildDeploymentMetrics' import Glance from './Glance' import OverviewPageHeader from './OverviewPageHeader' import WorkflowOverview from './WorkflowOverview' +import { importComponentFromFELibrary } from '@Components/common' + import './styles.scss' const BestPractices = importComponentFromFELibrary('BestPractices', null, 'function') diff --git a/src/Pages-Devtron-2.0/ApplicationManagement/Overview/constants.ts b/src/Pages-Devtron-2.0/ApplicationManagement/Overview/constants.ts index 937af34427..582d53eb31 100644 --- a/src/Pages-Devtron-2.0/ApplicationManagement/Overview/constants.ts +++ b/src/Pages-Devtron-2.0/ApplicationManagement/Overview/constants.ts @@ -1,9 +1,9 @@ import { getUrlWithSearchParams, MetricsInfoCardProps, ROUTER_URLS } from '@devtron-labs/devtron-fe-common-lib' -import { TIME_WINDOW } from '@PagesDevtron2.0/Shared/types' - import { GlanceMetricKeys, WorkflowOverviewMetricKeys } from './types' +import { TIME_WINDOW } from '@PagesDevtron2.0/Shared/types' + export const GLANCE_METRICS_CARDS_CONFIG: Record< GlanceMetricKeys, Omit diff --git a/src/Pages-Devtron-2.0/ApplicationManagement/Overview/services.ts b/src/Pages-Devtron-2.0/ApplicationManagement/Overview/services.ts index a31b48a5c9..66b69eca86 100644 --- a/src/Pages-Devtron-2.0/ApplicationManagement/Overview/services.ts +++ b/src/Pages-Devtron-2.0/ApplicationManagement/Overview/services.ts @@ -1,8 +1,5 @@ import { get, getUrlWithSearchParams, MetricsInfoCardProps, useQuery } from '@devtron-labs/devtron-fe-common-lib' -import { Routes } from '@Config/constants' -import { RelativeTimeWindow, TIME_WINDOW } from '@PagesDevtron2.0/Shared/types' - import { GLANCE_METRICS_CARDS_CONFIG, WORKFLOW_OVERVIEW_METRICS_CARDS_CONFIG } from './constants' import { AppOverviewDoraMetricsDTO, @@ -26,6 +23,9 @@ import { parseTimestampAccToWindow, } from './utils' +import { Routes } from '@Config/constants' +import { RelativeTimeWindow, TIME_WINDOW } from '@PagesDevtron2.0/Shared/types' + export const useGetGlanceConfig = () => useQuery({ queryKey: ['glanceConfig'], @@ -120,7 +120,7 @@ export const useGetBuildDeploymentActivityDetailed = ( ), select: ({ result }) => { const triggerTrend = getActivityKindTrendFromResult(activityKind, result) - const parsedResult = triggerTrend.map((item) => ({ + const parsedResult = triggerTrend.map((item) => ({ ...item, timestampLabel: parseTimestampAccToWindow(item?.timestamp ?? '', timeWindow), })) diff --git a/src/Pages-Devtron-2.0/ApplicationManagement/Overview/utils.ts b/src/Pages-Devtron-2.0/ApplicationManagement/Overview/utils.ts index 735d1c1693..f5f441d1f6 100644 --- a/src/Pages-Devtron-2.0/ApplicationManagement/Overview/utils.ts +++ b/src/Pages-Devtron-2.0/ApplicationManagement/Overview/utils.ts @@ -2,8 +2,6 @@ import moment from 'moment' import { isNullOrUndefined } from '@devtron-labs/devtron-fe-common-lib' -import { TIME_WINDOW } from '@PagesDevtron2.0/Shared/types' - import { BuildDeploymentActivityDetailedDTO, BuildDeploymentTriggerTrend, @@ -12,6 +10,8 @@ import { MetricValueDTO, } from './types' +import { TIME_WINDOW } from '@PagesDevtron2.0/Shared/types' + export const getValueStringFromMetricItem = (item: MetricValueDTO): string => { const { total, percentage } = item ?? { total: 0, percentage: 0 } @@ -71,7 +71,9 @@ export const getValueStringForDoraMetric = (overallAverage: DoraMetricAverage): export const parseTimestampAccToWindow = (timestamp: string, timeWindow: TIME_WINDOW) => { const momentObj = moment(timestamp).local() + // biome-ignore lint/suspicious/noEvolvingTypes: On switching to const the return type becomes string | string[] which causes type errors in components consuming this function let hour = null + // biome-ignore lint/suspicious/noEvolvingTypes: On switching to const the return type becomes string | string[] which causes type errors in components consuming this function let date = null switch (timeWindow) { case TIME_WINDOW.TODAY: diff --git a/src/Pages-Devtron-2.0/InfrastructureManagement/InfrastructureManagementRouter.tsx b/src/Pages-Devtron-2.0/InfrastructureManagement/InfrastructureManagementRouter.tsx index 9de872b010..88095e65c7 100644 --- a/src/Pages-Devtron-2.0/InfrastructureManagement/InfrastructureManagementRouter.tsx +++ b/src/Pages-Devtron-2.0/InfrastructureManagement/InfrastructureManagementRouter.tsx @@ -3,12 +3,12 @@ import { Route, Routes } from 'react-router-dom' import { BASE_ROUTES } from '@devtron-labs/devtron-fe-common-lib' +import { InfraOverview } from './Overview' + import { importComponentFromFELibrary } from '@Components/common' import { InfraAppsRouter } from '@Components/common/navigation/NavRoutes.components' import ResourceBrowserRouter from '@Components/ResourceBrowser/ResourceBrowserRouter' -import { InfraOverview } from './Overview' - const Charts = lazy(() => import('@Components/charts/Charts')) const ResourceWatcherRouter = importComponentFromFELibrary('ResourceWatcherRouter') diff --git a/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/AtAGlance.tsx b/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/AtAGlance.tsx index c50c87b62a..b54e48c52d 100644 --- a/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/AtAGlance.tsx +++ b/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/AtAGlance.tsx @@ -13,12 +13,12 @@ import { useQueryClient, } from '@devtron-labs/devtron-fe-common-lib' -import { importComponentFromFELibrary } from '@Components/common' - import { INFRA_OVERVIEW_QUERY_KEY } from './constants' import { refreshInfraOverviewCache } from './service' import { GlanceMetricsKeys, InfraOverviewAtAGlanceProps } from './types' +import { importComponentFromFELibrary } from '@Components/common' + const INFRA_OVERVIEW_QUERY_KEYS = importComponentFromFELibrary('INFRA_OVERVIEW_QUERY_KEYS', null, 'function') const InfrastructureManagementAtAGlance = ({ diff --git a/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/ClusterAndNodes/NodeViewGroupList.tsx b/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/ClusterAndNodes/NodeViewGroupList.tsx index bf1f01b5f7..5b8a9b6028 100644 --- a/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/ClusterAndNodes/NodeViewGroupList.tsx +++ b/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/ClusterAndNodes/NodeViewGroupList.tsx @@ -35,6 +35,7 @@ import { AUTOSCALER_TYPE_LABELS, EXPORT_NODE_LIST_HEADERS, NODE_ERRORS_LABEL_MAP import { AutoscalerTypeFilters, NodeErrorsFilters, NodeSchedulingTypeFilters } from './types' import { getNodeListFilterOptions } from './utils' +// biome-ignore lint/complexity/noBannedTypes: Legacy const NodeScheduleCellComponent = ({ row }: TableCellComponentProps) => { const { schedulable } = row.data @@ -46,6 +47,7 @@ const NodeScheduleCellComponent = ({ row }: TableCellComponentProps) => { const nodeErrors = row.data.nodeErrors.map((error) => NODE_ERRORS_LABEL_MAP[error])?.join(', ') || '' @@ -58,6 +60,7 @@ const ErrorCellComponent = ({ row }: TableCellComponentProps) => { const { nodeName, clusterId } = row.data @@ -80,6 +83,7 @@ const NodeNameCellComponent = ({ row }: TableCellComponentProps) => { const { clusterName } = row.data @@ -94,6 +98,7 @@ const ClusterNameCellComponent = ({ row }: TableCellComponentProps) => { const { autoscalerType } = row.data const autoscalerTypeLabel = AUTOSCALER_TYPE_LABELS[autoscalerType] || '' @@ -109,6 +114,7 @@ const AutoscalerTypeCellComponent = ({ const getGroupSpecificTableColumns = ( nodeViewGroupType: NodeViewGroupType, + // biome-ignore lint/complexity/noBannedTypes: Legacy ): TableColumnType[] => { switch (nodeViewGroupType) { case NodeViewGroupType.NODE_ERRORS: @@ -240,6 +246,7 @@ const NodeViewGroupListWrapper = ({ const NodeViewGroupList = ({ nodeViewGroupType }: { nodeViewGroupType: NodeViewGroupType }) => { const navigate = useNavigate() + // biome-ignore lint/complexity/noBannedTypes: Legacy const getRows: TableProps['getRows'] = useCallback( async ( { @@ -289,6 +296,7 @@ const NodeViewGroupList = ({ nodeViewGroupType }: { nodeViewGroupType: NodeViewG } return ( + // biome-ignore lint/complexity/noBannedTypes: Legacy id="table__node-detailed-list" columns={[ diff --git a/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/ClusterAndNodes/utils.tsx b/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/ClusterAndNodes/utils.tsx index d5c9c97ef8..7c66ef863b 100644 --- a/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/ClusterAndNodes/utils.tsx +++ b/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/ClusterAndNodes/utils.tsx @@ -12,8 +12,6 @@ import { useTheme, } from '@devtron-labs/devtron-fe-common-lib' -import { ChartTooltip } from '@PagesDevtron2.0/Shared' - import { AutoscalerTypes, ClusterCapacityDistribution, @@ -34,6 +32,8 @@ import { } from './constants' import { AutoscalerTypeFilters, ClusterCapacitySortKeys, NodeErrorsFilters, NodeSchedulingTypeFilters } from './types' +import { ChartTooltip } from '@PagesDevtron2.0/Shared' + const AllocatedResource = ({ label, value }: SelectPickerOptionType) => (
{label} diff --git a/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/Overview.tsx b/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/Overview.tsx index fed864f38f..b31acf31b5 100644 --- a/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/Overview.tsx +++ b/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/Overview.tsx @@ -9,14 +9,14 @@ import { ROUTER_URLS, } from '@devtron-labs/devtron-fe-common-lib' -import { importComponentFromFELibrary } from '@Components/common' - import InfrastructureManagementAtAGlance from './AtAGlance' import { ClusterAndNodes } from './ClusterAndNodes' import OverviewPageHeader from './OverviewPageHeader' import { useGetInfraOverview } from './service' import { getClusterListingUrl } from './utils' +import { importComponentFromFELibrary } from '@Components/common' + import './styles.scss' const ActionsAndInsights = importComponentFromFELibrary('ActionsAndInsights', null, 'function') diff --git a/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/service.ts b/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/service.ts index e5b996be3e..9603371666 100644 --- a/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/service.ts +++ b/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/service.ts @@ -1,7 +1,5 @@ import { APIOptions, get, getUrlWithSearchParams, useQuery } from '@devtron-labs/devtron-fe-common-lib' -import { Routes } from '@Config/constants' - import { INFRA_OVERVIEW_QUERY_KEY } from './constants' import { ClusterDistributionKeys, @@ -20,6 +18,8 @@ import { getReachableClusterCount, } from './utils' +import { Routes } from '@Config/constants' + export const useGetInfraOverview = () => useQuery({ queryKey: [INFRA_OVERVIEW_QUERY_KEY], diff --git a/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/utils.ts b/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/utils.ts index 9b10a309d4..dc04ed8822 100644 --- a/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/utils.ts +++ b/src/Pages-Devtron-2.0/InfrastructureManagement/Overview/utils.ts @@ -33,7 +33,7 @@ export const getInfraGlanceConfig = (result: InfraOverviewDTO) => redirectionLink: ROUTER_URLS.RESOURCE_BROWSER.ROOT, metricValue: (key === GlanceMetricsKeys.REACHABLE_CLUSTERS ? getReachableClusterCount(result) - : result?.[key]?.value ?? 0 + : (result?.[key]?.value ?? 0) ).toLocaleString(), metricUnit: key === GlanceMetricsKeys.REACHABLE_CLUSTERS ? undefined : result?.[key]?.unit, valueOutOf: @@ -49,6 +49,7 @@ export const getClusterNodeHealthConfig = ( } => ({ [ClusterNodeHealthStatusKeys.CLUSTER_STATUS_BREAKDOWN]: Object.values(ClusterStatusKeys).reduce( (acc, key) => ({ + // biome-ignore lint/performance/noAccumulatingSpread: Legacy ...acc, [key]: result?.clusterStatusBreakdown?.[key] ?? 0, }), @@ -56,6 +57,7 @@ export const getClusterNodeHealthConfig = ( ), [ClusterNodeHealthStatusKeys.NODE_ERRORS_BREAKDOWN]: Object.values(NodeErrorsKeys).reduce( (acc, key) => ({ + // biome-ignore lint/performance/noAccumulatingSpread: Legacy ...acc, [key]: result?.nodeErrorBreakdown?.errorCounts?.[key] ?? 0, }), @@ -63,6 +65,7 @@ export const getClusterNodeHealthConfig = ( ), [ClusterNodeHealthStatusKeys.NODE_SCHEDULING_BREAKDOWN]: Object.values(NodeSchedulingKeys).reduce( (acc, key) => ({ + // biome-ignore lint/performance/noAccumulatingSpread: Legacy ...acc, [key]: result?.nodeSchedulingBreakdown?.[key] ?? 0, }), diff --git a/src/Pages-Devtron-2.0/SecurityCenter/Overview/DeploymentSecurityStatus/AutoBlockedDeployments.tsx b/src/Pages-Devtron-2.0/SecurityCenter/Overview/DeploymentSecurityStatus/AutoBlockedDeployments.tsx index 83c452c87d..32fc65d919 100644 --- a/src/Pages-Devtron-2.0/SecurityCenter/Overview/DeploymentSecurityStatus/AutoBlockedDeployments.tsx +++ b/src/Pages-Devtron-2.0/SecurityCenter/Overview/DeploymentSecurityStatus/AutoBlockedDeployments.tsx @@ -9,11 +9,11 @@ import { SelectPickerVariantType, } from '@devtron-labs/devtron-fe-common-lib' -import { RELATIVE_TIME_WINDOW_SELECT_OPTIONS, RelativeTimeWindow } from '@PagesDevtron2.0/Shared' - import { useGetAutoBlockedDeploymentTrend } from '../services' import { getBlockedDeploymentChartTooltip } from './utils' +import { RELATIVE_TIME_WINDOW_SELECT_OPTIONS, RelativeTimeWindow } from '@PagesDevtron2.0/Shared' + const AutoBlockedDeployments = () => { const [timeRange, setTimeRange] = useState(RelativeTimeWindow.LAST_30_DAYS) diff --git a/src/Pages-Devtron-2.0/SecurityCenter/Overview/DeploymentSecurityStatus/utils.tsx b/src/Pages-Devtron-2.0/SecurityCenter/Overview/DeploymentSecurityStatus/utils.tsx index 93d861bf88..a0d3cf917c 100644 --- a/src/Pages-Devtron-2.0/SecurityCenter/Overview/DeploymentSecurityStatus/utils.tsx +++ b/src/Pages-Devtron-2.0/SecurityCenter/Overview/DeploymentSecurityStatus/utils.tsx @@ -1,12 +1,12 @@ import { ChartProps } from '@devtron-labs/devtron-fe-common-lib' +import { BlockedDeploymentTrend } from '../types' +import { COVERAGE_CHART_COLORS } from './CoverageMetrics' + import { ChartTooltip } from '@PagesDevtron2.0/Shared' import { RelativeTimeWindow } from '@PagesDevtron2.0/Shared/types' import { parseTimestampToDate } from '@PagesDevtron2.0/Shared/utils' -import { BlockedDeploymentTrend } from '../types' -import { COVERAGE_CHART_COLORS } from './CoverageMetrics' - export const getBlockedDeploymentChartTooltip: ( data: BlockedDeploymentTrend, timeRange: RelativeTimeWindow, diff --git a/src/Pages-Devtron-2.0/SecurityCenter/Overview/SeverityInsights/VulnerabilityTrend.tsx b/src/Pages-Devtron-2.0/SecurityCenter/Overview/SeverityInsights/VulnerabilityTrend.tsx index fb6a966639..078d42fd57 100644 --- a/src/Pages-Devtron-2.0/SecurityCenter/Overview/SeverityInsights/VulnerabilityTrend.tsx +++ b/src/Pages-Devtron-2.0/SecurityCenter/Overview/SeverityInsights/VulnerabilityTrend.tsx @@ -6,19 +6,19 @@ import { GenericSectionErrorState, getSelectPickerOptionByValue, ProdNonProdSelectValueTypes, + SEVERITY_LABEL_MAP, SelectPicker, SelectPickerOptionType, SelectPickerVariantType, - SEVERITY_LABEL_MAP, } from '@devtron-labs/devtron-fe-common-lib' -import { RELATIVE_TIME_WINDOW_SELECT_OPTIONS } from '@PagesDevtron2.0/Shared' -import { RelativeTimeWindow } from '@PagesDevtron2.0/Shared/types' - import { SEVERITY_CHART_COLOR_MAP, SEVERITY_ORDER } from '../constants' import { useGetVulnerabilityTrend } from '../services' import { getVulnerabilityTrendTooltip } from './utils' +import { RELATIVE_TIME_WINDOW_SELECT_OPTIONS } from '@PagesDevtron2.0/Shared' +import { RelativeTimeWindow } from '@PagesDevtron2.0/Shared/types' + const VulnerabilityTrend = ({ prodNonProdValue }: { prodNonProdValue: ProdNonProdSelectValueTypes }) => { const [timeRange, setTimeRange] = useState(RelativeTimeWindow.LAST_30_DAYS) diff --git a/src/Pages-Devtron-2.0/SecurityCenter/Overview/SeverityInsights/utils.tsx b/src/Pages-Devtron-2.0/SecurityCenter/Overview/SeverityInsights/utils.tsx index 6bbff6a753..896ee0dfec 100644 --- a/src/Pages-Devtron-2.0/SecurityCenter/Overview/SeverityInsights/utils.tsx +++ b/src/Pages-Devtron-2.0/SecurityCenter/Overview/SeverityInsights/utils.tsx @@ -1,12 +1,12 @@ import { ChartColorKey, ChartProps, SEVERITY_LABEL_MAP } from '@devtron-labs/devtron-fe-common-lib' +import { SEVERITY_ORDER } from '../constants' +import { VulnerabilityTrend } from '../types' + import { ChartColorIndicator, ChartTooltip } from '@PagesDevtron2.0/Shared/components' import { RelativeTimeWindow } from '@PagesDevtron2.0/Shared/types' import { parseTimestampToDate } from '@PagesDevtron2.0/Shared/utils' -import { SEVERITY_ORDER } from '../constants' -import { VulnerabilityTrend } from '../types' - export const getSeverityDistributionTooltip: ( title: string, xAxisLabels: string[], diff --git a/src/Pages-Devtron-2.0/SecurityCenter/Overview/services.ts b/src/Pages-Devtron-2.0/SecurityCenter/Overview/services.ts index 53ff74dd5d..5e2322d216 100644 --- a/src/Pages-Devtron-2.0/SecurityCenter/Overview/services.ts +++ b/src/Pages-Devtron-2.0/SecurityCenter/Overview/services.ts @@ -6,9 +6,6 @@ import { useQuery, } from '@devtron-labs/devtron-fe-common-lib' -import { Routes } from '@Config/constants' -import { RelativeTimeWindow } from '@PagesDevtron2.0/Shared/types' - import { SECURITY_AT_A_GLANCE_CARDS_CONFIG, SECURITY_OVERVIEW_QUERY_KEYS } from './constants' import { BlockedDeploymentTrend, @@ -30,6 +27,9 @@ import { parseSeverityDistributionDatasets, } from './utils' +import { Routes } from '@Config/constants' +import { RelativeTimeWindow } from '@PagesDevtron2.0/Shared/types' + export const useGetSecurityGlanceMetrics = () => useQuery({ queryKey: [SECURITY_OVERVIEW_QUERY_KEYS.SECURITY_GLANCE], diff --git a/src/Pages-Devtron-2.0/SecurityCenter/Overview/utils.ts b/src/Pages-Devtron-2.0/SecurityCenter/Overview/utils.ts index 457324eb4f..a1d7d56148 100644 --- a/src/Pages-Devtron-2.0/SecurityCenter/Overview/utils.ts +++ b/src/Pages-Devtron-2.0/SecurityCenter/Overview/utils.ts @@ -2,17 +2,17 @@ import dayjs from 'dayjs' import { ChartColorKey, - Severity, SEVERITY_LABEL_MAP, + Severity, SimpleDataset, SimpleDatasetForPie, } from '@devtron-labs/devtron-fe-common-lib' -import { RelativeTimeWindow } from '@PagesDevtron2.0/Shared/types' - import { SEVERITY_CHART_COLOR_MAP, SEVERITY_ORDER } from './constants' import { SecurityGlanceMetricKeys, SeverityAgeDistribution, SeverityDistribution } from './types' +import { RelativeTimeWindow } from '@PagesDevtron2.0/Shared/types' + // Sort and return only non-zero values export const parseSeverityDistribution = (severityDistribution: SeverityDistribution) => { if (!severityDistribution) { diff --git a/src/Pages/App/Configurations/WorkflowEditor/CDPipelineDeploymentAppType/CDPipelineDeploymentAppType.tsx b/src/Pages/App/Configurations/WorkflowEditor/CDPipelineDeploymentAppType/CDPipelineDeploymentAppType.tsx index 13aaef28a7..b74b192bb4 100644 --- a/src/Pages/App/Configurations/WorkflowEditor/CDPipelineDeploymentAppType/CDPipelineDeploymentAppType.tsx +++ b/src/Pages/App/Configurations/WorkflowEditor/CDPipelineDeploymentAppType/CDPipelineDeploymentAppType.tsx @@ -16,10 +16,10 @@ import { DeploymentAppTypes } from '@devtron-labs/devtron-fe-common-lib' -import { DeploymentAppRadioGroup } from '@Components/v2/values/chartValuesDiff/ChartValuesView.component' - import { CDPipelineDeploymentAppTypeProps } from './types' +import { DeploymentAppRadioGroup } from '@Components/v2/values/chartValuesDiff/ChartValuesView.component' + export const CDPipelineDeploymentAppType = ({ isVirtualEnvironment, allowedDeploymentTypes, @@ -38,7 +38,7 @@ export const CDPipelineDeploymentAppType = ({ // Want to show this when gitops module is installed, does not matter if it is configured or not (!noGitOpsModuleInstalledAndConfigured || isGitOpsInstalledButNotConfigured) && (
- {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} + {/** biome-ignore lint/a11y/noLabelWithoutControl: Legacy */} ( diff --git a/src/Pages/App/Configurations/WorkflowEditor/CreateCICDPipeline/service.ts b/src/Pages/App/Configurations/WorkflowEditor/CreateCICDPipeline/service.ts index 115e004a0b..ccb97d272b 100644 --- a/src/Pages/App/Configurations/WorkflowEditor/CreateCICDPipeline/service.ts +++ b/src/Pages/App/Configurations/WorkflowEditor/CreateCICDPipeline/service.ts @@ -25,13 +25,13 @@ import { YAMLStringify, } from '@devtron-labs/devtron-fe-common-lib' +import { CreateCICDPipelineData } from './types' + import { getCDPipelineNameSuggestion, getDeploymentStrategyList } from '@Components/cdPipeline/cdPipeline.service' import { GeneratedHelmPush } from '@Components/cdPipeline/cdPipeline.types' import { getInitData } from '@Components/ciPipeline/ciPipeline.service' import { sortObjectArrayAlphabetically } from '@Components/common' -import { CreateCICDPipelineData } from './types' - const getSavedStrategies = (strategies: DeploymentStrategy[]): SavedDeploymentStrategy[] => { if (strategies.length > 0) { const allStrategies = strategies.reduce((acc, strategy) => { diff --git a/src/Pages/App/Configurations/WorkflowEditor/CreateCICDPipeline/utils.ts b/src/Pages/App/Configurations/WorkflowEditor/CreateCICDPipeline/utils.ts index 399cffb78e..8824c18b89 100644 --- a/src/Pages/App/Configurations/WorkflowEditor/CreateCICDPipeline/utils.ts +++ b/src/Pages/App/Configurations/WorkflowEditor/CreateCICDPipeline/utils.ts @@ -22,13 +22,13 @@ import { TriggerType, } from '@devtron-labs/devtron-fe-common-lib' +import { CreateCICDPipelineData, CreateCICDPipelineFormError } from './types' + import { GeneratedHelmPush } from '@Components/cdPipeline/cdPipeline.types' import { ValidationRules } from '@Components/ciPipeline/validationRules' import { createClusterEnvGroup, getDeploymentAppType } from '@Components/common' import { ENV_ALREADY_EXIST_ERROR } from '@Config/constants' -import { CreateCICDPipelineData, CreateCICDPipelineFormError } from './types' - export const getCiCdPipelineDefaultState = (): CreateCICDPipelineData => ({ ci: { name: '', diff --git a/src/Pages/App/CreateAppModal/AppClone/types.ts b/src/Pages/App/CreateAppModal/AppClone/types.ts index e489b45091..c62a21a61a 100644 --- a/src/Pages/App/CreateAppModal/AppClone/types.ts +++ b/src/Pages/App/CreateAppModal/AppClone/types.ts @@ -16,10 +16,10 @@ import { BaseAppMetaData, GenericInfoCardListingProps } from '@devtron-labs/devtron-fe-common-lib' -import { APP_TYPE } from '@Config/constants' - import { SidebarProps } from '../types' +import { APP_TYPE } from '@Config/constants' + export interface AppCloneListProps extends Pick { handleCloneAppClick: ({ appId, appName }: BaseAppMetaData) => void isJobView?: boolean diff --git a/src/Pages/App/CreateAppModal/AppClone/useDevtronCloneList.tsx b/src/Pages/App/CreateAppModal/AppClone/useDevtronCloneList.tsx index b5cebd4329..0ba433f3a1 100644 --- a/src/Pages/App/CreateAppModal/AppClone/useDevtronCloneList.tsx +++ b/src/Pages/App/CreateAppModal/AppClone/useDevtronCloneList.tsx @@ -21,11 +21,11 @@ import { useEffect, useRef, useState } from 'react' import { getIsRequestAborted, showError, useAsync } from '@devtron-labs/devtron-fe-common-lib' -import { APP_TYPE } from '@Config/constants' - import { fetchDevtronCloneList } from '../service' import { DevtronAppCloneListProps } from './types' +import { APP_TYPE } from '@Config/constants' + export const useDevtronCloneList = ({ handleCloneAppClick, isJobView, searchKey }: DevtronAppCloneListProps) => { const cloneListAbortControllerRef = useRef(new AbortController()) const [isLoadingMore, setIsLoadingMore] = useState(false) diff --git a/src/Pages/App/CreateAppModal/ApplicationInfoForm.tsx b/src/Pages/App/CreateAppModal/ApplicationInfoForm.tsx index 322ddf6b34..215d0d81ac 100644 --- a/src/Pages/App/CreateAppModal/ApplicationInfoForm.tsx +++ b/src/Pages/App/CreateAppModal/ApplicationInfoForm.tsx @@ -18,11 +18,6 @@ import { ChangeEvent } from 'react' import { CustomInput, TagsContainer, Textarea } from '@devtron-labs/devtron-fe-common-lib' -import ICCaretLeftSmall from '@Icons/ic-caret-left-small.svg?react' -import { importComponentFromFELibrary } from '@Components/common' -import { APP_TYPE } from '@Config/constants' -import { getAppIconWithBackground } from '@Config/utils' - import ProjectSelector from './ProjectSelector' import { ApplicationInfoFormProps, @@ -32,6 +27,11 @@ import { ProjectSelectorProps, } from './types' +import { importComponentFromFELibrary } from '@Components/common' +import { APP_TYPE } from '@Config/constants' +import { getAppIconWithBackground } from '@Config/utils' +import ICCaretLeftSmall from '@Icons/ic-caret-left-small.svg?react' + const MandatoryTagsContainer = importComponentFromFELibrary('MandatoryTagsContainer', null, 'function') const ApplicationInfoForm = ({ diff --git a/src/Pages/App/CreateAppModal/CloneApplicationSelectionList.tsx b/src/Pages/App/CreateAppModal/CloneApplicationSelectionList.tsx index 37090c51b4..e906226266 100644 --- a/src/Pages/App/CreateAppModal/CloneApplicationSelectionList.tsx +++ b/src/Pages/App/CreateAppModal/CloneApplicationSelectionList.tsx @@ -24,10 +24,6 @@ import { Progressing, } from '@devtron-labs/devtron-fe-common-lib' -import { importComponentFromFELibrary } from '@Components/common' -import { APP_TYPE } from '@Config/constants' -import { getAppIconWithBackground } from '@Config/utils' - import { AppCloneList } from './AppClone' import ApplicationInfoForm from './ApplicationInfoForm' import { @@ -38,6 +34,10 @@ import { } from './types' import UpdateTemplateConfig from './UpdateTemplateConfig' +import { importComponentFromFELibrary } from '@Components/common' +import { APP_TYPE } from '@Config/constants' +import { getAppIconWithBackground } from '@Config/utils' + const TemplateList = importComponentFromFELibrary('TemplateList', null, 'function') export const CloneApplicationSelectionList = ({ diff --git a/src/Pages/App/CreateAppModal/CreateAppModal.component.tsx b/src/Pages/App/CreateAppModal/CreateAppModal.component.tsx index 53915aa4ef..47bb2e393e 100644 --- a/src/Pages/App/CreateAppModal/CreateAppModal.component.tsx +++ b/src/Pages/App/CreateAppModal/CreateAppModal.component.tsx @@ -28,19 +28,12 @@ import { validateTagValue, } from '@devtron-labs/devtron-fe-common-lib' -import { importComponentFromFELibrary } from '@Components/common' -import { saveHostURLConfiguration } from '@Components/hostURL/hosturl.service' -import { createJob } from '@Components/Jobs/Service' -import { REQUIRED_FIELDS_MISSING } from '@Config/constants' -import { APP_COMPOSE_STAGE, getAppComposeURL } from '@Config/routes' -import { getHostURLConfiguration } from '@Services/service' - import ApplicationInfoForm from './ApplicationInfoForm' import { CloneApplicationSelectionList } from './CloneApplicationSelectionList' import { createAppInitialFormErrorState, createAppInitialFormState, PROJECT_SELECT_INPUT_ID } from './constants' import HeaderSection from './HeaderSection' -import { createApp } from './service' import Sidebar from './Sidebar' +import { createApp } from './service' import { ApplicationInfoFormProps, CreateAppFormErrorStateType, @@ -51,6 +44,13 @@ import { } from './types' import { getCreateMethodConfig, getNoItemSelectToastText, validateFormField } from './utils' +import { importComponentFromFELibrary } from '@Components/common' +import { saveHostURLConfiguration } from '@Components/hostURL/hosturl.service' +import { createJob } from '@Components/Jobs/Service' +import { REQUIRED_FIELDS_MISSING } from '@Config/constants' +import { APP_COMPOSE_STAGE, getAppComposeURL } from '@Config/routes' +import { getHostURLConfiguration } from '@Services/service' + import './styles.scss' const createDevtronAppUsingTemplate = importComponentFromFELibrary('createDevtronAppUsingTemplate', null, 'function') @@ -87,6 +87,7 @@ const CreateAppModal = ({ isJobView, handleClose }: CreateAppModalProps) => { updatedFormErrorState.name = validateFormField('name', formState.name) updatedFormErrorState.description = validateFormField('description', formState.description) + // biome-ignore lint/suspicious/noEvolvingTypes: Legacy const labelTags = [] updatedFormErrorState.tags = {} let invalidLabels = false diff --git a/src/Pages/App/CreateAppModal/HeaderSection.tsx b/src/Pages/App/CreateAppModal/HeaderSection.tsx index 4fb0d8800e..08833c8178 100644 --- a/src/Pages/App/CreateAppModal/HeaderSection.tsx +++ b/src/Pages/App/CreateAppModal/HeaderSection.tsx @@ -16,10 +16,10 @@ import { Button, ButtonStyleType, ButtonVariantType, ComponentSizeType } from '@devtron-labs/devtron-fe-common-lib' -import ICClose from '@Icons/ic-close.svg?react' - import { HeaderSectionProps } from './types' +import ICClose from '@Icons/ic-close.svg?react' + const HeaderSection = ({ isJobView, handleClose, isCloseDisabled }: HeaderSectionProps) => (

Create {isJobView ? 'Job' : 'Devtron Application'}

diff --git a/src/Pages/App/CreateAppModal/ProjectSelector.tsx b/src/Pages/App/CreateAppModal/ProjectSelector.tsx index 9fb4c7a952..6d9ae5b30a 100644 --- a/src/Pages/App/CreateAppModal/ProjectSelector.tsx +++ b/src/Pages/App/CreateAppModal/ProjectSelector.tsx @@ -22,11 +22,11 @@ import { useGetResourceKindsOptions, } from '@devtron-labs/devtron-fe-common-lib' -import ICFolderColor from '@Icons/ic-folder-color.svg?react' - import { PROJECT_SELECT_INPUT_ID } from './constants' import { CreateAppFormStateType, ProjectSelectorProps } from './types' +import ICFolderColor from '@Icons/ic-folder-color.svg?react' + const ProjectSelector = ({ selectedProjectId, handleProjectIdChange, error }: ProjectSelectorProps) => { const { isResourcesOptionsLoading, resourcesOptionsMap, resourcesOptionsError, refetchResourcesOptions } = useGetResourceKindsOptions({ diff --git a/src/Pages/App/CreateAppModal/UpdateTemplateConfig.tsx b/src/Pages/App/CreateAppModal/UpdateTemplateConfig.tsx index 5ddebbf14a..47b2e7668c 100644 --- a/src/Pages/App/CreateAppModal/UpdateTemplateConfig.tsx +++ b/src/Pages/App/CreateAppModal/UpdateTemplateConfig.tsx @@ -16,14 +16,14 @@ import { noop } from '@devtron-labs/devtron-fe-common-lib' +import { CreateAppFormStateActionType, UpdateTemplateConfigProps } from './types' +import { Workflow, WorkflowProps } from './Workflow' + import CIConfig from '@Components/ciConfig/CIConfig' import { CIConfigProps } from '@Components/ciConfig/types' import { DockerConfigOverrideKeys } from '@Components/ciPipeline/types' -import { MaterialListProps } from '@Components/material/material.types' import MaterialList from '@Components/material/MaterialList' - -import { CreateAppFormStateActionType, UpdateTemplateConfigProps } from './types' -import { Workflow, WorkflowProps } from './Workflow' +import { MaterialListProps } from '@Components/material/material.types' const parentState: CIConfigProps['parentState'] = { loadingState: null, diff --git a/src/Pages/App/CreateAppModal/Workflow/Workflow.tsx b/src/Pages/App/CreateAppModal/Workflow/Workflow.tsx index 7eff40a6e7..bdf6b5ea61 100644 --- a/src/Pages/App/CreateAppModal/Workflow/Workflow.tsx +++ b/src/Pages/App/CreateAppModal/Workflow/Workflow.tsx @@ -27,9 +27,6 @@ import { useAsync, } from '@devtron-labs/devtron-fe-common-lib' -import { getCreateWorkflows } from '@Components/app/details/triggerView/workflow.service' -import { getEnvironmentListMin } from '@Services/service' - import { HandleNodeUpdateActionProps, NodeUpdateActionType, WorkflowProps } from './types' import { getCDNodeIcon, @@ -40,6 +37,9 @@ import { getWorkflowLinkedCDNodes, } from './utils' +import { getCreateWorkflows } from '@Components/app/details/triggerView/workflow.service' +import { getEnvironmentListMin } from '@Services/service' + export const Workflow = ({ templateId, onChange, workflowIdToErrorMessageMap }: WorkflowProps) => { // STATES const [nodes, setNodes] = useState>({}) diff --git a/src/Pages/App/CreateAppModal/Workflow/types.ts b/src/Pages/App/CreateAppModal/Workflow/types.ts index 71c718c019..d8bfb28d0a 100644 --- a/src/Pages/App/CreateAppModal/Workflow/types.ts +++ b/src/Pages/App/CreateAppModal/Workflow/types.ts @@ -16,11 +16,11 @@ import { CommonNodeAttr, SelectPickerOptionType, WorkflowType } from '@devtron-labs/devtron-fe-common-lib' +import { CreateAppFormErrorStateType, CreateAppFormStateType } from '../types' + import { EnvironmentListMinType } from '@Components/app/types' import { createClusterEnvGroup } from '@Components/common' -import { CreateAppFormErrorStateType, CreateAppFormStateType } from '../types' - export interface WorkflowProps { templateId: string onChange?: ( diff --git a/src/Pages/App/CreateAppModal/Workflow/utils.tsx b/src/Pages/App/CreateAppModal/Workflow/utils.tsx index 955bc57b36..20b4d51bcf 100644 --- a/src/Pages/App/CreateAppModal/Workflow/utils.tsx +++ b/src/Pages/App/CreateAppModal/Workflow/utils.tsx @@ -18,14 +18,22 @@ import { GroupBase } from 'react-select' import { CommonNodeAttr, - getSelectPickerOptionByValue, GitProviderIcon, GraphVisualizerEdge, GraphVisualizerNode, + getSelectPickerOptionByValue, SelectPickerOptionType, WorkflowType, } from '@devtron-labs/devtron-fe-common-lib' +import { + CDNodeEnvironmentSelectPickerOptionType, + ConvertWorkflowNodesToGraphVisualizerNodesProps, + GetWorkflowGraphVisualizerNodesProps, + NodeUpdateActionType, +} from './types' + +import { createClusterEnvGroup } from '@Components/common' import ICCD from '@Icons/ic-CD.svg?react' import ICCi from '@Icons/ic-CI.svg?react' import ICCIWebhook from '@Icons/ic-CIWebhook.svg?react' @@ -35,14 +43,6 @@ import ICLinkedCD from '@Icons/ic-linked-cd.svg?react' import ICNodeBuildLinked from '@Icons/ic-node-build-linked.svg?react' import ICPaperRocket from '@Icons/ic-paper-rocket.svg?react' import ICWarning from '@Icons/ic-warning.svg?react' -import { createClusterEnvGroup } from '@Components/common' - -import { - CDNodeEnvironmentSelectPickerOptionType, - ConvertWorkflowNodesToGraphVisualizerNodesProps, - GetWorkflowGraphVisualizerNodesProps, - NodeUpdateActionType, -} from './types' const getWorkflowCDNodeEnvironments = ( environmentListOptions: ConvertWorkflowNodesToGraphVisualizerNodesProps['environmentListOptions'], @@ -310,6 +310,7 @@ export const getValidatedNodes = (nodes: Record) const validatedNodes = nodes const workflowIdToErrorMessageMap: Record = {} + // biome-ignore lint/complexity/noFlatMapIdentity: Legacy const cdNodesWithDuplicateEnv = Array.from(getEnvironmentCDNodesMap(validatedNodes).values()) .filter((cdNodes) => cdNodes.length > 1) .flatMap((node) => node) diff --git a/src/Pages/App/CreateAppModal/service.ts b/src/Pages/App/CreateAppModal/service.ts index fc9968ab64..62e517d785 100644 --- a/src/Pages/App/CreateAppModal/service.ts +++ b/src/Pages/App/CreateAppModal/service.ts @@ -16,13 +16,13 @@ import { abortPreviousRequests, post } from '@devtron-labs/devtron-fe-common-lib' +import { CloneListResponse, CloneListTypes } from './AppClone/types' + import { getJobs } from '@Components/Jobs/Service' import { APP_TYPE, Routes } from '@Config/constants' import { getAppIconWithBackground } from '@Config/utils' import { getAppListMin } from '@Services/service' -import { CloneListResponse, CloneListTypes } from './AppClone/types' - export const createApp = (request) => post(Routes.APP, request) export const fetchDevtronCloneList = async ({ diff --git a/src/Pages/App/CreateAppModal/types.ts b/src/Pages/App/CreateAppModal/types.ts index 7dff59f886..92d9f9701b 100644 --- a/src/Pages/App/CreateAppModal/types.ts +++ b/src/Pages/App/CreateAppModal/types.ts @@ -25,11 +25,11 @@ import { TagsTableColumnsType, } from '@devtron-labs/devtron-fe-common-lib' +import { getCreateMethodConfig } from './utils' + import { CIConfigProps } from '@Components/ciConfig/types' import { GitMaterialType } from '@Components/material/material.types' -import { getCreateMethodConfig } from './utils' - interface CreateAppWorkflowConfigType { cd: { pipelineId: number diff --git a/src/Pages/App/CreateAppModal/utils.tsx b/src/Pages/App/CreateAppModal/utils.tsx index 61d69459dc..88720ef8ed 100644 --- a/src/Pages/App/CreateAppModal/utils.tsx +++ b/src/Pages/App/CreateAppModal/utils.tsx @@ -18,15 +18,15 @@ import { Icon, IconsProps, SelectPickerOptionType, + ValidationResponseType, validateAppName, validateDescription, - ValidationResponseType, } from '@devtron-labs/devtron-fe-common-lib' -import { importComponentFromFELibrary } from '@Components/common' - import { CreateAppFormStateType, CreateAppModalProps, CreationMethodType } from './types' +import { importComponentFromFELibrary } from '@Components/common' + const isFELibAvailable: boolean = importComponentFromFELibrary('isFELibAvailable', null, 'function') export const validateProject = (projectId: CreateAppFormStateType['projectId']): ValidationResponseType => { diff --git a/src/Pages/App/Details/ExternalFlux/ExternalFluxAppDetails.tsx b/src/Pages/App/Details/ExternalFlux/ExternalFluxAppDetails.tsx index f53f6c35c5..b0e73df15d 100644 --- a/src/Pages/App/Details/ExternalFlux/ExternalFluxAppDetails.tsx +++ b/src/Pages/App/Details/ExternalFlux/ExternalFluxAppDetails.tsx @@ -18,9 +18,9 @@ import { useEffect, useRef, useState } from 'react' import { useParams } from 'react-router-dom' import { - abortPreviousRequests, AIAgentContextSourceType, AppType, + abortPreviousRequests, DeploymentAppTypes, ERROR_STATUS_CODE, ErrorScreenManager, @@ -39,7 +39,7 @@ import { getExternalFluxCDAppDetails } from './service' import { ExternalFluxAppDetailParams } from './types' import { getAppStatus } from './utils' -let initTimer = null +let initTimer: ReturnType = null const ExternalFluxAppDetails = () => { const { clusterId, appName, namespace, templateType } = useParams() diff --git a/src/Pages/App/Details/ExternalFlux/ExternalFluxAppDetailsRoute.tsx b/src/Pages/App/Details/ExternalFlux/ExternalFluxAppDetailsRoute.tsx index 1fef5d0388..b5c1ef38ff 100644 --- a/src/Pages/App/Details/ExternalFlux/ExternalFluxAppDetailsRoute.tsx +++ b/src/Pages/App/Details/ExternalFlux/ExternalFluxAppDetailsRoute.tsx @@ -19,10 +19,10 @@ import { Navigate, Route, Routes } from 'react-router-dom' import { AppListConstants, Progressing, ROUTER_URLS } from '@devtron-labs/devtron-fe-common-lib' -import { URLS } from '@Config/routes' - import EAHeaderComponent from '../../../../components/v2/headers/EAHeader.component' +import { URLS } from '@Config/routes' + const ExternalFluxAppDetails = lazy(() => import('./ExternalFluxAppDetails')) const ExternalFluxAppDetailsRoute = () => ( diff --git a/src/Pages/App/Details/ExternalFlux/service.tsx b/src/Pages/App/Details/ExternalFlux/service.tsx index 4d58b93bcd..032c884a10 100644 --- a/src/Pages/App/Details/ExternalFlux/service.tsx +++ b/src/Pages/App/Details/ExternalFlux/service.tsx @@ -19,7 +19,7 @@ import { get, getUrlWithSearchParams } from '@devtron-labs/devtron-fe-common-lib import { Routes } from '../../../../config' import { GetExternalFluxCDAppDetailsParamsType } from './types' -export const getExternalFluxCDAppDetails = async ({ +export const getExternalFluxCDAppDetails = ({ clusterId, namespace, appName, diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig.service.ts b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig.service.ts index 45fb097a16..1a2f19afdc 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig.service.ts +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig.service.ts @@ -16,9 +16,9 @@ import { AppConfigProps, + ROUTES as CommonRoutes, get, getUrlWithSearchParams, - ROUTES as CommonRoutes, trash, } from '@devtron-labs/devtron-fe-common-lib' diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig.tsx index ab34e30a35..0c7ad38fb9 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig.tsx @@ -19,6 +19,7 @@ import { generatePath, useLocation, useNavigate, useParams } from 'react-router- import { AppConfigProps, + URLS as CommonURLS, ConfirmationModal, ConfirmationModalVariantType, ErrorScreenManager, @@ -30,11 +31,9 @@ import { showError, ToastManager, ToastVariantType, - URLS as CommonURLS, useAsync, } from '@devtron-labs/devtron-fe-common-lib' -import { DeleteComponentsName } from '@Config/constantMessaging' import { ApplicationDeletionInfo } from '@Pages/Shared/ApplicationDeletionInfo/ApplicationDeletionInfo' import { importComponentFromFELibrary } from '../../../../../components/common' @@ -44,8 +43,6 @@ import { getUserRole } from '../../../../GlobalConfigurations/Authorization/auth import { UserRoleType } from '../../../../GlobalConfigurations/Authorization/constants' import { getAppConfigStatus, getEnvConfig } from '../../service' import { AppConfigStatusItemType } from '../../service.types' -import AppComposeRouter from './MainContent/AppComposeRouter' -import { AppNavigation } from './Navigation/AppNavigation' import { ENV_CONFIG_PATH_REG } from './AppConfig.constants' import { deleteApp } from './AppConfig.service' import { @@ -57,6 +54,10 @@ import { } from './AppConfig.types' import { getNavItems, isCDPipelineCreated, isCIPipelineCreated, isUnlocked } from './AppConfig.utils' import { AppConfigurationProvider } from './AppConfiguration.provider' +import AppComposeRouter from './MainContent/AppComposeRouter' +import { AppNavigation } from './Navigation/AppNavigation' + +import { DeleteComponentsName } from '@Config/constantMessaging' import './appConfig.scss' @@ -543,6 +544,7 @@ const AppConfig = ({ appName, resourceKind, filteredEnvIds, isTemplateView }: Ap fetchEnvConfig={fetchEnvConfig} isTemplateView={isTemplateView} > + {/** biome-ignore lint/complexity/noUselessFragments: Keeping to due to type of children in parent */} <>
stage === STAGE_NAME.CI_PIPELINE || @@ -322,6 +322,7 @@ export const isCDPipelineCreated = (responseArr: AppConfigStatusItemType[]) => { export const transformEnvConfig = ({ resourceConfig }: EnvConfigDTO) => { const updatedEnvConfig = resourceConfig.reduce( (acc, curr) => ({ + // biome-ignore lint/performance/noAccumulatingSpread: Legacy ...acc, deploymentTemplate: curr.type === ConfigResourceType.DeploymentTemplate ? curr : acc.deploymentTemplate, configmaps: curr.type === ConfigResourceType.ConfigMap ? [...acc.configmaps, curr] : acc.configmaps, diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/AppComposeRouter.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/AppComposeRouter.tsx index 0b02ac9bf5..af32de6dae 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/AppComposeRouter.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/AppComposeRouter.tsx @@ -26,16 +26,17 @@ import { Progressing, } from '@devtron-labs/devtron-fe-common-lib' -import Next from '@Icons/ic-arrow-forward.svg?react' -import { ErrorBoundary, useAppContext } from '@Components/common' -import ExternalLinks from '@Components/externalLinks/ExternalLinks' -import { DEPLOYMENT_CONFIGURATION_RESOURCE_TYPE_ROUTE, URLS } from '@Config/index' import { ConfigMapSecretWrapper } from '@Pages/Shared/ConfigMapSecret/ConfigMapSecret.wrapper' import { NextButtonProps, STAGE_NAME } from '../AppConfig.types' import { useAppConfigurationContext } from '../AppConfiguration.provider' import { DeploymentConfigCompareWrapper } from './DeploymentConfigCompare' +import { ErrorBoundary, useAppContext } from '@Components/common' +import ExternalLinks from '@Components/externalLinks/ExternalLinks' +import { DEPLOYMENT_CONFIGURATION_RESOURCE_TYPE_ROUTE, URLS } from '@Config/index' +import Next from '@Icons/ic-arrow-forward.svg?react' + import '../appConfig.scss' const MaterialList = lazy(() => import('@Components/material/MaterialList')) diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/CompareConfigView.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/CompareConfigView.tsx index b0df1ea5e4..1c2b757828 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/CompareConfigView.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/CompareConfigView.tsx @@ -16,12 +16,12 @@ import { DeploymentHistoryDiffView, ErrorScreenManager } from '@devtron-labs/devtron-fe-common-lib' -import ICFileEdit from '@Icons/ic-file-edit.svg?react' -import { importComponentFromFELibrary } from '@Components/common' - import { CompareConfigViewProps } from './types' import { getCompareViewHistoryDiffConfigProps } from './utils' +import { importComponentFromFELibrary } from '@Components/common' +import ICFileEdit from '@Icons/ic-file-edit.svg?react' + const CompareFromApprovalSelector = importComponentFromFELibrary('CompareFromApprovalSelector', null, 'function') const CompareConfigView = ({ diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/ConfigDryRun.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/ConfigDryRun.tsx index 4f67b572f2..8461cf34cb 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/ConfigDryRun.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/ConfigDryRun.tsx @@ -17,8 +17,8 @@ import { useParams } from 'react-router-dom' import { - abortPreviousRequests, APIResponseHandler, + abortPreviousRequests, BaseURLParams, CodeEditor, DryRunEditorMode, @@ -30,15 +30,15 @@ import { useAsync, } from '@devtron-labs/devtron-fe-common-lib' -// FIXME: Placeholder icon since no sense of git merge icon as of now -import ICFileCode from '@Icons/ic-file-code.svg?react' -import ICFilePlay from '@Icons/ic-file-play.svg?react' -import { importComponentFromFELibrary } from '@Components/common' - import NoPublishedVersionEmptyState from './NoPublishedVersionEmptyState' import SelectMergeStrategy from './SelectMergeStrategy' import { ConfigDryRunProps } from './types' +import { importComponentFromFELibrary } from '@Components/common' +// FIXME: Placeholder icon since no sense of git merge icon as of now +import ICFileCode from '@Icons/ic-file-code.svg?react' +import ICFilePlay from '@Icons/ic-file-play.svg?react' + const DryRunEditorModeSelect = importComponentFromFELibrary('DryRunEditorModeSelect', null, 'function') const ConfigDryRun = ({ diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/ConfigHeader.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/ConfigHeader.tsx index 00fdf97e35..8e513f0b9e 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/ConfigHeader.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/ConfigHeader.tsx @@ -21,11 +21,11 @@ import { InvalidYAMLTippyWrapper, } from '@devtron-labs/devtron-fe-common-lib' -import ICErrorExclamation from '@Icons/ic-error-exclamation.svg?react' - import { ConfigHeaderProps, ConfigHeaderTabProps } from './types' import { getConfigHeaderTabConfig } from './utils' +import ICErrorExclamation from '@Icons/ic-error-exclamation.svg?react' + import './ConfigHeader.scss' const ConfigHeaderTab = ({ diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/ConfigToolbar.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/ConfigToolbar.tsx index 8a6d1a8c74..521d33fa2e 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/ConfigToolbar.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/ConfigToolbar.tsx @@ -32,16 +32,16 @@ import { ToggleResolveScopedVariables, } from '@devtron-labs/devtron-fe-common-lib' -import ICBookOpen from '@Icons/ic-book-open.svg?react' -import ICInfoOutlineGrey from '@Icons/ic-info-outline-grey.svg?react' -import ICMore from '@Icons/ic-more-option.svg?react' -import { importComponentFromFELibrary } from '@Components/common' - import BaseConfigurationNavigation from './BaseConfigurationNavigation' import SelectMergeStrategy from './SelectMergeStrategy' import { ConfigToolbarProps } from './types' import { PopupMenuItem } from './utils' +import { importComponentFromFELibrary } from '@Components/common' +import ICBookOpen from '@Icons/ic-book-open.svg?react' +import ICInfoOutlineGrey from '@Icons/ic-info-outline-grey.svg?react' +import ICMore from '@Icons/ic-more-option.svg?react' + const ProtectionViewTabGroup = importComponentFromFELibrary('ProtectionViewTabGroup', null, 'function') const MergePatchWithTemplateCheckbox = importComponentFromFELibrary('MergePatchWithTemplateCheckbox', null, 'function') const ConfigApproversInfoTippy = importComponentFromFELibrary('ConfigApproversInfoTippy', null, 'function') diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentConfigCompare/DeploymentConfigCompare.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentConfigCompare/DeploymentConfigCompare.tsx index 8a1ef46a86..c63fe04319 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentConfigCompare/DeploymentConfigCompare.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentConfigCompare/DeploymentConfigCompare.tsx @@ -38,7 +38,6 @@ import { } from '@devtron-labs/devtron-fe-common-lib' import { deploymentConfigDiffTabs, getDeploymentConfigDiffTabs } from '@Pages/Shared' -import { getChartReferencesForAppAndEnv, getTemplateOptions } from '@Services/service' import { BASE_CONFIGURATIONS } from '../../AppConfig.constants' import { @@ -64,6 +63,8 @@ import { parseCompareWithSearchParams, } from './utils' +import { getChartReferencesForAppAndEnv, getTemplateOptions } from '@Services/service' + export const DeploymentConfigCompare = ({ environments, appName, @@ -548,10 +549,10 @@ export const DeploymentConfigCompare = ({ type: 'string', text: compareTo || BASE_CONFIGURATIONS.name, }, - ...(((currentEnvOptions?.previousDeployments.length || + ...((((currentEnvOptions?.previousDeployments.length || appOrEnvIdToResourceApprovalConfigurationMap?.[getIdentifierForApprovalConfig(false)] ?.isApprovalApplicable) ?? - isBaseConfigProtected + isBaseConfigProtected) ? [ { id: `environment-config-type-selector-current`, @@ -591,16 +592,16 @@ export const DeploymentConfigCompare = ({ const _compareWithManifestChartRefId = chartRefId ?? (currentSearchParams.has('compareWithIdentifierId') && _isManifestView - ? compareEnvOptions.previousDeployments.find( + ? (compareEnvOptions.previousDeployments.find( (prev) => prev.wfrId === Number(currentSearchParams.get('compareWithIdentifierId')), - )?.chartRefId ?? null + )?.chartRefId ?? null) : null) const _manifestChartRefId = currentSearchParams.has('identifierId') && _isManifestView - ? currentEnvOptions.previousDeployments.find( + ? (currentEnvOptions.previousDeployments.find( (prev) => prev.wfrId === Number(currentSearchParams.get('identifierId')), - )?.chartRefId ?? null + )?.chartRefId ?? null) : null if (identifierId) { diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentConfigCompare/DeploymentConfigCompareWrapper.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentConfigCompare/DeploymentConfigCompareWrapper.tsx index 7a2447c63b..c1ecc74985 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentConfigCompare/DeploymentConfigCompareWrapper.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentConfigCompare/DeploymentConfigCompareWrapper.tsx @@ -19,12 +19,12 @@ import { generatePath, useLocation, useParams } from 'react-router-dom' import { EnvResourceType } from '@devtron-labs/devtron-fe-common-lib' -import { URLS } from '@Config/routes' - import { DeploymentConfigCompareProps, DeploymentConfigParams } from '../../AppConfig.types' import { DeploymentConfigCompare } from './DeploymentConfigCompare' import { DeploymentConfigCompareWrapperProps } from './types' +import { URLS } from '@Config/routes' + const DeploymentConfigCompareWrapper = ({ routePath, baseGoBackURL, diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentConfigCompare/service.utils.ts b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentConfigCompare/service.utils.ts index cf2c23e595..318f8f38bd 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentConfigCompare/service.utils.ts +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentConfigCompare/service.utils.ts @@ -17,9 +17,9 @@ import { AppEnvDeploymentConfigDTO, AppEnvDeploymentConfigType, + GetDeploymentManifestProps, getAppEnvDeploymentConfig, getDeploymentManifest, - GetDeploymentManifestProps, ResolvedDeploymentTemplateDTO, ResponseType, TemplateListType, diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentConfigCompare/utils.ts b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentConfigCompare/utils.ts index c3369c123b..2f1e3f923f 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentConfigCompare/utils.ts +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentConfigCompare/utils.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import { GroupBase, OptionsOrGroups } from 'react-select' import moment from 'moment' +import { GroupBase, OptionsOrGroups } from 'react-select' import { AppEnvDeploymentConfigDTO, @@ -25,8 +25,6 @@ import { YAMLStringify, } from '@devtron-labs/devtron-fe-common-lib' -import { Moment12HourFormat } from '@Config/constants' - import { BASE_CONFIGURATIONS } from '../../AppConfig.constants' import { AppEnvDeploymentConfigQueryParams, @@ -37,6 +35,8 @@ import { } from '../../AppConfig.types' import { SetIdentifierIdBasedOnConfigurationProps } from './types' +import { Moment12HourFormat } from '@Config/constants' + export const getPreviousDeploymentOptionValue = (identifierId: number, pipelineId?: number, chartRefId?: number) => { if (identifierId && pipelineId) { return `${AppEnvDeploymentConfigType.PREVIOUS_DEPLOYMENTS}-${identifierId}-${pipelineId}${chartRefId ? `-${chartRefId}` : ''}` @@ -295,7 +295,7 @@ export const getManifestRequestValues = (config: AppEnvDeploymentConfigDTO): { d null return { - data: _data ? YAMLStringify(_data) ?? '' : '', + data: _data ? (YAMLStringify(_data) ?? '') : '', chartRefId: getDraftConfigChartRefId(config), } } @@ -339,8 +339,8 @@ export const getIdentifierIdBasedOnConfiguration = ({ previousDeployments, }: SetIdentifierIdBasedOnConfigurationProps) => { const _identifierId = isManifestView - ? previousDeployments.find((prev) => prev.wfrId === identifierId)?.deploymentTemplateHistoryId ?? null - : previousDeployments.find((prev) => prev.deploymentTemplateHistoryId === identifierId)?.wfrId ?? null + ? (previousDeployments.find((prev) => prev.wfrId === identifierId)?.deploymentTemplateHistoryId ?? null) + : (previousDeployments.find((prev) => prev.deploymentTemplateHistoryId === identifierId)?.wfrId ?? null) return String(_identifierId) } diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DTChartSelector.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DTChartSelector.tsx index b1661bcf6d..a5cbb13017 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DTChartSelector.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DTChartSelector.tsx @@ -32,13 +32,13 @@ import { versionComparatorBySortOrder, } from '@devtron-labs/devtron-fe-common-lib' -import Dropdown from '@Icons/ic-chevron-down.svg?react' -import { sortObjectArrayAlphabetically } from '@Components/common' -import { DEPLOYMENT } from '@Config/constants' - import { CHART_DOCUMENTATION_LINK, CHART_TYPE_TAB, CHART_TYPE_TAB_KEYS } from './constants' import { ChartSelectorDropdownProps, DTChartSelectorProps } from './types' +import { sortObjectArrayAlphabetically } from '@Components/common' +import { DEPLOYMENT } from '@Config/constants' +import Dropdown from '@Icons/ic-chevron-down.svg?react' + const LoadingShimmer = () =>
const ChartSelectorDropdown = ({ @@ -56,8 +56,8 @@ const ChartSelectorDropdown = ({ ) const uniqueChartsByDevtron = new Map() const uniqueCustomCharts = new Map() - let devtronCharts = [] - let customCharts = [] + let devtronCharts: DeploymentChartVersionType[] = [] + let customCharts: DeploymentChartVersionType[] = [] charts.forEach((chart) => { const chartName = chart.name @@ -122,32 +122,33 @@ const ChartSelectorDropdown = ({
- <> - {customCharts.length > 0 && ( -
- ({ - label: CHART_TYPE_TAB[key], - value: key, - }))} - value={selectedChartTypeTab} - onChange={changeSelectedTab} - name="chart-type-tabs" - size={ComponentSizeType.xs} - /> -
- )} -
- {(selectedChartTypeTab === CHART_TYPE_TAB_KEYS.DEVTRON_CHART - ? devtronCharts - : customCharts - ).map((chart: DeploymentChartVersionType, index: number) => ( + {customCharts.length > 0 && ( + // biome-ignore lint/a11y/noNoninteractiveElementInteractions lint/a11y/noStaticElementInteractions lint/a11y/useKeyWithClickEvents: stopPropagation +
+ ({ + label: CHART_TYPE_TAB[key], + value: key, + }))} + value={selectedChartTypeTab} + onChange={changeSelectedTab} + name="chart-type-tabs" + size={ComponentSizeType.xs} + /> +
+ )} +
+ {(selectedChartTypeTab === CHART_TYPE_TAB_KEYS.DEVTRON_CHART ? devtronCharts : customCharts).map( + (chart: DeploymentChartVersionType, index: number) => ( + // biome-ignore lint/a11y/noNoninteractiveElementInteractions lint/a11y/noStaticElementInteractions lint/a11y/useKeyWithClickEvents: Legacy
)}
- ))} -
- + ), + )} +
) @@ -276,7 +277,7 @@ const DTChartSelector = ({
- {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} + {/** biome-ignore lint/a11y/noLabelWithoutControl: Legacy */} diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeleteOverrideDialog.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeleteOverrideDialog.tsx index cb1969b1dd..b4af77ddea 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeleteOverrideDialog.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeleteOverrideDialog.tsx @@ -24,11 +24,11 @@ import { showError, } from '@devtron-labs/devtron-fe-common-lib' -import { DeleteComponentsName } from '@Config/constantMessaging' - import { deleteOverrideDeploymentTemplate } from './service' import { DeleteOverrideDialogProps } from './types' +import { DeleteComponentsName } from '@Config/constantMessaging' + const DeleteOverrideDialog = ({ environmentConfigId, handleReload, diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeploymentTemplate.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeploymentTemplate.tsx index feeec87bf7..9ec4de6ad9 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeploymentTemplate.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeploymentTemplate.tsx @@ -20,9 +20,9 @@ import { useParams } from 'react-router-dom' import YAML from 'yaml' import { - abortPreviousRequests, API_STATUS_CODES, AppConfigProps, + abortPreviousRequests, BASE_CONFIGURATION_ENV_ID, BaseURLParams, Button, @@ -41,8 +41,8 @@ import { DryRunEditorMode, ErrorScreenManager, FloatingVariablesSuggestions, - GenericEmptyState, GET_RESOLVED_DEPLOYMENT_TEMPLATE_EMPTY_RESPONSE, + GenericEmptyState, getIsRequestAborted, getResolvedDeploymentTemplate, logExceptionToSentry, @@ -67,12 +67,7 @@ import { YAMLStringify, } from '@devtron-labs/devtron-fe-common-lib' -import ICClose from '@Icons/ic-close.svg?react' -import ICInfoOutlineGrey from '@Icons/ic-info-outline-grey.svg?react' import deleteOverrideEmptyStateImage from '@Images/no-artifact.webp' -import { importComponentFromFELibrary } from '@Components/common' -import { getModuleInfo } from '@Components/v2/devtronStackManager/DevtronStackManager.service' -import { APP_COMPOSE_STAGE, getAppComposeURL } from '@Config/routes' import { CM_CS_DEPLOYMENT_CONFIG_FLOATING_WIDGET_BOUNDARY_GAP } from '@Pages/Shared/ConfigMapSecret/constants' import BaseConfigurationNavigation from '../BaseConfigurationNavigation' @@ -135,6 +130,12 @@ import { parseDeploymentTemplateParams, } from './utils' +import { importComponentFromFELibrary } from '@Components/common' +import { getModuleInfo } from '@Components/v2/devtronStackManager/DevtronStackManager.service' +import { APP_COMPOSE_STAGE, getAppComposeURL } from '@Config/routes' +import ICClose from '@Icons/ic-close.svg?react' +import ICInfoOutlineGrey from '@Icons/ic-info-outline-grey.svg?react' + import './DeploymentTemplate.scss' const getDraftByResourceName = importComponentFromFELibrary('getDraftByResourceName', null, 'function') @@ -1152,9 +1153,10 @@ const DeploymentTemplate = ({ * * @param skipReadmeAndSchema - true only while doing handleSave */ - const prepareDataToSave = ({ skipReadmeAndSchema = false, fromDeleteOverride = false } = {}): - | UpdateBaseDTPayloadType - | UpdateEnvironmentDTPayloadType => { + const prepareDataToSave = ({ + skipReadmeAndSchema = false, + fromDeleteOverride = false, + } = {}): UpdateBaseDTPayloadType | UpdateEnvironmentDTPayloadType => { if (!envId) { return getUpdateBaseDeploymentTemplatePayload({ state, diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeploymentTemplateCTA.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeploymentTemplateCTA.tsx index 9bbc0db020..b831c9693f 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeploymentTemplateCTA.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeploymentTemplateCTA.tsx @@ -24,10 +24,10 @@ import { InvalidYAMLTippyWrapper, } from '@devtron-labs/devtron-fe-common-lib' -import ICArrowRight from '@Icons/ic-arrow-right.svg?react' - import { DeploymentTemplateCTAProps } from './types' +import ICArrowRight from '@Icons/ic-arrow-right.svg?react' + // For protect we will have a separate component const DeploymentTemplateCTA = ({ isLoading, diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeploymentTemplateForm.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeploymentTemplateForm.tsx index 99545a6cab..a84a4ad955 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeploymentTemplateForm.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeploymentTemplateForm.tsx @@ -26,16 +26,16 @@ import { SelectPickerOptionType, } from '@devtron-labs/devtron-fe-common-lib' -import ICBookOpen from '@Icons/ic-book-open.svg?react' -import ICPencil from '@Icons/ic-pencil.svg?react' -import { importComponentFromFELibrary } from '@Components/common' - import { MERGE_STRATEGY_OPTIONS } from '../constants' import { APPLICATION_METRICS_DROPDOWN_OPTIONS, DEPLOYMENT_TEMPLATE_LABELS_KEYS } from './constants' import { GUIView as DeploymentTemplateGUIView } from './GUIView' import { DeploymentTemplateFormProps } from './types' import { getEditorSchemaURIFromChartNameAndVersion } from './utils' +import { importComponentFromFELibrary } from '@Components/common' +import ICBookOpen from '@Icons/ic-book-open.svg?react' +import ICPencil from '@Icons/ic-pencil.svg?react' + const ExpressEditDiffEditor = importComponentFromFELibrary('ExpressEditDiffEditor', null, 'function') const DeploymentTemplateForm = ({ diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeploymentTemplateOptionsHeader.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeploymentTemplateOptionsHeader.tsx index 9780b22981..6be13e75c5 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeploymentTemplateOptionsHeader.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/DeploymentTemplateOptionsHeader.tsx @@ -15,8 +15,8 @@ */ import { - ComponentSizeType, CONFIGURATION_TYPE_OPTIONS, + ComponentSizeType, ConfigurationType, InvalidYAMLTippyWrapper, SegmentedControl, diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/GUIView/GUIView.component.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/GUIView/GUIView.component.tsx index 64d7c910a8..3db184c31f 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/GUIView/GUIView.component.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/GUIView/GUIView.component.tsx @@ -14,13 +14,13 @@ * limitations under the License. */ -import { useEffect, useMemo, useRef, useState } from 'react' import { JSONPath } from 'jsonpath-plus' +import { useEffect, useMemo, useRef, useState } from 'react' import YAML from 'yaml' import { - flatMapOfJSONPaths, FormProps, + flatMapOfJSONPaths, GenericEmptyState, GUIViewError, HIDE_SUBMIT_BUTTON_UI_SCHEMA, @@ -31,15 +31,16 @@ import { ToastVariantType, } from '@devtron-labs/devtron-fe-common-lib' -import ICArrow from '@Icons/ic-arrow-forward.svg?react' -import ICWarningY5 from '@Icons/ic-warning-y5.svg?react' import EmptyFolderImage from '@Images/empty-folder.webp' -import { importComponentFromFELibrary } from '@Components/common' import { DEPLOYMENT_TEMPLATE_LABELS_KEYS, GUI_VIEW_TEXTS } from '../constants' import { GUIViewProps, GUIViewState } from './types' import { GUIInfoBlock } from './utils' +import { importComponentFromFELibrary } from '@Components/common' +import ICArrow from '@Icons/ic-arrow-forward.svg?react' +import ICWarningY5 from '@Icons/ic-warning-y5.svg?react' + const makeObjectFromJsonPathArray = importComponentFromFELibrary('makeObjectFromJsonPathArray', null, 'function') const ConfigurableGUIViewPanel = importComponentFromFELibrary('ConfigurableGUIViewPanel', null, 'function') const ConfigurableGUIViewModel = importComponentFromFELibrary('ConfigurableGUIViewModel', null, 'function') diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/service.ts b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/service.ts index 327c151b0d..991cca91f1 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/service.ts +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/service.ts @@ -18,9 +18,9 @@ import { APIOptions, AppConfigProps, BaseURLParams, + GetTemplateAPIRouteType, get, getTemplateAPIRoute, - GetTemplateAPIRouteType, getUrlWithSearchParams, post, put, @@ -29,9 +29,6 @@ import { versionComparatorBySortOrder, } from '@devtron-labs/devtron-fe-common-lib' -import { Routes } from '@Config/constants' -import { getChartReferencesForAppAndEnv } from '@Services/service' - import { DeploymentTemplateConfigDTO, EnvironmentOverrideDeploymentTemplateDTO, @@ -41,6 +38,9 @@ import { } from './types' import { addGUISchemaIfAbsent } from './utils' +import { Routes } from '@Config/constants' +import { getChartReferencesForAppAndEnv } from '@Services/service' + export const updateBaseDeploymentTemplate = ( request: UpdateBaseDTPayloadType, abortSignal: AbortSignal, diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/types.ts b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/types.ts index de04f6be2e..c686ffe4c8 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/types.ts +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/types.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -import { SyntheticEvent } from 'react' import { Operation } from 'fast-json-patch' +import { SyntheticEvent } from 'react' import { AppConfigProps, @@ -325,6 +325,7 @@ export interface ChartSelectorDropdownProps isUnSet: boolean selectChart: ( selectedChart: DeploymentChartVersionType, + // biome-ignore lint/suspicious/noConfusingVoidType: Legacy ) => void | React.Dispatch> } diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/utils.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/utils.tsx index 33c296c568..ed3f3198b0 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/utils.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentTemplate/utils.tsx @@ -28,8 +28,6 @@ import { YAMLStringify, } from '@devtron-labs/devtron-fe-common-lib' -import { importComponentFromFELibrary } from '@Components/common' - import { DEFAULT_MERGE_STRATEGY } from '../constants' import { CompareConfigViewProps, EnvOverrideEditorCommonStateType } from '../types' import { CHART_NAME_TO_DOC_SEGMENT, PROTECT_BASE_DEPLOYMENT_TEMPLATE_IDENTIFIER_DTO } from './constants' @@ -51,6 +49,8 @@ import { UpdateEnvironmentDTPayloadType, } from './types' +import { importComponentFromFELibrary } from '@Components/common' + const removeLockedKeysFromYaml = importComponentFromFELibrary('removeLockedKeysFromYaml', null, 'function') const reapplyRemovedLockedKeysToYaml = importComponentFromFELibrary('reapplyRemovedLockedKeysToYaml', null, 'function') diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/NoOverrideEmptyState.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/NoOverrideEmptyState.tsx index eb3c571729..395b306fac 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/NoOverrideEmptyState.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/NoOverrideEmptyState.tsx @@ -23,11 +23,12 @@ import { ImageType, } from '@devtron-labs/devtron-fe-common-lib' -import ICAdd from '@Icons/ic-add.svg?react' import cmCsEmptyState from '@Images/cm-cs-empty-state.png' import { NoOverrideEmptyStateProps } from './types' +import ICAdd from '@Icons/ic-add.svg?react' + import './NoOverrideEmptyState.scss' const getNoOverrideEmptyStateTitle = ({ diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/SelectMergeStrategy.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/SelectMergeStrategy.tsx index f26c98f8c9..d033d5b209 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/SelectMergeStrategy.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/SelectMergeStrategy.tsx @@ -27,11 +27,11 @@ import { Tooltip, } from '@devtron-labs/devtron-fe-common-lib' -import { importComponentFromFELibrary } from '@Components/common' - import { MERGE_STRATEGY_OPTIONS } from './constants' import { SelectMergeStrategyProps } from './types' +import { importComponentFromFELibrary } from '@Components/common' + const PatchStrategyTooltipInfo = importComponentFromFELibrary('PatchStrategyTooltipInfo', null, 'function') const isFELibAvailable = importComponentFromFELibrary('isFELibAvailable', false, 'function') diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/utils.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/utils.tsx index 91ead71ea9..95f8115e18 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/utils.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/utils.tsx @@ -22,12 +22,6 @@ import { Tooltip, } from '@devtron-labs/devtron-fe-common-lib' -import ICArrowSquareIn from '@Icons/ic-arrow-square-in.svg?react' -import ICDeleteInteractive from '@Icons/ic-delete-interactive.svg?react' -import ICFileCode from '@Icons/ic-file-code.svg?react' -import ICFilePlay from '@Icons/ic-file-play.svg?react' -import { importComponentFromFELibrary } from '@Components/common' - import { CompareConfigViewEditorConfigType, ConfigHeaderTabConfigType, @@ -35,6 +29,12 @@ import { GetConfigToolbarPopupConfigProps, } from './types' +import { importComponentFromFELibrary } from '@Components/common' +import ICArrowSquareIn from '@Icons/ic-arrow-square-in.svg?react' +import ICDeleteInteractive from '@Icons/ic-delete-interactive.svg?react' +import ICFileCode from '@Icons/ic-file-code.svg?react' +import ICFilePlay from '@Icons/ic-file-play.svg?react' + const getToggleViewLockedKeysPopupButtonConfig = importComponentFromFELibrary( 'getToggleViewLockedKeysPopupButtonConfig', null, diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/EnvConfigurationsNav.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/EnvConfigurationsNav.tsx index 56119d25f0..7f1266757d 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/EnvConfigurationsNav.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/EnvConfigurationsNav.tsx @@ -14,11 +14,11 @@ * limitations under the License. */ +import Tippy from '@tippyjs/react' import { Dispatch, MouseEvent, useEffect, useMemo, useState } from 'react' import ReactGA from 'react-ga4' import { generatePath, NavLink, useLocation, useNavigate, useParams } from 'react-router-dom' import { GroupBase, OptionsOrGroups } from 'react-select' -import Tippy from '@tippyjs/react' import { BASE_CONFIGURATION_ENV_ID, @@ -27,30 +27,31 @@ import { ButtonVariantType, CollapsibleList, CollapsibleListConfig, + URLS as CommonURLS, ComponentSizeType, EnvResourceType, getSelectPickerOptionByValue, SelectPicker, SelectPickerOptionType, SelectPickerVariantType, - URLS as CommonURLS, useMainContext, } from '@devtron-labs/devtron-fe-common-lib' -import ICAdd from '@Icons/ic-add.svg?react' -import ICArrowsLeftRight from '@Icons/ic-arrows-left-right.svg?react' -import ICBack from '@Icons/ic-caret-left-small.svg?react' -import ICFileCode from '@Icons/ic-file-code.svg?react' -import ICLocked from '@Icons/ic-locked.svg?react' -import { useAppContext } from '@Components/common' -import { DEPLOYMENT_CONFIGURATION_RESOURCE_TYPE_ROUTE } from '@Config/constants' -import { URLS } from '@Config/routes' import { ResourceConfigState } from '@Pages/Applications/DevtronApps/service.types' import { BASE_CONFIGURATIONS } from '../AppConfig.constants' import { EnvConfigObjectKey, EnvConfigRouteParams, EnvConfigType, EnvConfigurationsNavProps } from '../AppConfig.types' import { getEnvConfiguration, getNavigationPath, getUnnamedIconConfig } from './Navigation.helper' +import { useAppContext } from '@Components/common' +import { DEPLOYMENT_CONFIGURATION_RESOURCE_TYPE_ROUTE } from '@Config/constants' +import { URLS } from '@Config/routes' +import ICAdd from '@Icons/ic-add.svg?react' +import ICArrowsLeftRight from '@Icons/ic-arrows-left-right.svg?react' +import ICBack from '@Icons/ic-caret-left-small.svg?react' +import ICFileCode from '@Icons/ic-file-code.svg?react' +import ICLocked from '@Icons/ic-locked.svg?react' + // LOADING SHIMMER const ShimmerText = ({ width }: { width: string }) => (
diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/EnvironmentOverrideRouter.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/EnvironmentOverrideRouter.tsx index 41d85eb8d9..20cd9fe9a8 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/EnvironmentOverrideRouter.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/EnvironmentOverrideRouter.tsx @@ -38,8 +38,6 @@ import { ToastVariantType, } from '@devtron-labs/devtron-fe-common-lib' -import ICStamp from '@Icons/ic-stamp.svg?react' - import Add from '../../../../../../assets/icons/ic-add.svg?react' import { createClusterEnvGroup, usePrevious } from '../../../../../../components/common' import { URLS } from '../../../../../../config' @@ -48,6 +46,8 @@ import { AppConfigState, JobEnvOverrideRouteProps } from '../AppConfig.types' import { useAppConfigurationContext } from '../AppConfiguration.provider' import { renderNavItem } from './Navigation.helper' +import ICStamp from '@Icons/ic-stamp.svg?react' + const EnvOverridesHelpNote = () => (
Environment overrides allow you to manage environment specific configurations after you’ve created deployment @@ -131,7 +131,7 @@ const JobEnvOverrideRoute = ({ envOverride, ciPipelines, reload, isEnvProtected const showDeleteDialog = (pipeline): JSX.Element => { const workFlows = workflowsRes?.workflows - let workFlow + let workFlow: (typeof workFlows)[number]['tree'][number] | undefined if (pipeline) { workFlows?.forEach((workflow) => { workflow.tree.forEach((ciPipeline) => { @@ -229,6 +229,7 @@ const EnvironmentOverrideRouter = ({ getEnvironmentListMinPublic(), getCIConfig(Number(appId), isTemplateView), ]) + // biome-ignore lint/suspicious/noEvolvingTypes: Legacy const list = [] envListMinRes?.forEach((env) => { if (env.cluster_name !== 'default_cluster' && env.isClusterCdActive) { diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/Navigation.helper.tsx b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/Navigation.helper.tsx index 37d9333a3b..c06e73ad49 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/Navigation.helper.tsx +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/Navigation.helper.tsx @@ -25,8 +25,6 @@ import { ResourceIdToResourceApprovalPolicyConfigMapType, } from '@devtron-labs/devtron-fe-common-lib' -import Lock from '@Icons/ic-locked.svg?react' -import ICStamp from '@Icons/ic-stamp.svg?react' import { ResourceConfigStage, ResourceConfigState } from '@Pages/Applications/DevtronApps/service.types' import { @@ -38,6 +36,9 @@ import { } from '../AppConfig.types' import { RESOURCE_CONFIG_STATE_TO_ICON_CONFIG_MAP } from './constants' +import Lock from '@Icons/ic-locked.svg?react' +import ICStamp from '@Icons/ic-stamp.svg?react' + const renderNavItemIcon = (isLocked: boolean, isApprovalPolicyConfigured: boolean, dataTestId: string) => { if (isLocked) { return @@ -141,6 +142,7 @@ export const getEnvConfiguration = ( } => Object.keys(envConfig).reduce( (acc, curr) => ({ + // biome-ignore lint/performance/noAccumulatingSpread: Legacy ...acc, [curr]: curr === EnvConfigObjectKey.DeploymentTemplate diff --git a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/constants.ts b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/constants.ts index 2382ce0551..9d98af2cc0 100644 --- a/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/constants.ts +++ b/src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/constants.ts @@ -16,10 +16,11 @@ import { CollapsibleListItem } from '@devtron-labs/devtron-fe-common-lib' +import { ResourceConfigState } from '@Pages/Applications/DevtronApps/service.types' + import ICCheckCircleDots from '@Icons/ic-check-circle-dots.svg?react' import ICFileEdit from '@Icons/ic-file-edit.svg?react' import ICStamp from '@Icons/ic-stamp.svg?react' -import { ResourceConfigState } from '@Pages/Applications/DevtronApps/service.types' export const RESOURCE_CONFIG_STATE_TO_ICON_CONFIG_MAP: Record< ResourceConfigState, diff --git a/src/Pages/Applications/DevtronApps/service.ts b/src/Pages/Applications/DevtronApps/service.ts index 62bd6d2792..fc2bbee402 100644 --- a/src/Pages/Applications/DevtronApps/service.ts +++ b/src/Pages/Applications/DevtronApps/service.ts @@ -33,9 +33,9 @@ import { AppConfigProps, + GetTemplateAPIRouteType, get, getTemplateAPIRoute, - GetTemplateAPIRouteType, getUrlWithSearchParams, noop, ResourceKindType, @@ -43,12 +43,12 @@ import { showError, } from '@devtron-labs/devtron-fe-common-lib' -import { Routes } from '@Config/constants' - import { DEFAULT_LANDING_STAGE, EnvConfigType } from './Details/AppConfigurations/AppConfig.types' import { transformEnvConfig } from './Details/AppConfigurations/AppConfig.utils' import { AppConfigStatusItemType } from './service.types' +import { Routes } from '@Config/constants' + export const getAppConfigStatus = ( appId: number, resourceKind: ResourceKindType, diff --git a/src/Pages/ChartStore/ChartDetails/ChartDetails.tsx b/src/Pages/ChartStore/ChartDetails/ChartDetails.tsx index 67ecbe64db..49be83ad31 100644 --- a/src/Pages/ChartStore/ChartDetails/ChartDetails.tsx +++ b/src/Pages/ChartStore/ChartDetails/ChartDetails.tsx @@ -35,10 +35,6 @@ import { useUrlFilters, } from '@devtron-labs/devtron-fe-common-lib' -import { ChartSelector } from '@Components/AppSelector' -import { getChartSelectAPI } from '@Components/charts/charts.util' -import { URLS } from '@Config/routes' - import { ChartDetailsAbout } from './ChartDetailsAbout' import { ChartDetailsDeploy } from './ChartDetailsDeploy' import { ChartDetailsDeployments } from './ChartDetailsDeployments' @@ -49,6 +45,10 @@ import { fetchChartDetails, fetchChartVersions } from './services' import { ChartDetailsRouteParams, ChartDetailsSearchParams, ChartDetailsSegment } from './types' import { chartSelectorFilterOption, chartSelectorFormatOptionLabel, parseChartDetailsSearchParams } from './utils' +import { ChartSelector } from '@Components/AppSelector' +import { getChartSelectAPI } from '@Components/charts/charts.util' +import { URLS } from '@Config/routes' + import './chartDetails.scss' const pathPattern = `${ROUTER_URLS.CHART_STORE}${URLS.CHART}/:chartId` diff --git a/src/Pages/ChartStore/ChartDetails/ChartDetailsAbout.tsx b/src/Pages/ChartStore/ChartDetails/ChartDetailsAbout.tsx index abc8a0892d..a9f9334535 100644 --- a/src/Pages/ChartStore/ChartDetails/ChartDetailsAbout.tsx +++ b/src/Pages/ChartStore/ChartDetails/ChartDetailsAbout.tsx @@ -14,8 +14,8 @@ * limitations under the License. */ -import { useMemo } from 'react' import moment from 'moment' +import { useMemo } from 'react' import { Button, diff --git a/src/Pages/ChartStore/ChartDetails/ChartDetailsDeploy.tsx b/src/Pages/ChartStore/ChartDetails/ChartDetailsDeploy.tsx index 72763ff68d..0cd8527ce1 100644 --- a/src/Pages/ChartStore/ChartDetails/ChartDetailsDeploy.tsx +++ b/src/Pages/ChartStore/ChartDetails/ChartDetailsDeploy.tsx @@ -19,12 +19,12 @@ import { useParams } from 'react-router-dom' import { APIResponseHandler, useAsync } from '@devtron-labs/devtron-fe-common-lib' -import ChartValuesView from '@Components/v2/values/chartValuesDiff/ChartValuesView' -import { ChartInstalledConfig } from '@Components/v2/values/chartValuesDiff/ChartValuesView.type' - import { fetchChartValuesList } from './services' import { ChartDetailsDeployProps, ChartDetailsRouteParams } from './types' +import ChartValuesView from '@Components/v2/values/chartValuesDiff/ChartValuesView' +import { ChartInstalledConfig } from '@Components/v2/values/chartValuesDiff/ChartValuesView.type' + export const ChartDetailsDeploy = ({ chartDetails, chartVersions, selectedChartVersion }: ChartDetailsDeployProps) => { const { chartId } = useParams() diff --git a/src/Pages/ChartStore/ChartDetails/ChartDetailsDeployments.tsx b/src/Pages/ChartStore/ChartDetails/ChartDetailsDeployments.tsx index 9386e035c7..463a3d53e6 100644 --- a/src/Pages/ChartStore/ChartDetails/ChartDetailsDeployments.tsx +++ b/src/Pages/ChartStore/ChartDetails/ChartDetailsDeployments.tsx @@ -35,8 +35,6 @@ import { useAsync, } from '@devtron-labs/devtron-fe-common-lib' -import ClusterNotReachableDialog from '@Components/common/ClusterNotReachableDialog/ClusterNotReachableDialog' -import { DELETE_ACTION } from '@Config/constants' import { ApplicationDeletionInfo } from '@Pages/Shared/ApplicationDeletionInfo/ApplicationDeletionInfo' import { DEPLOYMENTS_TABLE_COLUMNS, DeploymentsTableViewWrapper } from './ChartDetailsTableComponents' @@ -49,6 +47,9 @@ import { DeploymentsTableProps, } from './types' +import ClusterNotReachableDialog from '@Components/common/ClusterNotReachableDialog/ClusterNotReachableDialog' +import { DELETE_ACTION } from '@Config/constants' + export const ChartDetailsDeployments = ({ chartIcon }: ChartDetailsDeploymentsProps) => { // STATES const [isOpenDeleteConfirmationModal, setIsOpenDeleteConfirmationModal] = useState(false) diff --git a/src/Pages/ChartStore/ChartDetails/ChartDetailsPresetValues.tsx b/src/Pages/ChartStore/ChartDetails/ChartDetailsPresetValues.tsx index 33f79d94e2..9804d593e3 100644 --- a/src/Pages/ChartStore/ChartDetails/ChartDetailsPresetValues.tsx +++ b/src/Pages/ChartStore/ChartDetails/ChartDetailsPresetValues.tsx @@ -32,8 +32,6 @@ import { useAsync, } from '@devtron-labs/devtron-fe-common-lib' -import { deleteChartValues } from '@Components/charts/charts.service' -import { URLS } from '@Config/routes' import { ApplicationDeletionInfo } from '@Pages/Shared/ApplicationDeletionInfo/ApplicationDeletionInfo' import { @@ -50,6 +48,9 @@ import { PresetValuesTableProps, } from './types' +import { deleteChartValues } from '@Components/charts/charts.service' +import { URLS } from '@Config/routes' + const renderEmptyStateButton = (path: string) => () => ( -
+
+
{list.lastUsedAt ? moment(list.lastUsedAt).format( diff --git a/src/Pages/GlobalConfigurations/Authorization/APITokens/ApiTokens.component.tsx b/src/Pages/GlobalConfigurations/Authorization/APITokens/ApiTokens.component.tsx index e4d3d5f515..e54fff242b 100644 --- a/src/Pages/GlobalConfigurations/Authorization/APITokens/ApiTokens.component.tsx +++ b/src/Pages/GlobalConfigurations/Authorization/APITokens/ApiTokens.component.tsx @@ -28,8 +28,8 @@ import { import emptyGeneratToken from '@Images/ic-empty-generate-token.png' -import { TokenListType } from './apiToken.type' import APITokenList from './APITokenList' +import { TokenListType } from './apiToken.type' import CreateAPIToken from './CreateAPIToken' import EditAPIToken from './EditAPIToken' import { getGeneratedAPITokenList } from './service' diff --git a/src/Pages/GlobalConfigurations/Authorization/APITokens/CreateAPIToken.tsx b/src/Pages/GlobalConfigurations/Authorization/APITokens/CreateAPIToken.tsx index 8f9c149c1f..c63adb0892 100644 --- a/src/Pages/GlobalConfigurations/Authorization/APITokens/CreateAPIToken.tsx +++ b/src/Pages/GlobalConfigurations/Authorization/APITokens/CreateAPIToken.tsx @@ -14,11 +14,11 @@ * limitations under the License. */ +import dayjs from 'dayjs' /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable jsx-a11y/label-has-associated-control */ import { useEffect, useState } from 'react' import { useNavigate } from 'react-router-dom' -import dayjs from 'dayjs' import { CustomInput, @@ -31,7 +31,7 @@ import { useMainContext, } from '@devtron-labs/devtron-fe-common-lib' -import Error from '../../../../assets/icons/ic-warning.svg?react' +import ErrorIcon from '../../../../assets/icons/ic-warning.svg?react' import { importComponentFromFELibrary } from '../../../../components/common' import { REQUIRED_FIELDS_MISSING } from '../../../../config' import { API_COMPONENTS } from '../../../../config/constantMessaging' @@ -259,9 +259,9 @@ const CreateAPIToken = ({
- + {API_COMPONENTS.NEW_API_TITLE}
{renderQuestionwithTippy()} @@ -297,7 +297,7 @@ const CreateAPIToken = ({
{formData.dateType === 'Custom' && formDataErrorObj.invalidCustomDate && ( - + {/* eslint-disable-next-line react/no-unescaped-entities */} Custom expiration can't be blank. Please select a date. diff --git a/src/Pages/GlobalConfigurations/Authorization/APITokens/DeleteAPITokenModal.tsx b/src/Pages/GlobalConfigurations/Authorization/APITokens/DeleteAPITokenModal.tsx index 403610c3ce..76c2670a24 100644 --- a/src/Pages/GlobalConfigurations/Authorization/APITokens/DeleteAPITokenModal.tsx +++ b/src/Pages/GlobalConfigurations/Authorization/APITokens/DeleteAPITokenModal.tsx @@ -18,11 +18,11 @@ import { useNavigate } from 'react-router-dom' import { DeleteConfirmationModal, ROUTER_URLS } from '@devtron-labs/devtron-fe-common-lib' -import { DeleteComponentsName } from '@Config/constantMessaging' - import { DeleteAPITokenModalProps } from './apiToken.type' import { deleteGeneratedAPIToken } from './service' +import { DeleteComponentsName } from '@Config/constantMessaging' + const DeleteAPITokenModal = ({ isEditView, tokenData, reload, setDeleteConfirmation }: DeleteAPITokenModalProps) => { const navigate = useNavigate() diff --git a/src/Pages/GlobalConfigurations/Authorization/APITokens/EditAPIToken.tsx b/src/Pages/GlobalConfigurations/Authorization/APITokens/EditAPIToken.tsx index 08996a41f5..cc80fe1ac2 100644 --- a/src/Pages/GlobalConfigurations/Authorization/APITokens/EditAPIToken.tsx +++ b/src/Pages/GlobalConfigurations/Authorization/APITokens/EditAPIToken.tsx @@ -14,11 +14,11 @@ * limitations under the License. */ +import dayjs from 'dayjs' +import moment from 'moment' /* eslint-disable jsx-a11y/label-has-associated-control */ import React, { useEffect, useMemo, useState } from 'react' import { useNavigate, useParams } from 'react-router-dom' -import dayjs from 'dayjs' -import moment from 'moment' import { API_STATUS_CODES, @@ -207,9 +207,9 @@ const EditAPIToken = ({
- + {API_COMPONENTS.EDIT_API_TITLE}
{renderQuestionwithTippy()} @@ -247,6 +247,7 @@ const EditAPIToken = ({ error={invalidDescription ? 'Max 350 characters allowed.' : null} /> {!!editData?.token?.length && ( + // biome-ignore lint/a11y/noLabelWithoutControl: Legacy