Skip to content

Commit ed6981f

Browse files
committed
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-lib into feat/plugin-policy
2 parents e522fd4 + 3409271 commit ed6981f

File tree

14 files changed

+144
-90
lines changed

14 files changed

+144
-90
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.3.18-beta-1",
3+
"version": "0.3.22-beta-5",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/EmptyState/emptyState.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
max-height: 200px;
2828
width: auto;
2929
}
30+
.button svg {
31+
height: 100%;
32+
max-height: none;
33+
width: 100%;
34+
}
3035
h1,
3136
h2,
3237
h3,

src/Common/SortableTableHeaderCell/SortableTableHeaderCell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const SortableTableHeaderCell = ({
6363
return (
6464
<button
6565
type="button"
66-
className={`dc__transparent p-0 bcn-0 cn-7 flex dc__content-start dc__gap-4 dc__select-text ${!isSortable ? 'cursor-default' : ''}`}
66+
className={`dc__transparent p-0 cn-7 flex dc__content-start dc__gap-4 dc__select-text ${!isSortable ? 'cursor-default' : ''}`}
6767
onClick={isSortable ? triggerSorting : noop}
6868
disabled={disabled}
6969
>

src/Common/Tooltip/Tooltip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const Tooltip = ({
3737
maxWidth=""
3838
{...rest}
3939
{...(shortcutKeyCombo ? { content: <ShortcutKeyComboTooltipContent {...shortcutKeyCombo} /> } : {})}
40-
className={`${shortcutKeyCombo ? 'shortcut-keys__tippy' : 'default-tt'} ${wordBreak ? 'dc__word-break-all' : ''} dc__mxw-200 ${rest.className ?? ''}`}
40+
className={`${shortcutKeyCombo ? 'shortcut-keys__tippy' : 'default-tt'} ${wordBreak ? 'dc__word-break' : ''} dc__mxw-200 ${rest.className ?? ''}`}
4141
>
4242
{cloneElement(child, { ...child.props, onMouseEnter: handleMouseEnterEvent })}
4343
</TippyJS>

src/Shared/Components/ArtifactInfoModal/ArtifactInfoModal.component.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { getArtifactInfo, getCITriggerInfo } from '../../Services/app.service'
1919
import { APIResponseHandler } from '../APIResponseHandler'
2020
import { ReactComponent as ICClose } from '../../../Assets/Icon/ic-close.svg'
2121
import { ReactComponent as ICArrowDown } from '../../../Assets/Icon/ic-arrow-down.svg'
22-
import { Artifacts, HistoryComponentType } from '../CICDHistory'
22+
import { Artifacts } from '../CICDHistory'
2323
import MaterialHistory from '../MaterialHistory/MaterialHistory.component'
2424
import { ArtifactInfoModalProps } from './types'
2525

@@ -118,8 +118,6 @@ const ArtifactInfoModal = ({
118118
artifact={artifactInfo.image}
119119
blobStorageEnabled
120120
isArtifactUploaded={false}
121-
isJobView={false}
122-
type={HistoryComponentType.CI}
123121
imageReleaseTags={artifactInfo.imageReleaseTags}
124122
imageComment={artifactInfo.imageComment}
125123
ciPipelineId={artifactInfo.ciPipelineId}

src/Shared/Components/Button/Button.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ const Button = ({
180180
) : (
181181
<>
182182
{startIcon && <span className={iconClass}>{startIcon}</span>}
183-
<span className="dc__mxw-150 dc__align-left dc__truncate">{text}</span>
183+
<span className="dc__align-left">{text}</span>
184184
{endIcon && <span className={iconClass}>{endIcon}</span>}
185185
</>
186186
)}

src/Shared/Components/CICDHistory/Artifacts.tsx

Lines changed: 78 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import { ReactComponent as Down } from '../../../Assets/Icon/ic-arrow-forward.sv
3232
import docker from '../../../Assets/Icon/ic-docker.svg'
3333
import folder from '../../../Assets/Icon/ic-folder.svg'
3434
import noartifact from '../../../Assets/Img/no-artifact@2x.png'
35-
import { ArtifactType, CIListItemType, HistoryComponentType } from './types'
35+
import { ArtifactType, CIListItemType } from './types'
3636
import { TERMINAL_STATUS_MAP } from './constants'
3737
import { EMPTY_STATE_STATUS } from '../../constants'
3838

@@ -124,11 +124,9 @@ const Artifacts = ({
124124
downloadArtifactUrl,
125125
ciPipelineId,
126126
artifactId,
127-
isJobView,
128127
isJobCI,
129128
imageComment,
130129
imageReleaseTags,
131-
type,
132130
appReleaseTagNames,
133131
tagsEditable,
134132
hideImageTaggingHardDelete,
@@ -153,88 +151,96 @@ const Artifacts = ({
153151
if (status.toLowerCase() === TERMINAL_STATUS_MAP.RUNNING || status.toLowerCase() === TERMINAL_STATUS_MAP.STARTING) {
154152
return <CIProgressView />
155153
}
156-
if (
157-
status.toLowerCase() === TERMINAL_STATUS_MAP.FAILED ||
158-
status.toLowerCase() === TERMINAL_STATUS_MAP.CANCELLED ||
159-
status.toLowerCase() === TERMINAL_STATUS_MAP.ERROR
160-
) {
161-
if (isJobCI) {
154+
// If artifactId is not 0 image info is shown, if isArtifactUploaded is true reports are shown
155+
// In case both are not present empty state is shown
156+
// isArtifactUploaded can be true even if status is failed
157+
158+
// NOTE: This means there are no reports and no image artifacts i.e. empty state
159+
if (!isArtifactUploaded && !artifactId) {
160+
if (
161+
status.toLowerCase() === TERMINAL_STATUS_MAP.FAILED ||
162+
status.toLowerCase() === TERMINAL_STATUS_MAP.CANCELLED ||
163+
status.toLowerCase() === TERMINAL_STATUS_MAP.ERROR
164+
) {
162165
return (
163166
<GenericEmptyState
164-
title={EMPTY_STATE_STATUS.ARTIFACTS_EMPTY_STATE_TEXTS.FailedToFetchArtifacts}
165-
subTitle={EMPTY_STATE_STATUS.ARTIFACTS_EMPTY_STATE_TEXTS.FailedToFetchArtifactsError}
167+
title={
168+
isJobCI
169+
? EMPTY_STATE_STATUS.ARTIFACTS_EMPTY_STATE_TEXTS.FailedToFetchArtifacts
170+
: EMPTY_STATE_STATUS.ARTIFACTS_EMPTY_STATE_TEXTS.NoArtifactsGenerated
171+
}
172+
subTitle={
173+
isJobCI
174+
? EMPTY_STATE_STATUS.ARTIFACTS_EMPTY_STATE_TEXTS.FailedToFetchArtifactsError
175+
: EMPTY_STATE_STATUS.ARTIFACTS_EMPTY_STATE_TEXTS.NoArtifactsError
176+
}
166177
/>
167178
)
168179
}
169180

170-
return (
171-
<GenericEmptyState
172-
title={EMPTY_STATE_STATUS.ARTIFACTS_EMPTY_STATE_TEXTS.NoArtifactsGenerated}
173-
subTitle={EMPTY_STATE_STATUS.ARTIFACTS_EMPTY_STATE_TEXTS.NoArtifactsError}
174-
/>
175-
)
176-
}
177-
if (!artifactId && status.toLowerCase() === TERMINAL_STATUS_MAP.SUCCEEDED) {
178-
return (
179-
<GenericEmptyState
180-
title={EMPTY_STATE_STATUS.ARTIFACTS_EMPTY_STATE_TEXTS.NoArtifactsFound}
181-
subTitle={EMPTY_STATE_STATUS.ARTIFACTS_EMPTY_STATE_TEXTS.NoArtifactsFoundError}
182-
image={noartifact}
183-
/>
184-
)
181+
if (status.toLowerCase() === TERMINAL_STATUS_MAP.SUCCEEDED) {
182+
return (
183+
<GenericEmptyState
184+
title={EMPTY_STATE_STATUS.ARTIFACTS_EMPTY_STATE_TEXTS.NoArtifactsFound}
185+
subTitle={EMPTY_STATE_STATUS.ARTIFACTS_EMPTY_STATE_TEXTS.NoArtifactsFoundError}
186+
image={noartifact}
187+
/>
188+
)
189+
}
185190
}
191+
186192
return (
187193
<>
188194
<div className={`flex left column dc__gap-12 dc__content-start ${rootClassName ?? ''}`}>
189-
<CIListItem
190-
type="artifact"
191-
ciPipelineId={ciPipelineId}
192-
artifactId={artifactId}
193-
imageComment={imageComment}
194-
imageReleaseTags={imageReleaseTags}
195-
appReleaseTagNames={appReleaseTagNames}
196-
tagsEditable={tagsEditable}
197-
hideImageTaggingHardDelete={hideImageTaggingHardDelete}
198-
isSuperAdmin={isSuperAdmin}
199-
renderCIListHeader={renderCIListHeader}
200-
>
201-
<div className="flex column left hover-trigger">
202-
<div className="cn-9 fs-14 flex left" data-testid="artifact-text-visibility">
203-
{extractImage(artifact)}
204-
<div className="pl-4">
205-
<ClipboardButton content={extractImage(artifact)} />
195+
{!!artifactId && (
196+
<CIListItem
197+
type="artifact"
198+
ciPipelineId={ciPipelineId}
199+
artifactId={artifactId}
200+
imageComment={imageComment}
201+
imageReleaseTags={imageReleaseTags}
202+
appReleaseTagNames={appReleaseTagNames}
203+
tagsEditable={tagsEditable}
204+
hideImageTaggingHardDelete={hideImageTaggingHardDelete}
205+
isSuperAdmin={isSuperAdmin}
206+
renderCIListHeader={renderCIListHeader}
207+
>
208+
<div className="flex column left hover-trigger">
209+
<div className="cn-9 fs-14 flex left" data-testid="artifact-text-visibility">
210+
{extractImage(artifact)}
211+
<div className="pl-4">
212+
<ClipboardButton content={extractImage(artifact)} />
213+
</div>
206214
</div>
207-
</div>
208-
<div className="cn-7 fs-12 flex left" data-testid="artifact-image-text">
209-
{artifact}
210-
<div className="pl-4">
211-
<ClipboardButton content={artifact} />
215+
<div className="cn-7 fs-12 flex left" data-testid="artifact-image-text">
216+
{artifact}
217+
<div className="pl-4">
218+
<ClipboardButton content={artifact} />
219+
</div>
212220
</div>
213221
</div>
214-
</div>
215-
</CIListItem>
216-
{blobStorageEnabled &&
217-
downloadArtifactUrl &&
218-
(type === HistoryComponentType.CD || isArtifactUploaded || isJobView) && (
219-
<CIListItem
220-
type="report"
221-
hideImageTaggingHardDelete={hideImageTaggingHardDelete}
222-
isSuperAdmin={isSuperAdmin}
223-
renderCIListHeader={renderCIListHeader}
224-
>
225-
<div className="flex column left">
226-
<div className="cn-9 fs-14">Reports.zip</div>
227-
<button
228-
type="button"
229-
onClick={handleArtifact}
230-
className="anchor p-0 cb-5 fs-12 flex left pointer"
231-
>
232-
Download
233-
<Download className="ml-5 icon-dim-16" />
234-
</button>
235-
</div>
236-
</CIListItem>
237-
)}
222+
</CIListItem>
223+
)}
224+
{blobStorageEnabled && downloadArtifactUrl && isArtifactUploaded && (
225+
<CIListItem
226+
type="report"
227+
hideImageTaggingHardDelete={hideImageTaggingHardDelete}
228+
isSuperAdmin={isSuperAdmin}
229+
renderCIListHeader={renderCIListHeader}
230+
>
231+
<div className="flex column left">
232+
<div className="cn-9 fs-14">Reports.zip</div>
233+
<button
234+
type="button"
235+
onClick={handleArtifact}
236+
className="anchor p-0 cb-5 fs-12 flex left pointer"
237+
>
238+
Download
239+
<Download className="ml-5 icon-dim-16" />
240+
</button>
241+
</div>
242+
</CIListItem>
243+
)}
238244
</div>
239245
{!blobStorageEnabled && (
240246
<div className="flexbox dc__position-abs-b-20 dc__content-center w-100">

src/Shared/Components/CICDHistory/TriggerOutput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@ const HistoryLogs: React.FC<HistoryLogsProps> = ({
625625
status={triggerDetails.status}
626626
artifact={triggerDetails.artifact}
627627
blobStorageEnabled={triggerDetails.blobStorageEnabled}
628+
isArtifactUploaded={triggerDetails.isArtifactUploaded}
628629
ciPipelineId={triggerDetails.ciPipelineId}
629630
artifactId={triggerDetails.artifactId}
630631
imageComment={triggerDetails?.imageComment}
@@ -633,7 +634,6 @@ const HistoryLogs: React.FC<HistoryLogsProps> = ({
633634
appReleaseTagNames={appReleaseTags}
634635
hideImageTaggingHardDelete={hideImageTaggingHardDelete}
635636
downloadArtifactUrl={CDBuildReportUrl}
636-
type={HistoryComponentType.CD}
637637
renderCIListHeader={renderCIListHeader}
638638
rootClassName="p-16 flex-grow-1"
639639
/>

src/Shared/Components/CICDHistory/service.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,20 @@ export const prepareConfigMapAndSecretData = (
202202
}
203203
if (rawData.subPath) {
204204
secretValues['subPath'] = { displayName: 'Set SubPath', value: 'Yes' }
205+
206+
if (rawData.esoSubPath) {
207+
secretValues['subPathValues'] = { displayName: 'SubPath', value: rawData.esoSubPath.join(', ') }
208+
} else if (
209+
rawData.external &&
210+
rawData.externalType === 'KubernetesSecret' &&
211+
historyData.codeEditorValue?.resolvedValue
212+
) {
213+
const resolvedSecretData = JSON.parse(historyData.codeEditorValue.resolvedValue)
214+
secretValues['subPathValues'] = {
215+
displayName: 'SubPath',
216+
value: Object.keys(resolvedSecretData).join(', '),
217+
}
218+
}
205219
}
206220
if (rawData.filePermission) {
207221
secretValues['filePermission'] = {

0 commit comments

Comments
 (0)