-
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.
Admin: bootstrap whitelisted verified email module
- Loading branch information
Showing
10 changed files
with
122 additions
and
2 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
app/controllers/admin/whitelisted_verified_emails_controller.rb
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 @@ | ||
class Admin::WhitelistedVerifiedEmailsController < AdminController | ||
def index | ||
@verified_emails = VerifiedEmail.where(status: 'whitelisted').order(created_at: :desc).page(params[:page]).per(50) | ||
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
44 changes: 44 additions & 0 deletions
44
app/views/admin/whitelisted_verified_emails/index.html.erb
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 @@ | ||
<turbo-frame id="verified_emails_table"> | ||
<div class="fr-table fr-table--bordered"> | ||
<div class="fr-table__container"> | ||
<div class="fr-table__content"> | ||
<table> | ||
<thead> | ||
<tr> | ||
<% | ||
%w[ | ||
created_at | ||
actions | ||
].each do |attr| | ||
%> | ||
<th scope="col"> | ||
<%= t(".table.header.#{attr}") %> | ||
</th> | ||
<% end %> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
<% @verified_emails.each do |verified_email| %> | ||
<tr id="<%= dom_id(verified_email) %>"> | ||
<td class="verified-email-email"> | ||
<%= verified_email.email %> | ||
</td> | ||
<td class="verified-email-created_at"> | ||
<%= verified_email.created_at.to_date %> | ||
</td> | ||
<td class="verified-email-actions"> | ||
Supprimer | ||
</td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<%= paginate @verified_emails %> | ||
</turbo-frame> | ||
|
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,25 @@ | ||
<%= content_for(:body) do %> | ||
<div class="fr-container"> | ||
<div class="dashboard-sub-header"> | ||
<div class="sub-header"> | ||
<div> | ||
<h1 class="fr-m-0"> | ||
<%= t("admin.#{controller_name}.#{action_name}.title") %> | ||
</h1> | ||
</div> | ||
|
||
<% if content_for?(:header_action) %> | ||
<div> | ||
<%= content_for(:header_action) %> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
|
||
<%= render partial: 'shared/alerts' %> | ||
|
||
<%= yield %> | ||
</div> | ||
<% end %> | ||
|
||
<%= render template: 'layouts/application' %> |
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,16 @@ | ||
# language: fr | ||
|
||
Fonctionnalité: Espace admin: emails en liste blanche | ||
En tant qu'administrateur, je peux voir les emails en liste blanche et en ajouter des supplémentaires, | ||
dans le cas où on nous contacte au support et qu'on nous certifie que l'email est bien valide | ||
|
||
Contexte: | ||
Sachant que je suis un administrateur | ||
Et que je me connecte | ||
|
||
Scénario: Je peux consulter les emails en liste blanche | ||
Quand il y a l'email "[email protected]" marqué en tant que "liste blanche" | ||
Et qu'il y a l'email "[email protected]" marqué en tant que "délivrable" | ||
Et que je me rends sur le module "Emails vérifiés" de l'espace administrateur | ||
Alors la page contient "[email protected]" | ||
Et la page ne contient pas "[email protected]" |
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
10 changes: 10 additions & 0 deletions
10
features/step_definitions/whitelisted_verified_emails_steps.rb
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,10 @@ | ||
Quand("il y a l'email {string} marqué en tant que {string}") do |email, kind| | ||
case kind | ||
when 'délivrable' | ||
status = 'deliverable' | ||
when 'liste blanche' | ||
status = 'whitelisted' | ||
end | ||
|
||
create(:verified_email, email:, status:) | ||
end |