Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Create Todo List in Phoenix v1.5.3 #35

Merged
merged 141 commits into from
Jun 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
a54b657
remove old folders in preparation for migration to Phoenix 1.3 see: h…
nelsonic Jun 5, 2017
5072a39
adds Phoenix v1.3 base files for #16
nelsonic Jun 5, 2017
7d45ce3
adds coherence for auth (trialing it...)
nelsonic Jun 5, 2017
dd8426e
update npm install instructions in README for phx 1.3 #16
nelsonic Jun 5, 2017
da424c9
adds coherence to router.ex and seed data to seeds.exs for #16
nelsonic Jun 5, 2017
abb7f47
adds Absinthe (GraphQL) endpoint for https://github.com/dwyl/api/issu…
nelsonic Jun 6, 2017
4dccc04
adds GraphQL instructions to readme
nelsonic Jun 6, 2017
c5e3be3
update .travis.yml for Elixir Project see: https://github.com/dwyl/le…
nelsonic Jun 6, 2017
0fe5bfc
adds dev dependencies to mix.exs borrowed from: https://github.com/dw…
nelsonic Jun 6, 2017
26daa9d
adds steps to re-create the API using phoenix generators
nelsonic Jun 6, 2017
5ce82fc
update Procfile for launching on Heroku
nelsonic Jun 6, 2017
f7afbb3
update config/prod.exs for heroku deployment
nelsonic Jun 6, 2017
7d40d82
fix syntax error (missing comma) in config/prod.exs
nelsonic Jun 6, 2017
382bf3b
update Procfile to include mix ecto.migrate
nelsonic Jun 6, 2017
43222e4
adds instructions for how to query the API using CLI
nelsonic Jun 6, 2017
d5c626d
adds /register endpoint with unique email address (fail if email alre…
nelsonic Jun 8, 2017
4393d6d
[WiP] test failing >> ** (KeyError) key :inserted_at not found see: h…
nelsonic Jun 9, 2017
9ec20d1
Merge branch 'phoenix-v1.3' of https://github.com/dwyl/api into phoen…
samhstn Jun 9, 2017
0e28704
fixing key :inserted_at not found error in tests
samhstn Jun 9, 2017
5c95b44
Merge pull request #31 from dwyl/annoying-failing-test
nelsonic Jun 9, 2017
e570db7
remove old files
nelsonic Feb 23, 2020
71e13ef
update version of Elixir in .travis.yml
nelsonic Feb 23, 2020
64ca2bb
create coveralls.json file
nelsonic Feb 23, 2020
d3aa5c7
add README.md outline
nelsonic Feb 23, 2020
a06b93e
step 1: create app!
nelsonic Feb 23, 2020
02556fc
add link to TodoMVC
nelsonic Feb 24, 2020
4c1907d
remove _bak/ folder with Ye Olde files
nelsonic Feb 24, 2020
70e34bb
mix phx.new app
nelsonic Feb 24, 2020
19100c0
add excoveralls mix.exs to run coverage report
nelsonic Feb 24, 2020
29066a2
Merge branch 'master' into phoenix-v1.4.10
nelsonic Feb 24, 2020
9ad2bff
mix phx.new app (Phoenix 1.5.1) #36
nelsonic May 21, 2020
c3968df
update version of Elixir & OTP in .travis.yml #36
nelsonic May 21, 2020
a9be23e
add lib/app_web/telemetry.ex to coveralls.json as not used/tested
nelsonic May 21, 2020
40d4e8d
mix phx.gen.html Ctx Item items
nelsonic May 21, 2020
f66184b
add resources "/items", ItemController to router.ex
nelsonic May 21, 2020
cfd8ab7
add instructions and links for step 2.1 (add resources to router.ex) #36
nelsonic May 22, 2020
7517256
remove assets/package-lock.json as super noisy!
nelsonic May 22, 2020
fdc6429
add TodoMVC HTML for step 3 #36
nelsonic May 22, 2020
bddacda
add dummy TodoMVC code to index.html.eex for step 3.1 #36
nelsonic May 23, 2020
1d91980
update layout template to include TodoMVC CSS step 3.2 #36
nelsonic May 23, 2020
7bfbfd4
download TodoMVC CSS to /assets/css and serve locally
nelsonic May 23, 2020
9147b06
add complete/1 and checked/1 view functions to lib/app_web/views/item…
nelsonic May 23, 2020
0d55a4e
checked/1 returns "checked" when item.status == 1
nelsonic May 23, 2020
8425bc8
update item template in templates/item/index.html.eex #36
nelsonic May 23, 2020
1fbea19
tidy up indentation in <ul class="todo-list">
nelsonic May 23, 2020
031df40
Step 4: create test/app_web/views/item_view_test.exs to test view fun…
nelsonic May 23, 2020
0dfb7f1
add cover/ to .gitignore
nelsonic May 23, 2020
cc28797
add default values for person_id and status in lib/app/ctx/item.ex #36
nelsonic May 23, 2020
3d5f181
simplify new item form template to just :text field #36
nelsonic May 23, 2020
1caae9f
Step 5: simplify item/form.html.eex to just :text and hide submit but…
nelsonic May 24, 2020
aed0b2c
Step 5.2: add changeset to index/2 in lib/app_web/controllers/item_co…
nelsonic May 24, 2020
50a6f9a
Step 5: add autofocus to :text input see: https://github.com/dwyl/lea…
nelsonic May 24, 2020
41ad6d4
Step 5.3: render form.html in index.html
nelsonic May 24, 2020
69226e3
Step 5.4: redirect to :index after creating a new item
nelsonic May 24, 2020
447aa68
add GiF for section 5 #36
nelsonic May 24, 2020
7a54bcf
Step 5.5: update test/app_web/controllers/item_controller_test.exs to…
nelsonic May 24, 2020
7b4e351
Step 5.5 fix failing test #36
nelsonic May 24, 2020
8c375c6
add outline of remaining sections to README.md #36
nelsonic May 24, 2020
7e9ce53
Step 6: add (failing) test for remaining_items/1 #36
nelsonic May 24, 2020
f55292e
Step 6: display count of incomplete items in UI #36
nelsonic May 24, 2020
8b9ce7c
Step 6: add remaining_items(@items) to item/index.html.eex #36
nelsonic May 24, 2020
a31bbe3
Step 7.1 create failing test for toggle/2 #36
nelsonic May 24, 2020
f5fbc8a
step 7.1 add toggle_status/1 and toggle/2 tests to item_controller_te…
nelsonic May 24, 2020
dff0062
make tests pass by creating toggle_status/1 and toggle/2
nelsonic May 24, 2020
ada48cb
add get "/items/toggle/:id", ItemController, :toggle to router.ex
nelsonic May 24, 2020
65bec23
Step 3.2: simplify app.html.eex template #36
nelsonic May 24, 2020
5fd6730
Step 3.4: add @import "./todomvc-app.css"; to assets/css/app.scss
nelsonic May 24, 2020
c3915c6
update section 3 to load the TodoMVC css from localhost (adds steps b…
nelsonic May 24, 2020
c375a09
Update links in Step 7.2 & 7.3 #36
nelsonic May 24, 2020
e76ab86
replace <input> tag with <a> tag which invokes toggle/2 #36
nelsonic May 25, 2020
f1d76ef
Step 7.5: add .checked selector to assets/css/app.scss
nelsonic May 25, 2020
970eb18
[WiP] Step 8.1 figuring out double-click in CSS ... #36
nelsonic May 26, 2020
cc04db8
[WiP] double-click working to edit and item.text
nelsonic May 26, 2020
644462c
add debug code to app.scss see: https://github.com/dwyl/phoenix-todo-…
nelsonic May 26, 2020
2940e7f
update list_items/0 to Item |> order_by(asc: :id) |> Repo.all() #36
nelsonic May 26, 2020
b1eadd6
add explanation of Why double-click to edit is needed and link to CSS…
nelsonic May 26, 2020
da0fc81
clarify reasoning for double-click to edit (step 8.1)
nelsonic May 26, 2020
0dccb3b
Step 8.1 add double-click to edit code to index.html.eex #36
nelsonic May 28, 2020
88c2f83
remove nested label from a.new-todo
nelsonic May 28, 2020
40ce83b
tidy edit & form templates
nelsonic May 28, 2020
aaf6e23
Step 8.2 add CSS code required for double-click to edit
nelsonic May 28, 2020
404ad98
Step 8.3 update edit/2 and index/2 to allow for in-line editing #36
nelsonic May 28, 2020
32ba6ea
update ItemControllerTest to reflect changes made in step 8.3
nelsonic May 28, 2020
3894013
tidy up indentation in app.scss #36
nelsonic May 28, 2020
da7fc22
tidy indentation in index.html.eex
nelsonic May 28, 2020
cd2df21
Add links to all files in section 8 #36
nelsonic May 28, 2020
68f2a33
remove unexpected beginning of EEx tag "<%=" on "<%= else %>"
nelsonic May 28, 2020
37a0520
update links to index.html.eex (without warnings)
nelsonic May 28, 2020
3f5e3e3
Step 8.5: remove default Phoenix table view from inded.html.eex #36
nelsonic May 28, 2020
9105064
add screenshot at end of step 8.5 #36
nelsonic May 28, 2020
60e6d02
update "list all items" test assertion to reflect removal of default …
nelsonic May 28, 2020
3cce203
update link to test assertion update
nelsonic May 28, 2020
2ef7553
update to Phoenix 1.5.3
nelsonic May 28, 2020
7db9fba
add GIF of inline item editing in action #36
nelsonic May 28, 2020
bd5cfc8
mix format
nelsonic May 28, 2020
fcdc3a6
Step 9.1 create /:filter route #36
nelsonic May 29, 2020
1506d95
include filter in render/3
nelsonic May 29, 2020
1f744e3
lowercase filter default "All" > "all" https://www.youtube.com/watch?…
nelsonic May 29, 2020
b27b0c9
Step 9.3: Create filter/2 and selected/2 view functions #36
nelsonic May 29, 2020
cce1f0b
9.4 Update index.html template to use filter/2 and selected/2 functio…
nelsonic May 29, 2020
c613567
tidy up indentation of footer list #36
nelsonic May 29, 2020
26ab866
Step 9 (Footer Navigation/Filtering) Complete! #36
nelsonic May 29, 2020
edc6f65
add GIF of footer nav/filter working #36
nelsonic May 29, 2020
c36dd95
create clear_completed/2 handler
nelsonic May 29, 2020
cf4aa02
add get "/:filter", ItemController, :index to router.ex
nelsonic May 29, 2020
697059b
define clear_completed/2 for step 10 #36
nelsonic May 29, 2020
69b4d2c
update "Clear completed" in index.html #36
nelsonic May 29, 2020
927e2fa
update status to "2" for archived items
nelsonic May 29, 2020
7be6eb3
add links to clear completed code
nelsonic May 29, 2020
43898e7
add "Clear completed" GIF at end of Step 10 #36
nelsonic May 29, 2020
45ac34e
create pluarlise/1 test for 11.1 #36
nelsonic May 29, 2020
d527560
create pluralise/1 function for 11.1
nelsonic May 29, 2020
20abf7a
11.1 use pluralise/1 in footer of index.html #36
nelsonic May 29, 2020
b0c7a0b
11.2: wrap <footer> with if remaining_items(@items) > 0 #36
nelsonic May 29, 2020
1020bff
update/improve definition of pluralise/1 to include Zero case #36
nelsonic May 29, 2020
fbf22d5
Step 11.2: create got_items?/1 function and use it to tidy up code
nelsonic May 29, 2020
b367657
fix failing test after invalid got_items?/1 🙄
nelsonic May 29, 2020
4ff844d
use Enum.count in got_items?/1
nelsonic May 29, 2020
82f9070
Step 11.2 Update / (default route) to invoke ItemController #36
nelsonic May 29, 2020
0c25dd4
delete all Page related files (Controller, View, Template & Test) as …
nelsonic May 29, 2020
dccf482
create elixir_buildpack.config with latest Elixir/OTP for Heroku depl…
nelsonic May 29, 2020
2597244
enable prod.secret.exs for heroku deploy #36
nelsonic May 29, 2020
805e437
add engine directive to package.json to use Node v12 on heroku #36
nelsonic May 29, 2020
407fc68
add node_version=12.17.0 to elixir_buildpack.config for heroku deploy…
nelsonic May 29, 2020
17088ec
create phoenix_static_buildpack.config with node.js version
nelsonic May 29, 2020
2de0326
add final GIF of running the app on localhost #36
nelsonic May 29, 2020
88a94a6
Rename "Ctx" to "Todo" so the Contenxt has more meaning https://githu…
nelsonic May 29, 2020
bd0837a
remove <script> tag from app.html.eex layout template to improve rend…
nelsonic May 30, 2020
4d9e203
restore <script> tag to layout/app.html.eex to ensure Delete confirm …
nelsonic May 30, 2020
d14cdf1
reorder the steps in section 3 #36
nelsonic May 30, 2020
dd1291b
tidy up clarification of contexts in step 2
nelsonic May 30, 2020
500775a
simplify remaining_items/1 test
nelsonic May 30, 2020
2882c63
fix markdown fail in code formatting
nelsonic May 30, 2020
5892530
final fixes (proof reading!)
nelsonic May 30, 2020
3a268aa
re-enable hits badge in README.md
nelsonic May 30, 2020
ff7b357
remove superfluous "the" in sentence.
nelsonic Jun 2, 2020
2357e54
finish incomplete sentence ...
nelsonic Jun 2, 2020
7319178
remind people to run the migrations before the server!
nelsonic Jun 2, 2020
bde4bc9
clarify import todomvc-app.css in app.scss
nelsonic Jun 2, 2020
3946cbf
remove superfluous "is" in sentence.
nelsonic Jun 2, 2020
e8c9af2
fix typo "well help" > "will help"
nelsonic Jun 2, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .formatter.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
import_deps: [:ecto, :phoenix],
inputs: ["*.{ex,exs}", "priv/*/seeds.exs", "{config,lib,test}/**/*.{ex,exs}"],
subdirectories: ["priv/*/migrations"]
]
19 changes: 15 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,23 @@
/deps
/*.ez

# Where 3rd-party dependencies like ExDoc output generated docs.
/doc/

# Ignore .fetch files in case you like to edit your project deps locally.
/.fetch

# Ignore package tarball (built via "mix hex.build").
app-*.tar

# Generated on crash by the VM
erl_crash.dump

# Static artifacts
/node_modules
node_modules
node_modules/*
npm-debug.log
assets/package-lock.json

# Since we are building assets from web/static,
# we ignore priv/static. You may want to comment
Expand All @@ -21,7 +33,7 @@ erl_crash.dump
# Alternatively, you may comment the line below and commit the
# secrets file as long as you replace its contents by environment
# variables.
/config/prod.secret.exs
# /config/prod.secret.exs

lib-cov
*.seed
Expand All @@ -36,9 +48,8 @@ pids
logs
results

npm-debug.log
node_modules
.DS_Store
.vagrant
test/coverage.html
coverage/
cover/
25 changes: 20 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
language: node_js
node_js:
- 0.12
language: elixir
elixir:
- 1.10.3
otp_release:
- 22.1.8
services:
- elasticsearch
- postgresql
cache:
directories:
- _build
- deps
script:
- mix do setup, compile --warnings-as-errors, coveralls.json
after_success:
- bash <(curl -s https://codecov.io/bash)
env:
- ES_HOST="127.0.0.1" ES_PORT=9200 ES_INDEX=travis JWT_SECRET="EverythingIsAwesome!"
global:
- MIX_ENV=test
cache:
directories:
- _build
- deps
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: node server.js
web: MIX_ENV=prod mix do ecto.migrate, phx.server
Loading