GithubHelp home page GithubHelp logo

contact_demo's People

Contributors

smpallen99 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

contact_demo's Issues

Inconsistent with v0.3.0 of coherence package

I'm not sure whether to log the bug in the coherence repo or in this one. But, the problem is that with this code, I am unable to upgrade that package. Reason for upgrade: would like to have the 'register for account' functionality that was introduced after v0.2.0

Collapsing migrations for example codebase

@smpallen99 - for those who come across this project for the first time, I think it might be ok to have the migrations collapsed (I usually collapse migrations - one per table - before going live for v1). It removes some of the initial clutter associated with codebases that are just getting "warmed up".
Wdyt?

Using ex_admin

Since this codebase is using ex_admin, is there a need to maintain the regular controllers, etc in web/controllers?

None of the filters work

I tried with the latest code in contact_demo, and for eg in the contacts screen, I tried to search for "last_name" containing some characters. When the page refreshes, the selection (also reflected in the url as query parameters) always goes to the "Equals" selection for the first filtered field. I'm not sure if this is an issue with ex_admin or this codebase.

CSS and JS assets not loading

hi, I'm trying to use the exact downloaded version of the contact_demo app (downloaded as a zip). After running mix deps.get and npm install - I'm not able to get the CSS/Js files when running in development mode. Any help?

Demo server error

For a link such as: http://demo2.exadmin.info/admin/groups/batch_action
It seems to happen when clicking the Batch Action button when the javascript is blocked, say via a browser plugin or so since jquery is being loaded from off-site. Probably should not cause a server error regardless, but the button does nothing when the off-site javascript is loaded.

login not working

After entering the username and password as mentioned in the login page, the app is still in login page.
It loads a stays still.

User_Role model

TODO: In a later version of Ecto, can we remove this? imo, it doesn't need to be exposed as a first-class model

I saw this todo in the code, can this be improved now? Would it make a good PR?

We're on Ecto 2 so maybe the comment was with ecto 1.x

Fix test errors

