Skip to content

Commit 40f5100

Browse files
committed
feat: PopUpMenu - add support to disable close, CIPipeline - udate types
1 parent 539b058 commit 40f5100

File tree

5 files changed

+21
-19
lines changed

5 files changed

+21
-19
lines changed

src/Common/CIPipeline.Types.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ export interface ConstraintType {
107107
}
108108

109109
export interface ValueConstraintType {
110-
choices: string[]
111-
blockCustomValue: boolean
112-
constraint: ConstraintType
110+
choices?: string[]
111+
blockCustomValue?: boolean
112+
constraint?: ConstraintType
113113
}
114114

115115
export enum VariableTypeFormat {
@@ -134,9 +134,9 @@ export interface VariableType {
134134
refVariableStage?: RefVariableStageType
135135
variableStepIndexInPlugin?: number
136136
fileMountDir: string
137-
fileReferenceId: number
138-
valueConstraintId: number
139-
valueConstraint: ValueConstraintType
137+
fileReferenceId?: number
138+
valueConstraintId?: number
139+
valueConstraint?: ValueConstraintType
140140
isRuntimeArg: boolean
141141
refVariableUsed: boolean
142142
}

src/Common/PopupMenu.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const PopupMenu = ({
3434
autoClose = false,
3535
autoPosition = false,
3636
shouldPreventDefault = false,
37+
disableClose,
3738
}: PopupMenuType) => {
3839
const [popupPosition, setPopupPosition] = React.useState(null)
3940
const [opacity, setOpacity] = React.useState(0)
@@ -114,7 +115,7 @@ const PopupMenu = ({
114115
}
115116

116117
const handleClose = (e, inOrOut) => {
117-
if (autoClose || inOrOut === 'out') {
118+
if (!disableClose && (autoClose || inOrOut === 'out')) {
118119
if (observer && observer.current && observer.current.disconnect) observer.current.disconnect()
119120
setOpacity(0)
120121
setPopupPosition(null)

src/Common/Types.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
1616

1717
import React, { ReactNode, CSSProperties, ReactElement, MutableRefObject } from 'react'
1818
import { TippyProps } from '@tippyjs/react'
@@ -288,6 +288,7 @@ export interface PopupMenuType {
288288
autoClose?: boolean
289289
autoPosition?: boolean
290290
shouldPreventDefault?: boolean
291+
disableClose?: boolean
291292
}
292293

293294
export interface PopupMenuButtonType {

src/Shared/Components/DynamicDataTable/DynamicDataTableRow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export const DynamicDataTableRow = <K extends string, CustomStateType = Record<s
181181
)
182182
case DynamicDataTableRowDataType.FILE_UPLOAD:
183183
return (
184-
<div className={`w-100 h-100 flex top left px-8 min-w-0 ${row.data[key].value ? 'py-3' : 'py-8'}`}>
184+
<div className={`w-100 h-100 flex top left px-8 ${row.data[key].value ? 'py-3' : 'py-8'}`}>
185185
<FileUpload
186186
{...row.data[key].props}
187187
fileName={row.data[key].value}

src/Shared/Components/FileUpload/FileUpload.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ export const FileUpload = ({ label, fileName = '', multiple = false, fileTypes =
2323
}
2424

2525
return (
26-
<div>
26+
<div className="mw-none">
2727
{fileName ? (
2828
<div className="dc__border br-4 dc__overflow-hidden flexbox">
29-
<div className="flexbox dc__align-items-center dc__gap-8 px-8 py-4 min-w-0">
29+
<div className="flexbox dc__align-items-center dc__gap-8 px-8 py-4 mw-none">
3030
<ICCloudUpload className="icon-dim-16 dc__no-shrink" />
3131
<Tooltip content={fileName}>
3232
<span className="fs-12 lh-20 dc__ellipsis-right">{fileName}</span>

0 commit comments

Comments
 (0)