Can now decide whether to aloow wordwrapping or not
This commit is contained in:
parent
b9af3e482b
commit
7ee7776c78
@ -9,3 +9,29 @@
|
|||||||
.fit-content-width {
|
.fit-content-width {
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.task-name-display-panel {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.35rem;
|
||||||
|
width: 100%;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.task-name-display-panel__name {
|
||||||
|
flex: 1;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.task-name-display-panel--wrap {
|
||||||
|
white-space: normal;
|
||||||
|
|
||||||
|
.task-name-display-panel__name {
|
||||||
|
overflow: visible;
|
||||||
|
text-overflow: clip;
|
||||||
|
white-space: normal;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -10,11 +10,13 @@ import ValidationErrorIcon from "../../../../components/validationErrorIcon";
|
|||||||
export interface TaskNameDisplayPanel {
|
export interface TaskNameDisplayPanel {
|
||||||
task: TaskDefinition;
|
task: TaskDefinition;
|
||||||
showValidationErrorIcon: boolean;
|
showValidationErrorIcon: boolean;
|
||||||
|
allowWordWrap?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const TaskNameDisplayPanel: React.FC<TaskNameDisplayPanel> = ({
|
const TaskNameDisplayPanel: React.FC<TaskNameDisplayPanel> = ({
|
||||||
task,
|
task,
|
||||||
showValidationErrorIcon = false,
|
showValidationErrorIcon = false,
|
||||||
|
allowWordWrap = false,
|
||||||
}) => {
|
}) => {
|
||||||
const [tasksMetadata, setTasksMetadata] = React.useState<TaskMetadata[]>([]);
|
const [tasksMetadata, setTasksMetadata] = React.useState<TaskMetadata[]>([]);
|
||||||
|
|
||||||
@ -36,11 +38,16 @@ const TaskNameDisplayPanel: React.FC<TaskNameDisplayPanel> = ({
|
|||||||
}, [tasksMetadata]);
|
}, [tasksMetadata]);
|
||||||
|
|
||||||
const meta = taskMetadataByType.get(task.type);
|
const meta = taskMetadataByType.get(task.type);
|
||||||
|
const panelClassName = allowWordWrap
|
||||||
|
? "task-name-display-panel task-name-display-panel--wrap"
|
||||||
|
: "task-name-display-panel";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className={panelClassName}>
|
||||||
<FontAwesomeStringIcon icon={meta?.icon} />
|
<FontAwesomeStringIcon icon={meta?.icon} />
|
||||||
{task.config.name as string}
|
<span className="task-name-display-panel__name">
|
||||||
|
{task.config.name as string}
|
||||||
|
</span>
|
||||||
{<ValidationErrorIcon visible={showValidationErrorIcon} />}
|
{<ValidationErrorIcon visible={showValidationErrorIcon} />}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -690,6 +690,7 @@ const VisualiserTab: React.FC<VisualiserTabProps> = ({
|
|||||||
showValidationErrorIcon={
|
showValidationErrorIcon={
|
||||||
taskValidation[guid] === false
|
taskValidation[guid] === false
|
||||||
}
|
}
|
||||||
|
allowWordWrap={true}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user