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

Fix for long action name/description #97

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
26 changes: 24 additions & 2 deletions client/src/components/ActionsFlow.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'reactflow/dist/style.css'

import { Typography } from '@mui/material'
import Box from '@mui/material/Box'
import CircularProgress from '@mui/material/CircularProgress'
import Paper from '@mui/material/Paper'
Expand Down Expand Up @@ -118,6 +119,11 @@ const WhiteBand = ({ data }: { data: INodeData }) => {
typography: 'subtitle2',
fontSize: `${16 * elementsScaleCoef}px`,
lineHeight: 1,
overflow: 'hidden',
textOverflow: 'ellipsis',
display: '-webkit-box',
WebkitLineClamp: '1',
WebkitBoxOrient: 'vertical',
}}
>
{data?.label}
Expand All @@ -128,7 +134,12 @@ const WhiteBand = ({ data }: { data: INodeData }) => {
typography: 'subtitle2',
fontSize: `${11 * elementsScaleCoef}px`,
color: '#667085',
lineHeight: 1.2,
lineHeight: 1,
overflow: 'hidden',
textOverflow: 'ellipsis',
display: '-webkit-box',
WebkitLineClamp: '1',
WebkitBoxOrient: 'vertical',
}}
>
{data?.description}
Expand Down Expand Up @@ -232,7 +243,18 @@ function NodeWrapper({ data }: { data: INodeData }) {
color: '#fff',
}}
>
{data?.label}
<Typography
sx={{
lineHeight: 1,
overflow: 'hidden',
textOverflow: 'ellipsis',
display: '-webkit-box',
WebkitLineClamp: '2',
WebkitBoxOrient: 'vertical',
}}
>
{data?.label}
</Typography>
{data.actionsAmount && (
<Box
className={'actions-pill'}
Expand Down
18 changes: 17 additions & 1 deletion client/src/utils/react-flow-builder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { getCustomisation } from '../utils/page-customisation'
// Coefficient less than 0.51 behaves unpredictably.
// Use coefficient between 0.51 till endless
export const elementsScaleCoef = 1
export const actionWidth = 260 * elementsScaleCoef
export const actionWidth = 300 * elementsScaleCoef
export const actionHeight = 60 * elementsScaleCoef
export const grandFolderGap = 80 * elementsScaleCoef
export const folderLabelHeight = 50 * elementsScaleCoef
Expand All @@ -22,6 +22,22 @@ const layerColorSchemesHSL = [
[346.93, 83.26, 57.84],
[160.47, 68.42, 51.57],
[252.15, 91.86, 66.27],
[214.79, 87.25, 50.78],
[346.93, 83.26, 57.84],
[160.47, 68.42, 51.57],
[252.15, 91.86, 66.27],
[214.79, 87.25, 50.78],
[346.93, 83.26, 57.84],
[160.47, 68.42, 51.57],
[252.15, 91.86, 66.27],
[214.79, 87.25, 50.78],
[346.93, 83.26, 57.84],
[160.47, 68.42, 51.57],
[252.15, 91.86, 66.27],
[214.79, 87.25, 50.78],
[346.93, 83.26, 57.84],
[160.47, 68.42, 51.57],
[252.15, 91.86, 66.27],
]

export const buildNodeColor = ({
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
action:
title: Lorem ipsum dolor sit amet, an nam copiosae principes pertinacia. Ea decore sanctus vel. Ut regione pertinacia vel. Dolorum facilis at vix
description: Lorem ipsum dolor sit amet, an nam copiosae principes pertinacia. Ea decore sanctus vel. Ut regione pertinacia vel. Dolorum facilis at vix
arguments:
- name: arg1
title: Argument 1
description: Some additional info for arg
- name: arg2
title: Argument 2
description: Some additional info for arg
options: # TODO Use json schema. By default string. Do not allow complex data.
- name: opt1
title: Option 1
description: Some additional info for option
image: python:3.7-slim
command: python3 %s
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
action:
title: Lorem ipsum dolor sit amet, an nam copiosae principes pertinacia. Ea decore sanctus vel. Ut regione pertinacia vel. Dolorum facilis at vix
description: Lorem ipsum dolor sit amet, an nam copiosae principes pertinacia. Ea decore sanctus vel. Ut regione pertinacia vel. Dolorum facilis at vix
arguments:
- name: arg1
title: Argument 1
description: Some additional info for arg
- name: arg2
title: Argument 2
description: Some additional info for arg
options: # TODO Use json schema. By default string. Do not allow complex data.
- name: opt1
title: Option 1
description: Some additional info for option
image: python:3.7-slim
command: python3 %s