Skip to content

Commit b03bef5

Browse files
authored
Merge pull request #2354 from devtron-labs/chore/sync-theming-with-dev
chore: sync with develop
2 parents 94717c9 + 5a0ab05 commit b03bef5

File tree

97 files changed

+2845
-3239
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+2845
-3239
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ FEATURE_PROMO_EMBEDDED_BUTTON_TEXT=
6060
FEATURE_PROMO_EMBEDDED_MODAL_TITLE=
6161
FEATURE_PROMO_EMBEDDED_IFRAME_URL=
6262
FEATURE_SWAP_TRAFFIC_ENABLE=false
63-
FEATURE_RB_SYNC_CLUSTER_ENABLE=false
63+
FEATURE_RB_SYNC_CLUSTER_ENABLE=true
6464
FEATURE_BULK_RESTART_WORKLOADS_FROM_RB=deployment,rollout,daemonset,statefulset
6565
FEATURE_DEFAULT_MERGE_STRATEGY=
6666
FEATURE_CLUSTER_MAP_ENABLE=true

.eslintignore

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,15 +314,9 @@ src/components/material/MaterialList.tsx
314314
src/components/material/MaterialView.tsx
315315
src/components/material/UpdateMaterial.tsx
316316
src/components/notifications/AddNotification.tsx
317-
src/components/notifications/ConfigurationTab.tsx
318-
src/components/notifications/CreateHeaderDetails.tsx
319317
src/components/notifications/ModifyRecipientsModal.tsx
320318
src/components/notifications/NotificationTab.tsx
321319
src/components/notifications/Notifications.tsx
322-
src/components/notifications/SESConfigModal.tsx
323-
src/components/notifications/SMTPConfigModal.tsx
324-
src/components/notifications/SlackConfigModal.tsx
325-
src/components/notifications/WebhookConfigModal.tsx
326320
src/components/notifications/notifications.service.ts
327321
src/components/notifications/notifications.util.tsx
328322
src/components/onboardingGuide/GuideCommonHeader.tsx

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"homepage": "/dashboard",
66
"dependencies": {
7-
"@devtron-labs/devtron-fe-common-lib": "1.4.0-beta-7",
7+
"@devtron-labs/devtron-fe-common-lib": "1.4.9",
88
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
99
"@rjsf/core": "^5.13.3",
1010
"@rjsf/utils": "^5.13.3",

src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/AppNavigation.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ export const AppNavigation = () => {
124124
<Switch>
125125
<Route
126126
path={[
127-
`${path}/:resourceType(${Object.values(EnvResourceType).join('|')})/:envId(\\d+)?`,
127+
`${path}/:resourceType(${Object.values(EnvResourceType).join('|')})`,
128128
`${path}/${URLS.APP_ENV_OVERRIDE_CONFIG}/:envId(\\d+)/:resourceType(${Object.values(EnvResourceType).join('|')})`,
129129
]}
130130
>
131131
{({ match }) => (
132132
<EnvConfigurationsNav
133-
key={`env-configurations-nav-${match.params.envId}`}
133+
key={`env-configurations-nav-${'envId' in match.params ? match.params.envId : ''}`}
134134
envConfig={envConfig}
135135
fetchEnvConfig={fetchEnvConfig}
136136
environments={environments.map(({ environmentName, environmentId }) => ({

src/Pages/GlobalConfigurations/Authorization/Shared/components/K8sObjectPermissions/K8sListItemCard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
SelectPicker,
3131
ButtonVariantType,
3232
ButtonStyleType,
33+
ResourceListPayloadType,
3334
} from '@devtron-labs/devtron-fe-common-lib'
3435
import { K8S_EMPTY_GROUP } from '@Components/ResourceBrowser/Constants'
3536
import {
@@ -44,7 +45,7 @@ import {
4445
getResourceGroupList,
4546
namespaceListByClusterId,
4647
} from '../../../../../../components/ResourceBrowser/ResourceBrowser.service'
47-
import { K8SObjectType, ResourceListPayloadType } from '../../../../../../components/ResourceBrowser/Types'
48+
import { K8SObjectType } from '../../../../../../components/ResourceBrowser/Types'
4849
import { formatOptionLabel } from '../../../../../../components/v2/common/ReactSelect.utils'
4950
import { ReactComponent as Clone } from '../../../../../../assets/icons/ic-copy.svg'
5051
import { ReactComponent as Delete } from '../../../../../../assets/icons/ic-delete-interactive.svg'

src/Pages/Shared/ConfigMapSecret/ConfigMapSecretContainer.tsx

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ import {
2626
usePrompt,
2727
checkIfPathIsMatching,
2828
useUrlFilters,
29+
UseFormErrorHandler,
30+
UseFormSubmitHandler,
2931
} from '@devtron-labs/devtron-fe-common-lib'
3032

3133
import { URLS } from '@Config/routes'
@@ -682,7 +684,7 @@ export const ConfigMapSecretContainer = ({
682684
}
683685
}
684686

685-
const onSubmit: ConfigMapSecretFormProps['onSubmit'] = async (data) => {
687+
const onSubmit: UseFormSubmitHandler<ConfigMapSecretUseFormProps> = async (data) => {
686688
const payloadData = getConfigMapSecretPayload(data)
687689

688690
if (isApprovalPolicyConfigured) {
@@ -739,7 +741,7 @@ export const ConfigMapSecretContainer = ({
739741
}
740742
}
741743

742-
const onError: ConfigMapSecretFormProps['onError'] = (errors) => {
744+
const onError: UseFormErrorHandler<ConfigMapSecretUseFormProps> = (errors) => {
743745
if (errors.currentData?.[0] === CONFIG_MAP_SECRET_NO_DATA_ERROR) {
744746
ToastManager.showToast({
745747
variant: ToastVariantType.error,
@@ -755,6 +757,19 @@ export const ConfigMapSecretContainer = ({
755757
}
756758
}
757759

760+
const onDryRunError: UseFormErrorHandler<ConfigMapSecretUseFormProps> = (errors) => {
761+
const hasErrors = Object.keys(errors).some((key) => !!errors[key])
762+
if (hasErrors) {
763+
ToastManager.showToast({
764+
variant: ToastVariantType.error,
765+
description: 'Please resolve form errors before saving.',
766+
})
767+
}
768+
}
769+
770+
const formSubmitHandler = handleSubmit(onSubmit, onError)
771+
const dryRunSubmitHandler = handleSubmit(onSubmit, onDryRunError)
772+
758773
// CONFIG TOOLBAR POPUP MENU
759774
const toolbarPopupConfig: ConfigToolbarProps['popupConfig'] = {
760775
menuConfig: getConfigToolbarPopupConfig({
@@ -802,8 +817,7 @@ export const ConfigMapSecretContainer = ({
802817
draftData={resolvedDraftData ?? draftData}
803818
inheritedConfigMapSecretData={resolvedInheritedConfigMapSecretData ?? inheritedConfigMapSecretData}
804819
id={id}
805-
onError={onError}
806-
onSubmit={onSubmit}
820+
onSubmit={formSubmitHandler}
807821
selectedProtectionViewTab={selectedProtectionViewTab}
808822
updateCMSecret={updateCMSecret}
809823
componentType={componentType}
@@ -826,8 +840,7 @@ export const ConfigMapSecretContainer = ({
826840
isApprovalPolicyConfigured={isApprovalPolicyConfigured}
827841
isSubmitting={isSubmitting}
828842
disableDataTypeChange={isDeleteDisabled}
829-
onSubmit={onSubmit}
830-
onError={onError}
843+
onSubmit={formSubmitHandler}
831844
onCancel={onCancel}
832845
areScopeVariablesResolving={resolvedScopeVariablesResLoading}
833846
appChartRef={appChartRef}
@@ -886,7 +899,7 @@ export const ConfigMapSecretContainer = ({
886899
handleChangeDryRunEditorMode={setDryRunEditorMode}
887900
showCrudButtons={!showNoOverride}
888901
isSubmitting={isSubmitting}
889-
onSubmit={onSubmit}
902+
onSubmit={dryRunSubmitHandler}
890903
parentName={parentName}
891904
updateCMSecret={updateCMSecret}
892905
formData={resolvedFormData ?? formData}

src/Pages/Shared/ConfigMapSecret/ConfigMapSecretDryRun.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,6 @@ export const ConfigMapSecretDryRun = ({
144144
isDryRunDataPresent && !hideManifest,
145145
)
146146

147-
// METHODS
148-
const handleSubmit = () => onSubmit(formData)
149-
150147
// RENDERERS
151148
const renderLHSContent = () => {
152149
if (publishedVersionDoesNotExist) {
@@ -264,7 +261,7 @@ export const ConfigMapSecretDryRun = ({
264261
dataTestId="cm-secret-form-submit-btn"
265262
text={`Save${!isCreateView ? ' Changes' : ''}${isApprovalPolicyConfigured ? '...' : ''}`}
266263
size={ComponentSizeType.medium}
267-
onClick={handleSubmit}
264+
onClick={onSubmit}
268265
isLoading={isSubmitting}
269266
disabled={isSaveButtonDisabled}
270267
/>

src/Pages/Shared/ConfigMapSecret/ConfigMapSecretForm.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,13 @@ export const ConfigMapSecretForm = ({
6565
areScopeVariablesResolving,
6666
useFormProps,
6767
onSubmit,
68-
onError,
6968
onCancel,
7069
}: ConfigMapSecretFormProps) => {
7170
// HOOKS
7271
const location = useLocation()
7372

7473
// FORM PROPS
75-
const { data, errors, formState, setValue, register, handleSubmit } = useFormProps
74+
const { data, errors, formState, setValue, register } = useFormProps
7675

7776
// CONSTANTS
7877
const isCreateView = id === null
@@ -329,7 +328,7 @@ export const ConfigMapSecretForm = ({
329328
dataTestId="cm-secret-form-submit-btn"
330329
text={`Save${!isCreateView ? ' Changes' : ''}${isApprovalPolicyConfigured ? '...' : ''}`}
331330
size={ComponentSizeType.medium}
332-
onClick={handleSubmit(onSubmit, onError)}
331+
onClick={onSubmit}
333332
isLoading={isSubmitting}
334333
disabled={isSubmitting || areScopeVariablesResolving || isFormDisabled}
335334
/>

src/Pages/Shared/ConfigMapSecret/ConfigMapSecretProtected.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ export const ConfigMapSecretProtected = ({
3838
parentName,
3939
inheritedConfigMapSecretData,
4040
areScopeVariablesResolving,
41-
onError,
4241
onSubmit,
4342
updateCMSecret,
4443
shouldMergeTemplateWithPatches,
@@ -222,7 +221,6 @@ export const ConfigMapSecretProtected = ({
222221
disableDataTypeChange={disableDataTypeChange}
223222
isSubmitting={false}
224223
onCancel={noop}
225-
onError={onError}
226224
onSubmit={onSubmit}
227225
areScopeVariablesResolving={areScopeVariablesResolving}
228226
useFormProps={useFormProps}

src/Pages/Shared/ConfigMapSecret/types.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import {
88
ProtectConfigTabsType,
99
SelectPickerOptionType,
1010
useForm,
11-
UseFormErrorHandler,
12-
UseFormSubmitHandler,
1311
AppEnvDeploymentConfigDTO,
1412
DryRunEditorMode,
1513
ConfigHeaderTabType,
@@ -156,8 +154,7 @@ export interface ConfigMapSecretFormProps
156154
areScopeVariablesResolving: boolean
157155
isDraft?: boolean
158156
disableDataTypeChange: boolean
159-
onSubmit: UseFormSubmitHandler<ConfigMapSecretUseFormProps>
160-
onError: UseFormErrorHandler<ConfigMapSecretUseFormProps>
157+
onSubmit: () => void
161158
onCancel: () => void
162159
useFormProps: ReturnType<typeof useForm<ConfigMapSecretUseFormProps>>
163160
}
@@ -217,7 +214,6 @@ export type ConfigMapSecretProtectedProps = Pick<ConfigMapSecretContainerProps,
217214
| 'isJob'
218215
| 'disableDataTypeChange'
219216
| 'id'
220-
| 'onError'
221217
| 'onSubmit'
222218
| 'areScopeVariablesResolving'
223219
| 'appChartRef'

0 commit comments

Comments
 (0)