-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Feature - Allow users to be deleted #1592
Open
faloi
wants to merge
10
commits into
master
Choose a base branch
from
feature-delete-user-account
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ccb607b
Add delete account section
faloi 0617d5b
Send delete confirmation mail on submit
faloi b06bbc1
Final step of delete account flow
faloi 143d03a
Fix immersive orga broken test
faloi c453f0a
Add invalid token flow with feature specs
faloi 290b70d
Use mumuki-domain from GitHub branch
faloi 49c1cb7
fixup! Add invalid token flow with feature specs
faloi fce7e54
Attempt to fix Capybara errors
faloi b0ee222
Configuration to run JS tests on GH actions
faloi 7462f37
Fix capybara exclude tags
faloi 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 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,11 @@ | ||
module MailerHelper | ||
def delete_account_url_for(user) | ||
delete_confirmation_user_url host: organic_domain_for(user), token: user.delete_account_token | ||
end | ||
|
||
private | ||
|
||
def organic_domain_for(user) | ||
Mumukit::Platform.laboratory.organic_domain(user.last_organization) | ||
end | ||
end |
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,6 @@ | ||
<%= delete_account_url_for @user %> | ||
|
||
© Copyright 2015-<%= DateTime.now.year %> Mumuki. | ||
|
||
<%= t :stop_emails? %> | ||
<%= t :cancel_subscription %> |
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,19 @@ | ||
<div> | ||
<h3 class="text-danger"><%= t :delete_account %></h3> | ||
<div class="row"> | ||
<div class="col-md-8"> | ||
<p><%= t :delete_account_explain %></p> | ||
</div> | ||
<div class="col-md-4"> | ||
<div class="pull-right"> | ||
<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#user-delete-account-modal"> | ||
<%= t :delete_account %> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<%= content_for :no_container do %> | ||
<%= render partial: 'user_delete_modal', locals: { submit_url: delete_request_user_path } %> | ||
<% end %> |
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,17 @@ | ||
<%= content_for :breadcrumbs do %> | ||
<%= breadcrumbs @user %> | ||
<% end %> | ||
|
||
<div class="row"> | ||
<div class="mu-inline-block-left"> | ||
<h1> | ||
<%= t :delete_account %> | ||
</h1> | ||
</div> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="col-md-12"> | ||
<%= t :delete_account_confirmation_email_explain_html, user_email: @user.email, support_email: Rails.configuration.reminder_sender_email %> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not for you to address it @faloi, but we should define another configuration for Mumuki general purpose email |
||
</div> | ||
</div> |
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,44 @@ | ||
<script type="text/javascript" charset="utf-8"> | ||
function checkConfirmationText() { | ||
const val = $('#confirm-delete-input').val(); | ||
$('#delete-account-button').prop('disabled', val !== '<%= t :delete_account_confirmation_text %>'); | ||
} | ||
</script> | ||
|
||
<div class="modal fade" id="user-delete-account-modal" tabindex="-1" role="dialog"> | ||
<div class="modal-dialog"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | ||
<span aria-hidden="true">×</span></button> | ||
<h4 class="modal-title"><%= t :delete_account %></h4> | ||
</div> | ||
<div class="modal-body"> | ||
<div class="container-fluid"> | ||
<div class="row"> | ||
<%= t :delete_account_modal_explain_html, name: @user.name %> | ||
</div> | ||
<div class="row"> | ||
<% @user.student_granted_organizations.each do |organization| %> | ||
<div class="col-md-4 text-center"> | ||
<%= image_tag(organization.banner_url, width: '100%', class: 'pull-left') %> | ||
<p><%= organization.name %></p> | ||
</div> | ||
<% end %> | ||
</div> | ||
<div class="row"> | ||
<%= t :delete_account_confirmation_request %> <i><%= t :delete_account_confirmation_text %></i>. | ||
</div> | ||
<div class="row"> | ||
<%= form_with url: submit_url do |f| %> | ||
<div class="form-group"> | ||
<input class="form-control" type="text" id="confirm-delete-input" autocomplete="off" onkeyup="checkConfirmationText()"> | ||
</div> | ||
<%= f.submit t(:delete_account_agree), class: 'btn btn-danger', id: 'delete-account-button', disabled: true %> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
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,11 @@ | ||
<script type="text/javascript" charset="utf-8"> | ||
$(document).ready(function() { | ||
$('#user-delete-account-modal').modal(); | ||
}); | ||
</script> | ||
|
||
<%= render partial: 'user_delete_confirmation' %> | ||
|
||
<%= content_for :no_container do %> | ||
<%= render partial: 'user_delete_modal', locals: { submit_url: delete_confirmation_user_url } %> | ||
<% end %> |
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,22 @@ | ||
<%= content_for :breadcrumbs do %> | ||
<%= breadcrumbs @user %> | ||
<% end %> | ||
|
||
<div class="row"> | ||
<div class="mu-inline-block-left"> | ||
<h1> | ||
<%= t :delete_account %> | ||
</h1> | ||
</div> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="col-md-12"> | ||
<p> | ||
<%= t :delete_account_invalid_token %> | ||
</p> | ||
<p> | ||
<%= t :delete_account_try_again_html, profile_url: user_path %> | ||
</p> | ||
</div> | ||
</div> |
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,5 @@ | ||
<%= render partial: 'user_delete_confirmation' %> | ||
|
||
<%= content_for :no_container do %> | ||
<%= render partial: 'user_delete_modal', locals: { submit_url: delete_request_user_url } %> | ||
<% end %> |
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
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.
Prefer to explicitly obtain organization from where the user clicked delete profile button