feat: Add Alpine to assets

This commit is contained in:
Robert Prehn 2021-03-01 15:53:31 -06:00
parent d562855024
commit be58824bd3
4 changed files with 17 additions and 1 deletions

View file

@ -13,6 +13,7 @@ import "../css/app.css"
// import socket from "./socket" // import socket from "./socket"
// //
import "phoenix_html" import "phoenix_html"
import "alpinejs"
import { ready } from "./utils" import { ready } from "./utils"
function togglePasswordFieldVisibility() function togglePasswordFieldVisibility()
@ -22,7 +23,7 @@ function togglePasswordFieldVisibility()
if (el.type == 'password') if (el.type == 'password')
{ {
el.type = 'text' el.type = 'text'
} }
else else
{ {
el.type = 'password' el.type = 'password'

View file

@ -1332,6 +1332,11 @@
"integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=", "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=",
"dev": true "dev": true
}, },
"alpinejs": {
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/alpinejs/-/alpinejs-2.8.1.tgz",
"integrity": "sha512-ETJ/k0fbiBeP+OSd5Fhj70c+zb+YRzcVbyh5DVeLT3FBWMUeUvjOSWLi53IVLPSehaT2SKmB7w08WGF2jYTqNA=="
},
"amdefine": { "amdefine": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz",

View file

@ -9,6 +9,7 @@
}, },
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-free": "^5.14.0", "@fortawesome/fontawesome-free": "^5.14.0",
"alpinejs": "^2.8.1",
"autoprefixer": "^9.8.6", "autoprefixer": "^9.8.6",
"csswring": "^7.0.0", "csswring": "^7.0.0",
"glob": "^7.1.6", "glob": "^7.1.6",

View file

@ -27,4 +27,13 @@ defmodule AuthWeb.Plugs.RequireAdminTest do
assert !conn.halted assert !conn.halted
end end
test "call/2 with a user who is not admin", %{conn: conn} do
conn =
conn
|> Pow.Plug.assign_current_user(%User{roles: []}, [])
|> RequireAdmin.call([])
assert conn.halted
end
end end