-
Notifications
You must be signed in to change notification settings - Fork 289
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
Fixes #22731 - Add delete button to subscriptions page #7356
Conversation
Issues: #22731 |
@johnpmitsch, this pull request is currently not mergeable. Please rebase against the master branch and push again. If you have a remote called 'upstream' that points to this repository, you can do this by running:
This message was auto-generated by Foreman's prprocessor |
Note that the page won't be refreshed after the subscription is deleted, that is being handled by a separate issue which will show task progress on this page |
@tstrachota @waldenraines: I'm getting this when clicking on delete, I'm at a loss to what I am passing the
|
}, | ||
formatters: [ | ||
label => ( | ||
<Table.SelectionHeading aria-label={label}> |
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.
Could you factor it out into a reusable formatter? I guess this is a pattern that will be repeated often.
Ideally we should use it on the upstream subscriptions page too.
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.
👍
I cannot test this because I always get an empty state even though I have subscriptions. I observed this on @tstrachota's PR and since that is included with this it is broken here too. |
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.
I can't test this because of the aforementioned empty state issue I'm seeing.
Note to any reviewers from outside the team:
The progress of the deletion will be shown once http://projects.theforeman.org/issues/23285 is implemented.
@@ -14,6 +14,8 @@ class SubscriptionsPage extends Component { | |||
super(props); | |||
this.state = { | |||
manifestModalOpen: false, | |||
subscriptionDeleteModalOpen: false, | |||
hideDeleteButton: true, |
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.
Perhaps rename this to disableDeleteButton
?
@@ -217,6 +255,25 @@ class SubscriptionsTable extends Component { | |||
onConfirm={() => this.cancelEdit()} | |||
onCancel={() => this.showCancelConfirm(false)} | |||
/> | |||
<ConfirmDialog | |||
show={this.props.subscriptionDeleteModalOpen} | |||
title="Confirm Deletion" |
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.
You'll want to use {__('Confirm Deletion')}
here so this is translated.
), | ||
}} | ||
|
||
confirmLabel="Delete" |
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.
Same note about translation above.
}, | ||
formatters: [ | ||
label => ( | ||
<Table.SelectionHeading aria-label={label}> |
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.
👍
9f5d00d
to
6b70412
Compare
998c198
to
cfc21af
Compare
@tstrachota @waldenraines updated according to comments. A few outstanding questions:
|
to test:
|
cfc21af
to
ab8e073
Compare
I'm fine with us fixing this after this PR is merged if you want to file an issue for it.
We should probably do more to test individual functions within the page but we don't really do this elsewhere yet so I won't hold you to that. |
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.
Just a nitpick from me. Tested and it worked as expected.
export const DELETE_SUBSCRIPTIONS_SUCCESS = 'DELETE_SUBSCRIPTIONS_SUCCESS'; | ||
export const DELETE_SUBSCRIPTIONS_FAILURE = 'DELETE_SUBSCRIPTIONS_FAILURE'; | ||
|
||
|
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.
Extra newline here.
ab8e073
to
b3e31e2
Compare
This will delete subscriptions upstream (in RHSM) and refresh your manifest.
@waldenraines thanks, updated |
@johnpmitsch can you file an issue for the aforementioned JS error please? After that I think we're good to merge pending green checks. |
Feel free to merge this. |
This adds the capability to delete subscriptions upstream (in RHSM) and trigger a manifest refresh.
Depends on #7317, my changes are in a separate commit to make things easier to review.
To do: