From f8f492130d208c93f7a48b7ee5219cfd959d4491 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 1 Jun 2021 23:16:38 +0800 Subject: [PATCH 01/21] fix(react): update autocomplete ui --- datahub-web-react/src/app/search/SearchBar.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/datahub-web-react/src/app/search/SearchBar.tsx b/datahub-web-react/src/app/search/SearchBar.tsx index 117c6ba6e06dd1..ac8f1858845a5b 100644 --- a/datahub-web-react/src/app/search/SearchBar.tsx +++ b/datahub-web-react/src/app/search/SearchBar.tsx @@ -23,9 +23,9 @@ const ExploreForEntity = styled.span` font-size: 11px; `; -const styles = { - autoComplete: { width: 650 }, -}; +const StyledAutoComplete = styled(AutoComplete)` + width: 650px; +`; const renderItem = (suggestion: string, icon: JSX.Element, type: string) => ({ value: suggestion, @@ -91,14 +91,15 @@ export const SearchBar = ({ return (
- onSearch(filterSearchQuery(value), option.type)} onSearch={(value: string) => onQueryChange(value)} defaultValue={initialQuery || undefined} value={selected} onChange={(v) => setSelected(filterSearchQuery(v))} + dropdownStyle={{ maxHeight: 1000, overflowY: 'visible' }} > setSearchQuery(e.target.value)} data-testid="search-input" /> - +
); }; From a58a860af446f0b92240055074b2d5f574d3741c Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 2 Jun 2021 01:51:13 +0800 Subject: [PATCH 02/21] feat(react): add markdown deps, fix schema description --- datahub-web-react/package.json | 1 + .../entity/dataset/profile/schema/Schema.tsx | 2 - .../profile/schema/SchemaDescriptionField.tsx | 91 +++-- datahub-web-react/yarn.lock | 354 +++++++++++++++++- 4 files changed, 402 insertions(+), 46 deletions(-) diff --git a/datahub-web-react/package.json b/datahub-web-react/package.json index dafc2d949fec6f..06d634b8eef275 100644 --- a/datahub-web-react/package.json +++ b/datahub-web-react/package.json @@ -25,6 +25,7 @@ "@types/react-dom": "^17.0.0", "@types/react-router": "^5.1.8", "@types/react-router-dom": "^5.1.6", + "@uiw/react-md-editor": "^3.3.4", "@visx/drag": "^1.7.0", "@visx/responsive": "^1.7.0", "@vx/axis": "^0.0.199", diff --git a/datahub-web-react/src/app/entity/dataset/profile/schema/Schema.tsx b/datahub-web-react/src/app/entity/dataset/profile/schema/Schema.tsx index a992143fbc05c1..bf871b44263492 100644 --- a/datahub-web-react/src/app/entity/dataset/profile/schema/Schema.tsx +++ b/datahub-web-react/src/app/entity/dataset/profile/schema/Schema.tsx @@ -291,8 +291,6 @@ export default function SchemaView({ urn, schema, editableSchemaMetadata, update dataSource={rows} rowKey="fieldPath" expandable={{ defaultExpandAllRows: true, expandRowByClick: true }} - defaultExpandAllRows - expandRowByClick pagination={false} /> ) diff --git a/datahub-web-react/src/app/entity/dataset/profile/schema/SchemaDescriptionField.tsx b/datahub-web-react/src/app/entity/dataset/profile/schema/SchemaDescriptionField.tsx index 5363157533a5d2..ccb72e6c602413 100644 --- a/datahub-web-react/src/app/entity/dataset/profile/schema/SchemaDescriptionField.tsx +++ b/datahub-web-react/src/app/entity/dataset/profile/schema/SchemaDescriptionField.tsx @@ -69,46 +69,63 @@ export default function DescriptionField({ description, updatedDescription, onHo return ( {updatedDescription || description} - {onHover && setShowAddModal(true)} />} + {onHover && ( + { + e.preventDefault(); + e.stopPropagation(); + setShowAddModal(true); + }} + /> + )} {showAddModal && ( - - - - - } +
{ + e.preventDefault(); + e.stopPropagation(); + }} + aria-hidden="true" > -
- {(updatedDescription || description) && ( - Original:}> - {description} + + + + + } + > + + {(updatedDescription || description) && ( + Original:}> + {description} + + )} + Updated:}> +