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

Show icons in redesigned and existing progress dots (Unrevert 13212) #13248

Merged
merged 4 commits into from Feb 15, 2017

Conversation

Bjvanminnen
Copy link
Contributor

#13212 was reverted because when our progressRedesign experiment was not enabled, assessment level were not showing up properly. This is because even thoiconClassName knew to ignore 'fa-list-ol', we also rendered differently based on whether or not we had a level.icon.

This unifies the logic a little bit more, and gets us closer to the place I'd like us to be where the server sends us an IconType instead of a className. I'm essentially pretending that's what it does, except that the IconType key is actually just the className (if that makes sense)

elsif assessment
'fa-list-ol'
end
end
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@joshlory FYI for overriding icon for assessments. Looking at this again, I think that this (a) deserves a comment that captures some of the discussion we've had around icons and (b) I probably should reverse the conditionals, i.e.

if assessment
  'fa-list-ol'
else
  level.icon
end

Even though there probably aren't currently any level types that have an icon, that we would also make an assessment, if some existing type later did provide a default icon, I think we'd still want assessment to override.

'fa-external-link-square': 'fa fa-external-link-square',
'fa-video-camera': 'fa fa-video-camera',
'fa-stop-circle': 'fa fa-stop-circle',
'fa-map': 'fa fa-map',
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@@ -202,8 +215,8 @@ export const ProgressDot = Radium(React.createClass({

// fa-list-ol is used only by our redesigned dots, but we don't want to use
// it here
Copy link
Contributor

Choose a reason for hiding this comment

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

The fa-list-ol special case comment here should maybe be moved up to your mapping.

if (level.icon && level.icon !== 'fa-list-ol') {
return 'fa ' + level.icon;
if (level.icon) {
return iconClassFromIconType[level.icon];
Copy link
Contributor

Choose a reason for hiding this comment

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

You used to return '' empty string in the fa-list-ol case; now you return undefined. Intentional?

@@ -443,7 +443,8 @@ describe('ProgressDot component tests', () => {
);

const result = renderer.getRenderOutput();
expect(result.props.children[0].props.className).to.equal('');
expect(result.props.children[0].type).to.equal('div');
expect(result.props.children[0].props.className).to.equal(undefined);
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, seems intentional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't think it makes a big difference one way or the other really, but undefined seems slightly more accurate.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should your default case return undefined then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh yes, probably. I expect to do some future work here in the near future, so I'll try to remember to clean that up then.

Copy link
Contributor

@islemaster islemaster left a comment

Choose a reason for hiding this comment

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

LGTM. Maybe set a nicer PR title for our release logs? 😜

@Bjvanminnen Bjvanminnen changed the title Unrevert13212 Show icons in redesigned and existing progress dots (Unrevert 13212) Feb 15, 2017
@Bjvanminnen Bjvanminnen merged commit 4ac34e8 into staging Feb 15, 2017
@Bjvanminnen Bjvanminnen deleted the unrevert13212 branch February 15, 2017 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants