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

Feat/add default context when it's missing #69

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

kubosuke
Copy link
Contributor

@kubosuke kubosuke commented Jul 12, 2024

#65

Test

mix ecto.migrate

result:

❯ mix ecto.migrate
==> kanta
    warning: Phoenix.LiveView.push_redirect/2 is deprecated. Use push_navigate/2 instead
    │
 32 │      push_redirect(socket,
    │      ~
    │
    └─ (kanta 0.3.1) lib/kanta_web/live/translations/translation_form_live/components/singular_translation_form/singular_translation_form.ex:32:6: KantaWeb.Translations.SingularTranslationForm.handle_event/3

    warning: Phoenix.LiveView.push_redirect/2 is deprecated. Use push_navigate/2 instead
    │
 21 │     {:noreply, push_redirect(socket, to: "/kanta" <> to)}
    │                ~
    │
    └─ (kanta 0.3.1) lib/kanta_web/live/translations/contexts_live/contexts_live.ex:21:16: KantaWeb.Translations.ContextsLive.handle_event/3

    warning: Phoenix.LiveView.push_redirect/2 is deprecated. Use push_navigate/2 instead
    │
 66 │      push_redirect(socket,
    │      ~
    │
    └─ (kanta 0.3.1) lib/kanta_web/live/translations/translation_form_live/components/plural_translation_form/plural_translation_form.ex:66:6: KantaWeb.Translations.PluralTranslationForm.handle_event/3

    warning: Phoenix.LiveView.push_redirect/2 is deprecated. Use push_navigate/2 instead
    │
 69 │     {:noreply, push_redirect(socket, to: "/kanta" <> to)}
    │                ~
    │
    └─ (kanta 0.3.1) lib/kanta_web/live/translations/translations_live/translations_live.ex:69:16: KantaWeb.Translations.TranslationsLive.handle_event/3

    warning: variable "opts" is unused (if the variable is not meant to be used, prefix it with an underscore)
    │
 14 │   def up(opts) do
    │          ~~~~
    │
    └─ (kanta 0.3.1) lib/kanta/migrations/postgresql/v03.ex:14:10: Kanta.Migrations.Postgresql.V03.up/1

    warning: variable "opts" is unused (if the variable is not meant to be used, prefix it with an underscore)
    │
 24 │   def down(opts) do
    │            ~~~~
    │
    └─ (kanta 0.3.1) lib/kanta/migrations/postgresql/v03.ex:24:12: Kanta.Migrations.Postgresql.V03.down/1

    warning: module attribute @kanta_plural_translations was set but never used
    │
 12 │   @kanta_plural_translations "kanta_plural_translations"
    │   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    │
    └─ lib/kanta/migrations/postgresql/v03.ex:12: Kanta.Migrations.Postgresql.V03 (module)

    warning: module attribute @kanta_singular_translations was set but never used
    │
 11 │   @kanta_singular_translations "kanta_singular_translations"
    │   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    │
    └─ lib/kanta/migrations/postgresql/v03.ex:11: Kanta.Migrations.Postgresql.V03 (module)

    warning: module attribute @default_prefix was set but never used
    │
 10 │   @default_prefix "public"
    │   ~~~~~~~~~~~~~~~~~~~~~~~~
    │
    └─ lib/kanta/migrations/postgresql/v03.ex:10: Kanta.Migrations.Postgresql.V03 (module)

    warning: unused alias Context
    │
  8 │   alias Kanta.Translations.Context
    │   ~
    │
    └─ lib/kanta/migrations/postgresql/v03.ex:8:3

    warning: unused alias Translations
    │
  7 │   alias Kanta.Translations
    │   ~
    │
    └─ lib/kanta/migrations/postgresql/v03.ex:7:3

    warning: Phoenix.LiveView.push_redirect/2 is deprecated. Use push_navigate/2 instead
    │
 21 │     {:noreply, push_redirect(socket, to: "/kanta" <> to)}
    │                ~
    │
    └─ (kanta 0.3.1) lib/kanta_web/live/translations/domains_live/domains_live.ex:21:16: KantaWeb.Translations.DomainsLive.handle_event/3


22:06:08.017 [info] Migrations already up

db:

~/github/kubo is 📦 v0.1.0 via 💧 v1.17.2 (OTP 26) via 🐍 v3.11.2 on ☁️  
❯ psql -d kubo_dev -c 'select * from kanta_contexts;'
 id |  name   | description |  color  |     inserted_at     |     updated_at
----+---------+-------------+---------+---------------------+---------------------
  1 | default |             | #7E37D8 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00
(1 row)


~/github/kubo is 📦 v0.1.0 via 💧 v1.17.2 (OTP 26) via 🐍 v3.11.2 on ☁️  
❯ psql -d kubo_dev -c 'select * from kanta_messages;'
 id |                   msgid                    | message_type | domain_id | context_id |     inserted_at     |     updated_at      |                  searchable
----+--------------------------------------------+--------------+-----------+------------+---------------------+---------------------+-----------------------------------------------
  4 | Actions🔥                                   | singular     |        16 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'actions🔥':1A
  5 | Attempting to reconnect                    | singular     |        16 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'attempt':1A 'reconnect':3A
  6 | Error!                                     | singular     |        16 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'error':1A
  7 | Hang in there while we get back on track   | singular     |        16 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'back':7A 'get':6A 'hang':1A 'track':9A
  8 | Something went wrong!                      | singular     |        16 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'someth':1A 'went':2A 'wrong':3A
  9 | Success!                                   | singular     |        16 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'success':1A
 10 | We can't find the internet                 | singular     |        16 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'find':4A 'internet':6A
 11 | close                                      | singular     |        16 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'close':1A
 12 | can't be blank                             | singular     |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'blank':4A
 13 | has already been taken                     | singular     |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'alreadi':2A 'taken':4A
 14 | is invalid                                 | singular     |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'invalid':2A
 15 | must be accepted                           | singular     |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'accept':3A 'must':1A
 16 | has invalid format                         | singular     |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'format':3A 'invalid':2A
 17 | has an invalid entry                       | singular     |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'entri':4A 'invalid':3A
 18 | is reserved                                | singular     |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'reserv':2A
 19 | does not match confirmation                | singular     |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'confirm':4A 'match':3A
 20 | is still associated with this entry        | singular     |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'associ':3A 'entri':6A 'still':2A
 21 | are still associated with this entry       | singular     |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'associ':3A 'entri':6A 'still':2A
 22 | should have %{count} item(s)               | plural       |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'count':3A 'item':4A
 23 | should be %{count} character(s)            | plural       |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'charact':4A 'count':3A
 24 | should be %{count} byte(s)                 | plural       |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'byte':4A 'count':3A
 25 | should have at least %{count} item(s)      | plural       |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'count':5A 'item':6A 'least':4A
 26 | should be at least %{count} character(s)   | plural       |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'charact':6A 'count':5A 'least':4A
 27 | should be at least %{count} byte(s)        | plural       |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'byte':6A 'count':5A 'least':4A
 28 | should have at most %{count} item(s)       | plural       |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'count':5A 'item':6A
 29 | should be at most %{count} character(s)    | plural       |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'charact':6A 'count':5A
 30 | should be at most %{count} byte(s)         | plural       |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'byte':6A 'count':5A
 31 | must be less than %{number}                | singular     |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'less':3A 'must':1A 'number':5A
 32 | must be greater than %{number}             | singular     |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'greater':3A 'must':1A 'number':5A
 33 | must be less than or equal to %{number}    | singular     |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'equal':6A 'less':3A 'must':1A 'number':8A
 34 | must be greater than or equal to %{number} | singular     |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'equal':6A 'greater':3A 'must':1A 'number':8A
 35 | must be equal to %{number}                 | singular     |        17 |          1 | 2024-07-12 19:23:00 | 2024-07-12 19:23:00 | 'equal':3A 'must':1A 'number':5A

Copy link
Contributor

@ravensiris ravensiris left a comment

Choose a reason for hiding this comment

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

LGTM

@kubosuke
Copy link
Contributor Author

@ravensiris Thank you! we'd like to use this feature so when you're ready pls merge it, and publish new version 🙏

@jan-swiatek jan-swiatek changed the base branch from main to develop September 16, 2024 11:31
@jan-swiatek
Copy link
Contributor

Hi @kubosuke! We would love to merge this changes :) However I had to change base branch do develop. Could you please pull latest version and make sure it's up to date? Thank you!

@kubosuke
Copy link
Contributor Author

kubosuke commented Oct 1, 2024

@jan-swiatek Hi ya sorry for late 🙇 and thank you for reviewing. after pull latest version will let you know.

@kubosuke
Copy link
Contributor Author

kubosuke commented Oct 3, 2024

@jan-swiatek @ravensiris please check CI when you have time 🙏

@kubosuke
Copy link
Contributor Author

kubosuke commented Oct 7, 2024

Will check CI errors later

@vi0dine vi0dine deleted the branch curiosum-dev:develop October 9, 2024 16:21
@vi0dine vi0dine closed this Oct 9, 2024
@vi0dine vi0dine reopened this Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants