Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

add a Team receiving widget #138

Merged
merged 23 commits into from
Jun 30, 2016
Merged

add a Team receiving widget #138

merged 23 commits into from
Jun 30, 2016

Conversation

mattbk
Copy link
Contributor

@mattbk mattbk commented Jun 19, 2016

Lots to do. Starting with a clean/working duplication of v1 to v2, then will start chipping away.

#103 (comment):

So we should build a v2 widget that is cloned and then modified from the v1 widget. This new version will handle giving in the same way, but will handle taking (for ~users) and receiving (for teams).

A different PR:

  • Fix v1 to work with Gratipay API changes? "Receiving" is now "taking" in public.json.
    • Yes. Widgets for Gratipay 2.0 #103 (comment): "Widgets already in the wild should be updated to reflect giving and taking for ~users."
    • This has been done for v2 under the current PR, but no changes to v1 have been made.

Tests will measure different things for each version.
Leave test/example source data in test/ root rather than duplicating
across versions; data should be the same and reflect current Gratipay
API.
All pass right now.
@mattbk mattbk self-assigned this Jun 19, 2016
Receiving can no longer be anonymous (giving can).

Same as
91bbd00c0826f49b825
2a17cbe8bd561d32772db.
Change "receiving" language to "taking" language.
@mattbk mattbk added this to the Make Widgets 2.0 milestone Jun 21, 2016
@mattbk
Copy link
Contributor Author

mattbk commented Jun 21, 2016

#133 changes are incorporated.

@mattbk
Copy link
Contributor Author

mattbk commented Jun 21, 2016

Now, to the fun part.

I think a better approach will be to let data-gratipay-username continue to only mean ~user username, and write new widget code for Teams.
#112 (comment)

An example, using default-widget.html:

<!doctype html>
<script>grtpAPI = '/lib/v2/'</script>
<script>gratipayURI = '/test/gratipay.com/'</script>

<body>
    <script src="/lib/v2.js" data-gratipay-username="rummik" async></script>
</body>

Where it says data-gratipay-username= I should be able to put data-gratipay-teamslug= (TBD), and then pick it up in v2.js and go from there.

Only works for default-widget-team.html. Enough for tonight.
@mattbk
Copy link
Contributor Author

mattbk commented Jun 25, 2016

Forgot to test before committing.

Leaving the others for now, will step through as needed.
Stripping this down to basic functionality so teams can start using it.
@mattbk mattbk mentioned this pull request Jun 25, 2016
6 tasks
@mattbk
Copy link
Contributor Author

mattbk commented Jun 25, 2016

I think it's ready for review. Very simple and stripped down. Does not modify anything from v1.

  • Only includes default and custom widgets and associated tests (see /test/v2).
  • Removes giving entirely.
  • Realigns "taking" into "receiving" to match Gratipay API.

Example using default-widget.html:

<!doctype html>
<script>grtpAPI = '/lib/v2/'</script>
<script>gratipayURI = '/test/gratipay.com/'</script>

<body>
    <script src="/lib/v2.js" data-gratipay-teamslug="gratipay" async></script>
</body>

screen shot 2016-06-25 at 11 45 37 am

// Define window.Gratipay if it hasn't previously been defined
if (!window.Gratipay) {
// For legacy reasons, have window.Gittip also be defined
window.Gittip =
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's remove all the Gittip references from v2, ya?

@chadwhitacre
Copy link
Contributor

chadwhitacre commented Jun 29, 2016

Punchlist

@chadwhitacre
Copy link
Contributor

@chadwhitacre chadwhitacre changed the title Widgets v2 add a Team receiving widget Jun 29, 2016
@mattbk
Copy link
Contributor Author

mattbk commented Jun 29, 2016

Comments sound good so far, can't test until tonight at earliest.

Here's a diff between v1 and v2 in cc11356:

Should I be using this information for something?

@chadwhitacre
Copy link
Contributor

Should I be using this information for something?

Nope. That's just FYI at this point—mostly for me and @kaguillera as we review this. :)

Comments sound good, can't test until tonight at earliest.

More comments coming (probably). I will update the punchlist and let you know when I'm done reviewing. :)

<a class="gratipay-profile-link">profile link</a><br>
Identity: <span class="gratipay-identity"></span><br>
Receiving: <span class="gratipay-receiving"></span><br>
Goal: <span class="gratipay-goal"></span><br>
Copy link
Contributor

@chadwhitacre chadwhitacre Jun 29, 2016

Choose a reason for hiding this comment

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

We can drop goal throughout both the v1 and v2 APIs. We haven't had goals since ... I don't know, but not for a while now.

<div data-gratipay-teamslug="gratipay" data-gratipay-widget="custom">
Username: <span class="gratipay-slug"></span>
<a class="gratipay-profile-link">profile link</a><br>
Identity: <span class="gratipay-identity"></span><br>
Copy link
Contributor

Choose a reason for hiding this comment

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

We can drop identity, too. We're just dealing with Teams now, which are all plural.

var Gratipay = window.Gratipay || {};

// Where's our files?
var api = window.grtpAPI || 'https://grtp.co/v1/';
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be v2.

@chadwhitacre
Copy link
Contributor

Alright, @mattbk. I'm ready to merge this if you are. Even if we end up going a different direction on #103 with more of a Gumroad-style button, this work is basically done and is an improvement over having nothing for 2.0 widgets.

@mattbk
Copy link
Contributor Author

mattbk commented Jun 30, 2016

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants