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

Soft delete of jobs and datasets. Style dialog component #2343

Merged
merged 8 commits into from
Jan 13, 2023
Merged

Conversation

tito12
Copy link
Contributor

@tito12 tito12 commented Jan 3, 2023

Signed-off-by: tito12 [email protected]

Problem

According to the issue #2167 we need option to soft delete records, it's already possible from API but not from UI.

Solution

Added option for jobs and datasets to be able to soft delete record with dialog component and double confirmation from UI side.

image

Checklist

  • You've signed-off your work
  • Your changes are accompanied by tests (if relevant)
  • Your change contains a small diff and is self-contained
  • You've updated any relevant documentation (if relevant)
  • You've updated the CHANGELOG.md with details about your change under the "Unreleased" section (if relevant, depending on the change, this may not be necessary)
  • You've versioned your .sql database schema migration according to Flyway's naming convention (if relevant)
  • You've included a header in any source code files (if relevant)

@boring-cyborg boring-cyborg bot added the web label Jan 3, 2023
@wslulciuc wslulciuc requested a review from phixMe January 4, 2023 09:13
@wslulciuc
Copy link
Member

wslulciuc commented Jan 4, 2023

A much needed addition to the UI! Looks great, we should also added deletion of namespaces as a follow up feature. I'll let @phixMe provide a more thorough review.

@@ -26,16 +27,28 @@ export default function AlertDialog(props: IProps) {
<div>
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to have this encapsulating tag?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This component exist previously with encapsulating tag. Moved it to functional component as rest part components.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks

},
buttonDelete: {
backgroundColor: theme.palette.error.main,
color: 'white',
Copy link
Member

Choose a reason for hiding this comment

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

I think I like doing the theme.palette.common.white for these in case we ever wish to support light mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, added it

>
{i18next.t('jobs.delete')}
</Button>
<Dialog
Copy link
Member

Choose a reason for hiding this comment

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

There are two instances of this dialog... Can the dialog itself just be a reusable component.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This component is reusable and located in "components/Dialog.tsx", and use it with different props

<Box display={'flex'} alignItems={'center'}>
<Box mr={1}>
<Button
color='primary'
Copy link
Member

Choose a reason for hiding this comment

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

Can we make this a ghost variant... I think it's a little too strong on the page.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, good point

onClick={props.ignoreWarning}
>
Continue
</Button>
Copy link
Member

Choose a reason for hiding this comment

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

Can we make these small buttons inside the dialog?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, can you explain what do you mean by that?

Copy link
Member

Choose a reason for hiding this comment

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

I think we could possibly use smaller buttons here since the dialog is so minute, but maybe it's not necessary.

@codecov
Copy link

codecov bot commented Jan 9, 2023

Codecov Report

Merging #2343 (ad82bba) into main (a5bd35d) will increase coverage by 9.56%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##               main    #2343      +/-   ##
============================================
+ Coverage     67.15%   76.72%   +9.56%     
- Complexity      231     1177     +946     
============================================
  Files            40      222     +182     
  Lines           947     5354    +4407     
  Branches        101      429     +328     
============================================
+ Hits            636     4108    +3472     
- Misses          163      768     +605     
- Partials        148      478     +330     
Impacted Files Coverage Δ
.../main/java/marquez/db/mappers/SourceRowMapper.java 90.00% <0.00%> (ø)
api/src/main/java/marquez/common/models/Field.java 71.42% <0.00%> (ø)
...i/src/main/java/marquez/common/models/JobType.java 100.00% <0.00%> (ø)
...src/main/java/marquez/common/models/DatasetId.java 81.81% <0.00%> (ø)
.../api/exceptions/JsonProcessingExceptionMapper.java 100.00% <0.00%> (ø)
.../main/java/marquez/service/OpenLineageService.java 91.17% <0.00%> (ø)
...in/java/marquez/common/base/MorePreconditions.java 100.00% <0.00%> (ø)
...a/marquez/api/exceptions/RunNotFoundException.java 100.00% <0.00%> (ø)
api/src/main/java/marquez/db/JobContextDao.java 100.00% <0.00%> (ø)
...in/java/marquez/service/RunTransitionListener.java 0.00% <0.00%> (ø)
... and 172 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@tito12 tito12 requested a review from phixMe January 10, 2023 10:41
Copy link
Member

@phixMe phixMe left a comment

Choose a reason for hiding this comment

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

Thanks, looks good!

@tito12 tito12 enabled auto-merge (squash) January 13, 2023 15:38
@tito12 tito12 merged commit 5cae3ff into main Jan 13, 2023
@tito12 tito12 deleted the web/softdelete branch January 13, 2023 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants