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

Add "give kredits" button to contributor profiles #180

Merged
merged 6 commits into from
Dec 13, 2019

Conversation

raucao
Copy link
Member

@raucao raucao commented Dec 12, 2019

Includes support for query params for submitting new contributions (contributor ID, kind, amount).

closes #172
refs #40

Currently the default attributes are only set correctly when either none
or all attributes are handed to the component
Just contributor ID, kind, and amount for now.
Copy link
Contributor

@galfert galfert left a comment

Choose a reason for hiding this comment

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

Looks and works fine 👍

Just left a comment for a little improvement.

Object.keys(this.defaultAttr).forEach(a => {
if (typeof this.attributes[a] === 'undefined') {
this.attributes[a] = this.defaultAttr[a];
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of merging attributes manually, you can use Ember's assign method to replace the whole if-else block.

import { assign } from '@ember/polyfills';
...
this.set('attributes', assign({}, this.defaultAttr, this.attributes));

Co-authored-by: Garret Alfert <alfert@wevelop.de>
@raucao raucao force-pushed the feature/add_contribution_with_params branch from 9e5af8d to 3f4cc39 Compare December 13, 2019 16:05
@raucao raucao merged commit 215ad1d into master Dec 13, 2019
@raucao raucao deleted the feature/add_contribution_with_params branch December 13, 2019 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "give credits" option on the contributor profile
2 participants