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

Adds icon-status component #815

Merged

Conversation

AllenBW
Copy link
Member

@AllenBW AllenBW commented Jun 9, 2017

https://www.pivotaltracker.com/story/show/146029083

TL;DR

  • adds a new reusable component called icon-status, give it a status and array of possible values for different statuses, and you got ICONS 👶
  • employs aforementioned component in ansible details component

Takes 5 parameters ; and the icon class name pulled from here

  • status - string of the current status
  • success - array of strings for which to display the success icon; pficon pficon-ok
  • error - array of strings for which to display the error icon; pficon pficon-error-circle-o
  • queued - array of strings for which to display the circle clock icon; fa fa-clock-o
  • inprogress - array of strings for which to display the in progress spinner; spinner spinner-xs spinner-inline

If none of the following inputs match the status, the unknown icon will be displayed; pficon pficon-help

Examples of icons used

screen shot 2017-06-12 at 12 34 38 pm

The unknown catchall

screen shot 2017-06-12 at 12 41 44 pm

String values are still shown to user

screen shot 2017-06-12 at 12 49 41 pm

@AllenBW AllenBW changed the title Adds icon-status component [WIP] Adds icon-status component Jun 9, 2017
@AllenBW AllenBW added the wip label Jun 9, 2017
@AllenBW AllenBW added this to the Sprint 63 Ending Jun 19, 2017 milestone Jun 9, 2017
@Loicavenel
Copy link

@AllenBW any possible screenshots here? I would like to see it

@AllenBW
Copy link
Member Author

AllenBW commented Jun 9, 2017

@Loicavenel yeah when we're outta [wip] there will be all da goodies 👍 🌮

but if ya were wondering what the icons look like...

@AllenBW AllenBW force-pushed the PT/#146029083-status-icon-component branch from 6d4f636 to d0c4755 Compare June 12, 2017 16:56
@AllenBW AllenBW changed the title [WIP] Adds icon-status component Adds icon-status component Jun 12, 2017
@AllenBW
Copy link
Member Author

AllenBW commented Jun 12, 2017

@Loicavenel outta wip! GO GO GO GO GO 💃

@chriskacerguis chriskacerguis self-assigned this Jun 12, 2017
@chriskacerguis
Copy link
Contributor

A few thoughts...

  1. The clock icon appears to be a different size than the PF icons.
  2. The alignment of the icons vs. the "Status" label seem "off"

@serenamarie125 thoughts on those?

(see attached screenshot)

27044500-beee8df8-4f6b-11e7-9af9-d3f0f944584e

@@ -12,8 +12,8 @@ <h3 translate>Results</h3>
<div class="form-group">
<label class="control-label col-sm-3" translate>Status</label>
<div class="col-sm-8">
<input class="form-control text-capitalize" readonly
value="{{item.stack.status || ('Unknown' | translate)}}"/>
<icon-status status="item.stack.status" success="['successful', 'succeeded', 'create_complete']"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to define the stings here? That could become a VERY long list.

Copy link
Member Author

Choose a reason for hiding this comment

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

Presently not a long list, hence the deliberate inclusion for this first run. If it gets much longer tho you're spot on, const in the js is gonna be da way to play

Copy link
Contributor

Choose a reason for hiding this comment

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

Question about these strings being passed into the component, do we have to worry about those strings being translated and having that ruin the functionality they are meant for?

@AllenBW
Copy link
Member Author

AllenBW commented Jun 13, 2017

@chriskacerguis RIGHT!! icon alignment yo, used all things pitched by pf tho so.... idk :-/ i guess we could add custom class to get em all aligned, but that seems like the bandaid for the wrong problem...

@chriskacerguis
Copy link
Contributor

@ManageIQ/core-ux for ya'lls review :)

chriskacerguis
chriskacerguis previously approved these changes Jun 14, 2017
@chriskacerguis
Copy link
Contributor

/cc @Loicavenel

@Loicavenel
Copy link

Just for my clarification, are these status icon are for when Service is provisioned only? or for any actions done at the service level?

@cshinn
Copy link

cshinn commented Jun 14, 2017

@AllenBW I think there may be a mixup regarding the icons used for queued and inprogress; the descriptions don't match the provided icon classes.

Is it possible for an item to have two different status icons at the same? If not, then I don't think the size issue is severe enough to warrant specific code to fix it unless it causes other items to shift around on the page. I do agree, however, that the size discrepancy in the icons is unfortunate. Your thoughts @serenamarie125?

@AllenBW
Copy link
Member Author

AllenBW commented Jun 14, 2017

good catch, the mixup was pr description deep, eyyyyooo @cshinn swapped them around 🙇‍♀️

its technically possible for an item to have more than one icon at a time, this is by design, but one would have to deliberately desire this behavior (and code towards it) most of the time and in this pr, one icon per status. does not affect any other items in page, just looks a lil off when ya line em all up 😆

@Loicavenel icons can be used anywhere, application of this pr is an ansible service.

@serenamarie125
Copy link

happened again. I swear i must not hit "COMMENT" after commenting.
THANK YOU @AllenBW for doing this - this is great and will ensure more consistency. Would be assume if this could be shared with Ops UI too :D

Couple of comments

  1. Regarding size, this happens often with FA icons. Often we will end up duplicating them in PF to be sure size/spacing is appropriate. Let's see if we stick with the clock, because i don't think it's right.
  2. success - perfect, this is PF approved ✅
  3. error - perfect, this is PF approved ✅
  4. queued - array of strings for which to display the circle clock icon; fa fa-clock-o❌ let me get back to you be COB
  5. inprogress - array of strings for which to display the in progress spinner; spinner spinner-xs spinner-inline ❓ let me get back to you by COB
  6. unknown icon will be displayed; pficon pficon-help ❌ let me get back to you by COB

HTH!

@chriskacerguis
Copy link
Contributor

@serenamarie125 any update for us?

/cc @Loicavenel

@serenamarie125
Copy link

@chriskacerguis the current update is that PatternFly does not have appropriate icons at this point. IMO, we have 2 options
1 - use temp icons and open up another issue when icons are available
2 - wait for PF icons to be created ( could be 2+ weeks )

@AllenBW
Copy link
Member Author

AllenBW commented Jun 16, 2017

@serenamarie125 i vote temp! :P

@chriskacerguis
Copy link
Contributor

@AllenBW temp will work...I think it would be a better UX with PF icons...@serenamarie125 would you be able to give a more definitive timeline?

@serenamarie125
Copy link

Based on the fact that PF does not currently have standards for queued, in progress & unknown, I'd like to suggest one of 2 things:
1 - wait for 2-3 weeks for PF to create these icons
2 - merge as is, but update the icons as soon as PF creates them

If #2, i think we should pick a different icon for queued, because i don't think that one makes sense. Let me know your thoughts @chriskacerguis @Loicavenel

@miq-bot
Copy link
Member

miq-bot commented Jun 17, 2017

This pull request is not mergeable. Please rebase and repush.

@serenamarie125
Copy link

@AllenBW can you do me a favor and explain what the Queued status reflects in this instance? Is it the same as pending ? my concern with the clock icon is that users may confuse it with "scheduled"

@serenamarie125
Copy link

@chriskacerguis is 2-3 weeks enough of a timeline? It will be added to our sprint planning, and our 2 week sprint will begin on 6/27 so I anticipate it being completed that sprint.

@chriskacerguis
Copy link
Contributor

@serenamarie125 that works great, I think that it would be a better experience to have matching icons.

Copy link

@serenamarie125 serenamarie125 left a comment

Choose a reason for hiding this comment

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

Can you change this PR to use fa-hourglass-half for queued? And I will create a new Issue and link to the JIRA story about the PF suggested icons

@AllenBW
Copy link
Member Author

AllenBW commented Jun 19, 2017

@serenamarie125 updated! 🎖 ⚓️

Copy link

@serenamarie125 serenamarie125 left a comment

Choose a reason for hiding this comment

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

@AllenBW would be nice if screenshots were updated to reflect code :)

Thanks for making change to hourglass, i 👀 it in the code!

AllenBW and others added 5 commits June 19, 2017 10:46
Takes 5 parameteres 
- status - string of the current status
- success - array of strings for which to display the success icon
- error - array of strings for which to display the error icon
- queued - array of strings for which to display the circle clock icon
- inprogress - array of strings for which to display the in progress spinner

If none of the following inputs match the status, the unknown icon will be displayed
Supporting succeeded/successful strings for green icon
And failed/failure strings for red icon
@AllenBW AllenBW force-pushed the PT/#146029083-status-icon-component branch from 403e4d1 to ff26362 Compare June 19, 2017 14:47
@AllenBW AllenBW force-pushed the PT/#146029083-status-icon-component branch from ff26362 to eec8d3c Compare June 19, 2017 15:56
@miq-bot
Copy link
Member

miq-bot commented Jun 19, 2017

Checked commits AllenBW/manageiq-ui-service@655a7ff~...eec8d3c with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
0 files checked, 0 offenses detected
Everything looks fine. 🍰

@chriskacerguis chriskacerguis merged commit 474ee8e into ManageIQ:master Jun 19, 2017
Copy link
Contributor

@chalettu chalettu left a comment

Choose a reason for hiding this comment

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

@AllenBW , see below for the review comments I made.

inprogress: '<?',
},
template: `
<i class="pficon pficon-ok" ng-if="vm.isSuccess"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you could make this template a lot more concise. I would make one icon and write a function in the component that returns the CSS class to show and just use ng-class to display the resulting css class.

Copy link
Member Author

Choose a reason for hiding this comment

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

Intentionally verbose, favoring readability rather than conciseness, as was demonstrated above, likely these values are going to change

One below, don't have to worry about translations breaking functionality value and check value(s) are passed by the user, most often specified by the backend for both

@@ -12,8 +12,8 @@ <h3 translate>Results</h3>
<div class="form-group">
<label class="control-label col-sm-3" translate>Status</label>
<div class="col-sm-8">
<input class="form-control text-capitalize" readonly
value="{{item.stack.status || ('Unknown' | translate)}}"/>
<icon-status status="item.stack.status" success="['successful', 'succeeded', 'create_complete']"
Copy link
Contributor

Choose a reason for hiding this comment

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

Question about these strings being passed into the component, do we have to worry about those strings being translated and having that ruin the functionality they are meant for?

@AllenBW AllenBW deleted the PT/#146029083-status-icon-component branch June 21, 2017 12:59
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.

7 participants