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: Add tags to items #150

Merged
merged 19 commits into from
Sep 28, 2022
Merged

PR: Add tags to items #150

merged 19 commits into from
Sep 28, 2022

Conversation

SimonLab
Copy link
Member

  • Run mix deps.udpate --all to make sure all is up to date

ref: dwyl/app#245

Run `mix deps.udpate --all`

ref: #245
@SimonLab SimonLab added the in-progress An issue or pull request that is being worked on by the assigned person label Sep 15, 2022
@SimonLab SimonLab self-assigned this Sep 15, 2022
@SimonLab SimonLab temporarily deployed to dwylauth September 15, 2022 09:57 Inactive
@codecov
Copy link

codecov bot commented Sep 15, 2022

Codecov Report

Merging #150 (85c758c) into main (0270bb5) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main      #150   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         9    +2     
  Lines          136       166   +30     
=========================================
+ Hits           136       166   +30     
Impacted Files Coverage Δ
lib/app/item.ex 100.00% <100.00%> (ø)
lib/app/item_tag.ex 100.00% <100.00%> (ø)
lib/app/tag.ex 100.00% <100.00%> (ø)
lib/app/timer.ex 100.00% <100.00%> (ø)
lib/app_web/controllers/init_controller.ex 100.00% <100.00%> (ø)
lib/app_web/live/app_live.ex 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Create Ecto migration with unique indexes for tags and items_tags

ref: #245 app
@SimonLab SimonLab temporarily deployed to dwylauth September 15, 2022 11:08 Inactive
Add schemas and use many_to_many function to create
associations between tags and items
@SimonLab SimonLab temporarily deployed to dwylauth September 15, 2022 15:01 Inactive
Link tag to a person
@SimonLab SimonLab temporarily deployed to dwylauth September 16, 2022 08:13 Inactive
Add primary_key: false option in migration
@SimonLab SimonLab temporarily deployed to dwylauth September 16, 2022 10:54 Inactive
@SimonLab SimonLab temporarily deployed to dwylauth September 16, 2022 11:38 Inactive
@nelsonic nelsonic changed the title Add tags to items PR: Add tags to items Sep 20, 2022
Create .iex.exs file with aliases.
This allow us to access directly the aliases when running
a `iex -S mix` session

ref: https://twitter.com/mplatts/status/1570674202465935360
@SimonLab SimonLab temporarily deployed to dwylauth September 21, 2022 14:19 Inactive
Add documentation on how to create the tags migrations and schemas
@SimonLab SimonLab temporarily deployed to dwylauth September 22, 2022 09:48 Inactive
- Add more documentation about the migrations and schemas
- use citext in migration
@SimonLab SimonLab temporarily deployed to dwylauth September 22, 2022 14:37 Inactive
- Get the latest version of LiveView
- assign_new is now part of Phoenix.Component module
@SimonLab SimonLab temporarily deployed to dwylauth September 26, 2022 10:30 Inactive
Add simple test to test field value for ItemTag schema
@SimonLab SimonLab temporarily deployed to dwylauth September 26, 2022 11:23 Inactive
Define name of the unique constraint. This will convert the raised
error to changeset error
@SimonLab SimonLab temporarily deployed to dwylauth September 26, 2022 20:45 Inactive
lib/app/item.ex Outdated
@@ -48,7 +48,6 @@ defmodule App.Item do
def create_item_with_tags(attrs) do
%Item{}
|> changeset_with_tags(attrs)
|> IO.inspect()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worth updating the Elixir version to v1.14 so that we can use dbg? 😉 #finally 🎉

@SimonLab SimonLab temporarily deployed to dwylauth September 28, 2022 11:06 Inactive
Display list of tags under each items
Run formatter on project
@SimonLab SimonLab temporarily deployed to dwylauth September 28, 2022 11:07 Inactive
Add link to tak to filter the list by tag
@SimonLab SimonLab temporarily deployed to dwylauth September 28, 2022 12:45 Inactive
Add tests when filter by tag name
@SimonLab SimonLab temporarily deployed to dwylauth September 28, 2022 12:58 Inactive
Finish documentation for items-tags association
@SimonLab SimonLab temporarily deployed to dwylauth September 28, 2022 13:30 Inactive
@SimonLab SimonLab marked this pull request as ready for review September 28, 2022 13:35
@SimonLab
Copy link
Member Author

Let me know your thoughts on this @nelsonic
see dwyl/app#245 (comment)

@SimonLab SimonLab added awaiting-review An issue or pull request that needs to be reviewed and removed in-progress An issue or pull request that is being worked on by the assigned person labels Sep 28, 2022
@SimonLab SimonLab removed their assignment Sep 28, 2022
@nelsonic nelsonic added in-review Issue or pull request that is currently being reviewed by the assigned person and removed awaiting-review An issue or pull request that needs to be reviewed labels Sep 28, 2022
Copy link
Member

@nelsonic nelsonic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on localhost:

git pull
git checkout 'tags-#245'
mix deps.udpate --all

Upgraded:
  ecto 3.8.4 => 3.9.0
  ecto_sql 3.8.3 => 3.9.0
  phoenix_live_view 0.18.0 => 0.18.1

mix test
...
Finished in 1.1 seconds (0.2s async, 0.9s sync)
41 tests, 0 failures

Good sign. 👌

mix ecto.migrate

22:22:49.641 [info]  == Running 20220915103524 App.Repo.Migrations.AddTags.change/0 forward

22:22:49.650 [info]  execute "CREATE EXTENSION IF NOT EXISTS citext"

22:22:49.762 [info]  create table tags

22:22:49.778 [info]  create index tags_text_person_id_index

22:22:49.781 [info]  == Migrated 20220915103524 in 0.1s

22:22:49.873 [info]  == Running 20220915104854 App.Repo.Migrations.AddItemsTags.change/0 forward

22:22:49.873 [info]  create table items_tags

22:22:49.880 [info]  create index items_tags_item_id_tag_id_index

22:22:49.882 [info]  == Migrated 20220915104854 in 0.0s

Migrations appear to work.

mix phx.server

Created a new item with tags. ✅
When I attempt to edit the item I am not able to edit the tags:

image

@SimonLab this is looking very good so far.
Quite happy to merge it so we can ship + test it and add more features later. 💭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in-review Issue or pull request that is currently being reviewed by the assigned person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants