Skip to content

Commit

Permalink
Améliore l'affiche des erreurs d'importations + Amelioration filtre l…
Browse files Browse the repository at this point in the history
…og - A review (#392)

* Améliorer affiche erreur importation utilisateur

* Ajout des actions sur un utilisateur dans le filtre
  • Loading branch information
jdauphant authored Dec 30, 2019
1 parent 06eb10f commit 2ba799f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/services/EventService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class EventService @Inject()(db: Database) {
def all(limit: Int = 1000, fromUserId: Option[UUID] = None) = db.withConnection { implicit connection =>
fromUserId match {
case Some(userId) =>
SQL"""SELECT *, host(ip_address)::TEXT AS ip_address FROM "event" WHERE from_user_id = $userId::uuid ORDER BY creation_date DESC LIMIT $limit""".as(simpleEvent.*)
SQL"""SELECT *, host(ip_address)::TEXT AS ip_address FROM "event" WHERE from_user_id = $userId::uuid OR to_user_id = $userId::uuid ORDER BY creation_date DESC LIMIT $limit""".as(simpleEvent.*)
case None => ""
SQL"""SELECT *, host(ip_address)::TEXT AS ip_address FROM "event" ORDER BY creation_date DESC LIMIT $limit""".as(simpleEvent.*)
}
Expand Down
10 changes: 5 additions & 5 deletions app/views/reviewUsersImport.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@
} {
@helper.form(routes.CSVImportController.importUsersReviewPost(), 'method -> "post", 'class -> "mdl-cell mdl-cell--12-col") {
@helper.CSRF.formField
@if(form.hasGlobalErrors) {
<div style="color: red; font-weight: bold;">
@for(error <- form.globalErrors) {
@error.message
@if(form.hasErrors) {
<div class="notification notification--error">
@for(error <- form.errors) {
@error.format - @error.key
@for(arg <- error.args) {
<p>@arg</p>
@arg<br>
}
}
</div>
Expand Down

0 comments on commit 2ba799f

Please sign in to comment.