Skip to content

Commit 438ea59

Browse files
authored
Merge pull request #2738 from devtron-labs/fix/misc-fe-bugs
fix: misc FE Bugs
2 parents 4b0c283 + f70265b commit 438ea59

File tree

9 files changed

+110
-73
lines changed

9 files changed

+110
-73
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,6 @@ src/components/v2/values/chartValuesDiff/ChartValuesView.reducer.ts
372372
src/components/v2/values/chartValuesDiff/ChartValuesView.tsx
373373
src/components/v2/values/chartValuesDiff/ProjectUpdateModal.tsx
374374
src/components/v2/values/common/chartValues.api.ts
375-
src/components/workflowEditor/CDSuccessModal.tsx
376375
src/components/workflowEditor/CreateWorkflow.tsx
377376
src/components/workflowEditor/DeprecatedWarningModal.tsx
378377
src/components/workflowEditor/EmptyWorkflow.tsx

src/Pages/License/ActivateLicense.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const ActivateLicense = () => {
4646
return
4747
}
4848

49-
if (licenseData.licenseStatusError.code === LicensingErrorCodes.LicKeyNotFound) {
49+
if (licenseData?.licenseStatusError.code === LicensingErrorCodes.LicKeyNotFound) {
5050
setShowActivateDialog(true)
5151
}
5252
}, [isLoading, licenseData])

src/components/CIPipelineN/VariableDataTable/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ export const VARIABLE_DATA_TABLE_CELL_ERROR_MSGS = {
119119
VARIABLE_VALUE_REQUIRED: 'Variable value is required',
120120
VARIABLE_VALUE_NOT_A_NUMBER: 'Variable value is not a number',
121121
VARIABLE_VALUE_NOT_A_BOOLEAN: 'Variable value is not a boolean',
122+
MAX_LENGTH_255: 'Max 255 characters allowed',
122123
}
123124

124125
export const VARIABLE_DATA_TABLE_CELL_BOOL_VALUES = ['True', 'False', 'true', 'false']

src/components/CIPipelineN/VariableDataTable/validations.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ export const validateInputOutputVariableCell = ({
112112
isValid: false,
113113
}
114114
}
115+
if (name.length > 255) {
116+
return {
117+
errorMessages: [VARIABLE_DATA_TABLE_CELL_ERROR_MSGS.MAX_LENGTH_255],
118+
isValid: false,
119+
}
120+
}
115121
if ((keysFrequencyMap[name] ?? 0) > 1) {
116122
return {
117123
errorMessages: [VARIABLE_DATA_TABLE_CELL_ERROR_MSGS.UNIQUE_VARIABLE_NAME],
@@ -149,6 +155,14 @@ export const validateInputOutputVariableCell = ({
149155
}
150156
}
151157

158+
// test for max length if variable is string
159+
if (key === 'val' && format === VariableTypeFormat.STRING && variableValue && !!value && value.length > 255) {
160+
return {
161+
errorMessages: [VARIABLE_DATA_TABLE_CELL_ERROR_MSGS.MAX_LENGTH_255],
162+
isValid: false,
163+
}
164+
}
165+
152166
return { errorMessages: [], isValid: true }
153167
}
154168

src/components/app/details/triggerView/cdMaterial.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ import {
102102
RuntimeParamsErrorState,
103103
} from './types'
104104
import close from '../../../../assets/icons/ic-close.svg'
105-
import { ReactComponent as Check } from '../../../../assets/icons/ic-check-circle.svg'
106105
import { ReactComponent as DeployIcon } from '../../../../assets/icons/ic-nav-rocket.svg'
107106
import { ReactComponent as BackIcon } from '../../../../assets/icons/ic-arrow-backward.svg'
108107
import { ReactComponent as InfoOutline } from '../../../../assets/icons/ic-info-outline.svg'

src/components/cdPipeline/CDPipeline.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,6 +1418,8 @@ export default function CDPipeline({
14181418
return ''
14191419
}
14201420

1421+
const buttonDisableText = getButtonDisabledMessage()
1422+
14211423
return (
14221424
<div
14231425
className={`modal__body modal__body__ci_new_ui br-0 modal__body--p-0 ${
@@ -1476,15 +1478,17 @@ export default function CDPipeline({
14761478
{formData && (
14771479
<>
14781480
{renderSecondaryButton()}
1479-
<ButtonWithLoader
1480-
rootClassName="cta cta--workflow"
1481+
<Button
14811482
dataTestId="build-pipeline-button"
1483+
text={text}
14821484
onClick={savePipeline}
14831485
isLoading={loadingData}
1484-
disabled={!!getButtonDisabledMessage()}
1485-
>
1486-
{text}
1487-
</ButtonWithLoader>
1486+
disabled={!!buttonDisableText}
1487+
showTooltip={!!buttonDisableText}
1488+
tooltipProps={{
1489+
content: buttonDisableText,
1490+
}}
1491+
/>
14881492
</>
14891493
)}
14901494
</div>

src/components/dockerRegistry/Docker.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1975,6 +1975,7 @@ const DockerForm = ({
19751975
startIcon={<Trash />}
19761976
dataTestId="delete-container-registry"
19771977
onClick={showConfirmationModal}
1978+
disabled={loading}
19781979
/>
19791980
)}
19801981
<div className="flex right w-100 dc__gap-12">
@@ -1984,10 +1985,11 @@ const DockerForm = ({
19841985
text="Cancel"
19851986
variant={ButtonVariantType.secondary}
19861987
size={ComponentSizeType.medium}
1988+
disabled={loading}
19871989
/>
19881990
<Button
19891991
dataTestId="container-registry-save-button"
1990-
disabled={loading}
1992+
isLoading={loading}
19911993
text={id ? 'Update' : 'Save'}
19921994
size={ComponentSizeType.medium}
19931995
buttonProps={{

src/components/workflowEditor/CDSuccessModal.tsx

Lines changed: 66 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -14,82 +14,94 @@
1414
* limitations under the License.
1515
*/
1616

17-
import React from 'react'
1817
import { generatePath, NavLink } from 'react-router-dom'
19-
import { VisibleModal, URLS as CommonURLS, AppConfigProps } from '@devtron-labs/devtron-fe-common-lib'
20-
import { URLS } from '../../config'
21-
import { ReactComponent as SuccessIcon } from '../../assets/icons/ic-success-with-light-background.svg'
18+
19+
import { AppConfigProps, URLS as CommonURLS, VisibleModal2 } from '@devtron-labs/devtron-fe-common-lib'
20+
2221
import { ReactComponent as GotToBuildDeploy } from '../../assets/icons/go-to-buildanddeploy.svg'
2322
import { ReactComponent as GoToEnvOverride } from '../../assets/icons/go-to-envoverride.svg'
23+
import { ReactComponent as SuccessIcon } from '../../assets/icons/ic-success-with-light-background.svg'
24+
import { URLS } from '../../config'
2425

25-
interface CDSuccessModalType extends Required<Pick<AppConfigProps, 'isTemplateView'> >{
26+
interface CDSuccessModalType extends Required<Pick<AppConfigProps, 'isTemplateView'>> {
2627
appId: string
2728
envId: number
2829
closeSuccessPopup: () => void
2930
envName: string
3031
successTitle: string
3132
}
3233

33-
export default function CDSuccessModal({ appId, envId, closeSuccessPopup, envName, successTitle, isTemplateView }: CDSuccessModalType) {
34-
return (
35-
<VisibleModal className="transition-effect">
36-
<div className="modal__body" style={{ width: '600px' }}>
37-
<div className="flexbox mb-20">
38-
<div className="pr-16">
39-
<SuccessIcon />
40-
</div>
41-
<div>
42-
<div className="fw-6 fs-16" data-testid="cd-success-modal">
43-
{successTitle}
44-
</div>
45-
<div className="fs-13">What do you want to do next?</div>
34+
const CDSuccessModal = ({
35+
appId,
36+
envId,
37+
closeSuccessPopup,
38+
envName,
39+
successTitle,
40+
isTemplateView,
41+
}: CDSuccessModalType) => (
42+
<VisibleModal2 className="transition-effect">
43+
<div className="modal__body" style={{ width: '600px' }}>
44+
<div className="flexbox mb-20">
45+
<div className="pr-16">
46+
<SuccessIcon />
47+
</div>
48+
<div>
49+
<div className="fw-6 fs-16" data-testid="cd-success-modal">
50+
{successTitle}
4651
</div>
52+
<div className="fs-13">What do you want to do next?</div>
4753
</div>
48-
{!isTemplateView && (
49-
<NavLink
50-
to={`${URLS.APP}/${appId}/${URLS.APP_TRIGGER}`}
51-
data-testid="go-to-build-deploy-link"
52-
className="cb-5 dc__no-decor"
53-
>
54-
<div className="flex left br-4 p-15 mb-12 en-2 bw-1 action-card">
55-
<div className="cd-success-icon-container ">
56-
<GotToBuildDeploy />
57-
</div>
58-
<div className="ml-16 mr-16 flex-1">
59-
<div className="fw-6 fs-13 cn-9">Deploy this app on {envName}</div>
60-
<div>Go to Build & Deploy</div>
61-
</div>
62-
</div>
63-
</NavLink>
64-
)}
54+
</div>
55+
{!isTemplateView && (
6556
<NavLink
66-
to={`${isTemplateView ? generatePath(CommonURLS.GLOBAL_CONFIG_TEMPLATES_DEVTRON_APP_DETAIL, {
67-
appId,
68-
}) : `${URLS.APP}/${appId}`}/${CommonURLS.APP_CONFIG}/${URLS.APP_ENV_OVERRIDE_CONFIG}/${envId}`}
69-
data-testid="go-to-environmentOverride-link"
57+
to={`${URLS.APP}/${appId}/${URLS.APP_TRIGGER}`}
58+
data-testid="go-to-build-deploy-link"
7059
className="cb-5 dc__no-decor"
7160
>
7261
<div className="flex left br-4 p-15 mb-12 en-2 bw-1 action-card">
7362
<div className="cd-success-icon-container ">
74-
<GoToEnvOverride />
63+
<GotToBuildDeploy />
7564
</div>
7665
<div className="ml-16 mr-16 flex-1">
77-
<div className="fw-6 fs-13 cn-9">Override deployment configurations for {envName}</div>
78-
<div>Go to environment override</div>
66+
<div className="fw-6 fs-13 cn-9">Deploy this app on {envName}</div>
67+
<div>Go to Build & Deploy</div>
7968
</div>
8069
</div>
8170
</NavLink>
82-
<div className="close-button-container">
83-
<button
84-
type="button"
85-
className="fw-6 fs-13 lh-20 cta"
86-
onClick={closeSuccessPopup}
87-
data-testid="close-build-deploy-button"
88-
>
89-
Close
90-
</button>
71+
)}
72+
<NavLink
73+
to={`${
74+
isTemplateView
75+
? generatePath(CommonURLS.GLOBAL_CONFIG_TEMPLATES_DEVTRON_APP_DETAIL, {
76+
appId,
77+
})
78+
: `${URLS.APP}/${appId}`
79+
}/${CommonURLS.APP_CONFIG}/${URLS.APP_ENV_OVERRIDE_CONFIG}/${envId}`}
80+
data-testid="go-to-environmentOverride-link"
81+
className="cb-5 dc__no-decor"
82+
>
83+
<div className="flex left br-4 p-15 mb-12 en-2 bw-1 action-card">
84+
<div className="cd-success-icon-container ">
85+
<GoToEnvOverride />
86+
</div>
87+
<div className="ml-16 mr-16 flex-1">
88+
<div className="fw-6 fs-13 cn-9">Override deployment configurations for {envName}</div>
89+
<div>Go to environment override</div>
90+
</div>
9191
</div>
92+
</NavLink>
93+
<div className="close-button-container">
94+
<button
95+
type="button"
96+
className="fw-6 fs-13 lh-20 cta"
97+
onClick={closeSuccessPopup}
98+
data-testid="close-build-deploy-button"
99+
>
100+
Close
101+
</button>
92102
</div>
93-
</VisibleModal>
94-
)
95-
}
103+
</div>
104+
</VisibleModal2>
105+
)
106+
107+
export default CDSuccessModal

src/components/workflowEditor/workflowEditor.tsx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { Component, createContext } from 'react'
1818
import { Route, Switch, withRouter, generatePath } from 'react-router-dom'
1919
import {
2020
showError,
21-
DOCUMENTATION,
2221
Progressing,
2322
ErrorScreenManager,
2423
ConditionalWrap,
@@ -39,6 +38,11 @@ import {
3938
deleteWorkflow,
4039
InfoBlock,
4140
DocLink,
41+
Button,
42+
Icon,
43+
ComponentSizeType,
44+
ButtonVariantType,
45+
ButtonStyleType,
4246
} from '@devtron-labs/devtron-fe-common-lib'
4347
import Tippy from '@tippyjs/react'
4448
import { PipelineContext, WorkflowEditProps, WorkflowEditState } from './types'
@@ -908,11 +912,17 @@ class WorkflowEdit extends Component<WorkflowEditProps, WorkflowEditState> {
908912
<InfoBlock
909913
variant="help"
910914
description={
911-
<div className="flex fs-13 fw-4 lh-20 cn-0">
915+
<div className="flex dc__gap-8 fs-13 fw-4 lh-20 cn-9">
912916
Open a build pipeline to override
913-
<CloseIcon
914-
className="icon-dim-12 fcn-0 ml-8 cursor"
917+
<Button
918+
dataTestId="close-info-block"
919+
icon={<Icon name="ic-close-small" color={null} />}
920+
ariaLabel="close-info-button"
921+
showAriaLabelInTippy={false}
915922
onClick={this.removeTakeMeThereClickedItem}
923+
size={ComponentSizeType.xxs}
924+
variant={ButtonVariantType.borderLess}
925+
style={ButtonStyleType.negativeGrey}
916926
/>
917927
</div>
918928
}
@@ -953,11 +963,7 @@ class WorkflowEdit extends Component<WorkflowEditProps, WorkflowEditState> {
953963
? WORKFLOW_EDITOR_HEADER_TIPPY.INFO_TEXT.JOB_VIEW
954964
: WORKFLOW_EDITOR_HEADER_TIPPY.INFO_TEXT.DEFAULT
955965
}
956-
documentationLink={
957-
this.props.isJobView
958-
? "JOB_WORKFLOW_EDITOR"
959-
: "APP_CREATE_WORKFLOW"
960-
}
966+
documentationLink={this.props.isJobView ? 'JOB_WORKFLOW_EDITOR' : 'APP_CREATE_WORKFLOW'}
961967
documentationLinkText={WORKFLOW_EDITOR_HEADER_TIPPY.DOCUMENTATION_LINK_TEXT}
962968
placement="right"
963969
/>

0 commit comments

Comments
 (0)