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

Project Table : add quick actions box #16994

Merged
merged 5 commits into from Aug 14, 2017
Merged

Conversation

caleybrock
Copy link
Contributor

There was an early version of a quick actions box for the project card that is currently unused. I made it it's own component, updated to use the most recent designs and text, and used the new component both for the card and the table.
This affects no user facing features, but is visible in the storybook.
None of these components are linked to actions or redux yet (I'm trying to keep these PRs small because I might be switching to another project before I finish converting this entirely.)
screen shot 2017-08-10 at 11 08 50 am
screen shot 2017-08-10 at 11 09 13 am

@caleybrock
Copy link
Contributor Author

cc @Erin007 who originally worked on this.

@caleybrock
Copy link
Contributor Author

@Bjvanminnen it's possible you missed a notification for this one.

@Bjvanminnen
Copy link
Contributor

I did miss this somehow. My first reaction is I wonder whether this component should be the same as #17007 (or if it makes sense to have two different dropdown types components).

this.setState({
actionsOpen: false
});
}.bind(this));
Copy link
Contributor

Choose a reason for hiding this comment

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

could use an arrow function to avoid needing to bind

Copy link
Contributor

Choose a reason for hiding this comment

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

I do kind of like this .one approach.

<div style={styles.cellContainer}>
<div
style={selectedStyle}
ref={(icon) => { this.icon = icon; }}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: for one liners like this, you don't actually need the braces, i.e.

ref={icon => this.icon = icon}

let actions = [i18n.rename(), i18n.remix()];
this.props.isPublished ?
actions.push(i18n.removeFromPublicGallery()) : actions.push(i18n.publishToPublicGallery());
return actions;
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 this would be more clearly expressed as:

return [
  i18n.rename(),
  i81n.remix(),
  this.props.isPublished ? i18n.removeFromPublicGallery() : i18n.publishToPublicGallery()
];

{this.state.actionsOpen &&
<ProjectActionBox
isPublished={this.props.projectData.publishedToPublic}
style={{position: 'absolute', marginLeft: 10, marginTop: '-10px'}}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: i would put this style in our styles object (in general, i would advocate for doing so any time you have more than one style field)
also, you use a number for marginLeft but a string for marginTop?

@caleybrock
Copy link
Contributor Author

Updated code review feedback and chatted with Poorva/Mark who box think we should have separate styles for these.

@caleybrock
Copy link
Contributor Author

@Bjvanminnen did you want to take another look at this?

@caleybrock caleybrock merged commit 844bad7 into staging Aug 14, 2017
@caleybrock caleybrock deleted the projects-quick-actions branch August 14, 2017 16:37
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