Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: build infra v3 #2353

Merged
merged 29 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8bf92e3
refactor: rename ConfigMapSecret functions and types for clarity
AbhishekA1509 Dec 21, 2024
c1da947
Merge branch 'feat/build-infra-v2' into feat/build-infra-v3
AbhishekA1509 Dec 24, 2024
43ddcb0
feat: migrate cm cs parser to common
AbhishekA1509 Dec 26, 2024
143be0e
refactor: clean up unused constants and imports in ConfigMapSecret co…
AbhishekA1509 Dec 30, 2024
49afeb4
Merge branch 'develop' into feat/build-infra-v3
AbhishekA1509 Jan 3, 2025
7e79728
Add BuildInfra utility provider and refactor related components
AbhishekA1509 Jan 5, 2025
c653fa4
Refactor ConfigMapSecretForm to use isCreateView prop instead of id f…
AbhishekA1509 Jan 5, 2025
76b53fc
Refactor ConfigMapSecret components to remove deprecated code and imp…
AbhishekA1509 Jan 5, 2025
76f7db2
Merge branch 'feat/build-infra-2.5' into feat/build-infra-v3
AbhishekA1509 Jan 9, 2025
de98b40
refactor: remove FloatingVariablesSuggestions component and update re…
AbhishekA1509 Jan 10, 2025
767f289
feat: add y50
AbhishekA1509 Jan 12, 2025
cb0d02c
chore: update default value for scoped variables
AbhishekA1509 Jan 12, 2025
be03655
feat: add utility class for 1px width
AbhishekA1509 Jan 13, 2025
68a6e17
refactor: update ToggleResolveScopedVariables import from common
AbhishekA1509 Jan 13, 2025
e9e8777
Merge branch 'develop' into feat/build-infra-v3
AbhishekA1509 Jan 13, 2025
e850a43
fix: update isCreateView logic in ConfigMapSecret components
AbhishekA1509 Jan 13, 2025
118f58c
feat: add noContainerPadding prop to ConfigMapSecretForm and update s…
AbhishekA1509 Jan 13, 2025
2c1b936
refactor: update FormComponent to accept multiple validation modes
AbhishekA1509 Jan 13, 2025
adb658f
chore: update yarn.lock to reflect dependency version changes and rem…
AbhishekA1509 Jan 14, 2025
6eca53f
fix: self review
AbhishekA1509 Jan 14, 2025
6d0ddee
feat: add background shade for 50 suffix, and remove unused onError
AbhishekA1509 Jan 14, 2025
e841d0c
refactor: remove unused background color class for 50 suffix and upda…
AbhishekA1509 Jan 14, 2025
7ae6dcb
refactor: update FormComponent to accept a single validation mode ins…
AbhishekA1509 Jan 15, 2025
d2ee5d4
Merge branch 'develop' into feat/build-infra-v3
AbhishekA1509 Jan 16, 2025
b5bd457
chore: update devtron-fe-common-lib to 1.5.1-beta-1 and add react-dra…
AbhishekA1509 Jan 16, 2025
aad1fd8
chore: update devtron-fe-common-lib to 1.5.1-beta-2
AbhishekA1509 Jan 16, 2025
b3d7dc0
Merge branch 'develop' into feat/build-infra-v3
AbhishekA1509 Jan 21, 2025
1ce6092
chore: update devtron-fe-common-lib to version 1.5.3-beta-3
AbhishekA1509 Jan 21, 2025
50b8fa7
Merge branch 'develop' into feat/build-infra-v3
AbhishekA1509 Jan 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ HIDE_EXCLUDE_INCLUDE_GIT_COMMITS=true
ENABLE_BUILD_CONTEXT=false
CLAIR_TOOL_VERSION=
ENABLE_RESTART_WORKLOAD=false
ENABLE_SCOPED_VARIABLES=false
ENABLE_SCOPED_VARIABLES=true
DEFAULT_CI_TRIGGER_TYPE_MANUAL=false
ANNOUNCEMENT_BANNER_MSG=
LOGIN_PAGE_IMAGE=
Expand Down
7 changes: 0 additions & 7 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,6 @@ src/components/common/DatePickers/DayPickerRangeController.tsx
src/components/common/DeprecatedUpdateWarn.tsx
src/components/common/Description/GenericDescription.tsx
src/components/common/DynamicTabs/__tests__/DynamicTabs.test.tsx
src/components/common/FloatingVariablesSuggestions/FloatingVariablesSuggestions.tsx
src/components/common/FloatingVariablesSuggestions/SuggestionItem.tsx
src/components/common/FloatingVariablesSuggestions/Suggestions.tsx
src/components/common/FloatingVariablesSuggestions/__tests__/FloatingVariablesSuggestions.test.tsx
src/components/common/FloatingVariablesSuggestions/__tests__/Suggestions.test.tsx
src/components/common/FloatingVariablesSuggestions/__tests__/SuggestionsInfo.test.tsx
src/components/common/FloatingVariablesSuggestions/__tests__/SuggestionsItem.test.tsx
src/components/common/HiddenInput/HiddenInput.tsx
src/components/common/List/List.tsx
src/components/common/MultiSelect/MultiSelect.tsx
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"homepage": "/dashboard",
"dependencies": {
"@devtron-labs/devtron-fe-common-lib": "1.5.3",
"@devtron-labs/devtron-fe-common-lib": "1.5.3-beta-3",
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
"@rjsf/core": "^5.13.3",
"@rjsf/utils": "^5.13.3",
Expand All @@ -30,7 +30,6 @@
"react-csv": "^2.2.2",
"react-dates": "^21.8.0",
"react-dom": "^17.0.2",
"react-draggable": "^4.4.5",
"react-ga4": "^1.4.1",
"react-gtm-module": "^2.0.11",
"react-mde": "^11.5.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,19 @@

import React, { lazy, Suspense } from 'react'
import { useRouteMatch, useHistory, Route, Switch, Redirect, useLocation, generatePath } from 'react-router-dom'

import {
Progressing,
EnvResourceType,
BASE_CONFIGURATION_ENV_ID,
ApprovalConfigDataKindType,
getIsApprovalPolicyConfigured,
CMSecretComponentType,
} from '@devtron-labs/devtron-fe-common-lib'

import { ReactComponent as Next } from '@Icons/ic-arrow-forward.svg'
import { URLS } from '@Config/index'
import { ErrorBoundary, useAppContext } from '@Components/common'
import ExternalLinks from '@Components/externalLinks/ExternalLinks'
import { CMSecretComponentType } from '@Pages/Shared/ConfigMapSecret/types'
import { ConfigMapSecretWrapper } from '@Pages/Shared/ConfigMapSecret/ConfigMapSecret.wrapper'

import { NextButtonProps, STAGE_NAME } from '../AppConfig.types'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import {
getIsRequestAborted,
MODES,
useAsync,
ToggleResolveScopedVariables,
} from '@devtron-labs/devtron-fe-common-lib'
import { importComponentFromFELibrary } from '@Components/common'
import { ReactComponent as ICFilePlay } from '@Icons/ic-file-play.svg'
// FIXME: Placeholder icon since no sense of git merge icon as of now
import { ReactComponent as ICFileCode } from '@Icons/ic-file-code.svg'
import SelectMergeStrategy from './SelectMergeStrategy'
import ToggleResolveScopedVariables from './ToggleResolveScopedVariables'
import NoPublishedVersionEmptyState from './NoPublishedVersionEmptyState'
import { ConfigDryRunProps } from './types'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import {
BaseURLParams,
ComponentSizeType,
InvalidYAMLTippyWrapper,
ToggleResolveScopedVariables,
} from '@devtron-labs/devtron-fe-common-lib'
import { useParams } from 'react-router-dom'
import { importComponentFromFELibrary } from '@Components/common'
import { ReactComponent as ICMore } from '@Icons/ic-more-option.svg'
import { ReactComponent as ICBookOpen } from '@Icons/ic-book-open.svg'
import { ReactComponent as ICInfoOutlineGrey } from '@Icons/ic-info-outline-grey.svg'
import BaseConfigurationNavigation from './BaseConfigurationNavigation'
import ToggleResolveScopedVariables from './ToggleResolveScopedVariables'
import { PopupMenuItem } from './utils'
import { ConfigToolbarProps } from './types'
import SelectMergeStrategy from './SelectMergeStrategy'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ import {
getIsRequestAborted,
DraftAction,
checkIfPathIsMatching,
FloatingVariablesSuggestions,
} from '@devtron-labs/devtron-fe-common-lib'
import { Prompt, useLocation, useParams } from 'react-router-dom'
import YAML from 'yaml'
import { FloatingVariablesSuggestions, importComponentFromFELibrary } from '@Components/common'
import { importComponentFromFELibrary } from '@Components/common'
import { getModuleInfo } from '@Components/v2/devtronStackManager/DevtronStackManager.service'
import { URLS } from '@Config/routes'
import { ReactComponent as ICClose } from '@Icons/ic-close.svg'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import {
ComponentSizeType,
GenericEmptyState,
ImageType,
CMSecretComponentType,
} from '@devtron-labs/devtron-fe-common-lib'
import cmCsEmptyState from '@Images/cm-cs-empty-state.png'
import { ReactComponent as ICAdd } from '@Icons/ic-add.svg'
import { CMSecretComponentType } from '@Pages/Shared/ConfigMapSecret/types'
import { NoOverrideEmptyStateProps } from './types'

import './NoOverrideEmptyState.scss'
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export { default as ConfigHeader } from './ConfigHeader'
export { default as NoPublishedVersionEmptyState } from './NoPublishedVersionEmptyState'
export { default as CompareConfigView } from './CompareConfigView'
export * from './DeploymentConfigCompare'
export { default as ToggleResolveScopedVariables } from './ToggleResolveScopedVariables'
export { default as SelectMergeStrategy } from './SelectMergeStrategy'

export type { ConfigToolbarProps, CompareConfigViewProps } from './types'
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
ProtectConfigTabsType,
SelectPickerOptionType,
ServerErrors,
CMSecretComponentType,
} from '@devtron-labs/devtron-fe-common-lib'
import { CMSecretComponentType } from '@Pages/Shared/ConfigMapSecret/types'
import { FunctionComponent, MutableRefObject, ReactNode } from 'react'
import { DeploymentTemplateStateType } from './DeploymentTemplate/types'

Expand Down Expand Up @@ -219,16 +219,6 @@ export type ConfigDryRunProps = {
} & ConfigDryRunManifestProps &
ConfigErrorHandlingProps

export interface ToggleResolveScopedVariablesProps {
resolveScopedVariables: boolean
handleToggleScopedVariablesView: () => void
isDisabled?: boolean
/**
* @default true
*/
showTooltip?: boolean
}

export enum DeploymentTemplateComponentType {
DEPLOYMENT_TEMPLATE = '3',
}
Expand Down
7 changes: 6 additions & 1 deletion src/Pages/GlobalConfigurations/BuildInfra/BuildInfra.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { ErrorScreenNotAuthorized } from '@devtron-labs/devtron-fe-common-lib'
import { importComponentFromFELibrary } from '../../../components/common'
import { BuildInfraProps } from './types'
import ProfileForm from './ProfileForm'
import BuildInfraUtilityProvider from './BuildInfraUtiltityProvider'

const BuildInfraRouter = importComponentFromFELibrary('BuildInfraRouter', null, 'function')

Expand All @@ -28,7 +29,11 @@ export const BuildInfra: FunctionComponent<BuildInfraProps> = ({ isSuperAdmin })
}

if (BuildInfraRouter) {
return <BuildInfraRouter />
return (
<BuildInfraUtilityProvider>
<BuildInfraRouter />
</BuildInfraUtilityProvider>
)
}

