Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
465 additions
and
92 deletions.
There are no files selected for viewing
This file contains 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 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 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,54 @@ | ||
import Ember from 'ember'; | ||
import { EKMixin as EmberKeyboardMixin, keyDown } from 'ember-keyboard'; | ||
|
||
const { | ||
Component, | ||
computed: { alias }, | ||
get, | ||
inject: { service }, | ||
on, | ||
set | ||
} = Ember; | ||
|
||
export default Component.extend(EmberKeyboardMixin, { | ||
classNames: ['project-join-modal-container'], | ||
/** | ||
* Flag indicating if the modal to quickly join a project should be shown | ||
* Even if true, the modal will not be shown if there is a | ||
* currentProjectMembership | ||
* | ||
* @property showModal | ||
* @type {Boolean} | ||
*/ | ||
showModal: false, | ||
|
||
currentUser: service(), | ||
projectUser: service(), | ||
|
||
user: alias('currentUser.user'), | ||
|
||
init() { | ||
this._super(...arguments); | ||
set(this, 'keyboardActivated', true); | ||
}, | ||
|
||
close() { | ||
// Without this check, tests are throwing | ||
// errors on "calling set on destroyed object" | ||
// There must be some sort of async behavior related to ember-modal-dialog | ||
// we are not understanding. | ||
if (this && !get(this, 'isDestroying')) { | ||
set(this, 'showModal', false); | ||
} | ||
}, | ||
|
||
closeOnEsc: on(keyDown('Escape'), function() { | ||
get(this, 'close')(); | ||
}), | ||
|
||
actions: { | ||
joinProject(project) { | ||
get(this, 'projectUser').joinProject(project); | ||
} | ||
} | ||
}); |
This file contains 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 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 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 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,29 @@ | ||
import Ember from 'ember'; | ||
|
||
const { | ||
get, | ||
inject: { service }, | ||
Service | ||
} = Ember; | ||
|
||
export default Service.extend({ | ||
currentUser: service(), | ||
flashMessages: service(), | ||
store: service(), | ||
|
||
joinProject(project) { | ||
let user = get(this, 'currentUser.user'); | ||
let store = get(this, 'store'); | ||
|
||
let projectUser = { project, user, role: 'pending' }; | ||
|
||
return store.createRecord('project-user', projectUser) | ||
.save() | ||
.then(() => this._flashSuccess('Your request has been sent.')); | ||
}, | ||
|
||
_flashSuccess(message) { | ||
let options = { fixed: true, sticky: false, timeout: 5000 }; | ||
get(this, 'flashMessages').clearMessages().success(message, options); | ||
} | ||
}); |
This file contains 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 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 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 |
---|---|---|
|
@@ -72,4 +72,8 @@ | |
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
|
||
&__actions { | ||
text-align: center; | ||
} | ||
} |
This file contains 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 |
---|---|---|
|
@@ -32,7 +32,7 @@ | |
vertical-align: middle; | ||
} | ||
|
||
span { | ||
> span { | ||
color: $blue; | ||
} | ||
} | ||
|
This file contains 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,59 @@ | ||
.project-join-modal { | ||
padding: 20px; | ||
width: 350px; | ||
|
||
@include media($xs-screen) { | ||
max-width: calc(100% - 20px); | ||
} | ||
|
||
h1 { | ||
font-size: $body-font-size-x-large; | ||
margin-bottom: 20px; | ||
text-align: center; | ||
} | ||
} | ||
|
||
.project-join-modal__button { | ||
button { | ||
width: 100%; | ||
} | ||
} | ||
|
||
.project-join-modal__icons { | ||
align-items: center; | ||
display: flex; | ||
justify-content: center; | ||
|
||
&__icon { | ||
content: ""; | ||
display: block; | ||
height: 25px; | ||
margin: 0 15px; | ||
vertical-align: middle; | ||
width: 25px; | ||
|
||
&--join { | ||
@include sprite($join); | ||
} | ||
} | ||
} | ||
|
||
.project-join-modal__skills { | ||
margin-bottom: 20px; | ||
text-align: center; | ||
|
||
p { | ||
font-size: $body-font-size-normal; | ||
margin-bottom: 10px; | ||
} | ||
|
||
.related-skills .skills { | ||
max-height: none; | ||
overflow: auto; | ||
|
||
li { | ||
display: inline; | ||
float: none; | ||
} | ||
} | ||
} |
This file contains 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 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 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 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,28 @@ | ||
<button class="button default small" {{action (mut showModal) true}}>Join project</button> | ||
{{#if showModal}} | ||
{{#modal-dialog | ||
clickOutsideToClose=true | ||
close=(action close) | ||
containerClassNames="project-join-modal" | ||
renderInPlace=true | ||
targetAttachment="center" | ||
translucentOverlay=true}} | ||
<h1>Join {{project.title}}</h1> | ||
<div class="project-join-modal__icons"> | ||
<div class="project-join-modal__icons__avatar"> | ||
<img class="icon medium" src={{user.photoLargeUrl}} /> | ||
</div> | ||
<div class="project-join-modal__icons__icon project-join-modal__icons__icon--join"></div> | ||
<div class="project-join-modal__icons__avatar"> | ||
<img class="icon medium" src={{project.iconLargeUrl}} /> | ||
</div> | ||
</div> | ||
<div class="project-join-modal__skills"> | ||
<p>What can you help with?</p> | ||
{{related-skills isClickable=true skills=skills}} | ||
</div> | ||
<div class="project-join-modal__button"> | ||
<button class="button default" {{action "joinProject" project}}>Request to Join</button> | ||
</div> | ||
{{/modal-dialog}} | ||
{{/if}} |
This file contains 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 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 |
---|---|---|
@@ -1,4 +1 @@ | ||
<span>{{skill.title}}</span> | ||
{{#tooltip-on-component delay=1000 effect='none' side='bottom' updateFor=skill.isLoaded}} | ||
{{#if matched}}Delete your skill{{else}}Add new skill{{/if}} | ||
{{/tooltip-on-component}} |
This file contains 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{{#each sortedSkills as |skill|}} | ||
{{skill-list-item skill=skill action="skillItemHidden"}} | ||
{{skill-list-item isClickable=isClickable skill=skill action="skillItemHidden"}} | ||
{{/each}} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.