Skip to content

Commit d14835a

Browse files
committed
Merge branch 'develop' into feat/spog-1
2 parents e59366c + 7ef87b1 commit d14835a

File tree

107 files changed

+3301
-580
lines changed

Some content is hidden

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

107 files changed

+3301
-580
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "0.1.13-beta-8",
3+
"version": "0.2.2",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Assets/Icon/ic-book-open.svg

Lines changed: 19 additions & 0 deletions
Loading

src/Assets/Icon/ic-caret-down.svg

Lines changed: 16 additions & 0 deletions
Loading

src/Assets/Icon/ic-circle.svg

Lines changed: 9 additions & 0 deletions
Loading

src/Assets/Icon/ic-exit-fullscreen.svg

Lines changed: 2 additions & 15 deletions
Loading

src/Assets/Icon/ic-filter-applied.svg

Lines changed: 20 additions & 0 deletions
Loading

src/Assets/Icon/ic-filter.svg

Lines changed: 19 additions & 0 deletions
Loading

src/Assets/Icon/ic-fullscreen.svg

Lines changed: 2 additions & 2 deletions
Loading

src/Assets/Icon/ic-in-progress.svg

Lines changed: 10 additions & 0 deletions
Loading

src/Assets/Icon/ic-lego-block.svg

Lines changed: 36 additions & 0 deletions
Loading

src/Assets/Icon/ic-visibility-on.svg

Lines changed: 20 additions & 0 deletions
Loading

src/Common/AddCDButton/AddCDButton.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
import React from 'react'
1817
import Tippy from '@tippyjs/react'
1918
import { AddCDButtonProps, TooltipContentProps } from './types'
2019
import { AddCDPositions } from '../Types'

src/Common/AppStatus/AppStatus.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,23 @@ export default function AppStatus({
3333
}
3434
const appStatusLowerCase = status?.toLowerCase()
3535
const isNotDeployed = appStatusLowerCase === StatusConstants.NOT_DEPLOYED.noSpaceLower
36-
const iconClass = isNotDeployed ? StatusConstants.NOT_DEPLOYED.lowerCase : appStatusLowerCase
36+
const isNotReady = appStatus === StatusConstants.NOT_READY.normalCase
3737
const statusMessage = status || (isVirtualEnv ? StatusConstants.NOT_AVILABLE.normalCase : '-')
3838
const notDeployed = isJobView ? YET_TO_RUN : StatusConstants.NOT_DEPLOYED.normalCase
3939
const textContent = isNotDeployed ? notDeployed : statusMessage
4040

41+
const getIconClass = () => {
42+
if (isNotDeployed) {
43+
return StatusConstants.NOT_DEPLOYED.lowerCase
44+
}
45+
if (isNotReady) {
46+
return StatusConstants.NOT_READY.lowerCase
47+
}
48+
return appStatusLowerCase
49+
}
50+
51+
const iconClass = getIconClass()
52+
4153
const renderIcon = () => {
4254
if (iconClass) {
4355
return <span className={`dc__app-summary__icon icon-dim-16 ${iconClass} ${iconClass}--node`} />

src/Common/AppStatus/constants.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ export const StatusConstants = {
2020
normalCase: 'Not deployed',
2121
lowerCase: 'not-deployed',
2222
},
23+
NOT_READY: {
24+
noSpaceLower: 'notready',
25+
normalCase: 'Not Ready',
26+
lowerCase: 'not-ready',
27+
},
2328
APP_STATUS: {
2429
noSpaceLower: 'appStatus',
2530
normalText: 'App status',

src/Common/CIPipeline.Types.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -280,14 +280,3 @@ export interface FormErrorObjectType {
280280
steps: TaskErrorObj[]
281281
}
282282
}
283-
284-
export interface PluginDetailType {
285-
id: number
286-
name: string
287-
type: string
288-
description: string
289-
icon: string
290-
tags: string[]
291-
inputVariables?: VariableType[]
292-
outputVariables?: VariableType[]
293-
}

src/Common/ChartVersionAndTypeSelector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const ChartVersionAndTypeSelector = ({ setSelectedChartRefId }: ChartVersionAndT
7070
return (
7171
<div className="flex">
7272
<div className="chart-type-options flex" data-testid="chart-type-options">
73-
<span className="chart-type-options-label mr-4">Chart Type</span>
73+
<span className="cn-7 mr-4">Chart Type</span>
7474
<ReactSelect
7575
value={selectedChartType ?? chartTypeOptions[0]}
7676
options={chartTypeOptions}
@@ -79,7 +79,7 @@ const ChartVersionAndTypeSelector = ({ setSelectedChartRefId }: ChartVersionAndT
7979
/>
8080
</div>
8181
<div className="chart-version-options flex" data-testid="chart-version-options">
82-
<span className="chart-version-options-label mr-4">Chart Version</span>
82+
<span className="cn-7 mr-4">Chart Version</span>
8383
<ReactSelect
8484
value={selectedChartVersion ?? chartVersionOptions[0]}
8585
options={chartVersionOptions}

src/Common/ClipboardButton/ClipboardButton.tsx

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import { useState, useEffect, useCallback } from 'react'
1818
import Tippy from '@tippyjs/react'
19-
import { copyToClipboard, noop } from '../Helper'
19+
import { copyToClipboard, noop, stopPropagation } from '../Helper'
2020
import ClipboardProps from './types'
2121
import { ReactComponent as ICCopy } from '../../Assets/Icon/ic-copy.svg'
2222
import { ReactComponent as Check } from '../../Assets/Icon/ic-check.svg'
@@ -42,10 +42,17 @@ export default function ClipboardButton({
4242
const [copied, setCopied] = useState<boolean>(false)
4343
const [enableTippy, setEnableTippy] = useState<boolean>(false)
4444

45-
const handleTextCopied = () => setCopied(true)
45+
const handleTextCopied = () => {setCopied(true)}
4646
const handleEnableTippy = () => setEnableTippy(true)
4747
const handleDisableTippy = () => setEnableTippy(false)
48-
const handleCopyContent = useCallback(() => copyToClipboard(content, handleTextCopied), [content])
48+
const handleCopyContent = useCallback(
49+
(e?) => {
50+
if(e) stopPropagation(e)
51+
copyToClipboard(content, handleTextCopied)
52+
},
53+
[content],
54+
)
55+
const iconClassName = `icon-dim-${iconSize} dc__no-shrink`
4956

5057
useEffect(() => {
5158
if (!copied) return
@@ -65,28 +72,22 @@ export default function ClipboardButton({
6572
}
6673
}, [trigger, handleCopyContent])
6774
return (
68-
<div className="icon-dim-16 flex center">
69-
<Tippy
70-
className="default-tt"
71-
content={copied ? copiedTippyText : 'Copy'}
72-
placement="bottom"
73-
visible={copied || enableTippy}
74-
arrow={false}
75+
<Tippy
76+
className="default-tt"
77+
content={copied ? copiedTippyText : 'Copy'}
78+
placement="bottom"
79+
visible={copied || enableTippy}
80+
arrow={false}
81+
>
82+
<button
83+
type="button"
84+
className={`dc__outline-none-imp p-0 flex dc__transparent--unstyled dc__no-border ${rootClassName}`}
85+
onMouseEnter={handleEnableTippy}
86+
onMouseLeave={handleDisableTippy}
87+
onClick={handleCopyContent}
7588
>
76-
<button
77-
type="button"
78-
className={`dc__outline-none-imp p-0 flex bcn-0 dc__no-border ${rootClassName}`}
79-
onMouseEnter={handleEnableTippy}
80-
onMouseLeave={handleDisableTippy}
81-
onClick={handleCopyContent}
82-
>
83-
{copied ? (
84-
<Check className={`icon-dim-${iconSize}`} />
85-
) : (
86-
<ICCopy className={`icon-dim-${iconSize}`} />
87-
)}
88-
</button>
89-
</Tippy>
90-
</div>
89+
{copied ? <Check className={iconClassName} /> : <ICCopy className={iconClassName} />}
90+
</button>
91+
</Tippy>
9192
)
9293
}

0 commit comments

Comments
 (0)