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

[EMERAL-122] Add staff when user already exists #178

Merged
merged 1 commit into from
Jan 10, 2018

Conversation

manu-d
Copy link
Contributor

@manu-d manu-d commented Dec 14, 2017

  • If the invited email was already a regular user, a toaster error was displayed

=> We first check that no user has this email. If there is, we update the role, otherwise, same behaviour as before.

screen shot 2017-12-14 at 10 23 33

@manu-d
Copy link
Contributor Author

manu-d commented Dec 14, 2017

@ouranos
Maybe we could cherry-pick the first commit for 2.0

@ouranos
Copy link
Contributor

ouranos commented Dec 14, 2017

Please re-open on 3.3 branch. Thanks

Copy link

@xaun xaun left a comment

Choose a reason for hiding this comment

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

Looks good, just a couple minor suggestions

(success) ->
toastr.success("mnoe_admin_panel.dashboard.staffs.add_staff.modal.toastr_success", {extraData: {staff_name: "#{vm.user.name} #{vm.user.surname}"}})
vm.staffAlreadyExists = success.data.length > 0
Copy link

Choose a reason for hiding this comment

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

You could use !_.isEmpty(success.data)

@@ -16,24 +16,33 @@ <h3 class="modal-title" translate>mnoe_admin_panel.dashboard.staffs.add_staff.mo

<div class="row top-buffer-1">
<div class="col-sm-6">
<input type="email" class="form-control input-sm" id="user-email" ng-model="vm.user.email" placeholder="{{'mnoe_admin_panel.dashboard.staffs.add_staff.modal.placeholder.email' | translate}}" aria-label="{{'mnoe_admin_panel.dashboard.staffs.add_staff.modal.placeholder.email' | translate}}" required>
<input type="email" class="form-control input-sm" id="user-email" ng-model="vm.user.email" ng-change="vm.staffAlreadyExists = false" placeholder="{{'mnoe_admin_panel.dashboard.staffs.add_staff.modal.placeholder.email' | translate}}" aria-label="{{'mnoe_admin_panel.dashboard.staffs.add_staff.modal.placeholder.email' | translate}}" required>
Copy link

Choose a reason for hiding this comment

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

Best to avoid making an assignment in the template (ng-change="vm.staffAlreadyExists = false"), prefer adding an vm.onEmailChange method

@manu-d manu-d force-pushed the add_staff branch 4 times, most recently from 012e245 to 473e0e4 Compare December 18, 2017 09:37
@manu-d manu-d changed the base branch from emerald-staging to 1.0 December 18, 2017 09:38
@ouranos ouranos merged commit 10fba10 into maestrano:1.0 Jan 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants