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

Deprecate an entity #4633

Conversation

Ankit-Keshari-Vituity
Copy link
Contributor

Added a button to "deprecate" an entity from inside of the UI from the following entity profile page: dataset, chart, dashboard, data flow, data job, container, glossary term

deprecate_entity

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions
Copy link

github-actions bot commented Apr 11, 2022

Unit Test Results (build & test)

  96 files    96 suites   22m 38s ⏱️
689 tests 630 ✔️ 59 💤 0

Results for commit b6bb39e.

♻️ This comment has been updated with latest results.


return (
<Modal
title="Add Deprecation Data"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: Let's change to "Deprecation Details"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done and Committed.

refetch?: () => Promise<any>;
};

export const AddDeprecatedDataModal = ({ urn, visible, onClose, refetch }: Props) => {
Copy link
Collaborator

@jjoyce0510 jjoyce0510 Apr 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: Let's change name to "AddDeprecationDetailsModal"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done and Committed.

Cancel
</Button>
<Button form="addDeprecationForm" key="submit" htmlType="submit">
Add
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: let's rename this to "Ok"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done and Committed.

onClose();
};

const handleAdd = async (formData: any) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: let's rename to handleOk

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done and Committed.

<Form.Item name="note" label="Note">
<Input placeholder="Add Note" autoFocus />
</Form.Item>
<Form.Item name="decommissionTime" label="Decommission Time">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: Decomission Date

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done and Committed.

/>
</Tooltip>
</HeaderContainer>
{entityData?.deprecation?.deprecated && entityData?.deprecation?.decommissionTime !== null && (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: Let's put this condition in a variable above^^ (line 227) that is called "isDeprecated" --> I think we can also remove the && entityData?.deprecation?.decommissionTime !== null

Copy link
Contributor Author

@Ankit-Keshari-Vituity Ankit-Keshari-Vituity Apr 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the logic and committed

/>
</Tooltip>
</HeaderContainer>
{entityData?.deprecation?.deprecated &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets do this. above create a new variable

const hasDetails = (entityData?.deprecation?.note !== '' ||
entityData?.deprecation?.decommissionTime !== null)

then inside the content box we can do this:

!hasDetails && <current line 276-295> || 'No additional details'

then you can get rid of the long conditional on 269, as well as the line 303-310

entityData?.deprecation?.deprecated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed and committed my changes

@jjoyce0510 jjoyce0510 merged commit e572af6 into datahub-project:master Apr 15, 2022
maggiehays pushed a commit to maggiehays/datahub that referenced this pull request Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants