diff --git a/app/controllers/JavascriptController.scala b/app/controllers/JavascriptController.scala index e3020d6ec..a5b783bce 100644 --- a/app/controllers/JavascriptController.scala +++ b/app/controllers/JavascriptController.scala @@ -17,6 +17,7 @@ class JavascriptController() extends InjectedController { routes.javascript.GroupController.editGroup, routes.javascript.ApplicationController.all, routes.javascript.UserController.all, + routes.javascript.UserController.deleteUnusedUserById, routes.javascript.UserController.editUser ) ).as(MimeTypes.JAVASCRIPT) diff --git a/app/views/editUser.scala.html b/app/views/editUser.scala.html index 46f832c81..03b96da89 100644 --- a/app/views/editUser.scala.html +++ b/app/views/editUser.scala.html @@ -8,7 +8,6 @@ @main(currentUser, currentUserRights)(s"Utilisateur ${form("name").value.getOrElse("")}") { - }{ @defining(form.value.exists(user => Authorization.canEditOtherUser(uneditedUser)(currentUserRights))) { canEditUser => @helper.form(action = routes.UserController.editUserPost(uneditedUser.id), "class" -> "mdl-grid mdl-cell mdl-cell--12-col") { @@ -200,7 +199,7 @@ } @if(unused && canEditUser) { - +
} @@ -221,17 +220,6 @@

} -

Suppression d'un utilisateur inutilisé.

@@ -239,21 +227,11 @@

Suppression d'un utilisateur inutilisé.

Êtes-vous certain de vouloir supprimer le compte de cet utilisateur?
- - + +
- } } }{ diff --git a/app/views/helpers/head.scala b/app/views/helpers/head.scala index a4aad3239..4dde33353 100644 --- a/app/views/helpers/head.scala +++ b/app/views/helpers/head.scala @@ -42,8 +42,7 @@ object head { webJarScript("material.min.js"), publicScript("javascripts/polyfills.js"), publicScript("javascripts/main.js"), - webJarCss("dialog-polyfill.css"), - webJarScript("dialog-polyfill.js"), + publicCss("generated-js/index.css"), script(`type` := "text/javascript", src := JavascriptController.javascriptRoutes.url) ) diff --git a/app/views/home/page.scala.html b/app/views/home/page.scala.html index 1a7c734cb..7459abd6d 100644 --- a/app/views/home/page.scala.html +++ b/app/views/home/page.scala.html @@ -19,6 +19,7 @@ + - @webJarsUtil.locate("dialog-polyfill.css").css() - @webJarsUtil.locate("dialog-polyfill.js").script() + diff --git a/build.sbt b/build.sbt index a5b13b8bf..c34ee4030 100644 --- a/build.sbt +++ b/build.sbt @@ -104,7 +104,6 @@ libraryDependencies ++= Seq( "org.webjars" % "material-design-icons" % "4.0.0", "org.webjars.npm" % "roboto-fontface" % "0.10.0", "org.webjars.npm" % "slim-select" % "1.24.0", - "org.webjars.npm" % "dialog-polyfill" % "0.4.10", "org.webjars.npm" % "twemoji" % "2.5.1", "org.webjars" % "chartjs" % "2.9.4", "org.webjars" % "font-awesome" % "5.15.2", diff --git a/package.json b/package.json index a9b6f2b5d..fc17cc70a 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,8 @@ }, "devDependencies": { "@types/tabulator-tables": "4.8.0", + "css-loader": "5.2.4", + "mini-css-extract-plugin": "1.6.0", "rimraf": "3.0.2", "ts-loader": "9.1.1", "typescript": "4.2.4", diff --git a/public/javascripts/dialog.js b/public/javascripts/dialog.js deleted file mode 100644 index 9a914feda..000000000 --- a/public/javascripts/dialog.js +++ /dev/null @@ -1,7 +0,0 @@ -function closeDialog(dialog) { - dialog.close(); -} - -function showDialog(dialog) { - dialog.showModal(); -} \ No newline at end of file diff --git a/public/javascripts/main-page-bottom.js b/public/javascripts/main-page-bottom.js index eae8b462d..064975e7a 100644 --- a/public/javascripts/main-page-bottom.js +++ b/public/javascripts/main-page-bottom.js @@ -2,19 +2,6 @@ // TODO: The idea is to put everything in main.js in this file, then rename this file as main.js -// Note: `Array.from` does not work in HTMLUnit on NodeList -// so we resort to using this function -function querySelectorAllForEach(selector, exec) { - var nodes = document.querySelectorAll(selector); - if (nodes) { - for (var i = 0; i < nodes.length; i++) { - exec(nodes[i]); - } - } -} - - - // // Header ribbon (demo) // @@ -122,56 +109,6 @@ setupApplicationForm(); -// -// Dialog -// - -var dialogDeleteGroupId = "dialog-delete-group"; -var dialogDeleteGroupButtonShowId = "dialog-delete-group-show"; -var dialogDeleteGroupButtonCancelId = "dialog-delete-group-cancel"; -var dialogDeleteGroupButtonConfirmId = "dialog-delete-group-confirm"; -function setupDialog() { - var dialog = document.getElementById(dialogDeleteGroupId); - - if (dialog) { - if (!dialog.showModal) { - dialogPolyfill.registerDialog(dialog); - } - - querySelectorAllForEach( - "#" + dialogDeleteGroupButtonCancelId, - function (element) { - element.addEventListener('click', function(event) { - dialog.close(); - }); - } - ); - - querySelectorAllForEach( - "#" + dialogDeleteGroupButtonShowId, - function (element) { - element.addEventListener('click', function(event) { - dialog.showModal(); - }); - } - ); - - querySelectorAllForEach( - "#" + dialogDeleteGroupButtonConfirmId, - function (element) { - element.addEventListener('click', function(event) { - var uuid = element.dataset.uuid; - var url = jsRoutes.controllers.GroupController.deleteUnusedGroupById(uuid).url; - window.location = url; - }); - } - ); - } -} - - -setupDialog(); - // // Transform