-
Notifications
You must be signed in to change notification settings - Fork 664
Decline owner invites #1085
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
Merged
bors-voyager
merged 29 commits into
rust-lang:master
from
natboehm:decline-owner-invites
Sep 25, 2017
Merged
Decline owner invites #1085
Changes from 24 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
8701a31
created api route for user to accept invitation
natboehm a655676
test for accepting owner invites route, currently failing
natboehm 3d3bdec
test for accepting crate owner invitation, wrap delete and insert sta…
natboehm 43909ba
accept button functioning on frontend
natboehm aaba3c9
add filter to delete statment such that delete filters by crate_id an…
natboehm d7c0031
page should reload on accepting an invite
natboehm 1f74f42
cargo fmt
natboehm 3d4f0fd
js linting error
natboehm eceb03f
change route for accept to use model.save on the frontend
natboehm 5bdcabc
switch controller to component for pending invites, generate success …
natboehm 6b3d0df
fix test for accepting owner invite
natboehm d50416b
npm linting errors
natboehm 4b4aa3b
clippy
natboehm a8a6c96
delete whitespace
natboehm 440bee4
Add width to make columns line up on invite page
natboehm b64c808
delete http-data file formerly needed for test to pass
natboehm 9cf6974
add route and function for declining an owner invite
natboehm 4485f35
add filter statement for user_id - don't want to delete all occurranc…
natboehm 8b491ad
add test for declining invitations
natboehm 0f1f2b1
http data needed for test
natboehm 69a682d
comments i forgot to save
natboehm 4b41121
frontend functionality for declining invites
natboehm 52ee915
i don't know how this got back in here
natboehm 2f965d2
add decline function for /me/crate_invitations/:crate_id route
natboehm 0f771e4
updated test for declining invites
natboehm a252eb5
add frontend functionality for declining invitations
natboehm dcfe7c5
cargo fmt
natboehm 5f15a6a
remove http-data file formerly needed for tests
natboehm 3d7a851
Change button from deny to decline
natboehm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Component.extend({ | ||
isSuccess: false, | ||
isError: false, | ||
inviteError: 'default error message', | ||
|
||
actions: { | ||
acceptInvitation(invite) { | ||
invite.set('accepted', true); | ||
invite.save() | ||
.then(() => { | ||
this.set('isSuccess', true); | ||
}) | ||
.catch((error) => { | ||
this.set('isError', true); | ||
if (error.payload) { | ||
this.set('inviteError', | ||
`Error in accepting invite: ${error.payload.errors[0].detail}` | ||
); | ||
} else { | ||
this.set('inviteError', 'Error in accepting invite'); | ||
} | ||
}); | ||
} | ||
} | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<div class='row'> | ||
{{#if isSuccess }} | ||
<p>Success! You've been added as an owner of crate | ||
{{#link-to 'crate' invite.crate_name}}{{invite.crate_name}}{{/link-to}}. | ||
</p> | ||
{{else}} | ||
<div class='info'> | ||
<div class='name'> | ||
<h3> | ||
{{#link-to 'crate' invite.crate_name}} | ||
{{invite.crate_name}} | ||
{{/link-to}} | ||
</h3> | ||
</div> | ||
<div class='invite'> | ||
<p>Invited by: | ||
{{#link-to 'user' invite.invited_by_username}} | ||
{{invite.invited_by_username}} | ||
{{/link-to}} | ||
</p> | ||
</div> | ||
<div class='sent'> | ||
<span class='small'>{{moment-from-now invite.created_at}}</span> | ||
</div> | ||
<div class='actions'> | ||
<button class='small yellow-button' {{action 'acceptInvitation' invite}}>Accept</button> | ||
<button class='small yellow-button'>Deny</button> | ||
</div> | ||
{{#if isError}} | ||
<div class='label'> | ||
<p class='small-text'>{{inviteError}}</p> | ||
</div> | ||
{{/if}} | ||
</div> | ||
{{/if}} | ||
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like how this ended up, the code's easier to read and well organized! 💯