mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-02 19:58:59 +00:00
feat(react): update schema table to have fixed description column, set line break with max description width (#2382)
This commit is contained in:
parent
f018dd6f3e
commit
9a48e11b7b
@ -51,6 +51,7 @@ const defaultColumns = [
|
||||
title: 'Field',
|
||||
dataIndex: 'fieldPath',
|
||||
key: 'fieldPath',
|
||||
width: 192,
|
||||
render: (fieldPath: string) => {
|
||||
return <Typography.Text strong>{fieldPath}</Typography.Text>;
|
||||
},
|
||||
@ -153,6 +154,7 @@ export default function SchemaView({ schema, editableSchemaMetadata, updateEdita
|
||||
dataIndex: 'description',
|
||||
key: 'description',
|
||||
render: descriptionRender,
|
||||
width: 900,
|
||||
onCell: (record: SchemaField, rowIndex: number | undefined) => ({
|
||||
onMouseEnter: () => {
|
||||
setDescHoveredIndex(rowIndex);
|
||||
|
||||
@ -8,8 +8,18 @@ import { UpdateDatasetMutation } from '../../../../../graphql/dataset.generated'
|
||||
|
||||
const { TextArea } = Input;
|
||||
|
||||
const DescriptionContainer = styled.div`
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
`;
|
||||
|
||||
const DescriptionText = styled(Typography.Text)`
|
||||
padding-right: 8px;
|
||||
max-width: 600px;
|
||||
display: block;
|
||||
overflow-wrap: break-word;
|
||||
word-wrap: break-word;
|
||||
`;
|
||||
|
||||
const DescriptionTextInModal = styled(Typography.Text)`
|
||||
@ -23,7 +33,6 @@ const FormLabel = styled(Typography.Text)`
|
||||
|
||||
const EditIcon = styled(EditOutlined)`
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
margin-top: 4px;
|
||||
`;
|
||||
|
||||
@ -52,7 +61,7 @@ export default function DescriptionField({ description, updatedDescription, onHo
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<DescriptionContainer>
|
||||
<DescriptionText>{updatedDescription || description}</DescriptionText>
|
||||
{onHover && <EditIcon twoToneColor="#52c41a" onClick={() => setShowAddModal(true)} />}
|
||||
{showAddModal && (
|
||||
@ -95,6 +104,6 @@ export default function DescriptionField({ description, updatedDescription, onHo
|
||||
</Form>
|
||||
</Modal>
|
||||
)}
|
||||
</>
|
||||
</DescriptionContainer>
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user