return <ProfileForm />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { BuildInfraCMCSFormProps } from '@devtron-labs/devtron-fe-common-lib'
import { ConfigMapSecretForm } from '@Pages/Shared/ConfigMapSecret/ConfigMapSecretForm'

const BuildInfraCMCSForm = ({ parsedData, useFormProps, componentType }: BuildInfraCMCSFormProps) => (
<ConfigMapSecretForm
isCreateView={!parsedData.canOverride && parsedData.isOverridden}
configMapSecretData={parsedData.initialResponse}
inheritedConfigMapSecretData={parsedData.initialResponse}
cmSecretStateLabel={null}
isJob
appChartRef={null}
isApprovalPolicyConfigured={false}
areScopeVariablesResolving={false}
disableDataTypeChange={false}
componentType={componentType}
useFormProps={useFormProps}
isExternalSubmit
noContainerPadding
/>
)

export default BuildInfraCMCSForm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { useMemo } from 'react'
import { BuildInfraUtilityContext, BuildInfraUtilityContextType } from '@devtron-labs/devtron-fe-common-lib'
import BuildInfraCMCSForm from './BuildInfraCMCSForm'
import { BuildInfraUtilityProviderProps } from './types'

const BuildInfraUtilityProvider = ({ children }: BuildInfraUtilityProviderProps) => {
const value: BuildInfraUtilityContextType = useMemo(
() => ({
BuildInfraCMCSForm,
}),
[],
)

return <BuildInfraUtilityContext.Provider value={value}>{children}</BuildInfraUtilityContext.Provider>
}

export default BuildInfraUtilityProvider
6 changes: 6 additions & 0 deletions src/Pages/GlobalConfigurations/BuildInfra/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
* limitations under the License.
*/

import { ReactNode } from 'react'

export interface BuildInfraProps {
isSuperAdmin: boolean
}

export interface BuildInfraUtilityProviderProps {
children: ReactNode
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ import {
getIsApprovalPolicyConfigured,
Progressing,
useAsync,
CMSecretComponentType,
} from '@devtron-labs/devtron-fe-common-lib'

import { URLS } from '@Config/routes'
import { importComponentFromFELibrary } from '@Components/common'
import { ConfigMapSecretWrapper, CMSecretComponentType } from '@Pages/Shared/ConfigMapSecret'
import { ConfigMapSecretWrapper } from '@Pages/Shared/ConfigMapSecret'
import { DeploymentConfigCompare, DeploymentTemplate } from '@Pages/Applications'
import { getEnvConfig } from '@Pages/Applications/DevtronApps/service'
import { EnvConfigurationsNav } from '@Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/EnvConfigurationsNav'
Expand Down
11 changes: 5 additions & 6 deletions src/Pages/Shared/ConfigMapSecret/ConfigMapSecret.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
get,
post,
trash,
ResponseType,
getResolvedDeploymentTemplate,
ValuesAndManifestFlagDTO,
GetResolvedDeploymentTemplateProps,
Expand All @@ -29,14 +28,14 @@ import {
getIsRequestAborted,
DraftMetadataDTO,
showError,
ConfigMapSecretDataDTO,
JobCMSecretDataDTO,
CMSecretComponentType,
} from '@devtron-labs/devtron-fe-common-lib'

import { Routes } from '@Config/constants'

import { importComponentFromFELibrary } from '@Components/common'
import {
CMSecretComponentType,
GetConfigMapSecretConfigDataProps,
GetConfigMapSecretConfigDataReturnType,
UpdateConfigMapSecretProps,
Expand Down Expand Up @@ -106,14 +105,14 @@ export const overRideSecret = ({ appId, envId, payload, signal }: OverrideConfig
{ signal },
)

export const getCMSecret = ({
export const getJobCMSecret = ({
componentType,
id,
appId,
envId,
name,
signal,
}: GetCMSecretProps): Promise<ResponseType<Omit<ConfigMapSecretDataDTO['data'], 'isDeletable'>>> => {
}: GetCMSecretProps): Promise<JobCMSecretDataDTO> => {
let url = ''
if (envId !== null && envId !== undefined) {
url = `${
Expand All @@ -140,7 +139,7 @@ export const getConfigMapSecretConfigData = async <IsJob extends boolean = false
}: GetConfigMapSecretConfigDataProps<IsJob>) => {
try {
const { result } = await (isJob
? getCMSecret({
? getJobCMSecret({
componentType,
id: resourceId,
appId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import {
Progressing,
showError,
useAsync,
CMSecretComponentType,
} from '@devtron-labs/devtron-fe-common-lib'

import { getAppChartRefForAppAndEnv } from '@Services/service'
import { ComponentStates } from '@Pages/Shared/EnvironmentOverride/EnvironmentOverrides.types'

import { CM_SECRET_COMPONENT_NAME } from './constants'
import { CMSecretComponentType, CMSecretWrapperProps } from './types'
import { CMSecretWrapperProps } from './types'

import { ConfigMapSecretContainer } from './ConfigMapSecretContainer'

Expand Down
Loading
Loading