mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-02-22 22:28:15 +00:00
add tooltips back to icon buttons on model show page
This commit is contained in:
parent
471aa5f0cd
commit
9ffa0f5703
@ -6,6 +6,7 @@ import DialogContent from '@mui/material/DialogContent';
|
||||
import DialogContentText from '@mui/material/DialogContentText';
|
||||
import DialogTitle from '@mui/material/DialogTitle';
|
||||
import { IconButton } from '@mui/material';
|
||||
import SpiffTooltip from './SpiffTooltip';
|
||||
|
||||
type OwnProps = {
|
||||
'data-qa'?: string;
|
||||
@ -78,13 +79,15 @@ export default function ButtonWithConfirmation({
|
||||
if (hasIconOnly) {
|
||||
return (
|
||||
<>
|
||||
<IconButton
|
||||
data-qa={dataQa}
|
||||
onClick={handleShowConfirmationPrompt}
|
||||
aria-label={iconDescription || ''}
|
||||
>
|
||||
{renderIcon}
|
||||
</IconButton>
|
||||
<SpiffTooltip title={iconDescription || ''} placement="top">
|
||||
<IconButton
|
||||
data-qa={dataQa}
|
||||
onClick={handleShowConfirmationPrompt}
|
||||
aria-label={iconDescription || ''}
|
||||
>
|
||||
{renderIcon}
|
||||
</IconButton>
|
||||
</SpiffTooltip>
|
||||
{confirmationDialog()}
|
||||
</>
|
||||
);
|
||||
|
@ -21,6 +21,7 @@ import { PureAbility } from '@casl/ability';
|
||||
import ButtonWithConfirmation from './ButtonWithConfirmation';
|
||||
import ProcessModelTestRun from './ProcessModelTestRun';
|
||||
import { ProcessFile } from '../interfaces';
|
||||
import SpiffTooltip from './SpiffTooltip';
|
||||
|
||||
interface ProcessModelFileListProps {
|
||||
processModel: any;
|
||||
@ -73,29 +74,33 @@ export default function ProcessModelFileList({
|
||||
a={targetUris.processModelFileCreatePath}
|
||||
ability={ability}
|
||||
>
|
||||
<IconButton
|
||||
aria-label={`${actionWord} File`}
|
||||
data-qa={`edit-file-${processModelFile.name.replace('.', '-')}`}
|
||||
href={editUrl}
|
||||
>
|
||||
{icon}
|
||||
</IconButton>
|
||||
<SpiffTooltip title={`${actionWord} File`} placement="top">
|
||||
<IconButton
|
||||
aria-label={`${actionWord} File`}
|
||||
data-qa={`edit-file-${processModelFile.name.replace('.', '-')}`}
|
||||
href={editUrl}
|
||||
>
|
||||
{icon}
|
||||
</IconButton>
|
||||
</SpiffTooltip>
|
||||
</Can>,
|
||||
);
|
||||
}
|
||||
elements.push(
|
||||
<Can I="GET" a={targetUris.processModelFileCreatePath} ability={ability}>
|
||||
<IconButton
|
||||
aria-label="Download File"
|
||||
onClick={() =>
|
||||
window.open(
|
||||
`/${targetUris.processModelFilePath}/${processModelFile.name}`,
|
||||
'_blank',
|
||||
)
|
||||
}
|
||||
>
|
||||
<GetApp />
|
||||
</IconButton>
|
||||
<SpiffTooltip title="Download File" placement="top">
|
||||
<IconButton
|
||||
aria-label="Download File"
|
||||
onClick={() =>
|
||||
window.open(
|
||||
`/${targetUris.processModelFilePath}/${processModelFile.name}`,
|
||||
'_blank',
|
||||
)
|
||||
}
|
||||
>
|
||||
<GetApp />
|
||||
</IconButton>
|
||||
</SpiffTooltip>
|
||||
</Can>,
|
||||
);
|
||||
|
||||
@ -123,12 +128,14 @@ export default function ProcessModelFileList({
|
||||
if (processModelFile.name.match(/\.bpmn$/) && !isPrimaryBpmnFile) {
|
||||
elements.push(
|
||||
<Can I="PUT" a={targetUris.processModelShowPath} ability={ability}>
|
||||
<IconButton
|
||||
aria-label="Set As Primary File"
|
||||
onClick={() => onSetPrimaryFile(processModelFile.name)}
|
||||
>
|
||||
<Favorite />
|
||||
</IconButton>
|
||||
<SpiffTooltip title="Set As Primary File" placement="top">
|
||||
<IconButton
|
||||
aria-label="Set As Primary File"
|
||||
onClick={() => onSetPrimaryFile(processModelFile.name)}
|
||||
>
|
||||
<Favorite />
|
||||
</IconButton>
|
||||
</SpiffTooltip>
|
||||
</Can>,
|
||||
);
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ import {
|
||||
childrenForErrorObject,
|
||||
errorForDisplayFromTestCaseErrorDetails,
|
||||
} from './ErrorDisplay';
|
||||
import SpiffTooltip from './SpiffTooltip';
|
||||
|
||||
type OwnProps = {
|
||||
processModelFile?: ProcessFile;
|
||||
@ -41,23 +42,27 @@ export default function ProcessModelTestRun({
|
||||
if (testCaseResults) {
|
||||
if (testCaseResults.all_passed) {
|
||||
return (
|
||||
<IconButton
|
||||
color="success"
|
||||
aria-label="All BPMN unit tests passed"
|
||||
onClick={() => setShowTestCaseResultsModal(true)}
|
||||
>
|
||||
<CheckCircle />
|
||||
</IconButton>
|
||||
<SpiffTooltip title="All BPMN unit tests passed" placement="top">
|
||||
<IconButton
|
||||
color="success"
|
||||
aria-label="All BPMN unit tests passed"
|
||||
onClick={() => setShowTestCaseResultsModal(true)}
|
||||
>
|
||||
<CheckCircle />
|
||||
</IconButton>
|
||||
</SpiffTooltip>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<IconButton
|
||||
color="error"
|
||||
aria-label="BPMN unit tests failed"
|
||||
onClick={() => setShowTestCaseResultsModal(true)}
|
||||
>
|
||||
<Cancel />
|
||||
</IconButton>
|
||||
<SpiffTooltip title="BPMN unit tests failed" placement="top">
|
||||
<IconButton
|
||||
color="error"
|
||||
aria-label="BPMN unit tests failed"
|
||||
onClick={() => setShowTestCaseResultsModal(true)}
|
||||
>
|
||||
<Cancel />
|
||||
</IconButton>
|
||||
</SpiffTooltip>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
@ -159,13 +164,15 @@ export default function ProcessModelTestRun({
|
||||
|
||||
const buttonElement = () => {
|
||||
return (
|
||||
<IconButton
|
||||
color="primary"
|
||||
aria-label={titleText}
|
||||
onClick={() => onProcessModelTestRun()}
|
||||
>
|
||||
<Rule />
|
||||
</IconButton>
|
||||
<SpiffTooltip title={titleText} placement="top">
|
||||
<IconButton
|
||||
color="primary"
|
||||
aria-label={titleText}
|
||||
onClick={() => onProcessModelTestRun()}
|
||||
>
|
||||
<Rule />
|
||||
</IconButton>
|
||||
</SpiffTooltip>
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -22,6 +22,7 @@ import { Notification } from '../components/Notification';
|
||||
import ProcessModelTestRun from '../components/ProcessModelTestRun';
|
||||
import ProcessModelTabs from '../components/ProcessModelTabs';
|
||||
import ProcessModelFileUploadModal from '../components/ProcessModelFileUploadModal';
|
||||
import SpiffTooltip from '../components/SpiffTooltip';
|
||||
|
||||
export default function ProcessModelShow() {
|
||||
const params = useParams();
|
||||
@ -242,13 +243,15 @@ export default function ProcessModelShow() {
|
||||
Process Model: {processModel.display_name}
|
||||
</Typography>
|
||||
<Can I="PUT" a={targetUris.processModelShowPath} ability={ability}>
|
||||
<IconButton
|
||||
data-qa="edit-process-model-button"
|
||||
component="a"
|
||||
href={`/process-models/${modifiedProcessModelId}/edit`}
|
||||
>
|
||||
<Edit />
|
||||
</IconButton>
|
||||
<SpiffTooltip title="Edit Process Model" placement="top">
|
||||
<IconButton
|
||||
data-qa="edit-process-model-button"
|
||||
component="a"
|
||||
href={`/process-models/${modifiedProcessModelId}/edit`}
|
||||
>
|
||||
<Edit />
|
||||
</IconButton>
|
||||
</SpiffTooltip>
|
||||
</Can>
|
||||
<Can I="DELETE" a={targetUris.processModelShowPath} ability={ability}>
|
||||
<ButtonWithConfirmation
|
||||
|
Loading…
x
Reference in New Issue
Block a user