-
Notifications
You must be signed in to change notification settings - Fork 91
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
Refactors dashboard state to a component #1373
Refactors dashboard state to a component #1373
Conversation
46fc4b7
to
7c0e33a
Compare
This pull request is not mergeable. Please rebase and repush. |
7c0e33a
to
f6f7953
Compare
89e71b9
to
b68fddf
Compare
Thinking its probably a good idea to get @serenamarie125 to check this out also... specifically the loading of the state before the widgets are present, maybe each column should have a loading spinner? Or maybe not? |
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.
Never mind original comment
@AllenBW thanks for bringing this up ! From a PatternFly perspective, the cards should be displayed with their loading state, then once the data is available ... 🐰 🎩 The base card describes this state here: http://www.patternfly.org/pattern-library/cards/base-card/#design |
FYI - After chatting with @AllenBW as well as some of the visual designers, we will look into an alternate solution from a PF perspective - possibly a way to tie cards together, so that if data isn't available, you can only show a single spinner. This won't be trivial and a design should be done up front, implemented in PF and then be brought back to product. So for now, let's stick with the PF solution. Sound good ? |
ok swapping is a bad idea, gonna add a real quick loading state, we'll revisit this in the near future 😁 |
@serenamarie125 updated the first comment to have a new gif, showing loading state! also... if the user doesn't have permissions to view the card, its removed when loading fails |
4684a2a
to
6d3312e
Compare
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.
This is a thing of beauty! LGTM @AllenBW
@miq-bot add_label ux/approved |
8c6a1a9
to
f450f6e
Compare
f450f6e
to
e72fe1b
Compare
Removes nasty polling, still isn't a solid fix, but better
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.
Small little change for readability but this looks like a great change for how dashboards work. Great job!
@@ -123,4 +130,10 @@ export function NavigationFactory (RBAC, Polling, POLLING_INTERVAL, $ngRedux, Co | |||
}) | |||
}) | |||
} | |||
|
|||
function setPermissions () { | |||
menuItems[1].permissions = RBAC.has(RBAC.FEATURES.SERVICES.VIEW) |
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.
Can we create constants for these array positions. I know its simple but it will make the code a little easier to read.
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.
The assignment is self informing, I don't so much agree with creating variables that server no other purpose than to increase verbosity .
@himdel your attention required on this blocker PR . . . thx, Dan |
So... before reviewing this any further... do we need to I mean, it's great to see code rewritten to components. |
@@ -4,7 +4,7 @@ msgstr "" | |||
"Content-Transfer-Encoding: 8bit\n" | |||
"Project-Id-Version: \n" | |||
|
|||
#: ./client/app/states/dashboard/dashboard.html:88 | |||
#: ./client/app/components/dashboard/dashboard.html:88 |
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.
recreating pot
files should not be a part of the PR
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.
@himdel will remove, but why not? especially when file refactoring takes place?
@himdel agreed its a large change to be a bugfix, but removing the "application gateway" (the three asset resolves that challenged a user enters entering dashboard state) state resolves is the best way to fix the bz.. When any of those fails, the app router throws us into a |
@AllenBW So.. if we just backported a change that prevents the resolve from erroring..? Something like function resolveServicesWithDefinedServiceIds (CollectionsApi, RBAC) {
if (RBAC.has('service_view') && RBAC.has(RBAC.FEATURES.SERVICES.VIEW)) {
const options = {
expand: 'resources',
filter: ['service_id=nil'],
attributes: ['chargeback_report']
}
return CollectionsApi.query('services', options)
+ .catch(function() {
+ return null;
+ });
}
return true
} ? |
Checked commits AllenBW/manageiq-ui-service@e8962bb~...6e55968 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0 |
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.
Verified user switching now works correctly, regardless of the initial login role.
LGTM, thanks @AllenBW :)
@AllenBW One thing I do notice..
but..
Not sure if this is just about removing the count (but that doesn't sound blocker-worthy), or if the menu item should not be there (but that would be a separate bug entirely). |
@simaishi yes, whole pr, apologies for delayed response 😭 |
This is built on top of #1375, which is not in Gaprindashvili yet (not Two PRs touch many files/lines and I'm not sure how 'safe' it is to get either/both PRs to gaprindashvili branch now. Looking for a guidance from someone familiar with both changes... cc @chrispy1 |
To answer the how much work question (@simaishi ), wouldn't say more than a few hours of effort to copy this into a Gaprindashvili specific branch, the only overlap is a single file, and even that is not more than 5 or so lines |
@AllenBW Can you take care of creating a gaprindashvili version of this? |
ManageIQ#1373 for Gaprindashvili
Backported to Gaprindashvili via #1378 |
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1540733
In support of the longer term fix brought on by #1372
So there's a few bzs this fixes (for real this time):
look, its working 🍰
Goal of this is to be identical to original, cept no more 403 kick ya outta the app state change errors
TODO 👍 : (In this)