Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Validation into Alerts&Reports Modal #26108

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading