-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix(react): update schema description edit behavior #2718
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
Merged
shirshanka
merged 4 commits into
datahub-project:master
from
topwebtek7:FeatReactEditSchemaDescription
Jun 18, 2021
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
80ba546
fix(react): update schema description edit behavior
topwebtek7 e477e6c
fix(react): update showing add-description button on hover descriptio…
topwebtek7 a724060
fix(react): update descriptionmodal to dont save empty string
topwebtek7 6bb654b
fix(react): fix minor update in schema description
topwebtek7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
fix(react): update schema description edit behavior
- Loading branch information
commit 80ba5469e86a2bcb21992b1961503abd9d49823a
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,4 +1,5 @@ | ||||||
| import { Typography, message } from 'antd'; | ||||||
| import { Typography, message, Tag } from 'antd'; | ||||||
| import { EditOutlined } from '@ant-design/icons'; | ||||||
| import React, { useState } from 'react'; | ||||||
| import styled from 'styled-components'; | ||||||
| import { FetchResult } from '@apollo/client'; | ||||||
|
|
@@ -7,10 +8,23 @@ import { UpdateDatasetMutation } from '../../../../../graphql/dataset.generated' | |||||
| import UpdateDescriptionModal from '../../../shared/DescriptionModal'; | ||||||
| import MarkdownViewer from '../../../shared/MarkdownViewer'; | ||||||
|
|
||||||
| const EditIcon = styled(EditOutlined)` | ||||||
| cursor: pointer; | ||||||
| padding: 2px; | ||||||
| margin-left: 8px; | ||||||
| display: none; | ||||||
| `; | ||||||
|
|
||||||
| const DescriptionContainer = styled.div` | ||||||
| position: relative; | ||||||
| display: flex; | ||||||
| flex-direction: row; | ||||||
| width: 100%; | ||||||
| height: 100%; | ||||||
| min-height: 22px; | ||||||
| &:hover ${EditIcon} { | ||||||
| display: block; | ||||||
| } | ||||||
| `; | ||||||
|
|
||||||
| const DescriptionText = styled(MarkdownViewer)` | ||||||
|
|
@@ -25,6 +39,10 @@ const EditedLabel = styled(Typography.Text)` | |||||
| font-style: italic; | ||||||
| `; | ||||||
|
|
||||||
| const AddNewDescription = styled(Tag)` | ||||||
| cursor: pointer; | ||||||
| `; | ||||||
|
|
||||||
| type Props = { | ||||||
| description: string; | ||||||
| updatedDescription?: string | null; | ||||||
|
|
@@ -37,11 +55,18 @@ export default function DescriptionField({ description, updatedDescription, onUp | |||||
| const [showAddModal, setShowAddModal] = useState(false); | ||||||
|
|
||||||
| const onCloseModal = () => setShowAddModal(false); | ||||||
| const currentDesc: string = !!updatedDescription || updatedDescription === '' ? updatedDescription : description; | ||||||
|
||||||
| const currentDesc: string = !!updatedDescription || updatedDescription === '' ? updatedDescription : description; | |
| const currentDesc: string = !!updatedDescription ? updatedDescription : description; |
since we aren't supporting saving blank descriptions anyway?
topwebtek7 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
topwebtek7 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
topwebtek7 marked this conversation as resolved.
Show resolved
Hide resolved
topwebtek7 marked this conversation as resolved.
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is difficult to parse. What is happening here?