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

Fixes #22730: add manage manifest modal to subscriptions page. #7305

Merged
merged 1 commit into from
Apr 19, 2018

Conversation

waldenraines
Copy link
Contributor

@waldenraines waldenraines commented Apr 11, 2018

http://projects.theforeman.org/issues/22730

TODO:

  • Tests
  • Update manifest filename/etc on successful upload/delete
  • Modal opening up each time get task returns
  • Add progress bar above table for tasks that are running if the modal is closed
  • Add a modal on top of the modal to confirm deletion of manifest

Questions for UX:

  • How to handle delete manifest confirmation in modal
  • Show a progress bar when modal is exited? Right now if you refresh, upload, or delete and then navigate away and then back we don't show you the progress of your task.

@theforeman-bot
Copy link

Issues: #22730

@waldenraines
Copy link
Contributor Author

Questions for UX:

@Rohoover, see above please.

Copy link

@Rohoover Rohoover left a comment

Choose a reason for hiding this comment

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

So, we have confirmation of a modal on modal use. This can be adapted for delete confirmation. Let me know what you think about this or if you want to see a mockup first.

As for a progress bar, here are a couple thoughts:
We can disable all table actions (except for Manage Manifest) and continue to show the progress bar in the manifest modal. We could also - if technically feasible - place a progress bar on the content area of the table. Perhaps the content is faded back, or replaced completely. I can mock this up too if think this is worth pursuing.

@waldenraines
Copy link
Contributor Author

waldenraines commented Apr 12, 2018

So, we have confirmation of a modal on modal use. This can be adapted for delete confirmation. Let me know what you think about this or if you want to see a mockup first.

Do you have an screenshot of this from another application? That would suffice for me, I don't need a mockup of this particular page.

We can disable all table actions (except for Manage Manifest) and continue to show the progress bar in the manifest modal. We could also - if technically feasible - place a progress bar on the content area of the table. Perhaps the content is faded back, or replaced completely. I can mock this up too if think this is worth pursuing.

Well currently there is a "bug" that the manage manifest modal pops open every 3 seconds if you close it when the progress bar is updated. This could be a "feature" by just ensuring the modal is open when a task is ongoing and then just show the progress bar there. Just a thought.

@Rohoover
Copy link

@waldenraines

Here is the modal on modal -- mind you, it's not a delete confirmation.
image 2

Hmmmm, not a bad idea. Throwing this thought out there to think about... will it be annoying? Is there anything behind the modal that they would want or could interact with that we would be preventing them from doing so, or annoying them with a modal popping up every 3 seconds? If they close the modal, what's telling them that something is in progress? I guess that second question is what makes me think we need some other mechanism.

@waldenraines
Copy link
Contributor Author

waldenraines commented Apr 12, 2018

Hmmmm, not a bad idea. Throwing this thought out there to think about... will it be annoying? Is there anything behind the modal that they would want or could interact with that we would be preventing them from doing so, or annoying them with a modal popping up every 3 seconds? If they close the modal, what's telling them that something is in progress? I guess that second question is what makes me think we need some other mechanism.

Yeah, true, I wasn't sold on it even when I proposed it. I think a progress bar on the subscriptions page itself would be a better way to go. Do you have a strong preference to put it in the table versus above it?

Copy link

@Rohoover Rohoover left a comment

Choose a reason for hiding this comment

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

Let's put it above it, much like how the modal has a dimmed background, so users don't think the content was all blown away.

@Rohoover
Copy link

Something like this:

screen shot 2018-04-12 at 3 39 50 pm

I came up with this pretty quickly so I am flexible if you have another idea.

@waldenraines
Copy link
Contributor Author

Something like this:

Oh, interesting, when I said above I meant in the content area above the table but I like this better.

@waldenraines
Copy link
Contributor Author

Update manifest filename/etc on successful upload/delete
Modal opening up each time get task returns
Add progress bar above table for tasks that are running if the modal is closed
Add a modal on top of the modal to confirm deletion of manifest

Does anyone care if I complete these items as follow on PRs?

@waldenraines waldenraines changed the title [WIP] Fixes #22730: add manage manifest modal to subscriptions page. Fixes #22730: add manage manifest modal to subscriptions page. Apr 15, 2018
@waldenraines
Copy link
Contributor Author

waldenraines commented Apr 15, 2018

Tests added, would like to handle the rest of the todo items as separate PRs. Thoughts?

@waldenraines
Copy link
Contributor Author

Update manifest filename/etc on successful upload/delete

http://projects.theforeman.org/issues/23283

Modal opening up each time get task returns

http://projects.theforeman.org/issues/23284

Add progress bar above table for tasks that are running if the modal is closed

http://projects.theforeman.org/issues/23285

Add a modal on top of the modal to confirm deletion of manifest

http://projects.theforeman.org/issues/23286

TASK_BULK_SEARCH_FAILURE,
} from './TaskConstants';

export const bulkSearch = (extendedParams = {}) => (dispatch) => {
Copy link
Contributor Author

@waldenraines waldenraines Apr 16, 2018

Choose a reason for hiding this comment

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

These task related actions, reducers, and constants should probably be move to foreman (or at least the move_to_foreman directory 😄)

Copy link
Member

@tstrachota tstrachota left a comment

Choose a reason for hiding this comment

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

Nice @waldenraines !

I went through the code and did some testing. It works mostly fine. I added some questions and nitpicks inline. Given that this is still in the labs section, I agree it's fine to fix all of them as separate PRs as long as we track it somewhere. Maybe just saving the org to state could be fixed now.

Btw I noticed TypeError: deburr(...).replace is not a function after both delete and upload manifest. Not sure what causes that.

}
}

export const foremanTasksApi = new ForemanTasksApi();
Copy link
Member

Choose a reason for hiding this comment

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

👍 nice!


const emptyStateData = () => ({
header: __('There is no Manifest History to display.'),
description: __('Import a Manifest using the details tab.'),
Copy link
Member

Choose a reason for hiding this comment

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

In fact the tab is called "Manifest", not "details".

url: 'http://redhat.com',
},
action: {
title: __('Upload Manifest'),
Copy link
Member

Choose a reason for hiding this comment

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

This button has no effect. Can we just hide it?


case GET_ORGANIZATION_SUCCESS:
case SAVE_ORGANIZATION_SUCCESS: {
return Immutable({ loading: false }, ...action.response);
Copy link
Member

Choose a reason for hiding this comment

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

I guess this should have been Immutable({ loading: false, ...action.response}). Currently the fetched org data doesn't get stored in the state.

showModal: props.showModal,
};

this.hideModal = this.hideModal.bind(this);
Copy link
Member

Choose a reason for hiding this comment

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

Something like https://github.com/patternfly/patternfly-react/blob/master/src/common/helpers.js#L3-L7 would be handy. But no need to add it in this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, thanks, I didn't even know that existed!


<FormGroup>
<ControlLabel className="col-sm-3 control-label" htmlFor="usmaFile">
{__('USMA')}
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 that we're missing an info tooltip here (what is USMA? :))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, we should have a tooltip here that shows "Upstream Subscription Management Application".

library_id: 1,
});

export const successState = Immutable({ loading: false }, ...requestSuccessResponse);
Copy link
Member

Choose a reason for hiding this comment

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

I was wondering why the tests don't fail:)
{ loading: false, ...requestSuccessResponse } here too

componentDidMount() {
this.loadData();
}

loadData() {
this.props.pollBulkSearch({
search_id: 'pollBulkSearch',
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we use some more specific search_id? activeManifestTasksSearch or something similar.
It should probably be a constant too.


const initialState = Immutable({ loading: false, results: [] });

export default (state = initialState, action) => {
Copy link
Member

Choose a reason for hiding this comment

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

Is this reducer and state used anywhere or are you planning to use it anywhere? Or does it help debugging?
I'm just wondering if it makes sense to store results of any search in the generic state node.

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 can probably just be removed. I was using it at first but then changed my implementation. I will remove.

@waldenraines
Copy link
Contributor Author

Maybe just saving the org to state could be fixed now.

I'd really prefer getting all of these large pieces in first and fixing these known issues after the fact if at all possible.

@waldenraines
Copy link
Contributor Author

Btw I noticed TypeError: deburr(...).replace is not a function after both delete and upload manifest. Not sure what causes that.

http://projects.theforeman.org/issues/23302

@tstrachota
Copy link
Member

I'd really prefer getting all of these large pieces in first and fixing these known issues after the fact if at all possible.

NP, it's a simple issue, we can do it after

@waldenraines
Copy link
Contributor Author

@tstrachota updated. I believe I have fixed all of your comments.

Copy link
Member

@tstrachota tstrachota left a comment

Choose a reason for hiding this comment

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

👍 let's merge this

@tstrachota
Copy link
Member

...once the tests are green, of course 😃

@waldenraines
Copy link
Contributor Author

[test katello]

@jturel jturel self-assigned this Apr 17, 2018
@jturel
Copy link
Member

jturel commented Apr 17, 2018

I'm fine with this being merged as-is, and I know you're aware of something the things I'm mentioning here, but here's my feedback:

  • shows No Manifest Imported even though I have one
  • upon refreshing manifest and closing the modal, I can not open the modal via Manage Manifest button again (disabled)
  • however the button became enabled again when refresh was complete (good)
  • messaging "Refresh Manifest Completed Successfully." should this also be shown as an ordinary notification, not just in the modal?
  • "USMA" - can we expand this acronym on the page?
  • cdn url is sending a PUT to the API on each keypress in the text field & looks like its not actually updating it on the backend
  • cdn URL does not show the current value

@tstrachota
Copy link
Member

@jturel did you test Walden's latest commit? I was experiencing some of the issues you're describing but they got fixed with the latest update.

@jturel
Copy link
Member

jturel commented Apr 17, 2018

@tstrachota ah - nope. let me pull that down and take a look

@waldenraines
Copy link
Contributor Author

[test katello]

@waldenraines
Copy link
Contributor Author

shows No Manifest Imported even though I have one

Hmm, odd, was that right after you imported one?

upon refreshing manifest and closing the modal, I can not open the modal via Manage Manifest button again (disabled)
however the button became enabled again when refresh was complete (good)

I suppose we could look at not disabling the entire modal but just disabling the actions within the modal that cannot be done while an upload/delete/refresh is in progress.

messaging "Refresh Manifest Completed Successfully." should this also be shown as an ordinary notification, not just in the modal?

@Rohoover thoughts on that?

"USMA" - can we expand this acronym on the page?

There is now a tooltip that shows what it stands for.

cdn url is sending a PUT to the API on each keypress in the text field & looks like its not actually updating it on the backend

It should be but I have not yet made it grab the latest organization upon successful save.

cdn URL does not show the current value

See above.

@waldenraines
Copy link
Contributor Author

[test katello]

2 similar comments
@waldenraines
Copy link
Contributor Author

[test katello]

@waldenraines
Copy link
Contributor Author

[test katello]

@jturel
Copy link
Member

jturel commented Apr 18, 2018

Hmm, odd, was that right after you imported one?

Yes!

Extra note:

  • old manifest name shows after manifest delete (i did the delete right after a refresh if it matters) & i could still refresh (unexpected) which led to an (expected) error: "Upstream identity certificate not available

There is now a tooltip that shows what it stands for.

ok, that helps but the acronym just feels out of place to me.

Copy link
Member

@jturel jturel left a comment

Choose a reason for hiding this comment

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

Shaping up very nicely & left my thoughts. Thanks!

APJ

@waldenraines
Copy link
Contributor Author

ok, that helps but the acronym just feels out of place to me.

That came from the mockups, @Rohoover thoughts?

@waldenraines
Copy link
Contributor Author

old manifest name shows after manifest delete (i did the delete right after a refresh if it matters) & i could still refresh (unexpected) which led to an (expected) error: "Upstream identity certificate not available

Yeah, I think that's due to the lack of an organization refresh, I hope to fix that as part of http://projects.theforeman.org/issues/23283

Copy link

@Rohoover Rohoover left a comment

Choose a reason for hiding this comment

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

@waldenraines

Yes on disabling buttons in modal.
Yes on an extra notification of completed refresh.

@jlsherrill
Copy link
Member

[test katello]

1 similar comment
@waldenraines
Copy link
Contributor Author

[test katello]

@waldenraines
Copy link
Contributor Author

[test katello]

@waldenraines waldenraines merged commit 2a5bde8 into Katello:master Apr 19, 2018
@waldenraines waldenraines deleted the 22730 branch April 19, 2018 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants