Skip to content

Commit 5761bdc

Browse files
committed
Merge branch 'develop' into feat/build-infra-v2
2 parents 51872be + 4aa8d7f commit 5761bdc

File tree

21 files changed

+222
-15
lines changed

21 files changed

+222
-15
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": "1.3.2-beta-2",
3+
"version": "1.3.6",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Assets/Sounds/DeployAudio.mp3

37.6 KB
Binary file not shown.

src/Common/CIPipeline.Types.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,11 @@ export interface DockerConfigOverrideType {
259259
ciBuildConfig: CIBuildConfigType
260260
}
261261

262+
export enum WORKFLOW_CACHE_CONFIG_ENUM {
263+
INHERIT = 'INHERIT',
264+
OVERRIDE = 'OVERRIDE',
265+
}
266+
262267
export interface FormType {
263268
name: string
264269
args: { key: string; value: string }[]
@@ -291,6 +296,11 @@ export interface FormType {
291296
isDockerConfigOverridden?: boolean
292297
dockerConfigOverride?: DockerConfigOverrideType
293298
isOffendingMandatoryPlugin?: boolean
299+
workflowCacheConfig?: {
300+
type: WORKFLOW_CACHE_CONFIG_ENUM
301+
value: boolean
302+
globalValue: boolean
303+
}
294304
}
295305

296306
export interface ErrorObj {

src/Common/Helper.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
ZERO_TIME_STRING,
3333
TOAST_ACCESS_DENIED,
3434
UNCHANGED_ARRAY_ELEMENT_SYMBOL,
35+
DATE_TIME_FORMATS,
3536
} from './Constants'
3637
import { ServerErrors } from './ServerError'
3738
import { AsyncOptions, AsyncState, DeploymentNodeType, UseSearchString } from './Types'
@@ -233,6 +234,9 @@ export function handleUTCTime(ts: string, isRelativeTime = false) {
233234
return timestamp
234235
}
235236

237+
export const getFormattedUTCTimeForExport = (timeToConvert: string, fallback = '-') =>
238+
timeToConvert ? `${moment(timeToConvert).utc().format(DATE_TIME_FORMATS.TWELVE_HOURS_EXPORT_FORMAT)} (UTC)` : '-'
239+
236240
export function useSearchString(): UseSearchString {
237241
const location = useLocation()
238242
const queryParams: URLSearchParams = useMemo(() => {

src/Common/RJSF/widgets/Checkbox.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import React, { ChangeEvent } from 'react'
1818
import { WidgetProps } from '@rjsf/utils'
1919
import Toggle from '../../Toggle/Toggle'
20+
import { isNullOrUndefined } from '@Shared/Helpers'
2021

2122
export const Checkbox = ({
2223
id,
@@ -38,7 +39,7 @@ export const Checkbox = ({
3839
}
3940
}
4041

41-
const isSelected: boolean = typeof value === 'undefined' ? false : value
42+
const isSelected: boolean = isNullOrUndefined(value) ? false : value
4243

4344
return (
4445
<div>

src/Common/Toggle/Toggle.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,20 @@ input:focus + .toggle__slider {
119119
background-color: var(--N0);
120120
}
121121
}
122+
123+
&--h20 {
124+
.toggle__slider {
125+
&.with-icon svg {
126+
height: 18px;
127+
width: 18px;
128+
padding: 2px;
129+
}
130+
}
131+
132+
input:checked + .toggle__slider {
133+
&.with-icon svg {
134+
left: -10px;
135+
}
136+
}
137+
}
122138
}

src/Pages/GlobalConfigurations/Authorization/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
export * from './constants'
1818
export type { UserListFilterParams, UserRoleGroup, UserGroupDTO, UserGroupType } from './types'
19+
export { UserTypeToFetchType } from './types'
1920
export * from './shared'
2021
export * from './service'
2122
export { getUserAndApiTokenOption } from './utils'

src/Pages/GlobalConfigurations/Authorization/types.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,18 @@
1717
import { BaseFilterQueryParams } from '../../../Shared'
1818
import { UserListSortableKeys, UserStatus } from './constants'
1919

20+
export enum UserTypeToFetchType {
21+
includeDeleted = 'includeDeleted',
22+
excludeDelete = 'excludeDelete',
23+
onlyDeleted = 'onlyDeleted',
24+
}
25+
2026
export type UserListFilterParams = BaseFilterQueryParams<UserListSortableKeys> & {
2127
/**
2228
* Selected statuses (if any)
2329
*/
2430
status: UserStatus[]
31+
typeToFetch?: UserTypeToFetchType
2532
}
2633

2734
export interface UserMinType {
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import { motion } from 'framer-motion'
2+
import { ReactComponent as ICDeploy } from '@Icons/ic-nav-rocket.svg'
3+
import { ComponentSizeType } from '@Shared/constants'
4+
import { SyntheticEvent, useEffect, useRef, useState } from 'react'
5+
import DeployAudio from '@Sounds/DeployAudio.mp3'
6+
import { Button } from '../Button'
7+
import './animatedDeployButton.scss'
8+
import { AnimatedDeployButtonProps } from './types'
9+
10+
const AnimatedDeployButton = ({ isVirtualEnvironment, onButtonClick }: AnimatedDeployButtonProps) => {
11+
const audioRef = useRef<HTMLAudioElement>(null)
12+
const timeoutRef = useRef<ReturnType<typeof setTimeout>>(null)
13+
const isAudioEnabled: boolean = window._env_.FEATURE_ACTION_AUDIOS_ENABLE
14+
const [clicked, setClicked] = useState<boolean>(false)
15+
const svgMotionVariants = {
16+
hover: {
17+
rotate: 45,
18+
},
19+
}
20+
21+
const handleButtonClick = async (e: SyntheticEvent) => {
22+
if (clicked) {
23+
return
24+
}
25+
if (isAudioEnabled && audioRef.current) {
26+
try {
27+
await audioRef.current.play()
28+
} catch {
29+
// do nothing
30+
}
31+
}
32+
setClicked(true)
33+
timeoutRef.current = setTimeout(() => {
34+
setClicked(false)
35+
onButtonClick(e, false)
36+
}, 700)
37+
}
38+
39+
useEffect(
40+
() => () => {
41+
clearTimeout(timeoutRef.current)
42+
},
43+
[],
44+
)
45+
46+
return (
47+
<motion.div whileHover="hover" className={`${clicked ? 'hide-button-text' : ''}`}>
48+
<Button
49+
dataTestId="cd-trigger-deploy-button"
50+
text={`Deploy${isVirtualEnvironment ? ' to isolated env' : ''}`}
51+
startIcon={
52+
<motion.div
53+
variants={svgMotionVariants}
54+
animate={
55+
clicked
56+
? {
57+
x: 200,
58+
rotate: 45,
59+
transition: {
60+
duration: 0.5,
61+
delay: 0.1,
62+
},
63+
}
64+
: {}
65+
}
66+
>
67+
<ICDeploy className="icon-dim-16" />
68+
</motion.div>
69+
}
70+
size={ComponentSizeType.large}
71+
onClick={handleButtonClick}
72+
/>
73+
{/* Disabling es-lint as captions are not required */}
74+
{/* eslint-disable-next-line jsx-a11y/media-has-caption */}
75+
<audio hidden ref={audioRef} src={DeployAudio} />
76+
</motion.div>
77+
)
78+
}
79+
80+
export default AnimatedDeployButton

0 commit comments

Comments
 (0)