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

Refactor 2 - WIP #20

Merged
merged 26 commits into from
Jan 26, 2016
Merged

Refactor 2 - WIP #20

merged 26 commits into from
Jan 26, 2016

Conversation

rogerhutchings
Copy link
Contributor

So, following standup today, we've decided to:

This makes Panoptes-Front-End the standard, allows us to replace the API code in there, and means we have a working client for custom projects (including AnnoTate and Shakespeare's World, which already use the lib).

This will also supersede #14.

it begins

@rogerhutchings rogerhutchings self-assigned this Dec 17, 2015
@rogerhutchings rogerhutchings changed the title Refactor 2 Refactor 2 - WIP Dec 18, 2015
@brian-c
Copy link
Contributor

brian-c commented Dec 27, 2015

Tests are all passing in Node now, wooo. Some changes to json-api-client were required, which I'm making in the fix-requests branch there.

I took some liberty with the non-Node-module bits: the dist/...js file is no longer included, so if someone wants a single file, they need to run the build script themselves (we should really really discourage this). And I deleted the bower file: bower is doomed, nobody should be starting a new project with it. Any objections?

Still need to try plugging it into the PFE to sure it still works in there, but the API is the same now so I think it'll be cool.

@rogerhutchings
Copy link
Contributor Author

Awesome :) Nope. Bower's done, and if people want to use it in a new project they can install this via Git. Same goes for the dist dir.

I want to add one more feature, which is OAuth signin (a la Wildcam Gorongosa etc). I might try doing that in a separate branch and merging it here though

@rogerhutchings
Copy link
Contributor Author

I've also added sugar-client as it seems to be a dependency


var sugarClient = new SugarClient();

auth.listen('change', function() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@brian-c auth is undefined here - should be authClient? And I don't think change is emitted anymore..?

Copy link
Contributor

Choose a reason for hiding this comment

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

Switched all those refs to auth, I don't really consider that module a client.

The module should still emit change events, is it not doing that somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair enough. Still can't find a change event being emitted in there though...

(Happy New Year btw :) )

@brian-c
Copy link
Contributor

brian-c commented Jan 15, 2016

Awaiting a version bump after zooniverse/json-api-client#24, then I think this is solid. Major version bump.

@brian-c
Copy link
Contributor

brian-c commented Jan 18, 2016

All set now.

@rogerhutchings
Copy link
Contributor Author

@brian-c Looks good. The only thing that I can see is that issue in sugar.js where it's listening for an auth change that as far as I can see isn't being emitted anywhere. Am I just misunderstanding it?

@rogerhutchings
Copy link
Contributor Author

Just thought of another thing. Given that json-api-client now has superagent as a dependency, we can probably trash it here?

@brian-c
Copy link
Contributor

brian-c commented Jan 21, 2016

@rogerhutchings Change events are fired whenever update is called on a model. Is this not working in the sugar module?

@rogerhutchings
Copy link
Contributor Author

Ah - I think I was just being dumb and looking for the event to be emitted explicitly. I think this is good to go!

@brian-c brian-c assigned srallen and unassigned rogerhutchings Jan 26, 2016
@brian-c
Copy link
Contributor

brian-c commented Jan 26, 2016

Fixed.

srallen added a commit that referenced this pull request Jan 26, 2016
Tests passing for me and looks good. 💯
@srallen srallen merged commit 7737061 into master Jan 26, 2016
@srallen srallen deleted the epic-refactor branch January 26, 2016 17:41
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.

3 participants