Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ae1e375
feat: add rocket launch icon
RohitRaj011 Apr 7, 2025
07ff6e3
feat: AnimatedDeployButton - add support for exception user
RohitRaj011 Apr 7, 2025
fc72c2e
feat: add support for exceptionUser in deployment APIs
RohitRaj011 Apr 8, 2025
c0a2124
feat: add support for image deployed without approval
RohitRaj011 Apr 8, 2025
b32d4be
feat: AnimatedDeployButton add support for isLoading prop
RohitRaj011 Apr 8, 2025
6209c14
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
RohitRaj011 Apr 9, 2025
4613a17
chore: add ic-checks & ic-selected icon
RohitRaj011 Apr 10, 2025
7c882a4
fix: adjust gap in ArtifactInfo component
RohitRaj011 Apr 10, 2025
aa87441
feat: replace ic-timeout-two-dash with ic-timeout-dash icon and updat…
RohitRaj011 Apr 11, 2025
9007f37
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
RohitRaj011 Apr 11, 2025
f5f6f08
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
RohitRaj011 Apr 15, 2025
7a8e491
feat: TabGroup - add truncate to tabs
RohitRaj011 Apr 16, 2025
c1962be
feat: update AnimatedDeployButton to use exceptionUserConfig for depl…
RohitRaj011 Apr 17, 2025
c400d9b
feat: display text for deployments by exception users
RohitRaj011 Apr 17, 2025
7fa7c13
feat: DeploymentDetailSteps - virtual environment - show deployed by …
RohitRaj011 Apr 22, 2025
6799f34
fix: update badge element in TabGroup to use span instead of div
RohitRaj011 Apr 22, 2025
794725a
chore: add ic-key icon
RohitRaj011 Apr 22, 2025
3404e9c
feat: add UserIdentifier component
RohitRaj011 Apr 22, 2025
4e9ee84
fix: remove isExceptionUser from CDMaterialResponseType and related l…
RohitRaj011 Apr 22, 2025
0450fbe
refactor: UserIdentifier - styling update
RohitRaj011 Apr 22, 2025
d73dc48
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
RohitRaj011 Apr 22, 2025
c88025a
fix: DeploymentHistoryConfigDiff - incorrect config diff showing fix
RohitRaj011 Apr 23, 2025
0c33ac3
refactor: Artifacts, UserIdentifier - code optimization, remove redun…
RohitRaj011 Apr 24, 2025
17235c3
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
RohitRaj011 Apr 28, 2025
ffc73b7
chore(version): bump to 1.12.0-beta-2
RohitRaj011 Apr 28, 2025
34d4a63
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-l…
RohitRaj011 May 5, 2025
a013fbf
refactor: rename email prop to identifier in UserIdentifier component
RohitRaj011 May 5, 2025
afd87c8
chore(version): bump to 1.12.0-pre-4
RohitRaj011 May 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtron-labs/devtron-fe-common-lib",
"version": "1.12.0-pre-3",
"version": "1.12.0-pre-4",
"description": "Supporting common component library",
"type": "module",
"main": "dist/index.js",
Expand Down
3 changes: 3 additions & 0 deletions src/Assets/IconV2/ic-checks.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/Assets/IconV2/ic-key.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions src/Assets/IconV2/ic-timeout-dash.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 25 additions & 21 deletions src/Common/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,25 +231,27 @@ interface InfoColourBarTextConfigType {
actionButtonConfig?: ButtonProps
}

type InfoColourBarMessageProp = {
message: ReactNode
linkText?: ReactNode
redirectLink?: string
linkOnClick?: () => void
linkClass?: string
internalLink?: boolean

textConfig?: never
} | {
textConfig: InfoColourBarTextConfigType

message?: never
linkText?: never
redirectLink?: never
linkOnClick?: () => never
linkClass?: never
internalLink?: never
}
type InfoColourBarMessageProp =
| {
message: ReactNode
linkText?: ReactNode
redirectLink?: string
linkOnClick?: () => void
linkClass?: string
internalLink?: boolean

textConfig?: never
}
| {
textConfig: InfoColourBarTextConfigType

message?: never
linkText?: never
redirectLink?: never
linkOnClick?: () => never
linkClass?: never
internalLink?: never
}

export type InfoColourBarType = InfoColourBarMessageProp & {
classname: string
Expand Down Expand Up @@ -848,7 +850,7 @@ export interface Strategy {
default?: boolean
}

export interface CDStage extends Partial<Pick<CommonNodeAttr, 'triggerBlockedInfo' | 'isTriggerBlocked' >> {
export interface CDStage extends Partial<Pick<CommonNodeAttr, 'triggerBlockedInfo' | 'isTriggerBlocked'>> {
status: string
name: string
triggerType: 'AUTOMATIC' | 'MANUAL'
Expand All @@ -860,7 +862,9 @@ export interface CDStageConfigMapSecretNames {
secrets: any[]
}

export interface PrePostDeployStageType extends MandatoryPluginBaseStateType, Partial<Pick<CommonNodeAttr, 'triggerBlockedInfo'>> {
export interface PrePostDeployStageType
extends MandatoryPluginBaseStateType,
Partial<Pick<CommonNodeAttr, 'triggerBlockedInfo'>> {
isValid: boolean
steps: TaskErrorObj[]
triggerType: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,19 @@ import { motion } from 'framer-motion'
import DeployAudio from '@Sounds/DeployAudio.mp3'
import { ComponentSizeType } from '@Shared/constants'

import { Button } from '../Button'
import { Button, ButtonStyleType } from '../Button'
import { Icon } from '../Icon'
import { AnimatedDeployButtonProps } from './types'

import './animatedDeployButton.scss'

const AnimatedDeployButton = ({ isVirtualEnvironment, onButtonClick }: AnimatedDeployButtonProps) => {
const AnimatedDeployButton = ({
isLoading,
isVirtualEnvironment,
onButtonClick,
exceptionUserConfig,
isBulkCDTrigger,
}: AnimatedDeployButtonProps) => {
const audioRef = useRef<HTMLAudioElement>(null)
const timeoutRef = useRef<ReturnType<typeof setTimeout>>(null)
const isAudioEnabled: boolean = window._env_.FEATURE_ACTION_AUDIOS_ENABLE
Expand All @@ -36,6 +42,7 @@ const AnimatedDeployButton = ({ isVirtualEnvironment, onButtonClick }: AnimatedD
rotate: 45,
},
}
const isExceptionUser = exceptionUserConfig?.canDeploy || exceptionUserConfig?.isImageApprover

const handleButtonClick = async (e: SyntheticEvent) => {
if (clicked) {
Expand Down Expand Up @@ -66,7 +73,12 @@ const AnimatedDeployButton = ({ isVirtualEnvironment, onButtonClick }: AnimatedD
<motion.div whileHover="hover" className={`${clicked ? 'hide-button-text' : ''}`}>
<Button
dataTestId="cd-trigger-deploy-button"
text={`Deploy${isVirtualEnvironment ? ' to isolated env' : ''}`}
isLoading={isLoading}
text={
exceptionUserConfig?.canDeploy
? 'Deploy without approval'
: `Deploy${isVirtualEnvironment ? ' to isolated env' : ''}`
}
startIcon={
<motion.div
variants={svgMotionVariants}
Expand All @@ -88,6 +100,13 @@ const AnimatedDeployButton = ({ isVirtualEnvironment, onButtonClick }: AnimatedD
}
size={ComponentSizeType.large}
onClick={handleButtonClick}
style={isExceptionUser ? ButtonStyleType.warning : ButtonStyleType.default}
showTooltip={isExceptionUser}
tooltipProps={{
content: isBulkCDTrigger
? 'You are authorized to deploy as an exception user for some applications'
: 'You are authorized to deploy as an exception user',
}}
/>
{/* Disabling es-lint as captions are not required */}
{/* eslint-disable-next-line jsx-a11y/media-has-caption */}
Expand Down
6 changes: 6 additions & 0 deletions src/Shared/Components/AnimatedDeployButton/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
*/

export interface AnimatedDeployButtonProps {
isLoading?: boolean
isVirtualEnvironment: boolean
onButtonClick: (e, disableDeployButton: boolean) => void
exceptionUserConfig?: {
canDeploy: boolean
isImageApprover: boolean
}
isBulkCDTrigger?: boolean
}
17 changes: 10 additions & 7 deletions src/Shared/Components/CICDHistory/Artifacts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,14 @@ export const CIListItem = ({
selectedEnvironmentName,
renderCIListHeader,
targetPlatforms,
isDeploymentWithoutApproval,
}: CIListItemType) => {
const headerMetaDataPresent =
!!getIsApprovalPolicyConfigured(userApprovalMetadata?.approvalConfigData) ||
!!appliedFilters?.length ||
!!promotionApprovalMetadata?.promotedFromType
const showCIListHeader =
!!renderCIListHeader &&
(!!getIsApprovalPolicyConfigured(userApprovalMetadata?.approvalConfigData) ||
!!appliedFilters?.length ||
!!promotionApprovalMetadata?.promotedFromType ||
isDeploymentWithoutApproval)

return (
<>
Expand All @@ -83,20 +86,20 @@ export const CIListItem = ({
</div>
)}

{headerMetaDataPresent &&
renderCIListHeader &&
{showCIListHeader &&
renderCIListHeader({
userApprovalMetadata,
triggeredBy,
appliedFilters,
appliedFiltersTimestamp,
promotionApprovalMetadata,
selectedEnvironmentName,
isDeploymentWithoutApproval,
})}

<div
className={`dc__h-fit-content ci-artifact image-tag-parent-card bg__primary br-4 dc__border p-12 w-100 dc__mxw-800 ci-artifact--${type} ${
headerMetaDataPresent && renderCIListHeader ? 'dc__no-top-radius dc__no-top-border' : ''
showCIListHeader ? 'dc__no-top-radius dc__no-top-border' : ''
}`}
data-testid="hover-on-report-artifact"
>
Expand Down
12 changes: 11 additions & 1 deletion src/Shared/Components/CICDHistory/DeploymentDetailSteps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const DeploymentDetailSteps = ({
isVirtualEnvironment,
processVirtualEnvironmentDeploymentData,
renderDeploymentApprovalInfo,
isDeploymentWithoutApproval,
}: DeploymentDetailStepsType) => {
const history = useHistory()
const { url } = useRouteMatch()
Expand All @@ -51,6 +52,8 @@ const DeploymentDetailSteps = ({
deploymentStatus?.toUpperCase() !== TIMELINE_STATUS.ABORTED,
)
const isVirtualEnv = useRef(isVirtualEnvironment)
const isDeploymentWithoutApprovalRef = useRef(isDeploymentWithoutApproval)

const processedData =
isVirtualEnv.current && processVirtualEnvironmentDeploymentData
? processVirtualEnvironmentDeploymentData()
Expand All @@ -69,7 +72,10 @@ const DeploymentDetailSteps = ({
.then((deploymentStatusDetailRes) => {
if (deploymentStatus !== 'Aborted') {
// eslint-disable-next-line no-use-before-define
processDeploymentStatusData(deploymentStatusDetailRes.result)
processDeploymentStatusData({
...deploymentStatusDetailRes.result,
isDeploymentWithoutApproval: isDeploymentWithoutApprovalRef.current,
})
}
})
.catch(() => {
Expand Down Expand Up @@ -97,6 +103,10 @@ const DeploymentDetailSteps = ({
isVirtualEnv.current = isVirtualEnvironment
}, [isVirtualEnvironment])

useEffect(() => {
isDeploymentWithoutApprovalRef.current = isDeploymentWithoutApproval
}, [isDeploymentWithoutApproval])

const processDeploymentStatusData = (deploymentStatusDetailRes: DeploymentStatusDetailsType): void => {
const processedDeploymentStatusDetailsData =
isVirtualEnv.current && processVirtualEnvironmentDeploymentData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ export const DeploymentStatusDetailRow = ({
>
{renderIcon(statusBreakDownType.icon)}
<span className="ml-12 mr-12 fs-13">
<span data-testid="deployment-status-step-name">{statusBreakDownType.displayText}</span>
<span data-testid="deployment-status-step-name" className="flex left">
{statusBreakDownType.displayText}
</span>
{statusBreakDownType.displaySubText && (
<span className={`ml-12 f-${statusBreakDownType.icon || 'waiting'}`}>
{statusBreakDownType.displaySubText}
Expand Down
2 changes: 2 additions & 0 deletions src/Shared/Components/CICDHistory/History.components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export const GitChanges = ({
selectedEnvironmentName,
renderCIListHeader,
targetPlatforms,
isDeploymentWithoutApproval,
}: GitChangesType) => {
const { isSuperAdmin } = useGetUserRoles()

Expand Down Expand Up @@ -202,6 +203,7 @@ export const GitChanges = ({
selectedEnvironmentName={selectedEnvironmentName}
renderCIListHeader={renderCIListHeader}
targetPlatforms={targetPlatforms}
isDeploymentWithoutApproval={isDeploymentWithoutApproval}
>
<div className="flex column left hover-trigger">
<div className="cn-9 fs-14 flex left">
Expand Down
2 changes: 2 additions & 0 deletions src/Shared/Components/CICDHistory/TriggerOutput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ const HistoryLogs: React.FC<HistoryLogsProps> = ({
isVirtualEnvironment={triggerDetails.IsVirtualEnvironment}
processVirtualEnvironmentDeploymentData={processVirtualEnvironmentDeploymentData}
renderDeploymentApprovalInfo={renderDeploymentApprovalInfo}
isDeploymentWithoutApproval={triggerDetails.isDeploymentWithoutApproval ?? false}
/>
</Route>
)}
Expand All @@ -156,6 +157,7 @@ const HistoryLogs: React.FC<HistoryLogsProps> = ({
promotionApprovalMetadata={triggerDetails?.promotionApprovalMetadata}
renderCIListHeader={renderCIListHeader}
targetPlatforms={targetPlatforms}
isDeploymentWithoutApproval={triggerDetails.isDeploymentWithoutApproval ?? false}
/>
</Route>
{triggerDetails.stage === 'DEPLOY' && (
Expand Down
13 changes: 8 additions & 5 deletions src/Shared/Components/CICDHistory/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export interface History extends Pick<TargetPlatformsDTO, 'targetPlatforms'>, Wo
triggerMetadata?: string
runSource?: RunSourceType
targetConfig?: TargetConfigType
isDeploymentWithoutApproval?: boolean
}

export interface ExecutionInfoType {
Expand Down Expand Up @@ -389,7 +390,7 @@ export interface DeploymentStatusDetailsTimelineType {
statusTime: string
resourceDetails?: SyncStageResourceDetail[]
}
export interface DeploymentStatusDetailsType {
export interface DeploymentStatusDetailsType extends Pick<History, 'isDeploymentWithoutApproval'> {
deploymentFinishedOn: string
deploymentStartedOn: string
triggeredBy: string
Expand All @@ -405,7 +406,7 @@ export interface DeploymentStatusDetailsResponse extends ResponseType {

interface DeploymentStatusDetailRow {
icon: string
displayText: string
displayText: ReactNode
displaySubText: string
time: string
resourceDetails?: any
Expand All @@ -431,7 +432,7 @@ export interface DeploymentStatusDetailsBreakdownDataType {
}
}

export interface DeploymentDetailStepsType {
export interface DeploymentDetailStepsType extends Pick<History, 'isDeploymentWithoutApproval'> {
deploymentStatus?: string
deploymentAppType?: DeploymentAppTypes
isHelmApps?: boolean
Expand All @@ -445,7 +446,7 @@ export interface DeploymentDetailStepsType {
renderDeploymentApprovalInfo: (userApprovalMetadata: UserApprovalMetadataType) => JSX.Element
}

export interface RenderCIListHeaderProps {
export interface RenderCIListHeaderProps extends Required<Pick<History, 'isDeploymentWithoutApproval'>> {
userApprovalMetadata: UserApprovalMetadataType
triggeredBy: string
appliedFilters: FilterConditionsListType[]
Expand All @@ -465,7 +466,7 @@ export interface VirtualHistoryArtifactProps {
}
}

export type CIListItemType = Pick<History, 'promotionApprovalMetadata'> & {
export type CIListItemType = Pick<History, 'promotionApprovalMetadata' | 'isDeploymentWithoutApproval'> & {
userApprovalMetadata?: UserApprovalMetadataType
triggeredBy?: string
children: ReactNode
Expand Down Expand Up @@ -737,6 +738,7 @@ export type GitChangesType = {
appliedFilters?: never
appliedFiltersTimestamp?: never
renderCIListHeader?: never
isDeploymentWithoutApproval?: never
}
| {
artifact: string
Expand All @@ -755,6 +757,7 @@ export type GitChangesType = {
appliedFilters?: FilterConditionsListType[]
appliedFiltersTimestamp?: string
renderCIListHeader: (renderCIListHeaderProps: RenderCIListHeaderProps) => JSX.Element
isDeploymentWithoutApproval?: History['isDeploymentWithoutApproval']
}
)

Expand Down
Loading