mix test gives the following errors:

  1) test validations validates uniqueness of 'email' field (ContactDemo.UserTest)
     test/models/user_test.exs:125
     ** (MatchError) no match of right hand side value: {:ok, %ContactDemo.User{__meta__: #Ecto.Schema.Metadata<:loaded, "users">, active: true, confirmation_send_at: nil, confirmation_token: nil, confirmed_at: nil, current_sign_in_at: nil, current_sign_in_ip: nil, email: "[email protected]", encrypted_password: "$2b$12$9rChK6zFjj9w1QLLM/iIkebn8whpGg4LXG5EzpAHlZPXZBpBhu946", expire_on: #<Date(2016-11-21)>, failed_attempts: 0, id: 65, inserted_at: #Ecto.DateTime<2016-11-21 02:54:48>, last_sign_in_at: nil, last_sign_in_ip: nil, locked_at: nil, name: "Erwin Schimmel", password: "changeme", password_confirmation: "changeme", remember_created_at: nil, reset_password_sent_at: nil, reset_password_token: nil, roles: #Ecto.Association.NotLoaded<association :roles is not loaded>, sign_in_count: 0, unlock_token: nil, updated_at: #Ecto.DateTime<2016-11-21 02:54:48>, username: "amir", users_roles: #Ecto.Association.NotLoaded<association :users_roles is not loaded>}}
     stacktrace:
       test/models/user_test.exs:128: (test)

...

  2) test validations validates uniqueness of 'username' field (ContactDemo.UserTest)
     test/models/user_test.exs:132
     ** (MatchError) no match of right hand side value: {:ok, %ContactDemo.User{__meta__: #Ecto.Schema.Metadata<:loaded, "users">, active: true, confirmation_send_at: nil, confirmation_token: nil, confirmed_at: nil, current_sign_in_at: nil, current_sign_in_ip: nil, email: "[email protected]", encrypted_password: "$2b$12$FfAT2G.BvcvZfe/j8m.BNuxP6Ei0FiquYotBDhnNx4AaBGrOPVeJy", expire_on: #<Date(2016-11-21)>, failed_attempts: 0, id: 67, inserted_at: #Ecto.DateTime<2016-11-21 02:54:48>, last_sign_in_at: nil, last_sign_in_ip: nil, locked_at: nil, name: "Ross Lemke", password: "changeme", password_confirmation: "changeme", remember_created_at: nil, reset_password_sent_at: nil, reset_password_token: nil, roles: #Ecto.Association.NotLoaded<association :roles is not loaded>, sign_in_count: 0, unlock_token: nil, updated_at: #Ecto.DateTime<2016-11-21 02:54:48>, username: "rowan", users_roles: #Ecto.Association.NotLoaded<association :users_roles is not loaded>}}
     stacktrace:
       test/models/user_test.exs:135: (test)

....................................................

  3) test validations validates uniqueness of 'name' field (ContactDemo.RoleTest)
     test/models/role_test.exs:48
     ** (MatchError) no match of right hand side value: {:ok, %ContactDemo.Role{__meta__: #Ecto.Schema.Metadata<:loaded, "roles">, id: 35, inserted_at: #Ecto.DateTime<2016-11-21 02:54:51>, name: "Otilia Grant", updated_at: #Ecto.DateTime<2016-11-21 02:54:51>, users: #Ecto.Association.NotLoaded<association :users is not loaded>, users_roles: #Ecto.Association.NotLoaded<association :users_roles is not loaded>}}
     stacktrace:
       test/models/role_test.exs:51: (test)

............

  4) test validations validates uniqueness of 'name' field (ContactDemo.GroupTest)
     test/models/group_test.exs:48
     ** (MatchError) no match of right hand side value: {:ok, %ContactDemo.Group{__meta__: #Ecto.Schema.Metadata<:loaded, "groups">, contacts: #Ecto.Association.NotLoaded<association :contacts is not loaded>, contacts_groups: #Ecto.Association.NotLoaded<association :contacts_groups is not loaded>, id: 47, inserted_at: #Ecto.DateTime<2016-11-21 02:54:51>, name: "orchid", updated_at: #Ecto.DateTime<2016-11-21 02:54:51>}}
     stacktrace:
       test/models/group_test.exs:51: (test)

.................................................................

  5) test validations contact_id: if changeset refers to a non-existent contact_id (ContactDemo.ContactGroupTest)
     test/models/contact_group_test.exs:18
     ** (Postgrex.Error) ERROR (undefined_column): column "inserted_at" of relation "contacts_groups" does not exist
     stacktrace:
       (ecto) lib/ecto/adapters/sql.ex:463: Ecto.Adapters.SQL.struct/6
       (ecto) lib/ecto/repo/schema.ex:397: Ecto.Repo.Schema.apply/4
       (ecto) lib/ecto/repo/schema.ex:193: anonymous fn/11 in Ecto.Repo.Schema.do_insert/4
       (ecto) lib/ecto/repo/schema.ex:614: anonymous fn/3 in Ecto.Repo.Schema.wrap_in_transaction/6
       (ecto) lib/ecto/adapters/sql.ex:508: anonymous fn/3 in Ecto.Adapters.SQL.do_transaction/3
       (db_connection) lib/db_connection.ex:1274: DBConnection.transaction_run/4
       (db_connection) lib/db_connection.ex:1198: DBConnection.run_begin/3
       (db_connection) lib/db_connection.ex:789: DBConnection.transaction/3
       test/models/contact_group_test.exs:20: (test)

.

  6) test validations group_id: if changeset refers to a non-existent group_id (ContactDemo.ContactGroupTest)
     test/models/contact_group_test.exs:31
     ** (Postgrex.Error) ERROR (undefined_column): column "inserted_at" of relation "contacts_groups" does not exist
     stacktrace:
       (ecto) lib/ecto/adapters/sql.ex:463: Ecto.Adapters.SQL.struct/6
       (ecto) lib/ecto/repo/schema.ex:397: Ecto.Repo.Schema.apply/4
       (ecto) lib/ecto/repo/schema.ex:193: anonymous fn/11 in Ecto.Repo.Schema.do_insert/4
       (ecto) lib/ecto/repo/schema.ex:614: anonymous fn/3 in Ecto.Repo.Schema.wrap_in_transaction/6
       (ecto) lib/ecto/adapters/sql.ex:508: anonymous fn/3 in Ecto.Adapters.SQL.do_transaction/3
       (db_connection) lib/db_connection.ex:1274: DBConnection.transaction_run/4
       (db_connection) lib/db_connection.ex:1198: DBConnection.run_begin/3
       (db_connection) lib/db_connection.ex:789: DBConnection.transaction/3
       test/models/contact_group_test.exs:33: (test)

...

Finished in 4.7 seconds
171 tests, 6 failures, 24 skipped

Randomized with seed 478064

Drag and Drop sort on categories exception

Drag and drop a category to change the sort order and get the following exception:

[info] module=Plug.Logger line=27 function=call/2 POST /admin/categories/sort
[debug] module=Phoenix.Logger line=25 function=phoenix_controller_call/3 Processing by ExAdmin.AdminController.sort/2
  Parameters: %{"ids" => ["1", "3", "2", "4", "5"], "resource" => "categories"}
  Pipelines: [:browser]
[info] module=Plug.Logger line=34 function=call/2 Sent 500 in 20ms
[error] #PID<0.1399.0> running ContactDemo.Endpoint terminated
Server: localhost:4001 (http)
Request: POST /admin/categories/sort
** (exit) an exception was raised:
    ** (UndefinedFunctionError) function ExAdmin.AdminController.sort/2 is undefined or private
        ExAdmin.AdminController.sort(%Plug.Conn{adapter: {Plug.Adapters.Cowboy.Conn, :...}, assigns: %{current_user: %ContactDemo.User{__meta__: #Ecto.Schema.Metadata<:loaded, "users">, active: true, confirmation_send_at: nil, confirmation_token: nil, confirmed_at: #Ecto.DateTime<2016-11-21 02:35:52>, current_sign_in_at: #Ecto.DateTime<2016-11-21 02:42:56>, current_sign_in_ip: "{127, 0, 0, 1}", email: "[email protected]", encrypted_password: "$2b$12$aT/rKP1qcUSkXAB91dAKVu9FzrD0LAWvLON2MSOI1j/Bk69CHQVay", expire_on: nil, failed_attempts: 0, id: 1, inserted_at: #Ecto.DateTime<2016-11-21 02:35:52>, last_sign_in_at: #Ecto.DateTime<2016-11-21 02:39:00>, last_sign_in_ip: "{127, 0, 0, 1}", locked_at: nil, name: "Demo User", password: nil, password_confirmation: nil, remember_created_at: nil, reset_password_sent_at: nil, reset_password_token: nil, roles: #Ecto.Association.NotLoaded<association :roles is not loaded>, sign_in_count: 3, unlock_token: nil, updated_at: #Ecto.DateTime<2016-11-21 02:42:56>, username: "demouser", users_roles: #Ecto.Association.NotLoaded<association :users_roles is not loaded>}, theme: ExAdmin.Theme.AdminLte2}, before_send: [#Function<0.78035410/1 in Plug.CSRFProtection.call/2>, #Function<4.45355785/1 in Phoenix.Controller.fetch_flash/2>, #Function<0.74176132/1 in Plug.Session.before_send/2>, #Function<1.86316214/1 in Plug.Logger.call/2>, #Function<0.6223796/1 in Phoenix.LiveReloader.before_send_inject_reloader/1>], body_params: %{"ids" => ["1", "3", "2", "4", "5"]}, cookies: %{"_admin2_key" => "g3QAAAABbQAAAAtfY3NyZl90b2tlbm0AAAAYNEJlUmsyVTJ1NGdFc0VWMTVyOVA3UT09##HSrLNw6V_EVXIX-F4cagBQk1ng0=", "_nested_key" => "SFMyNTY.g3QAAAADbQAAAAtfY3NyZl90b2tlbm0AAAAYeGI4ZnNTcmJIcFlrcEQ5RTZRQjg4Zz09bQAAAAxzZXNzaW9uX2F1dGhtAAAAJGNjNzFmZjIyLWFmOTQtMTFlNi1hZDFlLTYwMDMwODhlNzViY20AAAAOdXNlcl9yZXR1cm5fdG9kAANuaWw.Mq8wCxFHuo26vGcRrlHexBOGKNuq_ijt1JzZqpER8X8"}, halted: false, host: "localhost", method: "POST", owner: #PID<0.1399.0>, params: %{"ids" => ["1", "3", "2", "4", "5"], "resource" => "categories"}, path_info: ["admin", "categories", "sort"], peer: {{127, 0, 0, 1}, 56097}, port: 4001, private: %{ContactDemo.Router => {[], %{}}, :phoenix_action => :sort, :phoenix_controller => ExAdmin.AdminController, :phoenix_endpoint => ContactDemo.Endpoint, :phoenix_flash => %{}, :phoenix_format => "html", :phoenix_layout => {ExAdmin.LayoutView, "admin_lte2.html"}, :phoenix_pipelines => [:browser], :phoenix_route => #Function<56.99136698/1 in ContactDemo.Router.match_route/4>, :phoenix_router => ContactDemo.Router, :phoenix_view => ExAdmin.AdminView, :plug_session => %{"_csrf_token" => "xb8fsSrbHpYkpD9E6QB88g==", "session_auth" => "cc71ff22-af94-11e6-ad1e-6003088e75bc", "user_return_to" => nil}, :plug_session_fetch => :done}, query_params: %{}, query_string: "", remote_ip: {127, 0, 0, 1}, req_cookies: %{"_admin2_key" => "g3QAAAABbQAAAAtfY3NyZl90b2tlbm0AAAAYNEJlUmsyVTJ1NGdFc0VWMTVyOVA3UT09##HSrLNw6V_EVXIX-F4cagBQk1ng0=", "_nested_key" => "SFMyNTY.g3QAAAADbQAAAAtfY3NyZl90b2tlbm0AAAAYeGI4ZnNTcmJIcFlrcEQ5RTZRQjg4Zz09bQAAAAxzZXNzaW9uX2F1dGhtAAAAJGNjNzFmZjIyLWFmOTQtMTFlNi1hZDFlLTYwMDMwODhlNzViY20AAAAOdXNlcl9yZXR1cm5fdG9kAANuaWw.Mq8wCxFHuo26vGcRrlHexBOGKNuq_ijt1JzZqpER8X8"}, req_headers: [{"host", "localhost:4001"}, {"connection", "keep-alive"}, {"content-length", "59"}, {"accept", "*/*"}, {"origin", "http://localhost:4001"}, {"x-csrf-token", "EjBzMQIQMTgtNDA7JQoOB2MQd05yAAAAjRKWqCCZeDiPUN7BUA5vJg=="}, {"x-requested-with", "XMLHttpRequest"}, {"user-agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36"}, {"content-type", "application/x-www-form-urlencoded; charset=UTF-8"}, {"referer", "http://localhost:4001/admin/categories"}, {"accept-encoding", "gzip, deflate, br"}, {"accept-language", "en-US,en;q=0.8"}, {"cookie", "_admin2_key=g3QAAAABbQAAAAtfY3NyZl90b2tlbm0AAAAYNEJlUmsyVTJ1NGdFc0VWMTVyOVA3UT09##HSrLNw6V_EVXIX-F4cagBQk1ng0=; _nested_key=SFMyNTY.g3QAAAADbQAAAAtfY3NyZl90b2tlbm0AAAAYeGI4ZnNTcmJIcFlrcEQ5RTZRQjg4Zz09bQAAAAxzZXNzaW9uX2F1dGhtAAAAJGNjNzFmZjIyLWFmOTQtMTFlNi1hZDFlLTYwMDMwODhlNzViY20AAAAOdXNlcl9yZXR1cm5fdG9kAANuaWw.Mq8wCxFHuo26vGcRrlHexBOGKNuq_ijt1JzZqpER8X8"}], request_path: "/admin/categories/sort", resp_body: nil, resp_cookies: %{}, resp_headers: [{"cache-control", "max-age=0, private, must-revalidate"}, {"x-request-id", "i7du90jpsvmp0ejvppor7ckd0hsuhgqo"}, {"x-frame-options", "SAMEORIGIN"}, {"x-xss-protection", "1; mode=block"}, {"x-content-type-options", "nosniff"}], scheme: :http, script_name: [], secret_key_base: "m3g6ltbv+hunhzFPWAfLWNaGIxoUn7KirHwPyYl6NSP44qOQfaMAj+RgR/Fr1JJS", state: :unset, status: nil}, %{"ids" => ["1", "3", "2", "4", "5"], "resource" => "categories"})
        web/controllers/admin_controller.ex:1: ExAdmin.AdminController.action/2
        web/controllers/admin_controller.ex:1: ExAdmin.AdminController.phoenix_controller_pipeline/2
        (contact_demo) lib/contact_demo/endpoint.ex:1: ContactDemo.Endpoint.instrument/4
        (contact_demo) lib/phoenix/router.ex:261: ContactDemo.Router.dispatch/2
        (contact_demo) web/router.ex:1: ContactDemo.Router.do_call/2
        (contact_demo) lib/contact_demo/endpoint.ex:1: ContactDemo.Endpoint.phoenix_pipeline/1
        (contact_demo) lib/plug/debugger.ex:123: ContactDemo.Endpoint."call (overridable 3)"/2
        (contact_demo) lib/contact_demo/endpoint.ex:1: ContactDemo.Endpoint.call/2
        (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
        (cowboy) src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.