-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1530 from eciis/invites-mobile-page
Invites mobile page
- Loading branch information
Showing
13 changed files
with
242 additions
and
54 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
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,53 @@ | ||
.invite-inst { | ||
display: grid; | ||
padding: 1em 0; | ||
} | ||
|
||
.invite-inst__toolbar { | ||
position: fixed; | ||
z-index: 3; | ||
width: 100%; | ||
} | ||
|
||
.invite-inst__toolbar__title { | ||
color: #737474; | ||
text-transform: uppercase; | ||
white-space: nowrap; | ||
} | ||
|
||
.invite-inst__cards { | ||
grid-row-start: 2; | ||
display: grid; | ||
grid-row-gap: 1em; | ||
padding-top: 25%; | ||
} | ||
|
||
.invite-inst__card__content { | ||
display: grid; | ||
grid-row-gap: 1em; | ||
} | ||
|
||
.invite-inst__card__content md-input-container { | ||
padding-right: 0; | ||
margin: 0; | ||
color: #9E9E9E; | ||
} | ||
|
||
.invite-inst__btns { | ||
text-align: end; | ||
margin-bottom: 0.5em; | ||
} | ||
|
||
.invite-inst__btn { | ||
width: min-content; | ||
justify-self: end; | ||
background-color: #009688; | ||
color: white; | ||
margin-right: 0; | ||
} | ||
|
||
.invite-inst__list { | ||
display: grid; | ||
grid-row-gap: 0.5em; | ||
max-height: 18em; | ||
} |
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,87 @@ | ||
<white-toolbar | ||
primary-button-icon="keyboard_arrow_left" | ||
title="Convites" | ||
title-class="invite-inst__toolbar__title" | ||
class="invite-inst__toolbar"> | ||
</white-toolbar> | ||
|
||
<md-content class="invite-inst"> | ||
<div class="invite-inst__cards"> | ||
<clickable-card icon="send" title="Convidar Instituição"> | ||
<div class="invite-inst__card__content"> | ||
<form name="inviteInstCtrl.inviteInstForm"> | ||
<md-input-container md-no-float class="md-block"> | ||
<input placeholder="Nome da instituição convidada" class="green-input" type="text" | ||
ng-model="inviteInstCtrl.invite.suggestion_institution_name" | ||
aria-label="Nome da instituição convidada" required> | ||
</md-input-container> | ||
<md-input-container md-no-float class="md-block"> | ||
<input placeholder="E-mail da instituição" class="green-input" type="email" | ||
ng-model="inviteInstCtrl.invite.invitee" | ||
aria-label="E-mail da instituição" required> | ||
</md-input-container> | ||
</form> | ||
<div class="invite-inst__btns"> | ||
<md-button class="invite-inst__btn" ng-disabled="inviteInstCtrl.inviteInstForm.$pristine" | ||
ng-click="inviteInstCtrl.cancelInvite()"> | ||
CANCELAR | ||
</md-button> | ||
<md-button class="invite-inst__btn" ng-disabled="inviteInstCtrl.inviteInstForm.$invalid" | ||
ng-click="inviteInstCtrl.checkInstInvite($event)"> | ||
ENVIAR | ||
</md-button> | ||
</div> | ||
</div> | ||
</clickable-card> | ||
|
||
<clickable-card icon="email" title="Convites Enviados"> | ||
<div class="invite-inst__card__content"> | ||
<search-field keyword="searchSentInvites"></search-field> | ||
<md-content class="invite-inst__list custom-scrollbar"> | ||
<entity-showcase ng-repeat="invite in inviteInstCtrl.sent_invitations | filter: searchSentInvites" | ||
icon="account_balance" | ||
title="invite.stub_institution.name || invite.suggestion_institution_name" | ||
subtitles-list="[ | ||
invite.invitee, | ||
'Convidado por: '+ invite.sender_name | ||
]" | ||
right-icon-btns="[ | ||
inviteInstCtrl.createIconBtn('send', null, inviteInstCtrl.resendInvite, [invite.key, $event]) | ||
]"> | ||
</entity-showcase> | ||
</md-content> | ||
</div> | ||
</clickable-card> | ||
|
||
<clickable-card icon="announcement" title="Convites Requisitados" show-notification="inviteInstCtrl.hasNewRequests()"> | ||
<search-field keyword="searchSentRequests"></search-field> | ||
<md-content class="invite-inst__list custom-scrollbar"> | ||
<entity-showcase ng-repeat="request in inviteInstCtrl.sent_requests | filter: searchSentRequests" | ||
icon="account_balance" | ||
title="request.institution.name || request.requested_inst_name" | ||
subtitles-list="[ | ||
'Requisitado por: '+ request.sender_name, | ||
'E-mail: ' + request.sender[0] | ||
]" | ||
right-icon-btns="[ | ||
inviteInstCtrl.createIconBtn('error', '#009688', inviteInstCtrl.showPendingRequestDialog, [$event, request]) | ||
]"> | ||
</entity-showcase> | ||
</md-content> | ||
</clickable-card> | ||
|
||
<clickable-card icon="check_circle" title="Convites Aceitos"> | ||
<search-field keyword="searchAcceptedInvite"></search-field> | ||
<md-content class="invite-inst__list custom-scrollbar"> | ||
<entity-showcase ng-repeat="acceptedInvite in inviteInstCtrl.accepted_invitations | filter: searchAcceptedInvite" | ||
icon="account_balance" | ||
title="acceptedInvite.stub_institution.name" | ||
subtitles-list="[ | ||
'Nome sugerido: '+ acceptedInvite.suggestion_institution_name, | ||
]" | ||
left-action="inviteInstCtrl.goToActiveInst(acceptedInvite.stub_institution)"> | ||
</entity-showcase> | ||
</md-content> | ||
</clickable-card> | ||
</div> | ||
</md-content> |
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 |
---|---|---|
|
@@ -33,6 +33,11 @@ | |
status: 'sent', | ||
} | ||
|
||
const form = { | ||
'$setPristine': () => {}, | ||
'$setUntouched': () => {} | ||
}; | ||
|
||
var INSTITUTION_SEARCH_URI = '/api/search/institution?value='; | ||
|
||
var invite = new Invite({invitee: "[email protected]", suggestion_institution_name : "New Institution", key: '123'}, 'institution', institution.key); | ||
|
@@ -71,6 +76,8 @@ | |
}; | ||
state.params.institutionKey = institution.key; | ||
inviteinstitutionCtrl = createCtrl(); | ||
inviteinstitutionCtrl.$onInit(); | ||
inviteinstitutionCtrl.inviteInstForm = form; | ||
httpBackend.flush(); | ||
})); | ||
|
||
|
@@ -99,6 +106,7 @@ | |
} | ||
}; | ||
}); | ||
spyOn(inviteinstitutionCtrl, 'resetForm'); | ||
inviteinstitutionCtrl.invite = invite; | ||
}); | ||
|
||
|
@@ -107,6 +115,7 @@ | |
var promise = inviteinstitutionCtrl.sendInstInvite(invite); | ||
promise.then(function() { | ||
expect(inviteService.sendInviteInst).toHaveBeenCalledWith(invite); | ||
expect(inviteinstitutionCtrl.resetForm).toHaveBeenCalled(); | ||
done(); | ||
}); | ||
}); | ||
|
@@ -218,9 +227,11 @@ | |
|
||
describe('$onInit', function () { | ||
it('should call showLinkRequestDialog if in mobile screen', function () { | ||
spyOn(stateLinkRequestService, 'showLinkRequestDialog'); | ||
spyOn(inviteinstitutionCtrl, '_loadSentRequests'); | ||
spyOn(inviteinstitutionCtrl, '_loadSentInvitations'); | ||
inviteinstitutionCtrl.$onInit(); | ||
expect(stateLinkRequestService.showLinkRequestDialog).toHaveBeenCalledWith(stateLinks.INVITE_INSTITUTION, states.HOME); | ||
expect(inviteinstitutionCtrl._loadSentRequests).toHaveBeenCalled(); | ||
expect(inviteinstitutionCtrl._loadSentInvitations).toHaveBeenCalled(); | ||
}); | ||
}); | ||
})); |
Oops, something went wrong.