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 #24129: fix subs. display when no manifest. #7516
Conversation
Issues: #24129 |
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.
Wanted to get some feedback on this before fixing the tests, let me know what you think.
@@ -186,6 +189,16 @@ class SubscriptionsPage extends Component { | |||
|
|||
const csvParams = createSubscriptionParams({ search: this.state.searchQuery }); | |||
|
|||
const emptyStateData = { |
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.
Had to pull this back into the subscriptions page component in order to open the manifest. Open to other solutions.
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.
@tstrachota especially interested in your opinion on this since you did the initial refactor into the subscriptions table component.
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 see two solutions here:
- The
EmptyState
component currently takes prop action:{url, title}
. We can change it to{url, title, onClick}
and let the component decide whether to wrap the button withLinkContainer
(whenurl
is present) or just render a button withonClick
. - Alternatively you could keep
EmptyState
as is in this PR and change the empty state date to a function and inject the handler:
const emptyStateData = ({onButtonClick}) => ({
header: __('There are no Subscriptions to display'),
description: __('Import a Manifest to manage your Entitlements.'),
actionButton: (
<Button onClick={onButtonClick}>
{__('Import a Manifest')}
</Button>
),
}};
Both solutions seem fine to me. I slightly tend to prefer the first one. Adding actionButton
prop feels like adding another way to achieve the same to me.
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.
@tstrachota updated.
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.
It works well @waldenraines!
I think that we should refactor the empty state as discussed in the other comment. Apart from that it's good.
[test katello/webpack] |
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.
LGTM 👍
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.
👍 works nicely
When there is no manifest: - Disable "Add subscription" button in the top right toolbar with an appropriate tooltip message. - Show different empty view on the subscriptions page saying "Import a Manifest to manage your Entitlements" or something similar and show "Manage Manifest" button. - Change the text in the add subscriptions empty view to the above. https://projects.theforeman.org/issues/24129
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.
Approving based on other comments! Thanks @waldenraines
When there is no manifest:
Disable "Add subscription" button in the top right toolbar
with an appropriate tooltip message.
Show different empty view on the subscriptions page saying
"Import a Manifest to manage your Entitlements" or something
similar and show "Manage Manifest" button.
Change the text in the add subscriptions empty view to the above.
https://projects.theforeman.org/issues/24129
TODO