Skip to content

Conversation

@aoby
Copy link
Contributor

@aoby aoby commented May 18, 2016

To make this a little smaller, I removed the reports from this first set of changes. The reports aren't needed for facilitator summit so I can add them back in and review next week.

cc @islemaster @pcardune @breville

Note: some of the css is still being worked out.

Screenshots:

New:

image

Workshop index:

image

View (not started):

image

followed by:

image
Clicking edit opens the fields for edit.

View (in progress):

image

Attendance

image

Copy link
Contributor

Choose a reason for hiding this comment

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

anything that gets used in the front end should probably be part of the dependencies section. I don't think it will make a difference the way we have things set up, but "best practices" and all that.

Copy link
Contributor

Choose a reason for hiding this comment

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

idk, dependencies are what's required to run, devDependencies are required to develop. In this case, these packages are used to create a build product, but none of them are required to consume the resulting package. I think this is the argument we've been using for putting everything in devDependencies.

Copy link
Contributor

Choose a reason for hiding this comment

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

Might be interesting to see what this all does for package size. I know that for moment at least, I've used it in personal projects until realizing that it's footprint was a lot bigger than justified for how I was using it.

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 yeah. It certainly is convenient though. Maybe we can find a lighter-weight alternative, or just do the parsing and formatting ourselves (though that's obviously less desirable).

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, it's a pretty nice library. Presumably we're only requiring it in this new bundle so far too, which means we're not actually growing anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, "so far". But it might set a precedent and encourage others ;)

@Bjvanminnen
Copy link
Contributor

Metapoint: A lot of my comments are things that don't necessarily have to be addressed immediately (i.e. shouldn't block checkin). I'll try to prepend these with "nit" as much as I can. These are things that may be worth looking at/thinking about, but don't let them prevent you from merging.

Copy link
Contributor

Choose a reason for hiding this comment

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

Same story with modifying state, this should just be this.setState({adminOverride: !this.state.adminOverride})

Copy link
Contributor

Choose a reason for hiding this comment

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

Directly modifying this.state

@islemaster
Copy link
Contributor

screenshot from 2016-05-18 10-04-35

Wow! Only four lines removed?

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Just realized you've been using snake_case for your component files. Our preference elsewhere has been for CamelCase, though it's probably not worth going through and changing everything

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's actually inconsistent. See https://github.com/code-dot-org/code-dot-org/tree/staging/code-studio/src/js/components (send_to_phone.jsx, share_dialog.jsx, etc). But those are in the minority. I guess this is just ruby style creep on my part. I'll update this one after the initial commit.

Copy link
Contributor

Choose a reason for hiding this comment

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

You are right that we haven't been entirely consistent (I'm the guilty party that created those components). Not that big a deal if these are different if changing will be a lot of work.

@Bjvanminnen
Copy link
Contributor

Overall, this looks really good. I had a decent number of style nits, but really there were a lot fewer than I expected there to be :)

I think the one big thing I'd like to see changed is that there are a bunch of places where you're directly modifying this.state which is a big no-no in React. Hopefully most of these are pretty easy to fix.

I'd also like to see a few more comments, especially at the component level summarizing what each component's purpose is.

My other big meta-point is that we'd really rather never be in a position where we're reviewing a huge PR like this on a deadline. It makes it so that it's more difficult to look at everything as closely, and it becomes riskier to actually make any changes based on feedback (since there's the pressure to get things committed). As a team, I think we should make an effort to have large features like this broken into a series of smaller commits, that can receive/iterate on feedback earlier rather than having one giant change.

Let me know if there's anything I can do to help, either testing changes or in some other way!

Copy link
Contributor

Choose a reason for hiding this comment

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

Super small nit: these can be handleDataChange(e) { in ES6.

@Bjvanminnen
Copy link
Contributor

Changes look good. Left a few comments on the commit, most of which can probably be ignored or put off if you want. The only one I'd be sure to take a look at was where you could end up modifying another component's props object.

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 the cloning for sessions needs to happen sooner (i.e. before we mutate it), otherwise we're still changing the props of the caller.

I don't think we need to clone destroyedSessions at all as this is just a local object.

i.e. I would expect:

handleSessionsChange: function (sessions, removedSession) {
    sessions = _.cloneDeep(sessions); 
    sessions.sessionsModified = true;
     var destroyedSessions = [];
     if (removedSession && removedSession.id) {
        destroyedSessions.push(removedSession);
      }
      this.setState({
        sessions: sessions,
        destroyedSessions: destroyedSessions
      });

At this point if you want you could take advantage of an ES6 feature and simplify the last bit to this.setState({sessions, destroyedSessions})

@Bjvanminnen
Copy link
Contributor

lgtm

@aoby aoby force-pushed the pd-workshop-ui branch from 2b470c6 to 4b55571 Compare May 18, 2016 20:57
@aoby aoby merged commit dfcf2a5 into staging May 18, 2016
@aoby aoby deleted the pd-workshop-ui branch May 18, 2016 20:58
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.

5 participants