Skip to content

Commit abb54e9

Browse files
authored
Merge branch 'develop' into chore/sync-packet-17
2 parents d61c36b + 730088a commit abb54e9

Some content is hidden

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

51 files changed

+135
-137
lines changed

src/Common/Api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,4 +263,4 @@ export const abortPreviousRequests = <T>(
263263
*/
264264
export const getIsRequestAborted = (error) =>
265265
// The 0 code is common for aborted and blocked requests
266-
error && error.code === 0 && error.message.search('abort\|aborted')
266+
error && error.code === 0 && error.message.search('abort|aborted')

src/Common/AppStatus/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
*/
1616

1717
export { default as AppStatus } from './AppStatus'
18-
export * from './utils'
18+
export * from './utils'

src/Common/ClipboardButton/ClipboardButton.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ 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 = () => {
46+
setCopied(true)
47+
}
4648
const handleEnableTippy = () => setEnableTippy(true)
4749
const handleDisableTippy = () => setEnableTippy(false)
4850
const handleCopyContent = useCallback(
4951
(e?) => {
50-
if(e) stopPropagation(e)
52+
if (e) stopPropagation(e)
5153
copyToClipboard(content, handleTextCopied)
5254
},
5355
[content],

src/Common/Common.service.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,13 @@ export function setImageTags(request, pipelineId: number, artifactId: number) {
8080
return post(`${ROUTES.IMAGE_TAGGING}/${pipelineId}/${artifactId}`, request)
8181
}
8282

83-
const cdMaterialListModal = (artifacts: any[], offset: number, artifactId?: number, artifactStatus?: string, disableDefaultSelection?: boolean) => {
83+
const cdMaterialListModal = (
84+
artifacts: any[],
85+
offset: number,
86+
artifactId?: number,
87+
artifactStatus?: string,
88+
disableDefaultSelection?: boolean,
89+
) => {
8490
if (!artifacts || !artifacts.length) return []
8591

8692
const markFirstSelected = offset === 0
@@ -346,9 +352,7 @@ export function fetchChartTemplateVersions() {
346352
return get(`${ROUTES.DEPLOYMENT_TEMPLATE_LIST}?appId=-1&envId=-1`)
347353
}
348354

349-
export const getDefaultConfig = (): Promise<ResponseType> => {
350-
return get(`${ROUTES.NOTIFIER}/channel/config`)
351-
}
355+
export const getDefaultConfig = (): Promise<ResponseType> => get(`${ROUTES.NOTIFIER}/channel/config`)
352356

353357
export function getEnvironmentListMinPublic(includeAllowedDeploymentTypes?: boolean) {
354358
return get(
@@ -361,13 +365,12 @@ export function getClusterListMin() {
361365
return get(URL)
362366
}
363367

364-
export const getResourceGroupListRaw = (clusterId: string): Promise<ResponseType<ApiResourceType>> => {
365-
return get(`${ROUTES.API_RESOURCE}/${ROUTES.GVK}/${clusterId}`)
366-
}
368+
export const getResourceGroupListRaw = (clusterId: string): Promise<ResponseType<ApiResourceType>> =>
369+
get(`${ROUTES.API_RESOURCE}/${ROUTES.GVK}/${clusterId}`)
367370

368371
export function getNamespaceListMin(clusterIdsCsv: string): Promise<EnvironmentListHelmResponse> {
369-
const URL = `${ROUTES.NAMESPACE}/autocomplete?ids=${clusterIdsCsv}`
370-
return get(URL)
372+
const URL = `${ROUTES.NAMESPACE}/autocomplete?ids=${clusterIdsCsv}`
373+
return get(URL)
371374
}
372375
export function getWebhookEventsForEventId(eventId: string | number) {
373376
const URL = `${ROUTES.GIT_HOST_EVENT}/${eventId}`

src/Common/CustomInput/CustomInput.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ export const CustomInput = ({
135135

136136
{getInputError()}
137137
{helperText && (
138-
<div className="flex left top dc__gap-4 fs-11 lh-16 cn-7 mt-4">
139-
<Info className="icon-dim-16" />
140-
<div>{helperText}</div>
138+
<div className="flex left top dc__gap-4 fs-11 lh-16 cn-7 mt-4">
139+
<Info className="icon-dim-16" />
140+
<div>{helperText}</div>
141141
</div>
142142
)}
143143
</div>

src/Common/DraggableWrapper/DraggableWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default function DraggableWrapper({
3434
parentRef,
3535
boundaryGap = 16,
3636
childDivProps = {},
37-
layoutFixDelta = 0
37+
layoutFixDelta = 0,
3838
}: DraggableWrapperProps) {
3939
const windowSize = useWindowSize()
4040
const nodeRef = useRef<HTMLDivElement>(null)

src/Common/EmptyState/GenericEmptyState.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,7 @@ const GenericEmptyState = ({
8484
>
8585
<div className="flex column dc__gap-8">
8686
<h4 className="title fw-6 cn-9 mt-0 mb-0 lh-24 dc__align-center">{title}</h4>
87-
{subTitle && (
88-
<p className={`subtitle ${isRowLayout ? 'subtitle--text-start' : ''}`}>
89-
{subTitle}
90-
</p>
91-
)}
87+
{subTitle && <p className={`subtitle ${isRowLayout ? 'subtitle--text-start' : ''}`}>{subTitle}</p>}
9288
</div>
9389
{isButtonAvailable && renderButton()}
9490
{children}

src/Common/ErrorPage.tsx

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

17-
import { useHistory } from 'react-router'
17+
import { useHistory } from 'react-router-dom'
1818
import { ERROR_STATUS_CODE, ERROR_EMPTY_SCREEN, ROUTES } from './Constants'
1919
import GenericEmptyState from './EmptyState/GenericEmptyState'
2020
import { ErrorPageType } from './Types'

src/Common/Helper.tsx

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ import { ERROR_EMPTY_SCREEN, SortingOrder, EXCLUDED_FALSY_VALUES, DISCORD_LINK,
2727
import { ServerErrors } from './ServerError'
2828
import { toastAccessDenied } from './ToastBody'
2929
import { AsyncOptions, AsyncState, UseSearchString } from './Types'
30-
import { scrollableInterface } from '../Shared'
31-
import { DATE_TIME_FORMAT_STRING } from '../Shared'
30+
import { scrollableInterface, DATE_TIME_FORMAT_STRING } from '../Shared'
3231
import { ReactComponent as ArrowDown } from '../Assets/Icon/ic-chevron-down.svg'
3332

3433
toast.configure({
@@ -730,8 +729,7 @@ export const powerSetOfSubstringsFromStart = (strings: string[], regex: RegExp)
730729
return _keys
731730
})
732731

733-
export const convertJSONPointerToJSONPath = (pointer: string) =>
734-
pointer.replace(/\//g, '.').replace(/\./, '$.')
732+
export const convertJSONPointerToJSONPath = (pointer: string) => pointer.replace(/\//g, '.').replace(/\./, '$.')
735733

736734
export const flatMapOfJSONPaths = (
737735
paths: string[],
@@ -775,15 +773,16 @@ export const handleRelativeDateSorting = (dateStringA, dateStringB, sortOrder) =
775773

776774
if (isNaN(dateA) && isNaN(dateB)) {
777775
return 0 // Both dates are invalid, consider them equal
778-
} else if (isNaN(dateA)) {
776+
}
777+
if (isNaN(dateA)) {
779778
// dateA is invalid, move it to the end if sorting ASC, otherwise to the beginning
780779
return sortOrder === SortingOrder.ASC ? 1 : -1
781-
} else if (isNaN(dateB)) {
780+
}
781+
if (isNaN(dateB)) {
782782
// dateB is invalid, move it to the end if sorting ASC, otherwise to the beginning
783783
return sortOrder === SortingOrder.ASC ? -1 : 1
784-
} else {
785-
return sortOrder === SortingOrder.ASC ? dateB - dateA : dateA - dateB
786784
}
785+
return sortOrder === SortingOrder.ASC ? dateB - dateA : dateA - dateB
787786
}
788787

789788
/**
@@ -1027,13 +1026,11 @@ export function useKeyDown() {
10271026
return keys
10281027
}
10291028

1030-
export const DropdownIndicator = (props) => {
1031-
return (
1032-
<components.DropdownIndicator {...props}>
1033-
<ArrowDown className="icon-dim-20 icon-n6" />
1034-
</components.DropdownIndicator>
1035-
)
1036-
}
1029+
export const DropdownIndicator = (props) => (
1030+
<components.DropdownIndicator {...props}>
1031+
<ArrowDown className="icon-dim-20 icon-n6" />
1032+
</components.DropdownIndicator>
1033+
)
10371034

10381035
export function mapByKey<T = Map<any, any>>(arr: any[], id: string): T {
10391036
if (!Array.isArray(arr)) {

src/Common/ImageTags.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,14 +280,12 @@ export const ImageTagsContainer = ({
280280
<div className="h-250 fs-13 dc__overflow-scroll p-12">
281281
<div>Image labels allow you to tag container images with readable and relatable labels eg. v1.0.</div>
282282
<ul className="pl-20 mt-8">
283-
<li>
284-
A label can only be added if a workflow has CD pipelines deploying to Production environments.
285-
</li>
283+
<li>A label can only be added if a workflow has CD pipelines deploying to Production environments.</li>
286284
<li>Multiple labels can be added to an image.</li>
287285
<li>Multiple images in an application cannot have the same label.</li>
288286
<li>
289-
Labels cannot be deleted once saved. Although, you can soft delete a label if an unwanted label has been
290-
added.
287+
Labels cannot be deleted once saved. Although, you can soft delete a label if an unwanted label has
288+
been added.
291289
</li>
292290
</ul>
293291
</div>

src/Common/InfoColorBar/InfoColourbar.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const InfoColourBar = ({
3232
linkClass,
3333
internalLink,
3434
styles,
35-
hideIcon = false
35+
hideIcon = false,
3636
}: InfoColourBarType) => {
3737
const renderLink = () => {
3838
if (!linkText) {
@@ -86,9 +86,11 @@ const InfoColourBar = ({
8686
style={styles}
8787
>
8888
<div className={`flex top ${typeof renderActionButton === 'function' ? 'mr-5' : ''}`}>
89-
{!hideIcon && <div className={`icon-dim-${iconSize ?? '20'} mr-10`}>
90-
<Icon className={`icon-dim-${iconSize ?? '20'} ${iconClass || ''} mr-8`} />
91-
</div>}
89+
{!hideIcon && (
90+
<div className={`icon-dim-${iconSize ?? '20'} mr-10`}>
91+
<Icon className={`icon-dim-${iconSize ?? '20'} ${iconClass || ''} mr-8`} />
92+
</div>
93+
)}
9294
<div className={`info-bar-message-wrapper ${linkClass || ''}`}>
9395
<span className={linkText && redirectLink ? 'mr-5' : ''}>{message}</span>
9496
{renderLink()}

src/Common/Markdown/markdown.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,11 @@
6969
line-height: inherit;
7070
word-wrap: normal;
7171
white-space: pre;
72-
border: 0
72+
border: 0;
7373
}
7474
}
7575

76-
7776
a.anchor {
7877
color: var(--N900);
7978
}
80-
}
79+
}

src/Common/Modals/VisibleModal2.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import React, { SyntheticEvent } from 'react'
1818
import ReactDOM from 'react-dom'
1919
import { preventBodyScroll } from '../../Shared'
20-
import { stopPropagation } from '../Helper';
20+
import { stopPropagation } from '../Helper'
2121

2222
export class VisibleModal2 extends React.Component<{ className: string; close?: (e) => void }> {
2323
modalRef = document.getElementById('visible-modal-2')

src/Common/MultiSelectCustomization.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ export const SingleSelectOption = (props) => {
6363
}
6464

6565
/**
66-
* Multi value container
67-
*/
66+
* Multi value container
67+
*/
6868

6969
export const MultiValueContainer = (props) => {
7070
const { children, data, innerProps, selectProps } = props
@@ -77,7 +77,7 @@ export const MultiValueContainer = (props) => {
7777
)
7878
}
7979
/**
80-
*
80+
*
8181
* Multi value container with count
8282
*/
8383
export const MultiValueContainerWithCount = (props: any) => {

src/Common/Pagination/pagination.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
width: 64px;
4747
position: absolute;
4848
bottom: 31px;
49-
background-color: var(--white);;
49+
background-color: var(--white);
5050
}
5151

5252
.select__button {

src/Common/PopupMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const PopupMenu = ({
3333
onToggleCallback = null,
3434
autoClose = false,
3535
autoPosition = false,
36-
shouldPreventDefault = false
36+
shouldPreventDefault = false,
3737
}: PopupMenuType) => {
3838
const [popupPosition, setPopupPosition] = React.useState(null)
3939
const [opacity, setOpacity] = React.useState(0)

src/Common/RJSF/rjsfForm.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
margin-right: 28px;
2121
}
2222

23-
&__field, &__field--error {
23+
&__field,
24+
&__field--error {
2425
grid-template-columns: 250px 1fr;
2526

2627
input.form__input {

src/Common/RJSF/templates/ArrayFieldItemTemplate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const ArrayFieldItemTemplate = ({
3232
return (
3333
<div className="dc__position-rel display-grid rjsf-form-template__array-field-item flex-align-center">
3434
{children}
35-
<div className="dc__position-abs remove-btn__container" style={{ right: "-28px", top: "9px" }}>
35+
<div className="dc__position-abs remove-btn__container" style={{ right: '-28px', top: '9px' }}>
3636
{hasToolbar && hasRemove && (
3737
<RemoveButton
3838
disabled={disabled || readonly}

src/Common/RJSF/templates/ObjectFieldTemplate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
*/
1616

1717
import { ObjectFieldTemplateProps, canExpand, titleId } from '@rjsf/utils'
18+
import { JSONPath } from 'jsonpath-plus'
1819
import { FieldRowWithLabel } from '../common/FieldRow'
1920
import { TitleField } from './TitleField'
2021
import { AddButton } from './ButtonTemplates'
21-
import { JSONPath } from 'jsonpath-plus'
2222
import { RJSFFormSchema } from '../types'
2323

2424
const Field = ({

src/Common/RJSF/templates/TitleField.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@
1717
import { TitleFieldProps } from '@rjsf/utils'
1818
import { Tooltip } from '@Common/Tooltip'
1919

20-
export const TitleField = ({ id, title, required, description }: TitleFieldProps & Partial<Record<'description', string>>) => (
20+
export const TitleField = ({
21+
id,
22+
title,
23+
required,
24+
description,
25+
}: TitleFieldProps & Partial<Record<'description', string>>) => (
2126
<legend className="fs-13 fw-6 cn-9 lh-20 dc__no-border py-9 mb-0" id={id}>
2227
<Tooltip alwaysShowTippyOnHover={!!description} content={description}>
2328
<span className={`${description ? 'text-underline-dashed-300' : ''}`}>{title}</span>

src/Common/RJSF/templates/WrapIfAdditionalTemplate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const WrapIfAdditionalTemplate = ({
5050
/>
5151
</div>
5252
<div>{children}</div>
53-
<div className="dc__position-abs remove-btn__container" style={{ right: "-28px", top: "9px" }}>
53+
<div className="dc__position-abs remove-btn__container" style={{ right: '-28px', top: '9px' }}>
5454
<RemoveButton
5555
disabled={disabled || readonly}
5656
onClick={onDropPropertyClick(label)}

src/Common/RJSF/widgets/Select.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
*/
1616

1717
import React from 'react'
18-
import isEqual from 'lodash/isEqual'
1918
import { WidgetProps } from '@rjsf/utils'
2019
import ReactSelect, { MenuListProps, components } from 'react-select'
2120
import { PLACEHOLDERS } from '../constants'
2221
import { getCommonSelectStyle } from '../utils'
2322

2423
import { ReactComponent as ArrowDown } from '../../../Assets/Icon/ic-chevron-down.svg'
24+
import { deepEqual } from '@Common/Helper'
2525

2626
const commonStyles = getCommonSelectStyle()
2727

@@ -58,8 +58,8 @@ export const Select = (props: WidgetProps) => {
5858

5959
const getOption = (value) =>
6060
multiple
61-
? selectOptions.filter((option) => value.some((val) => isEqual(val, option.value)))
62-
: selectOptions.find((option) => isEqual(value, option.value))
61+
? selectOptions.filter((option) => value.some((val) => deepEqual(val, option.value)))
62+
: selectOptions.find((option) => deepEqual(value, option.value))
6363

6464
return (
6565
<ReactSelect

src/Common/RadioGroup/radioGroup.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@
3434
display: flex;
3535
align-items: center;
3636
}
37-
.radio+.radio {
37+
.radio + .radio {
3838
margin-top: 0;
3939
}
40-
input[type=checkbox] {
40+
input[type='checkbox'] {
4141
display: contents;
4242
overflow: hidden;
4343
max-width: 0px;
4444
height: 0;
4545
opacity: 0;
4646
margin: unset;
4747
}
48-
input+.radio__item-label {
48+
input + .radio__item-label {
4949
padding: 4px 6px;
5050
height: 100%;
5151
width: 100%;
@@ -54,9 +54,9 @@
5454
transition: all 0.5s;
5555
cursor: pointer;
5656
}
57-
input[type=checkbox]:checked+.radio__item-label {
57+
input[type='checkbox']:checked + .radio__item-label {
5858
background: #2c3354;
5959
color: white;
6060
border-radius: 4px;
6161
}
62-
}
62+
}

0 commit comments

Comments
 (0)