Skip to content

Commit

Permalink
Splitting into sections and adding validation
Browse files Browse the repository at this point in the history
  • Loading branch information
fisjac committed Nov 22, 2023
1 parent 76177ef commit 413a2b1
Show file tree
Hide file tree
Showing 4 changed files with 422 additions and 203 deletions.
8 changes: 4 additions & 4 deletions superset-frontend/src/components/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
import React, { Children, ReactElement } from 'react';
import { kebabCase } from 'lodash';
import React, { Children, ReactElement, ReactNode } from 'react';
// import { kebabCase } from 'lodash';
import { mix } from 'polished';
import cx from 'classnames';
import { AntdButton } from 'src/components';
Expand All @@ -43,7 +43,7 @@ export type ButtonSize = 'default' | 'small' | 'xsmall';

export type ButtonProps = Omit<AntdButtonProps, 'css'> &
Pick<TooltipProps, 'placement'> & {
tooltip?: string;
tooltip?: ReactNode;
className?: string;
buttonSize?: ButtonSize;
buttonStyle?: ButtonStyle;
Expand Down Expand Up @@ -209,7 +209,7 @@ export default function Button(props: ButtonProps) {
return (
<Tooltip
placement={placement}
id={`${kebabCase(tooltip)}-tooltip`}
// id={`${kebabCase(tooltip)}-tooltip`}
title={tooltip}
>
{/* wrap the button in a span so that the tooltip shows up
Expand Down
3 changes: 3 additions & 0 deletions superset-frontend/src/components/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export interface ModalProps {
className?: string;
children: ReactNode;
disablePrimaryButton?: boolean;
primaryTooltipMessage?: ReactNode;
primaryButtonLoading?: boolean;
onHide: () => void;
onHandledPrimaryAction?: () => void;
Expand Down Expand Up @@ -232,6 +233,7 @@ const defaultResizableConfig = (hideFooter: boolean | undefined) => ({
const CustomModal = ({
children,
disablePrimaryButton = false,
primaryTooltipMessage,
primaryButtonLoading = false,
onHide,
onHandledPrimaryAction,
Expand Down Expand Up @@ -272,6 +274,7 @@ const CustomModal = ({
key="submit"
buttonStyle={primaryButtonType}
disabled={disablePrimaryButton}
tooltip={primaryTooltipMessage}
loading={primaryButtonLoading}
onClick={onHandledPrimaryAction}
cta
Expand Down
Loading

0 comments on commit 413a2b1

Please sign in to comment.