diff options
author | Lauri Ojansivu <x@xet7.org> | 2019-05-09 16:06:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-09 16:06:17 +0300 |
commit | c8506697776c5f5ed0d82de0f4bd84bcc379db45 (patch) | |
tree | d31562f4bd14dedc096f806e2b250a0e7711cf25 /client | |
parent | 04c7372a4e665becb7383c319b9b514217468e54 (diff) | |
parent | cdef8a33e4df1caf9c8796ded4d946a76acb28a0 (diff) | |
download | wekan-c8506697776c5f5ed0d82de0f4bd84bcc379db45.tar.gz wekan-c8506697776c5f5ed0d82de0f4bd84bcc379db45.tar.bz2 wekan-c8506697776c5f5ed0d82de0f4bd84bcc379db45.zip |
Merge pull request #2384 from Akuket/origin/edge
Delete user feature
Diffstat (limited to 'client')
-rw-r--r-- | client/components/settings/peopleBody.jade | 5 | ||||
-rw-r--r-- | client/components/settings/peopleBody.js | 9 | ||||
-rw-r--r-- | client/components/settings/peopleBody.styl | 12 | ||||
-rw-r--r-- | client/components/users/userHeader.jade | 5 | ||||
-rw-r--r-- | client/components/users/userHeader.js | 5 |
5 files changed, 34 insertions, 2 deletions
diff --git a/client/components/settings/peopleBody.jade b/client/components/settings/peopleBody.jade index 4dca5cb1..15deb005 100644 --- a/client/components/settings/peopleBody.jade +++ b/client/components/settings/peopleBody.jade @@ -107,5 +107,8 @@ template(name="editUserPopup") label | {{_ 'password'}} input.js-profile-password(type="password") + div.buttonsContainer + input.primary.wide(type="submit" value="{{_ 'save'}}") + div + input#deleteButton.primary.wide(type="button" value="{{_ 'delete'}}") - input.primary.wide(type="submit" value="{{_ 'save'}}") diff --git a/client/components/settings/peopleBody.js b/client/components/settings/peopleBody.js index 3ec96bb0..83cf14fa 100644 --- a/client/components/settings/peopleBody.js +++ b/client/components/settings/peopleBody.js @@ -98,6 +98,7 @@ Template.peopleRow.helpers({ Template.editUserPopup.onCreated(function() { this.authenticationMethods = new ReactiveVar([]); + this.errorMessage = new ReactiveVar(''); Meteor.call('getAuthenticationsEnabled', (_, result) => { if (result) { @@ -129,6 +130,9 @@ Template.editUserPopup.helpers({ const selected = Users.findOne(userId).authenticationMethod; return selected === 'ldap'; }, + errorMessage() { + return Template.instance().errorMessage.get(); + }, }); BlazeComponent.extendComponent({ @@ -220,4 +224,9 @@ Template.editUserPopup.events({ }); } else Popup.close(); }, + + 'click #deleteButton'() { + Users.remove(this.userId); + Popup.close(); + }, }); diff --git a/client/components/settings/peopleBody.styl b/client/components/settings/peopleBody.styl index b98c5340..80387611 100644 --- a/client/components/settings/peopleBody.styl +++ b/client/components/settings/peopleBody.styl @@ -34,3 +34,15 @@ table button min-width: 60px; + +.content-wrapper + margin-top: 10px + +.buttonsContainer + display: flex + + input + margin: 0 + + div + margin: auto diff --git a/client/components/users/userHeader.jade b/client/components/users/userHeader.jade index c55b65c2..2a3d04cc 100644 --- a/client/components/users/userHeader.jade +++ b/client/components/users/userHeader.jade @@ -53,7 +53,10 @@ template(name="editProfilePopup") input.js-profile-email(type="email" value="{{emails.[0].address}}") else input.js-profile-email(type="email" value="{{emails.[0].address}}" readonly) - input.primary.wide(type="submit" value="{{_ 'save'}}") + div.buttonsContainer + input.primary.wide(type="submit" value="{{_ 'save'}}") + div + input#deleteButton.primary.wide(type="button" value="{{_ 'delete'}}") template(name="changePasswordPopup") +atForm(state='changePwd') diff --git a/client/components/users/userHeader.js b/client/components/users/userHeader.js index 6a2397a4..869c9d15 100644 --- a/client/components/users/userHeader.js +++ b/client/components/users/userHeader.js @@ -95,6 +95,11 @@ Template.editProfilePopup.events({ }); } else Popup.back(); }, + 'click #deleteButton'() { + Users.remove(Meteor.userId()); + Popup.close(); + AccountsTemplates.logout(); + }, }); // XXX For some reason the useraccounts autofocus isnt working in this case. |