Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 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
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-rocket-launch.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.
10 changes: 4 additions & 6 deletions src/Common/Common.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ import {
sanitizeUserApprovalList,
stringComparatorBySortOrder,
} from '@Shared/Helpers'
import {
PolicyBlockInfo,
RuntimeParamsAPIResponseType,
RuntimePluginVariables,
} from '@Shared/types'
import { PolicyBlockInfo, RuntimeParamsAPIResponseType, RuntimePluginVariables } from '@Shared/types'
import { GitProviderType, ROUTES } from './Constants'
import { getUrlWithSearchParams, sortCallback } from './Helper'
import {
Expand Down Expand Up @@ -264,7 +260,7 @@ export const parseRuntimeParams = (response: RuntimeParamsAPIResponseType): Runt
const runtimeParams = (response?.runtimePluginVariables ?? []).map<RuntimePluginVariables>((variable) => ({
...variable,
defaultValue: variable.value,
stepVariableId: variable.stepVariableId || Math.floor(new Date().valueOf() * Math.random())
stepVariableId: variable.stepVariableId || Math.floor(new Date().valueOf() * Math.random()),
}))

runtimeParams.push(...envVariables)
Expand Down Expand Up @@ -324,6 +320,7 @@ export const processCDMaterialServiceResponse = (
...processCDMaterialsMetaInfo(cdMaterialsResult),
...processCDMaterialsApprovalInfo(false, cdMaterialsResult),
...processImagePromotionInfo(cdMaterialsResult),
isExceptionUser: false,
}
}

Expand Down Expand Up @@ -352,6 +349,7 @@ export const processCDMaterialServiceResponse = (
...approvalInfo,
...metaInfo,
...imagePromotionInfo,
Comment thread
RohitRaj011 marked this conversation as resolved.
isExceptionUser: cdMaterialsResult.userApprovalConfig?.isExceptionUser ?? false,
Comment thread
AbhishekA1509 marked this conversation as resolved.
Outdated
}
}

Expand Down
47 changes: 26 additions & 21 deletions src/Common/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,25 +230,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 @@ -783,6 +785,7 @@ export interface CDMaterialResponseType
CDMaterialsApprovalInfo,
ImagePromotionMaterialInfo {
materials: CDMaterialType[]
isExceptionUser: boolean
}

export interface InputDetailType {
Expand Down Expand Up @@ -847,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 @@ -859,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 @@ -21,12 +21,18 @@ import { ReactComponent as ICDeploy } from '@Icons/ic-nav-rocket.svg'
import DeployAudio from '@Sounds/DeployAudio.mp3'
import { ComponentSizeType } from '@Shared/constants'

import { Button } from '../Button'
import { Button, ButtonStyleType } from '../Button'
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 && !isBulkCDTrigger ? 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
}
13 changes: 12 additions & 1 deletion src/Shared/Components/CICDHistory/Artifacts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
useGetUserRoles,
} from '../../../Common'
import { EMPTY_STATE_STATUS } from '../../constants'
import { Icon } from '../Icon'
import { TargetPlatformBadgeList } from '../TargetPlatforms'
import { TERMINAL_STATUS_MAP } from './constants'
import { ArtifactType, CIListItemType } from './types'
Expand Down Expand Up @@ -67,6 +68,7 @@ export const CIListItem = ({
selectedEnvironmentName,
renderCIListHeader,
targetPlatforms,
isDeploymentWithoutApproval,
}: CIListItemType) => {
const headerMetaDataPresent =
!!getIsApprovalPolicyConfigured(userApprovalMetadata?.approvalConfigData) ||
Expand All @@ -83,6 +85,13 @@ export const CIListItem = ({
</div>
)}

{isDeploymentWithoutApproval && (
Comment thread
AbhishekA1509 marked this conversation as resolved.
Outdated
<div className="w-100 bg__primary flex left dc__gap-6 px-12 pt-8 pb-7 border__secondary--bottom border__primary--top border__primary--left border__primary--right dc__top-radius-4">
<Icon name="ic-lightning-fill" color="Y500" />
<p className="m-0 fs-13 lh-20 cn-9">Deployed by an exception user</p>
</div>
)}

{headerMetaDataPresent &&
renderCIListHeader &&
renderCIListHeader({
Expand All @@ -96,7 +105,9 @@ export const CIListItem = ({

<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' : ''
(headerMetaDataPresent && renderCIListHeader) || isDeploymentWithoutApproval
? 'dc__no-top-radius dc__no-top-border'
: ''
}`}
data-testid="hover-on-report-artifact"
>
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
1 change: 1 addition & 0 deletions src/Shared/Components/CICDHistory/TriggerOutput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ const HistoryLogs: React.FC<HistoryLogsProps> = ({
promotionApprovalMetadata={triggerDetails?.promotionApprovalMetadata}
renderCIListHeader={renderCIListHeader}
targetPlatforms={targetPlatforms}
isDeploymentWithoutApproval={triggerDetails.isDeploymentWithoutApproval ?? false}
/>
</Route>
{triggerDetails.stage === 'DEPLOY' && (
Expand Down
5 changes: 4 additions & 1 deletion 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 @@ -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
10 changes: 8 additions & 2 deletions src/Shared/Components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { ReactComponent as ICCaretLeft } from '@IconsV2/ic-caret-left.svg'
import { ReactComponent as ICCd } from '@IconsV2/ic-cd.svg'
import { ReactComponent as ICChatCircleDots } from '@IconsV2/ic-chat-circle-dots.svg'
import { ReactComponent as ICCheck } from '@IconsV2/ic-check.svg'
import { ReactComponent as ICChecks } from '@IconsV2/ic-checks.svg'
import { ReactComponent as ICCiLinked } from '@IconsV2/ic-ci-linked.svg'
import { ReactComponent as ICCiWebhook } from '@IconsV2/ic-ci-webhook.svg'
import { ReactComponent as ICCircleLoader } from '@IconsV2/ic-circle-loader.svg'
Expand Down Expand Up @@ -86,6 +87,8 @@ import { ReactComponent as ICPaperPlaneColor } from '@IconsV2/ic-paper-plane-col
import { ReactComponent as ICPencil } from '@IconsV2/ic-pencil.svg'
import { ReactComponent as ICQuay } from '@IconsV2/ic-quay.svg'
import { ReactComponent as ICQuote } from '@IconsV2/ic-quote.svg'
import { ReactComponent as ICRocketLaunch } from '@IconsV2/ic-rocket-launch.svg'
import { ReactComponent as ICSelected } from '@IconsV2/ic-selected.svg'
import { ReactComponent as ICShieldCheck } from '@IconsV2/ic-shield-check.svg'
import { ReactComponent as ICSortAscending } from '@IconsV2/ic-sort-ascending.svg'
import { ReactComponent as ICSortDescending } from '@IconsV2/ic-sort-descending.svg'
Expand All @@ -96,7 +99,7 @@ import { ReactComponent as ICStamp } from '@IconsV2/ic-stamp.svg'
import { ReactComponent as ICSuccess } from '@IconsV2/ic-success.svg'
import { ReactComponent as ICSuspended } from '@IconsV2/ic-suspended.svg'
import { ReactComponent as ICTata1mg } from '@IconsV2/ic-tata1mg.svg'
import { ReactComponent as ICTimeoutTwoDash } from '@IconsV2/ic-timeout-two-dash.svg'
import { ReactComponent as ICTimeoutDash } from '@IconsV2/ic-timeout-dash.svg'
import { ReactComponent as ICTimer } from '@IconsV2/ic-timer.svg'
import { ReactComponent as ICTravclan } from '@IconsV2/ic-travclan.svg'
import { ReactComponent as ICUnknown } from '@IconsV2/ic-unknown.svg'
Expand Down Expand Up @@ -131,6 +134,7 @@ export const iconMap = {
'ic-cd': ICCd,
'ic-chat-circle-dots': ICChatCircleDots,
'ic-check': ICCheck,
'ic-checks': ICChecks,
'ic-ci-linked': ICCiLinked,
'ic-ci-webhook': ICCiWebhook,
'ic-circle-loader': ICCircleLoader,
Expand Down Expand Up @@ -195,6 +199,8 @@ export const iconMap = {
'ic-pencil': ICPencil,
'ic-quay': ICQuay,
'ic-quote': ICQuote,
'ic-rocket-launch': ICRocketLaunch,
'ic-selected': ICSelected,
'ic-shield-check': ICShieldCheck,
'ic-sort-ascending': ICSortAscending,
'ic-sort-descending': ICSortDescending,
Expand All @@ -205,7 +211,7 @@ export const iconMap = {
'ic-success': ICSuccess,
'ic-suspended': ICSuspended,
'ic-tata1mg': ICTata1mg,
'ic-timeout-two-dash': ICTimeoutTwoDash,
'ic-timeout-dash': ICTimeoutDash,
'ic-timer': ICTimer,
'ic-travclan': ICTravclan,
'ic-unknown': ICUnknown,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const ArtifactInfo = ({
}

return (
<div className="material-history__info flex left fs-13 dc__gap-8">
<div className="material-history__info flex left fs-13 dc__gap-6">
<DeployIcon className="icon-dim-16 scn-6" />
<span className="fs-13 fw-4">{deployedTime}</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/Shared/Components/StatusComponent/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const getIconName = (status: string, showAnimatedIcon: boolean): IconName
return 'ic-hibernate'
case 'timedout':
case 'timed_out':
return 'ic-timeout-two-dash'
return 'ic-timeout-dash'
default:
return null
}
Expand Down
Loading