some minor chnages to prepare for chnaging actions dropdown to buttons

This commit is contained in:
jasquat 2022-11-08 09:50:58 -05:00
parent fa0e3d9933
commit 691e785433
2 changed files with 26 additions and 4 deletions

View File

@ -8,6 +8,10 @@ type OwnProps = {
onConfirmation: (..._args: any[]) => any; onConfirmation: (..._args: any[]) => any;
title?: string; title?: string;
confirmButtonLabel?: string; confirmButtonLabel?: string;
kind?: string;
renderIcon?: boolean | null;
iconDescription?: string | null;
hasIconOnly?: boolean;
}; };
export default function ButtonWithConfirmation({ export default function ButtonWithConfirmation({
@ -16,6 +20,10 @@ export default function ButtonWithConfirmation({
onConfirmation, onConfirmation,
title = 'Are you sure?', title = 'Are you sure?',
confirmButtonLabel = 'OK', confirmButtonLabel = 'OK',
kind = 'danger',
renderIcon = null,
iconDescription = null,
hasIconOnly = false,
}: OwnProps) { }: OwnProps) {
const [showConfirmationPrompt, setShowConfirmationPrompt] = useState(false); const [showConfirmationPrompt, setShowConfirmationPrompt] = useState(false);
@ -49,7 +57,13 @@ export default function ButtonWithConfirmation({
return ( return (
<> <>
<Button onClick={handleShowConfirmationPrompt} kind="danger"> <Button
onClick={handleShowConfirmationPrompt}
kind={kind}
renderIcon={renderIcon}
iconDescription={iconDescription}
hasIconOnly={hasIconOnly}
>
{buttonLabel} {buttonLabel}
</Button> </Button>
{confirmationDialog()} {confirmationDialog()}

View File

@ -211,7 +211,7 @@ export default function ProcessModelShow() {
let actionDropDirection = 'bottom'; let actionDropDirection = 'bottom';
if (index + 1 === processModel.files.length) { if (index + 1 === processModel.files.length) {
actionDropDirection = 'top'; actionDropDirection = 'bottom';
} }
// The dropdown will get covered up if it extends passed the table container. // The dropdown will get covered up if it extends passed the table container.
@ -401,6 +401,13 @@ export default function ProcessModelShow() {
> >
Upload File Upload File
</Button> </Button>
<Button
renderIcon={Add}
href={`/admin/process-models/${processModel.process_group_id}/${processModel.id}/files?file_type=bpmn`}
size="sm"
>
New BPMN File
</Button>
<Button <Button
renderIcon={Add} renderIcon={Add}
href={`/admin/process-models/${processModel.process_group_id}/${processModel.id}/files?file_type=dmn`} href={`/admin/process-models/${processModel.process_group_id}/${processModel.id}/files?file_type=dmn`}
@ -433,6 +440,7 @@ export default function ProcessModelShow() {
if (processModel) { if (processModel) {
return ( return (
<> <>
{fileUploadModal()}
<ProcessBreadcrumb <ProcessBreadcrumb
processGroupId={processModel.process_group_id} processGroupId={processModel.process_group_id}
processModelId={processModel.id} processModelId={processModel.id}
@ -450,9 +458,9 @@ export default function ProcessModelShow() {
Edit process model Edit process model
</Button> </Button>
</Stack> </Stack>
{fileUploadModal()}
{processInstanceResultTag()}
<br /> <br />
<br />
{processInstanceResultTag()}
{processModelButtons()} {processModelButtons()}
<br /> <br />
<br /> <br />