From 0420b1944e493415854aa418d9cb93c25d92f25b Mon Sep 17 00:00:00 2001 From: Zoey de Souza Pessanha Date: Sun, 14 Jan 2024 16:25:26 -0300 Subject: [PATCH] feat: format --- .formatter.exs | 2 +- lib/pescarte/catalogo/models/habitat.ex | 5 +- lib/pescarte/catalogo/models/peixe.ex | 9 +-- lib/pescarte/cotacoes/models/cotacao.ex | 14 ++-- .../cotacoes/models/cotacao_pescado.ex | 18 ++--- lib/pescarte/cotacoes/models/fonte.ex | 6 +- lib/pescarte/cotacoes/models/pescado.ex | 6 +- lib/pescarte/cotacoes/repository.ex | 4 +- lib/pescarte/identidades/models/contato.ex | 11 ++-- lib/pescarte/identidades/models/endereco.ex | 14 ++-- lib/pescarte/identidades/models/token.ex | 13 ++-- .../modulo_pesquisa/i_manage_repository.ex | 3 +- lib/pescarte/modulo_pesquisa/models/campus.ex | 11 ++-- .../modulo_pesquisa/models/linha_pesquisa.ex | 15 +++-- lib/pescarte/modulo_pesquisa/models/midia.ex | 22 ++++--- .../modulo_pesquisa/models/midia/categoria.ex | 4 +- .../modulo_pesquisa/models/midia/tag.ex | 5 +- .../modulo_pesquisa/models/nucleo_pesquisa.ex | 8 +-- .../modulo_pesquisa/models/pesquisador.ex | 42 +++++++----- .../modulo_pesquisa/schemas/conteudo_anual.ex | 2 +- .../schemas/conteudo_mensal.ex | 2 +- .../schemas/conteudo_trimestral.ex | 2 +- .../modulo_pesquisa/schemas/pesquisador.ex | 10 +-- .../schemas/relatorio_pesquisa.ex | 10 +-- .../design_system/search_input.ex | 14 ++-- lib/pescarte_web/layouts.ex | 2 +- .../pesquisa/relatorio_live/index.html.heex | 66 +++++++++---------- lib/pescarte_web/templates/error_html.ex | 2 +- lib/pescarte_web/templates/landing_html.ex | 2 +- 29 files changed, 171 insertions(+), 153 deletions(-) diff --git a/.formatter.exs b/.formatter.exs index fc518fef..23e2728d 100644 --- a/.formatter.exs +++ b/.formatter.exs @@ -1,6 +1,6 @@ # Used by "mix format" [ imports: [:phoenix, :ecto], - inputs: ["mix.exs", "config/*.exs"], plugins: [Phoenix.LiveView.HTMLFormatter], + inputs: ["*.{ex,exs,heex}", "{lib,test}/**/*.{ex,exs,heex}"] ] diff --git a/lib/pescarte/catalogo/models/habitat.ex b/lib/pescarte/catalogo/models/habitat.ex index 8b7a63ea..7409528e 100644 --- a/lib/pescarte/catalogo/models/habitat.ex +++ b/lib/pescarte/catalogo/models/habitat.ex @@ -13,13 +13,14 @@ defmodule Pescarte.Catalogo.Models.Habitat do @primary_key {:nome, :string, autogenerate: false} schema "habitat" do - field :id_publico, Pescarte.Database.Types.PublicId, autogenerate: true + field(:id_publico, Pescarte.Database.Types.PublicId, autogenerate: true) - many_to_many :peixes, Peixe, + many_to_many(:peixes, Peixe, join_through: "peixes_habitats", join_keys: [habitat_nome: :nome, peixe_nome_cientifico: :nome_cientifico], on_replace: :delete, unique: true + ) timestamps() end diff --git a/lib/pescarte/catalogo/models/peixe.ex b/lib/pescarte/catalogo/models/peixe.ex index 2f48866b..7d855948 100644 --- a/lib/pescarte/catalogo/models/peixe.ex +++ b/lib/pescarte/catalogo/models/peixe.ex @@ -15,15 +15,16 @@ defmodule Pescarte.Catalogo.Models.Peixe do @primary_key {:nome_cientifico, :string, autogenerate: false} schema "peixe" do - field :link_imagem, :string - field :nativo?, :boolean, default: false - field :id_publico, Pescarte.Database.Types.PublicId, autogenerate: true + field(:link_imagem, :string) + field(:nativo?, :boolean, default: false) + field(:id_publico, Pescarte.Database.Types.PublicId, autogenerate: true) - many_to_many :habitats, Habitat, + many_to_many(:habitats, Habitat, join_through: "peixes_habitats", join_keys: [peixe_nome_cientifico: :nome_cientifico, habitat_nome: :nome], on_replace: :delete, unique: true + ) timestamps() end diff --git a/lib/pescarte/cotacoes/models/cotacao.ex b/lib/pescarte/cotacoes/models/cotacao.ex index 4fc2728c..3520f4c0 100644 --- a/lib/pescarte/cotacoes/models/cotacao.ex +++ b/lib/pescarte/cotacoes/models/cotacao.ex @@ -18,13 +18,13 @@ defmodule Pescarte.Cotacoes.Models.Cotacao do @primary_key false schema "cotacao" do - field :data, :date, primary_key: true - field :link, :string, primary_key: true - field :fonte, :string - field :importada?, :boolean, default: false - field :baixada?, :boolean, default: false - field :tipo, Ecto.Enum, values: ~w(pdf zip)a - field :id, Pescarte.Database.Types.PublicId, autogenerate: true + field(:data, :date, primary_key: true) + field(:link, :string, primary_key: true) + field(:fonte, :string) + field(:importada?, :boolean, default: false) + field(:baixada?, :boolean, default: false) + field(:tipo, Ecto.Enum, values: ~w(pdf zip)a) + field(:id, Pescarte.Database.Types.PublicId, autogenerate: true) end @spec changeset(Cotacao.t(), map) :: changeset diff --git a/lib/pescarte/cotacoes/models/cotacao_pescado.ex b/lib/pescarte/cotacoes/models/cotacao_pescado.ex index 0a0854e1..931eede4 100644 --- a/lib/pescarte/cotacoes/models/cotacao_pescado.ex +++ b/lib/pescarte/cotacoes/models/cotacao_pescado.ex @@ -18,15 +18,15 @@ defmodule Pescarte.Cotacoes.Models.CotacaoPescado do @primary_key false schema "cotacoes_pescados" do - field :id, Pescarte.Database.Types.PublicId, autogenerate: true - field :cotacao_data, :date, primary_key: true - field :cotacao_link, :string - field :pescado_codigo, :string, primary_key: true - field :fonte_nome, :string, primary_key: true - field :preco_minimo, :integer - field :preco_maximo, :integer - field :preco_mais_comum, :integer - field :preco_medio, :integer + field(:id, Pescarte.Database.Types.PublicId, autogenerate: true) + field(:cotacao_data, :date, primary_key: true) + field(:cotacao_link, :string) + field(:pescado_codigo, :string, primary_key: true) + field(:fonte_nome, :string, primary_key: true) + field(:preco_minimo, :integer) + field(:preco_maximo, :integer) + field(:preco_mais_comum, :integer) + field(:preco_medio, :integer) end @spec changeset(CotacaoPescado.t(), map) :: changeset diff --git a/lib/pescarte/cotacoes/models/fonte.ex b/lib/pescarte/cotacoes/models/fonte.ex index f0af7815..6216821c 100644 --- a/lib/pescarte/cotacoes/models/fonte.ex +++ b/lib/pescarte/cotacoes/models/fonte.ex @@ -8,9 +8,9 @@ defmodule Pescarte.Cotacoes.Models.Fonte do @primary_key {:nome, :string, autogenerate: false} schema "fonte_cotacao" do - field :link, :string - field :descricao, :string - field :id, Pescarte.Database.Types.PublicId, autogenerate: true + field(:link, :string) + field(:descricao, :string) + field(:id, Pescarte.Database.Types.PublicId, autogenerate: true) end @spec changeset(Fonte.t(), map) :: changeset diff --git a/lib/pescarte/cotacoes/models/pescado.ex b/lib/pescarte/cotacoes/models/pescado.ex index a2076ee7..638fdec0 100644 --- a/lib/pescarte/cotacoes/models/pescado.ex +++ b/lib/pescarte/cotacoes/models/pescado.ex @@ -8,9 +8,9 @@ defmodule Pescarte.Cotacoes.Models.Pescado do @primary_key {:codigo, :string, autogenerate: false} schema "pescado" do - field :descricao, :string - field :embalagem, :string - field :id, Pescarte.Database.Types.PublicId, autogenerate: true + field(:descricao, :string) + field(:embalagem, :string) + field(:id, Pescarte.Database.Types.PublicId, autogenerate: true) end @spec changeset(Pescado.t(), map) :: changeset diff --git a/lib/pescarte/cotacoes/repository.ex b/lib/pescarte/cotacoes/repository.ex index 597430a1..06b51151 100644 --- a/lib/pescarte/cotacoes/repository.ex +++ b/lib/pescarte/cotacoes/repository.ex @@ -10,7 +10,7 @@ defmodule Pescarte.Cotacoes.Repository do @impl true def find_all_cotacao_by_not_ingested do - query = from c in Cotacao, where: not c.importada?, select: c + query = from(c in Cotacao, where: not c.importada?, select: c) Repo.Replica.all(query) end @@ -41,7 +41,7 @@ defmodule Pescarte.Cotacoes.Repository do @impl true def find_all_cotacao_by_not_downloaded do - query = from c in Cotacao, where: not c.baixada?, select: c + query = from(c in Cotacao, where: not c.baixada?, select: c) Repo.Replica.all(query) end diff --git a/lib/pescarte/identidades/models/contato.ex b/lib/pescarte/identidades/models/contato.ex index 5cc6c9fd..2b1fe07e 100644 --- a/lib/pescarte/identidades/models/contato.ex +++ b/lib/pescarte/identidades/models/contato.ex @@ -17,15 +17,16 @@ defmodule Pescarte.Identidades.Models.Contato do @primary_key {:email_principal, :string, autogenerate: false} schema "contato" do - field :celular_principal, :string - field :emails_adicionais, {:array, :string} - field :celulares_adicionais, {:array, :string} - field :id_publico, Pescarte.Database.Types.PublicId, autogenerate: true + field(:celular_principal, :string) + field(:emails_adicionais, {:array, :string}) + field(:celulares_adicionais, {:array, :string}) + field(:id_publico, Pescarte.Database.Types.PublicId, autogenerate: true) - belongs_to :endereco, Endereco, + belongs_to(:endereco, Endereco, foreign_key: :endereco_cep, references: :cep, type: :string + ) timestamps() end diff --git a/lib/pescarte/identidades/models/endereco.ex b/lib/pescarte/identidades/models/endereco.ex index 14fa2951..294808bc 100644 --- a/lib/pescarte/identidades/models/endereco.ex +++ b/lib/pescarte/identidades/models/endereco.ex @@ -14,13 +14,13 @@ defmodule Pescarte.Identidades.Models.Endereco do @primary_key {:cep, :string, autogenerate: false} schema "endereco" do - field :bairro, :string - field :rua, :string - field :numero, :string - field :complemento, :string - field :cidade, :string - field :estado, :string - field :id_publico, Pescarte.Database.Types.PublicId, autogenerate: true + field(:bairro, :string) + field(:rua, :string) + field(:numero, :string) + field(:complemento, :string) + field(:cidade, :string) + field(:estado, :string) + field(:id_publico, Pescarte.Database.Types.PublicId, autogenerate: true) timestamps() end diff --git a/lib/pescarte/identidades/models/token.ex b/lib/pescarte/identidades/models/token.ex index a4a033bf..5e7916b4 100644 --- a/lib/pescarte/identidades/models/token.ex +++ b/lib/pescarte/identidades/models/token.ex @@ -23,14 +23,15 @@ defmodule Pescarte.Identidades.Models.Token do } schema "user_token" do - field :token, :binary - field :contexto, :string - field :enviado_para, :string + field(:token, :binary) + field(:contexto, :string) + field(:enviado_para, :string) - belongs_to :usuario, Usuario, + belongs_to(:usuario, Usuario, foreign_key: :usuario_id, references: :id_publico, type: :string + ) timestamps(updated_at: false) end @@ -46,10 +47,10 @@ defmodule Pescarte.Identidades.Models.Token do Obtém todos os tokens do usuário fornecido para os contextos fornecidos. """ def user_and_contexts_query(user, :all) do - from t in Token, where: t.usuario_id == ^user.id_publico + from(t in Token, where: t.usuario_id == ^user.id_publico) end def user_and_contexts_query(user, [_ | _] = contexts) do - from t in Token, where: t.usuario_id == ^user.id_publico and t.contexto in ^contexts + from(t in Token, where: t.usuario_id == ^user.id_publico and t.contexto in ^contexts) end end diff --git a/lib/pescarte/modulo_pesquisa/i_manage_repository.ex b/lib/pescarte/modulo_pesquisa/i_manage_repository.ex index 2c3f03ec..208941da 100644 --- a/lib/pescarte/modulo_pesquisa/i_manage_repository.ex +++ b/lib/pescarte/modulo_pesquisa/i_manage_repository.ex @@ -17,7 +17,8 @@ defmodule Pescarte.ModuloPesquisa.IManageRepository do {:ok, Categoria.t()} | {:error, changeset} @callback fetch_midia_by_id_publico(Pescarte.Database.id()) :: {:ok, Midia.t()} | {:error, changeset} - @callback fetch_tag_by_id_publico(Pescarte.Database.id()) :: {:ok, Tag.t()} | {:error, changeset} + @callback fetch_tag_by_id_publico(Pescarte.Database.id()) :: + {:ok, Tag.t()} | {:error, changeset} @callback fetch_tag_by_etiqueta(binary) :: {:ok, Tag.t()} | {:error, changeset} @callback fetch_tags_from_ids(list(Pescarte.Database.id())) :: list(Tag.t()) diff --git a/lib/pescarte/modulo_pesquisa/models/campus.ex b/lib/pescarte/modulo_pesquisa/models/campus.ex index fdbc2bbb..eada6ba6 100644 --- a/lib/pescarte/modulo_pesquisa/models/campus.ex +++ b/lib/pescarte/modulo_pesquisa/models/campus.ex @@ -20,17 +20,18 @@ defmodule Pescarte.ModuloPesquisa.Models.Campus do @primary_key {:acronimo, :string, autogenerate: false} schema "campus" do - field :nome, :string - field :nome_universidade, :string - field :id_publico, PublicId, autogenerate: true + field(:nome, :string) + field(:nome_universidade, :string) + field(:id_publico, PublicId, autogenerate: true) - has_many :pesquisadores, Pesquisador, foreign_key: :campus_acronimo, references: :acronimo + has_many(:pesquisadores, Pesquisador, foreign_key: :campus_acronimo, references: :acronimo) - belongs_to :endereco, Endereco, + belongs_to(:endereco, Endereco, on_replace: :delete, foreign_key: :endereco_cep, references: :cep, type: :string + ) timestamps() end diff --git a/lib/pescarte/modulo_pesquisa/models/linha_pesquisa.ex b/lib/pescarte/modulo_pesquisa/models/linha_pesquisa.ex index e9b61e0f..e0416387 100644 --- a/lib/pescarte/modulo_pesquisa/models/linha_pesquisa.ex +++ b/lib/pescarte/modulo_pesquisa/models/linha_pesquisa.ex @@ -19,25 +19,28 @@ defmodule Pescarte.ModuloPesquisa.Models.LinhaPesquisa do @primary_key {:numero, :integer, autogenerate: false} schema "linha_pesquisa" do - field :desc_curta, :string - field :desc, :string - field :id_publico, Pescarte.Database.Types.PublicId, autogenerate: true + field(:desc_curta, :string) + field(:desc, :string) + field(:id_publico, Pescarte.Database.Types.PublicId, autogenerate: true) - belongs_to :nucleo_pesquisa, NucleoPesquisa, + belongs_to(:nucleo_pesquisa, NucleoPesquisa, foreign_key: :nucleo_pesquisa_letra, references: :letra, type: :string + ) - belongs_to :responsavel_lp, Pesquisador, + belongs_to(:responsavel_lp, Pesquisador, foreign_key: :responsavel_lp_id, references: :id_publico, type: :string + ) - many_to_many :pesquisadores, Pesquisador, + many_to_many(:pesquisadores, Pesquisador, join_through: "linhas_pesquisas_pesquisadores", join_keys: [pesquisador_id: :id_publico, linha_pesquisa_numero: :numero], on_replace: :delete, unique: true + ) timestamps() end diff --git a/lib/pescarte/modulo_pesquisa/models/midia.ex b/lib/pescarte/modulo_pesquisa/models/midia.ex index 40dc4341..1b7053c9 100644 --- a/lib/pescarte/modulo_pesquisa/models/midia.ex +++ b/lib/pescarte/modulo_pesquisa/models/midia.ex @@ -25,25 +25,27 @@ defmodule Pescarte.ModuloPesquisa.Models.Midia do @primary_key {:link, :string, autogenerate: false} schema "midia" do - field :tipo, Ecto.Enum, values: @tipos - field :nome_arquivo, :string - field :data_arquivo, :date - field :restrito?, :boolean, default: false - field :observacao, :string - field :texto_alternativo, :string - field :id_publico, PublicId, autogenerate: true - - belongs_to :autor, Usuario, + field(:tipo, Ecto.Enum, values: @tipos) + field(:nome_arquivo, :string) + field(:data_arquivo, :date) + field(:restrito?, :boolean, default: false) + field(:observacao, :string) + field(:texto_alternativo, :string) + field(:id_publico, PublicId, autogenerate: true) + + belongs_to(:autor, Usuario, on_replace: :update, foreign_key: :autor_id, references: :id_publico, type: :string + ) - many_to_many :tags, Tag, + many_to_many(:tags, Tag, join_through: "midias_tags", join_keys: [midia_link: :link, tag_etiqueta: :etiqueta], on_replace: :delete, unique: true + ) timestamps() end diff --git a/lib/pescarte/modulo_pesquisa/models/midia/categoria.ex b/lib/pescarte/modulo_pesquisa/models/midia/categoria.ex index 9b471bd9..f8147f11 100644 --- a/lib/pescarte/modulo_pesquisa/models/midia/categoria.ex +++ b/lib/pescarte/modulo_pesquisa/models/midia/categoria.ex @@ -9,9 +9,9 @@ defmodule Pescarte.ModuloPesquisa.Models.Midia.Categoria do @primary_key {:nome, :string, autogenerate: false} schema "categoria" do - field :id_publico, Pescarte.Database.Types.PublicId, autogenerate: true + field(:id_publico, Pescarte.Database.Types.PublicId, autogenerate: true) - has_many :tags, Tag, foreign_key: :categoria_nome, references: :nome + has_many(:tags, Tag, foreign_key: :categoria_nome, references: :nome) timestamps() end diff --git a/lib/pescarte/modulo_pesquisa/models/midia/tag.ex b/lib/pescarte/modulo_pesquisa/models/midia/tag.ex index 73d7e390..6756df9b 100644 --- a/lib/pescarte/modulo_pesquisa/models/midia/tag.ex +++ b/lib/pescarte/modulo_pesquisa/models/midia/tag.ex @@ -9,12 +9,13 @@ defmodule Pescarte.ModuloPesquisa.Models.Midia.Tag do @primary_key {:etiqueta, :string, autogenerate: false} schema "tag" do - field :id_publico, Pescarte.Database.Types.PublicId, autogenerate: true + field(:id_publico, Pescarte.Database.Types.PublicId, autogenerate: true) - belongs_to :categoria, Categoria, + belongs_to(:categoria, Categoria, foreign_key: :categoria_nome, references: :nome, type: :string + ) timestamps() end diff --git a/lib/pescarte/modulo_pesquisa/models/nucleo_pesquisa.ex b/lib/pescarte/modulo_pesquisa/models/nucleo_pesquisa.ex index 22e5f026..265c7092 100644 --- a/lib/pescarte/modulo_pesquisa/models/nucleo_pesquisa.ex +++ b/lib/pescarte/modulo_pesquisa/models/nucleo_pesquisa.ex @@ -13,11 +13,11 @@ defmodule Pescarte.ModuloPesquisa.Models.NucleoPesquisa do @primary_key {:letra, :string, autogenerate: false} schema "nucleo_pesquisa" do - field :nome, :string - field :desc, :string - field :id_publico, Pescarte.Database.Types.PublicId, autogenerate: true + field(:nome, :string) + field(:desc, :string) + field(:id_publico, Pescarte.Database.Types.PublicId, autogenerate: true) - has_many :linha_pesquisas, LinhaPesquisa, foreign_key: :nucleo_pesquisa_letra + has_many(:linha_pesquisas, LinhaPesquisa, foreign_key: :nucleo_pesquisa_letra) timestamps() end diff --git a/lib/pescarte/modulo_pesquisa/models/pesquisador.ex b/lib/pescarte/modulo_pesquisa/models/pesquisador.ex index 77d60eff..2b784c0f 100644 --- a/lib/pescarte/modulo_pesquisa/models/pesquisador.ex +++ b/lib/pescarte/modulo_pesquisa/models/pesquisador.ex @@ -43,49 +43,55 @@ defmodule Pescarte.ModuloPesquisa.Models.Pesquisador do @primary_key {:id_publico, Pescarte.Database.Types.PublicId, autogenerate: true} schema "pesquisador" do - field :minibio, :string - field :bolsa, Ecto.Enum, values: @tipo_bolsas - field :link_lattes, :string - field :link_banner_perfil, :string - field :link_avatar, :string - field :link_linkedin, :string - field :formacao, :string - field :data_inicio_bolsa, :date - field :data_fim_bolsa, :date - field :data_contratacao, :date - field :data_termino, :date + field(:minibio, :string) + field(:bolsa, Ecto.Enum, values: @tipo_bolsas) + field(:link_lattes, :string) + field(:link_banner_perfil, :string) + field(:link_avatar, :string) + field(:link_linkedin, :string) + field(:formacao, :string) + field(:data_inicio_bolsa, :date) + field(:data_fim_bolsa, :date) + field(:data_contratacao, :date) + field(:data_termino, :date) - has_one :linha_pesquisa, LinhaPesquisa, + has_one(:linha_pesquisa, LinhaPesquisa, foreign_key: :responsavel_lp_id, references: :id_publico + ) - has_many :relatorios_pesquisa, RelatorioPesquisa, + has_many(:relatorios_pesquisa, RelatorioPesquisa, references: :id_publico, foreign_key: :pesquisador_id + ) - has_many :orientandos, Pesquisador, references: :id_publico + has_many(:orientandos, Pesquisador, references: :id_publico) - has_many :midias, Midia, + has_many(:midias, Midia, foreign_key: :autor_id, references: :id_publico, foreign_key: :pesquisador_id + ) - belongs_to :usuario, Usuario, + belongs_to(:usuario, Usuario, on_replace: :update, references: :id_publico, foreign_key: :usuario_id, type: :string + ) - belongs_to :campus, Campus, + belongs_to(:campus, Campus, foreign_key: :campus_acronimo, references: :acronimo, type: :string + ) - belongs_to :orientador, Pesquisador, + belongs_to(:orientador, Pesquisador, on_replace: :update, references: :id_publico, foreign_key: :orientador_id, type: :string + ) timestamps() end diff --git a/lib/pescarte/modulo_pesquisa/schemas/conteudo_anual.ex b/lib/pescarte/modulo_pesquisa/schemas/conteudo_anual.ex index bd0eb2c9..fb3b858c 100644 --- a/lib/pescarte/modulo_pesquisa/schemas/conteudo_anual.ex +++ b/lib/pescarte/modulo_pesquisa/schemas/conteudo_anual.ex @@ -19,7 +19,7 @@ defmodule Pescarte.ModuloPesquisa.Schemas.ConteudoAnual do embedded_schema do for field <- @fields do - field field, :string + field(field, :string) end end diff --git a/lib/pescarte/modulo_pesquisa/schemas/conteudo_mensal.ex b/lib/pescarte/modulo_pesquisa/schemas/conteudo_mensal.ex index 685ed441..e4733d4e 100644 --- a/lib/pescarte/modulo_pesquisa/schemas/conteudo_mensal.ex +++ b/lib/pescarte/modulo_pesquisa/schemas/conteudo_mensal.ex @@ -19,7 +19,7 @@ defmodule Pescarte.ModuloPesquisa.Schemas.ConteudoMensal do embedded_schema do for field <- @fields do - field field, :string + field(field, :string) end end diff --git a/lib/pescarte/modulo_pesquisa/schemas/conteudo_trimestral.ex b/lib/pescarte/modulo_pesquisa/schemas/conteudo_trimestral.ex index 803f1aae..b92ee2ec 100644 --- a/lib/pescarte/modulo_pesquisa/schemas/conteudo_trimestral.ex +++ b/lib/pescarte/modulo_pesquisa/schemas/conteudo_trimestral.ex @@ -17,7 +17,7 @@ defmodule Pescarte.ModuloPesquisa.Schemas.ConteudoTrimestral do embedded_schema do for field <- @fields do - field field, :string + field(field, :string) end end diff --git a/lib/pescarte/modulo_pesquisa/schemas/pesquisador.ex b/lib/pescarte/modulo_pesquisa/schemas/pesquisador.ex index 8fc69622..a98dc5db 100644 --- a/lib/pescarte/modulo_pesquisa/schemas/pesquisador.ex +++ b/lib/pescarte/modulo_pesquisa/schemas/pesquisador.ex @@ -18,11 +18,11 @@ defmodule Pescarte.ModuloPesquisa.Schemas.Pesquisador do @primary_key false embedded_schema do - field :id, Pescarte.Database.Types.PublicId, autogenerate: false - field :nome, :string - field :cpf, :string - field :email, :string - field :participacao, Ecto.Enum, values: Model.tipo_bolsas() + field(:id, Pescarte.Database.Types.PublicId, autogenerate: false) + field(:nome, :string) + field(:cpf, :string) + field(:email, :string) + field(:participacao, Ecto.Enum, values: Model.tipo_bolsas()) end def parse!(attrs) do diff --git a/lib/pescarte/modulo_pesquisa/schemas/relatorio_pesquisa.ex b/lib/pescarte/modulo_pesquisa/schemas/relatorio_pesquisa.ex index 5488e6db..b6a63bdc 100644 --- a/lib/pescarte/modulo_pesquisa/schemas/relatorio_pesquisa.ex +++ b/lib/pescarte/modulo_pesquisa/schemas/relatorio_pesquisa.ex @@ -17,11 +17,11 @@ defmodule Pescarte.ModuloPesquisa.Schemas.RelatorioPesquisa do @optional_fields ~w(data nome_pesquisador)a embedded_schema do - field :data, :date - field :periodo, :string - field :nome_pesquisador, :string - field :tipo, Ecto.Enum, values: ~w(anual mensal trimestral)a - field :status, Ecto.Enum, values: ~w(entregue pendente atrasado)a + field(:data, :date) + field(:periodo, :string) + field(:nome_pesquisador, :string) + field(:tipo, Ecto.Enum, values: ~w(anual mensal trimestral)a) + field(:status, Ecto.Enum, values: ~w(entregue pendente atrasado)a) end @spec parse!(map) :: RelatorioPesquisa.t() diff --git a/lib/pescarte_web/design_system/search_input.ex b/lib/pescarte_web/design_system/search_input.ex index 982574d9..31d28a6e 100644 --- a/lib/pescarte_web/design_system/search_input.ex +++ b/lib/pescarte_web/design_system/search_input.ex @@ -11,13 +11,13 @@ defmodule PescarteWeb.DesignSystem.SearchInput do |> assign(filtered: [])} end - attr :id, :string, required: true - attr :name, :string, required: true - attr :content, :list, default: [] - attr :placeholder, :string, default: "Faça uma pesquisa..." - attr :field, Phoenix.HTML.FormFieldcontent - attr :size, :string, values: ~w(base large), default: "base" - attr :patch, :string, required: true + attr(:id, :string, required: true) + attr(:name, :string, required: true) + attr(:content, :list, default: []) + attr(:placeholder, :string, default: "Faça uma pesquisa...") + attr(:field, Phoenix.HTML.FormFieldcontent) + attr(:size, :string, values: ~w(base large), default: "base") + attr(:patch, :string, required: true) @impl true def render(assigns) do diff --git a/lib/pescarte_web/layouts.ex b/lib/pescarte_web/layouts.ex index 6aec3e80..7c80c94d 100644 --- a/lib/pescarte_web/layouts.ex +++ b/lib/pescarte_web/layouts.ex @@ -1,5 +1,5 @@ defmodule PescarteWeb.Layouts do use PescarteWeb, :html - embed_templates "layouts/*" + embed_templates("layouts/*") end diff --git a/lib/pescarte_web/live/pesquisa/relatorio_live/index.html.heex b/lib/pescarte_web/live/pesquisa/relatorio_live/index.html.heex index 65953de9..c1496464 100644 --- a/lib/pescarte_web/live/pesquisa/relatorio_live/index.html.heex +++ b/lib/pescarte_web/live/pesquisa/relatorio_live/index.html.heex @@ -1,43 +1,43 @@
<.live_component diff --git a/lib/pescarte_web/templates/error_html.ex b/lib/pescarte_web/templates/error_html.ex index db78dbb0..c8ca5808 100644 --- a/lib/pescarte_web/templates/error_html.ex +++ b/lib/pescarte_web/templates/error_html.ex @@ -1,7 +1,7 @@ defmodule PescarteWeb.ErrorHTML do use PescarteWeb, :html - embed_templates "error_html/*" + embed_templates("error_html/*") def template_not_found(template, _assigns) do Phoenix.Controller.status_message_from_template(template) diff --git a/lib/pescarte_web/templates/landing_html.ex b/lib/pescarte_web/templates/landing_html.ex index b0935064..cbf5f5fe 100644 --- a/lib/pescarte_web/templates/landing_html.ex +++ b/lib/pescarte_web/templates/landing_html.ex @@ -1,7 +1,7 @@ defmodule PescarteWeb.LandingHTML do use PescarteWeb, :html - embed_templates "landing_html/*" + embed_templates("landing_html/*") def handle_event("dialog", _value, socket) do IO.puts("HHHHHHHHEEEEEEEEELLLLLLLLLOOOOOOOOOOOOOOOOOOOOO")