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(ui)#12833: soft delete service and edit action restrictions after soft delete #13824

Merged
merged 29 commits into from
Nov 10, 2023

Conversation

aniketkatkar97
Copy link
Member

@aniketkatkar97 aniketkatkar97 commented Nov 2, 2023

Describe your changes:

Fixes #12833

I worked on adding edit action checks for soft-deleted entities for the following entities:

  • Services
  • Databases
  • Database Schemas
  • Tables
  • Topics
  • Dashboards
  • Pipelines
  • Containers
  • MlModels
  • Search Indices
  • Stored Procedures
  • Dashboard Data Modals
Screen.Recording.2023-11-09.at.7.34.57.PM.mov
  • Teams
Screen.Recording.2023-11-09.at.7.42.39.PM.mov

Type of change:

  • Bug fix

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

@aniketkatkar97 aniketkatkar97 added the UI UI specific issues label Nov 2, 2023
@aniketkatkar97 aniketkatkar97 self-assigned this Nov 2, 2023
@github-actions github-actions bot added the safe to test Add this label to run secure Github workflows on PRs label Nov 2, 2023
Copy link
Contributor

github-actions bot commented Nov 2, 2023

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 48%
48.87% (23586/48265) 30.64% (8873/28962) 30.39% (2682/8825)

@aniketkatkar97 aniketkatkar97 marked this pull request as ready for review November 9, 2023 14:22
@harshach
Copy link
Collaborator

harshach commented Nov 9, 2023

@aniketkatkar97 can we add cypress tests for this

@aniketkatkar97
Copy link
Member Author

@harshach Yes the tests are almost done. I will raise a separate PR for it.

@aniketkatkar97 aniketkatkar97 marked this pull request as draft November 10, 2023 06:16
const tasksDAGView = useMemo(
() =>
!isEmpty(pipelineDetails.tasks) && !isUndefined(pipelineDetails.tasks) ? (
<Card headStyle={{ background: '#fafafa' }} title={t('label.dag-view')}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we avoid inline staying?

/>
</Space>
</Col>
{!currentTeam.deleted && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
{!currentTeam.deleted && (
{!isTeamDeleted && (

<Input
autoComplete="off"
data-testid="confirmation-text-input"
disabled={entityDeleteState.loading === 'waiting'}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we use autoFocus prop to make it focus instead manual code?

@@ -126,7 +126,7 @@ const CustomEntityDetailV1 = () => {
setIsButtonLoading(false);
}
},
[selectedEntityTypeDetail.id]
[selectedEntityTypeDetail]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why we change this? Can you add details of it?

Copy link
Member Author

Choose a reason for hiding this comment

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

So we are using selectedEntityTypeDetail, as well inside the function, and the other data was not updating due to the specified dependancy

getDatabaseSchemas(
const fetchDatabaseSchemas = async (pagingObj?: string) => {
try {
const response = await getDatabaseSchemas(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const response = await getDatabaseSchemas(
setSchemaDataLoading(true);
const response = await getDatabaseSchemas(

Copy link

[open-metadata-ui] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

0.0% 0.0% Coverage
5.8% 5.8% Duplication

@aniketkatkar97 aniketkatkar97 marked this pull request as ready for review November 10, 2023 08:57
@chirag-madlani chirag-madlani merged commit ba35e1e into main Nov 10, 2023
14 of 18 checks passed
@chirag-madlani chirag-madlani deleted the fix-12833 branch November 10, 2023 08:58
aniketkatkar97 added a commit that referenced this pull request Nov 10, 2023
… soft delete (#13824)

* Added soft delete option for services

* disabled edit actions for deleted entities
fixed code smells
code refactoring

* added loading icon in restore entity modal while API call is pending

* fixed code smells

* localization changes

* changes to make actions disabled for deleted entities

* fixed code smell

* changes to limit actions for soft deleted teams

* localization changes

* added deleted badge for soft deleted teams

* Fixed unit tests

* improved delete modal functionality
limited actions for deleted tables on profiler tab

* fixed failing unit tests

* added missing up vote and down vote functionality for search Index entities

* updated the logic to show display name if available in search suggestions

* fixed custom properties settings page bug
added soft delete limitations for container and search index custom property tab

* fixed unit tests

* fixed bugs on table details page and container details page

* Fixed bug on team details page

---------

Co-authored-by: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com>
ulixius9 pushed a commit that referenced this pull request Nov 10, 2023
… soft delete (#13824)

* Added soft delete option for services

* disabled edit actions for deleted entities
fixed code smells
code refactoring

* added loading icon in restore entity modal while API call is pending

* fixed code smells

* localization changes

* changes to make actions disabled for deleted entities

* fixed code smell

* changes to limit actions for soft deleted teams

* localization changes

* added deleted badge for soft deleted teams

* Fixed unit tests

* improved delete modal functionality
limited actions for deleted tables on profiler tab

* fixed failing unit tests

* added missing up vote and down vote functionality for search Index entities

* updated the logic to show display name if available in search suggestions

* fixed custom properties settings page bug
added soft delete limitations for container and search index custom property tab

* fixed unit tests

* fixed bugs on table details page and container details page

* Fixed bug on team details page

---------

Co-authored-by: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test Add this label to run secure Github workflows on PRs UI UI specific issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ui: add soft delete option for services and limit actions for soft deleted entities
3 participants