Skip to content

Commit 69fc575

Browse files
committed
Merge branch 'develop' of https://github.com/devtron-labs/dashboard into fix/depandabot-issues
2 parents 5f580d4 + bfb6af5 commit 69fc575

File tree

34 files changed

+375
-443
lines changed

34 files changed

+375
-443
lines changed

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.14.2-beta-1",
7+
"@devtron-labs/devtron-fe-common-lib": "1.15.0-pre-1",
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/MainContent/ConfigDryRun.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ const ConfigDryRun = ({
131131
)}
132132

133133
<ToggleResolveScopedVariables
134+
name="resolve-scoped-variables-dry-run-view"
134135
handleToggleScopedVariablesView={handleToggleResolveScopedVariables}
135136
resolveScopedVariables={resolveScopedVariables}
136137
isDisabled={!!errorInfo}

src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/ConfigToolbar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ const ConfigToolbar = ({
313313
<InvalidYAMLTippyWrapper parsingError={parsingError} restoreLastSavedYAML={restoreLastSavedYAML}>
314314
<div>
315315
<ToggleResolveScopedVariables
316+
name="resolve-scoped-variables"
316317
resolveScopedVariables={resolveScopedVariables}
317318
handleToggleScopedVariablesView={handleToggleScopedVariablesView}
318319
isDisabled={isDisabled}

src/Pages/Shared/ConfigMapSecret/ConfigMapSecretDryRun.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,13 @@ export const ConfigMapSecretDryRun = ({
194194
areScopeVariablesResolving={areScopeVariablesResolving}
195195
fallbackMergeStrategy={DEFAULT_MERGE_STRATEGY}
196196
/>
197-
{renderExternalInfo(
198-
dryRunConfigMapSecretData.externalType,
199-
dryRunConfigMapSecretData.external,
200-
componentType,
201-
'mr-16 ml-16',
202-
)}
197+
<div className="ml-16 mr-16">
198+
{renderExternalInfo(
199+
dryRunConfigMapSecretData.externalType,
200+
dryRunConfigMapSecretData.external,
201+
componentType,
202+
)}
203+
</div>
203204
</>
204205
)
205206
}
@@ -224,6 +225,7 @@ export const ConfigMapSecretDryRun = ({
224225
)}
225226
<div className="dc__border-right-n1 dc__align-self-stretch mt-2 mb-2" />
226227
<ToggleResolveScopedVariables
228+
name="resolve-scoped-variables-dry-run-view"
227229
resolveScopedVariables={resolveScopedVariables}
228230
handleToggleScopedVariablesView={handleToggleScopedVariablesView}
229231
isDisabled={areScopeVariablesResolving}

src/Pages/Shared/ConfigMapSecret/helpers.tsx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@ import {
2323
DocLink,
2424
Icon,
2525
InfoBlock,
26-
InfoColourBar,
2726
} from '@devtron-labs/devtron-fe-common-lib'
2827

29-
import { ReactComponent as InfoIcon } from '@Icons/info-filled.svg'
3028
import { URLS } from '@Config/routes'
3129

3230
import { EXTERNAL_INFO_TEXT } from './constants'
@@ -54,20 +52,12 @@ export const renderExternalInfo = (
5452
externalType: CMSecretExternalType,
5553
external: boolean,
5654
componentType: CMSecretComponentType,
57-
className?: string,
5855
) =>
5956
externalType === CMSecretExternalType.KubernetesSecret ||
6057
(componentType === CMSecretComponentType.ConfigMap && external) ? (
61-
<InfoColourBar
62-
classname={`info_bar ${className || ''}`}
63-
message={
64-
<div className="flex column left">
65-
<h4 className="m-0 lh-20 dc__info-title">{EXTERNAL_INFO_TEXT[componentType].title}</h4>
66-
<p className="m-0 lh-20 dc__info-subtitle">{EXTERNAL_INFO_TEXT[componentType].infoText}</p>
67-
</div>
68-
}
69-
Icon={InfoIcon}
70-
iconSize={20}
58+
<InfoBlock
59+
heading={EXTERNAL_INFO_TEXT[componentType].title}
60+
description={EXTERNAL_INFO_TEXT[componentType].infoText}
7161
/>
7262
) : null
7363

src/assets/icons/ic-asterisk.svg

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/components/CIPipelineN/Build.tsx

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
import React, { useContext } from 'react'
18-
import { Progressing, Toggle, CiPipelineSourceTypeOption, CustomInput } from '@devtron-labs/devtron-fe-common-lib'
17+
import { useContext } from 'react'
18+
import { Progressing, CiPipelineSourceTypeOption, CustomInput, DTSwitch } from '@devtron-labs/devtron-fe-common-lib'
1919
import { SourceTypeMap, ViewType } from '../../config'
2020
import { createWebhookConditionList } from '../ciPipeline/ciPipeline.service'
2121
import { SourceMaterials } from '../ciPipeline/SourceMaterials'
@@ -233,35 +233,30 @@ export const Build = ({
233233
)
234234
}
235235

236-
const renderScanner = () => {
237-
return (
238-
<>
239-
<hr />
240-
<div>
241-
<div
242-
className="en-2 bw-1 br-4 pt-12 pb-12 pl-16 pr-12"
243-
style={{ display: 'grid', gridTemplateColumns: '52px auto 32px' }}
244-
>
245-
<BugScanner />
246-
<div>
247-
<p className="fs-13 lh-20 fw-6 cn-9 mb-4">Scan for vulnerabilities</p>
248-
<p className="fs-13 lh-18 mb-0 fs-12">
249-
Perform security scan after container image is built.
250-
</p>
251-
</div>
252-
<div className="mt-4" style={{ width: '32px', height: '20px' }}>
253-
<Toggle
254-
disabled={window._env_.FORCE_SECURITY_SCANNING && formData.scanEnabled}
255-
selected={formData.scanEnabled}
256-
onSelect={handleScanToggle}
257-
dataTestId="create-build-pipeline-scan-vulnerabilities-toggle"
258-
/>
259-
</div>
236+
const renderScanner = () => (
237+
<>
238+
<hr />
239+
<div>
240+
<div
241+
className="en-2 bw-1 br-4 pt-12 pb-12 pl-16 pr-12"
242+
style={{ display: 'grid', gridTemplateColumns: '52px auto 32px' }}
243+
>
244+
<BugScanner />
245+
<div>
246+
<p className="fs-13 lh-20 fw-6 cn-9 mb-4">Scan for vulnerabilities</p>
247+
<p className="fs-13 lh-18 mb-0 fs-12">Perform security scan after container image is built.</p>
260248
</div>
249+
<DTSwitch
250+
isDisabled={window._env_.FORCE_SECURITY_SCANNING && formData.scanEnabled}
251+
ariaLabel="Toggle scan for security vulnerabilities"
252+
isChecked={formData.scanEnabled}
253+
onChange={handleScanToggle}
254+
name="create-build-pipeline-scan-vulnerabilities-toggle"
255+
/>
261256
</div>
262-
</>
263-
)
264-
}
257+
</div>
258+
</>
259+
)
265260

266261
return pageState === ViewType.LOADING.toString() ? (
267262
<div style={{ minHeight: '200px' }} className="flex">

src/components/CIPipelineN/CreatePluginModal/CreatePluginInputVariableContainer.tsx

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { Toggle } from '@devtron-labs/devtron-fe-common-lib'
18-
19-
import { ReactComponent as ICAsterisk } from '@Icons/ic-asterisk.svg'
17+
import { DTSwitch } from '@devtron-labs/devtron-fe-common-lib'
2018

2119
import { CreatePluginActionType, CreatePluginInputVariableContainerProps, InputVariableItemProps } from './types'
2220

@@ -31,17 +29,16 @@ const InputVariableItem = ({ handleChange, index, name, allowEmptyValue }: Input
3129
{name}
3230
</h4>
3331

34-
<div className="w-28 h-18">
35-
<Toggle
36-
selected={!allowEmptyValue}
37-
onSelect={handleAllowEmptyValueToggle}
38-
name={`toggle-${name}-allow-empty-value`}
39-
rootClassName="mb-0 dc__toggle-square-toggle"
40-
Icon={ICAsterisk}
41-
iconClass={`bg__primary ${!allowEmptyValue ? 'fcr-5' : 'fcn-6'}`}
42-
color={!allowEmptyValue ? 'var(--B300)' : 'var(--N200)'}
43-
/>
44-
</div>
32+
<DTSwitch
33+
name={`toggle-is-${name}-mandatory`}
34+
onChange={handleAllowEmptyValueToggle}
35+
ariaLabel={`Toggle is ${name} mandatory`}
36+
isChecked={!allowEmptyValue}
37+
shape="square"
38+
variant="theme"
39+
iconName="ic-asterisk"
40+
iconColor="R500"
41+
/>
4542
</div>
4643
)
4744
}

src/components/CIPipelineN/CustomImageTags.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@
1717
import { useState } from 'react'
1818
import Tippy from '@tippyjs/react'
1919
import {
20+
Collapse,
21+
DTSwitch,
2022
OptionType,
2123
RegistryIcon,
2224
RegistryType,
2325
SelectPicker,
2426
Textarea,
25-
Toggle,
2627
} from '@devtron-labs/devtron-fe-common-lib'
2728
import { CustomImageTagsType } from './CustomImageTag.type'
2829
import { ValidationRules } from '../ciPipeline/validationRules'
2930
import { CustomErrorMessage, REQUIRED_FIELD_MSG } from '../../config/constantMessaging'
30-
import { ReactComponent as Warning } from '../../assets/icons/ic-warning.svg'
3131
import { ReactComponent as Edit } from '../../assets/icons/ic-pencil.svg'
3232
import { ReactComponent as AlertTriangle } from '../../assets/icons/ic-alert-triangle.svg'
3333
import { ReactComponent as GeneratedImage } from '../../assets/icons/ic-generated-image.svg'
@@ -263,15 +263,16 @@ function CustomImageTags({
263263
</div>
264264
</div>
265265
</div>
266-
<div className="" style={{ width: '32px', height: '20px' }}>
267-
<Toggle
268-
selected={formData.enableCustomTag}
269-
onSelect={handleCustomTagToggle}
270-
dataTestId="create-build-pipeline-custom-tag-enabled-toggle"
271-
/>
272-
</div>
266+
<DTSwitch
267+
name="create-build-pipeline-custom-tag-enabled-toggle"
268+
ariaLabel="Toggle enable custom image tag"
269+
isChecked={formData.enableCustomTag}
270+
onChange={handleCustomTagToggle}
271+
/>
273272
</div>
274-
{formData.enableCustomTag && renderCustomImageDetails()}
273+
<Collapse expand={formData.enableCustomTag}>
274+
{renderCustomImageDetails()}
275+
</Collapse>
275276
<hr />
276277
</div>
277278
)

src/components/ClusterNodes/ClusterTerminal.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
CHECKBOX_VALUE,
2323
ComponentSizeType,
2424
get,
25+
getIsRequestAborted,
2526
NodeTaintType,
2627
noop,
2728
OptionType,
@@ -198,6 +199,10 @@ const ClusterTerminal = ({
198199
}
199200

200201
function sessionError(error): void {
202+
if (getIsRequestAborted(error)) {
203+
return
204+
}
205+
201206
showError(error)
202207
if (error instanceof ServerErrors && Array.isArray(error.errors)) {
203208
error.errors.forEach(({ userMessage }) => {
@@ -885,6 +890,10 @@ const ClusterTerminal = ({
885890
return nodeGroupOptions
886891
}
887892

893+
const toggleDebugMode = (): void => {
894+
setDebugMode((prev) => !prev)
895+
}
896+
888897
const selectionListData: TerminalSelectionListDataType = {
889898
firstRow: [
890899
{
@@ -990,7 +999,7 @@ const ClusterTerminal = ({
990999
type: TerminalWrapperType.DEBUG_MODE_TOGGLE_BUTTON,
9911000
hideTerminalStripComponent: hideShell || selectedNodeName.value === AUTO_SELECT.value,
9921001
showInfoTippy: true,
993-
onToggle: setDebugMode,
1002+
onToggle: toggleDebugMode,
9941003
isEnabled: debugMode,
9951004
},
9961005
{

0 commit comments

Comments
 (0)