From adcc541cc28ae87975d266c87112c5e76553d8ca Mon Sep 17 00:00:00 2001 From: Harshil Sharma Date: Thu, 19 Jan 2023 15:11:02 +0530 Subject: [PATCH] Added ActionDialog for dialog with two default action buttons --- webapp/i18n/en.json | 4 +++- .../statusProperty/categoryConfigrationDialog.scss | 1 - .../statusProperty/categoryConfigrationDialog.tsx | 5 +++-- webapp/src/widgets/buttons/button.tsx | 7 +++++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/webapp/i18n/en.json b/webapp/i18n/en.json index 2404b0d38..88e79dd08 100644 --- a/webapp/i18n/en.json +++ b/webapp/i18n/en.json @@ -446,5 +446,7 @@ "tutorial_tip.out": "Opt out of these tips.", "tutorial_tip.seen": "Seen this before?", "statusProperty.configDialog.title": "Edit Statuses", - "statusProperty.configDialog.subTitle": "Categorise your status values to represent what each value represents" + "statusProperty.configDialog.subTitle": "Categorise your status values to represent what each value represents", + "generic.cancel": "Cancel", + "generic.save": "Save" } \ No newline at end of file diff --git a/webapp/src/components/standardProperties/statusProperty/categoryConfigrationDialog.scss b/webapp/src/components/standardProperties/statusProperty/categoryConfigrationDialog.scss index b8a4ac245..d854968b7 100644 --- a/webapp/src/components/standardProperties/statusProperty/categoryConfigrationDialog.scss +++ b/webapp/src/components/standardProperties/statusProperty/categoryConfigrationDialog.scss @@ -4,7 +4,6 @@ width: 832px; height: 540px; padding: 0 32px; - padding-bottom: 24px; } } diff --git a/webapp/src/components/standardProperties/statusProperty/categoryConfigrationDialog.tsx b/webapp/src/components/standardProperties/statusProperty/categoryConfigrationDialog.tsx index babb94b67..27cfb2cef 100644 --- a/webapp/src/components/standardProperties/statusProperty/categoryConfigrationDialog.tsx +++ b/webapp/src/components/standardProperties/statusProperty/categoryConfigrationDialog.tsx @@ -12,6 +12,7 @@ import InfoIcon from '../../../widgets/icons/info' import Dialog from '../../dialog' import './categoryConfigrationDialog.scss' +import ActionDialog from '../../actionDialog/actionDialog' export type StatusCategory = { id: string @@ -31,7 +32,7 @@ const StatusPropertyConfigrationDialog = (props: Props): JSX.Element => { /> ) return ( - { ) })} - + ) } diff --git a/webapp/src/widgets/buttons/button.tsx b/webapp/src/widgets/buttons/button.tsx index b9ca3addc..21c9f3eba 100644 --- a/webapp/src/widgets/buttons/button.tsx +++ b/webapp/src/widgets/buttons/button.tsx @@ -5,6 +5,9 @@ import React from 'react' import './button.scss' import {Utils} from '../../utils' +export type ButtonSize = 'xsmall' | 'small' | 'medium' | 'large' +export type Emphasis = 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'gray' | 'danger' | 'default' | 'link' + type Props = { onClick?: (e: React.MouseEvent) => void onMouseOver?: (e: React.MouseEvent) => void @@ -16,8 +19,8 @@ type Props = { filled?: boolean active?: boolean submit?: boolean - emphasis?: string - size?: string + emphasis?: Emphasis + size?: ButtonSize danger?: boolean className?: string rightIcon?: boolean