avo 1.2.11.pre.4 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of avo might be problematic. Click here for more details.

Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +0 -2
  3. data/Gemfile.lock +1 -1
  4. data/README.md +3 -2
  5. data/app/components/avo/edit/fields/markdown_field_component.html.erb +1 -0
  6. data/app/components/avo/edit/fields/trix_field_component.html.erb +1 -1
  7. data/app/components/avo/panel_component.html.erb +5 -3
  8. data/app/components/avo/panel_component.rb +6 -1
  9. data/app/components/avo/show/fields/markdown_field_component.html.erb +1 -0
  10. data/app/components/avo/views/resource_index_component.html.erb +1 -1
  11. data/app/components/avo/views/resource_show_component.html.erb +1 -1
  12. data/app/packs/js/controllers/fields/simple_mde_controller.js +9 -1
  13. data/lib/avo/fields/base_field.rb +3 -1
  14. data/lib/avo/fields/markdown_field.rb +3 -4
  15. data/lib/avo/version.rb +1 -1
  16. data/lib/generators/avo/locales_generator.rb +2 -2
  17. data/lib/generators/avo/templates/locales/avo.en.yml +1 -0
  18. data/lib/generators/avo/templates/locales/avo.nb-NO.yml +81 -0
  19. data/lib/generators/avo/templates/locales/avo.pt-BR.yml +82 -0
  20. data/lib/generators/avo/templates/locales/avo.ro.yml +70 -0
  21. data/public/avo-packs/css/application-af3e670d.css.map +1 -1
  22. data/public/avo-packs/css/application-af3e670d.css.map.br +0 -0
  23. data/public/avo-packs/css/application-af3e670d.css.map.gz +0 -0
  24. data/public/avo-packs/js/application-801f1297670a4c6df1b6.js +26 -0
  25. data/public/avo-packs/js/{application-e66a1f4df5d01326ce36.js.LICENSE.txt → application-801f1297670a4c6df1b6.js.LICENSE.txt} +0 -0
  26. data/public/avo-packs/js/application-801f1297670a4c6df1b6.js.br +0 -0
  27. data/public/avo-packs/js/application-801f1297670a4c6df1b6.js.gz +0 -0
  28. data/public/avo-packs/js/application-801f1297670a4c6df1b6.js.map +1 -0
  29. data/public/avo-packs/js/application-801f1297670a4c6df1b6.js.map.br +0 -0
  30. data/public/avo-packs/js/application-801f1297670a4c6df1b6.js.map.gz +0 -0
  31. data/public/avo-packs/manifest.json +8 -8
  32. metadata +13 -10
  33. data/public/avo-packs/js/application-e66a1f4df5d01326ce36.js +0 -26
  34. data/public/avo-packs/js/application-e66a1f4df5d01326ce36.js.br +0 -0
  35. data/public/avo-packs/js/application-e66a1f4df5d01326ce36.js.gz +0 -0
  36. data/public/avo-packs/js/application-e66a1f4df5d01326ce36.js.map +0 -1
  37. data/public/avo-packs/js/application-e66a1f4df5d01326ce36.js.map.br +0 -0
  38. data/public/avo-packs/js/application-e66a1f4df5d01326ce36.js.map.gz +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0e04eeebd11ad1f927113dd7aefe2b72988089713cd0abc5ea7ded746f0d5d2d
4
- data.tar.gz: 0677f4dbad8ce2adaabdd82d745301ef190bbbe75ff0769107c7ce5368cfa149
3
+ metadata.gz: d095fdb8b9a9bf01c80c78122c8d208884ae1e1258f89b508bc3a9633c6415af
4
+ data.tar.gz: f521708087549cbae1c0cdaac208d25807b51485bb877827c54574516c4bed21
5
5
  SHA512:
6
- metadata.gz: 59f16efb569f7c1cc52fce93ef5ec7ee5a2292bdb06bd89e9ac0c090f4802f81063fb5b426e8656e2f93d7324faff9859b823964a3d54b7ee84c1823911fda22
7
- data.tar.gz: 8f04ea620dc5f8144cb8edfd0030d89fb5fc7ce3ec0c07790cdfc62dfcdb9f095b15ca86063252c5ae40c449317d73190dc2f93ee43963c700f8b1f9627cdaa8
6
+ metadata.gz: 6337100f747bc3b02c1e426b8d99bd97bd96511e52882adeef1f7b84001fab51a2404e0f2119d32e5548c0c503bc39f30462c8bc5adfbab16f1f22b3ceaf3b9c
7
+ data.tar.gz: ddc4333d401bf01327e1b4b47e73fa6c9ba7c8a650d9ddad810b6de038470eb75f95ae626c545e3dff43973a059a90af66e5e6666637628aaa5b85bd4a4dc8aa
data/Gemfile CHANGED
@@ -125,5 +125,3 @@ gem 'meta-tags'
125
125
  gem 'breadcrumbs_on_rails'
126
126
 
127
127
  gem 'manifester'
128
- # gem 'manifester', path: '/Users/adrian/work/avocado/gem/manifester'
129
-
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (1.2.11.pre.4)
4
+ avo (1.3.3)
5
5
  active_link_to
6
6
  addressable
7
7
  breadcrumbs_on_rails
data/README.md CHANGED
@@ -30,12 +30,13 @@ Avo is a beautiful next-generation framework that empowers you, the developer, t
30
30
  - **Keeps your app clean** - You don't need to change your app to use Avo. Drop it in your existing app or add it to a new one and you're done 🙌
31
31
  - **Custom fields***- No worries if we missed a field you need. Generate a custom field in a jiffy.
32
32
  - **Dashboard widgets and metrics*** - Customize your dashboard with the tools and analytics you need.
33
- - **Custom tools*** - You need to add a page with something completely new, you've got it!
33
+ - **Custom tools** - You need to add a page with something completely new, you've got it!
34
34
  - **Authorization** - Leverage Pundit policies to build a robust and scalable authorization system.
35
35
  - **Themable*** - Dress it up into your own colors.
36
36
  - **Localization*** - Have it available in any language you need.
37
+ - **No asset pipeline pollution** - Bring your own asset pipeline.
37
38
 
38
- *Some features are still under development
39
+ *Features still under development
39
40
 
40
41
  # Installation
41
42
  Add this line to your application's `Gemfile`:
@@ -5,6 +5,7 @@
5
5
  placeholder: @field.placeholder,
6
6
  disabled: @field.readonly,
7
7
  'data-simple-mde-target': 'element',
8
+ 'data-component-options': @field.options.to_json,
8
9
  'data-view': :edit
9
10
  %>
10
11
  </div>
@@ -1,6 +1,6 @@
1
1
  <%= edit_field_wrapper field: @field, index: @index, form: @form, resource: @resource, displayed_in_modal: @displayed_in_modal do %>
2
2
  <% trix_id = "trix_#{@resource.name.underscore}_#{@field.id}" %>
3
- <trix-editor input="<%= trix_id %>" value="<%= @field.value %>" placeholder="<%= @field.placeholder %>"><%== @field.value %></trix-editor>
3
+ <trix-editor input="<%= trix_id %>" placeholder="<%= @field.placeholder %>"><%== @field.value %></trix-editor>
4
4
  <%= @form.text_area @field.id,
5
5
  id: trix_id,
6
6
  class: helpers.input_classes('w-full hidden', has_error: (@resource.model.present? and @resource.model.errors.include?(@field.id))),
@@ -1,9 +1,11 @@
1
1
  <div <%== data_attributes %>>
2
2
  <div class="mb-6">
3
3
  <div>
4
- <div class="breadcrumbs">
5
- <%= helpers.render_breadcrumbs(separator: helpers.svg('chevron-right', class: 'inline-block h-3 stroke-current relative top-[-1px] ml-1' )) if Avo.configuration.display_breadcrumbs %>
6
- </div>
4
+ <% if show_breadcrumbs? %>
5
+ <div class="breadcrumbs">
6
+ <%= helpers.render_breadcrumbs(separator: helpers.svg('chevron-right', class: 'inline-block h-3 stroke-current relative top-[-1px] ml-1' )) if Avo.configuration.display_breadcrumbs %>
7
+ </div>
8
+ <% end %>
7
9
  <div class="text-2xl tracking-normal font-bold text-gray-800 truncate">
8
10
  <%= @title %>
9
11
  </div>
@@ -6,10 +6,11 @@ class Avo::PanelComponent < ViewComponent::Base
6
6
  renders_one :bare_content
7
7
  renders_one :footer
8
8
 
9
- def initialize(title: nil, body_classes: nil, data: {})
9
+ def initialize(title: nil, body_classes: nil, data: {}, show_breadcrumbs: true)
10
10
  @title = title
11
11
  @body_classes = body_classes
12
12
  @data = data
13
+ @show_breadcrumbs = show_breadcrumbs
13
14
  end
14
15
 
15
16
  private
@@ -21,4 +22,8 @@ class Avo::PanelComponent < ViewComponent::Base
21
22
  " data-#{key}=\"#{value}\""
22
23
  end.join
23
24
  end
25
+
26
+ def show_breadcrumbs?
27
+ @show_breadcrumbs
28
+ end
24
29
  end
@@ -5,6 +5,7 @@
5
5
  placeholder: @field.placeholder,
6
6
  disabled: @field.readonly,
7
7
  'data-simple-mde-target': 'element',
8
+ 'data-component-options': @field.options.to_json,
8
9
  'data-view': :show %>
9
10
  </div>
10
11
  <% end %>
@@ -1,4 +1,4 @@
1
- <%= render Avo::PanelComponent.new title: title, body_classes: 'py-4', data: { component: 'resources-index' } do |c| %>
1
+ <%= render Avo::PanelComponent.new title: title, body_classes: 'py-4', data: { component: 'resources-index' }, show_breadcrumbs: @reflection.blank? do |c| %>
2
2
  <% c.tools do %>
3
3
  <%= render 'actions' if @actions.present? %>
4
4
 
@@ -3,7 +3,7 @@
3
3
  data-selected-resources="[<%= @resource.model.id %>]"
4
4
  >
5
5
  <% @resource.panels.each do |resource_panel| %>
6
- <%= render(Avo::PanelComponent.new(title: resource_panel[:name])) do |c| %>
6
+ <%= render Avo::PanelComponent.new(title: resource_panel[:name], show_breadcrumbs: @reflection.blank?) do |c| %>
7
7
  <% c.tools do %>
8
8
  <% if resource_panel[:name] == @resource.default_panel_name %>
9
9
  <%= render 'actions' %>
@@ -8,10 +8,18 @@ export default class extends Controller {
8
8
  return this.elementTarget.dataset.view
9
9
  }
10
10
 
11
+ get componentOptions() {
12
+ try {
13
+ return JSON.parse(this.elementTarget.dataset.componentOptions)
14
+ } catch (error) {
15
+ return {}
16
+ }
17
+ }
18
+
11
19
  connect() {
12
20
  const options = {
13
21
  element: this.elementTarget,
14
- spellChecker: false,
22
+ spellChecker: this.componentOptions.spell_checker,
15
23
  }
16
24
 
17
25
  if (this.view === 'show') {
@@ -33,6 +33,7 @@ module Avo
33
33
  attr_accessor :meta
34
34
  attr_accessor :panel_name
35
35
  attr_accessor :link_to_resource
36
+ attr_accessor :options
36
37
 
37
38
  class_attribute :field_name_attribute
38
39
 
@@ -67,7 +68,8 @@ module Avo
67
68
  default: nil,
68
69
  visible: true,
69
70
  meta: {},
70
- panel_name: nil
71
+ panel_name: nil,
72
+ options: {}
71
73
  }
72
74
 
73
75
  # Set the values in the following order
@@ -12,10 +12,9 @@ module Avo
12
12
 
13
13
  @always_show = args[:always_show].present? ? args[:always_show] : false
14
14
  @height = args[:height].present? ? args[:height].to_s : "auto"
15
- end
16
-
17
- def hydrate_field(fields, model, resource, view)
18
- {
15
+ @spell_checker = args[:spell_checker].present? ? args[:spell_checker] : false
16
+ @options = {
17
+ spell_checker: @spell_checker,
19
18
  always_show: @always_show,
20
19
  height: @height
21
20
  }
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "1.2.11.pre.4"
2
+ VERSION = "1.3.3"
3
3
  end
@@ -6,10 +6,10 @@ module Generators
6
6
  source_root File.expand_path("templates", __dir__)
7
7
 
8
8
  namespace "avo:locales"
9
- desc "Creates an Avo initializer adds the route to the routes file."
9
+ desc "Add Avo locale files to your project."
10
10
 
11
11
  def create_files
12
- template "locales/avo.en.yml", "config/locales/avo.en.yml"
12
+ directory File.join(__dir__, "templates", "locales"), "config/locales"
13
13
  end
14
14
  end
15
15
  end
@@ -59,6 +59,7 @@ en:
59
59
  and_x_other_resources: 'and %{count} other resources'
60
60
  go_back: 'Go back'
61
61
  home: 'Home'
62
+ new: 'new'
62
63
  attach_item: 'Attach %{item}'
63
64
  choose_item: 'Choose %{item}'
64
65
  create_new_item: 'Create new %{item}'
@@ -0,0 +1,81 @@
1
+ nb:
2
+ avo:
3
+ dashboard: 'Dashboard'
4
+ choose_a_country: 'Velg et land'
5
+ choose_an_option: 'Velg et alternativ'
6
+ are_you_sure_you_want_to_run_this_option: 'Er du sikker?'
7
+ are_you_sure_detach_item: 'Er du sikker på at du vil koble fra %{item}.'
8
+ run: 'Kjør'
9
+ cancel: 'Avslutt'
10
+ action_ran_successfully: 'Suksess!'
11
+ resource_details: "%{item} detaljer: %{title}"
12
+ update_item: 'Oppdatert %{item}: %{title}'
13
+ unauthorized: 'Ikke autorisert'
14
+ attachment_class_attached: '%{attachment_class} lagt til.'
15
+ attachment_class_detached: '%{attachment_class} fjernet.'
16
+ resource_updated: 'Ressurs oppdatert'
17
+ resource_created: 'Ressurs generert'
18
+ resource_destroyed: 'Ressurs slettet'
19
+ switch_to_view: "Bytt til %{view_type} vis"
20
+ click_to_reveal_filters: "Vis filter"
21
+ attachment_destroyed: 'Vedlett slettet'
22
+ failed_to_find_attachment: 'Fant ikke vedlegg'
23
+ you_missed_something_check_form: 'Her mangler du noe. Vennligst sjekk skjemaet.'
24
+ remove_selection: 'Fjern valg'
25
+ select_item: 'Velg'
26
+ delete_file: 'Slett fil'
27
+ delete: 'slett'
28
+ delete_item: 'Slett %{item}'
29
+ download_item: 'Last ned %{item}'
30
+ download_file: 'Last ned fil'
31
+ download: 'Last ned'
32
+ view: 'Vis'
33
+ view_item: 'vis %{item}'
34
+ edit: 'endre'
35
+ edit_item: 'endre %{item}'
36
+ detach_item: 'koble fra %{item}'
37
+ number_of_items:
38
+ zero: 'ingen %{item}'
39
+ one: 'en %{item}'
40
+ other: '%{count} %{item}'
41
+ are_you_sure: 'Er du sikker?'
42
+ filters: 'Filter'
43
+ per_page: 'Per side'
44
+ more: 'Mer'
45
+ attach: 'Legg til'
46
+ cancel: 'Avslutt'
47
+ save: 'Lagre'
48
+ attach_and_attach_another: 'Legg til & Legg til ny'
49
+ hide_content: 'Skjul innhold'
50
+ show_content: 'Vis innhold'
51
+ no_related_item_found: 'Ingen relaterte %{item} funnet'
52
+ no_item_found: 'Ingen %{item} funnet'
53
+ loading: 'Laster'
54
+ confirm: 'Bekreft'
55
+ actions: 'Handlinger'
56
+ resources: 'Ressurser'
57
+ oops_nothing_found: 'Oops! Ingen ting funnet...'
58
+ type_to_search: 'Søk.'
59
+ and_x_other_resources: 'og %{count} andre ressurser'
60
+ go_back: 'Gå tilbake'
61
+ home: 'Hjem'
62
+ attach_item: 'Legg til %{item}'
63
+ choose_item: 'Velge %{item}'
64
+ create_new_item: 'Lag ny %{item}'
65
+ table_view: 'Tabell visning'
66
+ grid_view: 'Grid visning'
67
+ next_page: 'Neste side'
68
+ prev_page: 'Forrige side'
69
+ list_is_empty: 'Listen er tom'
70
+ field_translations:
71
+ file:
72
+ zero: 'filer'
73
+ one: 'fil'
74
+ other: 'filer'
75
+ resource_translations:
76
+ user:
77
+ zero: 'brukere'
78
+ one: 'bruker'
79
+ other: 'brukere'
80
+ reset_filters: 'Nullstill filter'
81
+ not_authorized: 'Du er ikke autorisert til å gjøre denne handlingen.'
@@ -0,0 +1,82 @@
1
+ pt:
2
+ avo:
3
+ dashboard: 'Painel'
4
+ choose_a_country: 'Escolha um país'
5
+ choose_an_option: 'Escolha uma opção'
6
+ are_you_sure_you_want_to_run_this_option: 'Você tem certeza que deseja executar esta ação?'
7
+ are_you_sure_detach_item: 'Você tem certeza que deseja separar este %{item}.'
8
+ run: 'Executar'
9
+ cancel: 'Cancelar'
10
+ action_ran_successfully: 'Ação executada com sucesso!'
11
+ resource_details: "Detalhe %{item}: %{title}"
12
+ update_item: 'atualizar %{item}: %{title}'
13
+ unauthorized: 'Não autorizado'
14
+ attachment_class_attached: '%{attachment_class} anexado.'
15
+ attachment_class_detached: '%{attachment_class} separado.'
16
+ resource_updated: 'Recurso atualizado'
17
+ resource_created: 'Recurso criado'
18
+ resource_destroyed: 'Recurso destruído'
19
+ switch_to_view: "Alterar para visão %{view_type}"
20
+ click_to_reveal_filters: "Clique para revelar os filtros"
21
+ attachment_destroyed: 'Anexo destruído'
22
+ failed_to_find_attachment: 'Falhou ao achar anexo'
23
+ you_missed_something_check_form: 'Você pode ter esquecido algo. Por favor, cheque o formulário.'
24
+ remove_selection: 'Remover seleção'
25
+ select_item: 'Selecionar item'
26
+ delete_file: 'Deletar arquivo'
27
+ delete: 'deletar'
28
+ delete_item: 'Deletar %{item}'
29
+ download_item: 'Baixar %{item}'
30
+ download_file: 'Baixar arquivo'
31
+ download: 'Baixar'
32
+ view: 'Visualizar'
33
+ view_item: 'visualizar %{item}'
34
+ edit: 'editar'
35
+ edit_item: 'editar %{item}'
36
+ detach_item: 'separar %{item}'
37
+ number_of_items:
38
+ zero: 'sem %{item}'
39
+ one: 'um %{item}'
40
+ other: '%{count} %{item}'
41
+ are_you_sure: 'Você tem certeza?'
42
+ filters: 'Filtros'
43
+ per_page: 'Por página'
44
+ more: 'Mais'
45
+ attach: 'Anexar'
46
+ cancel: 'Cancelar'
47
+ save: 'Salvar'
48
+ attach_and_attach_another: 'Anexar & anexar outro'
49
+ hide_content: 'Esconder conteúdo'
50
+ show_content: 'Mostrar conteúdo'
51
+ no_related_item_found: 'Nenhum %{item} relacionado encontrado'
52
+ no_item_found: 'Nenhum %{item} encontrado'
53
+ loading: 'Carregando'
54
+ confirm: 'Confirmar'
55
+ actions: 'Ações'
56
+ resources: 'Recursos'
57
+ oops_nothing_found: 'Oops! Nada encontrado...'
58
+ type_to_search: 'Digite para buscar.'
59
+ and_x_other_resources: 'e %{count} outros recursos'
60
+ go_back: 'Voltar'
61
+ home: 'Início'
62
+ new: 'novo'
63
+ attach_item: 'Anexar %{item}'
64
+ choose_item: 'Escolher %{item}'
65
+ create_new_item: 'Criar novo %{item}'
66
+ table_view: 'Visualização em tabela'
67
+ grid_view: 'Visualização em grade'
68
+ next_page: 'Próxima página'
69
+ prev_page: 'Página anterior'
70
+ list_is_empty: 'Lista vazia'
71
+ field_translations:
72
+ file:
73
+ zero: 'arquivos'
74
+ one: 'arquivo'
75
+ other: 'arquivos'
76
+ resource_translations:
77
+ user:
78
+ zero: 'usuários'
79
+ one: 'usuário'
80
+ other: 'usuários'
81
+ reset_filters: 'Limpar filtros'
82
+ not_authorized: 'Você não está autorizado à executar essa ação.'
@@ -0,0 +1,70 @@
1
+ ro:
2
+ avo:
3
+ dashboard: 'Panou de control'
4
+ choose_a_country: 'Alege o tara'
5
+ choose_an_option: 'Alege o optiune'
6
+ are_you_sure_you_want_to_run_this_option: 'Esti sigur ca vrei sa rulezi aceasta actiune?'
7
+ run: 'Ruleaza'
8
+ cancel: 'Anuleaza'
9
+ action_ran_successfully: 'Actiunea a rulat cu succes!'
10
+ resource_details: 'Detalii %{item}'
11
+ unauthorized: 'Neautorizat'
12
+ attachment_class_attached: '%{attachment_class} anexat.'
13
+ attachment_class_detached: '%{attachment_class} separat.'
14
+ resource_updated: 'Resursa actualizata'
15
+ resource_created: 'Resursa creata'
16
+ resource_destroyed: 'Resursa stearsa'
17
+ remove_selection: 'Sterge selectia'
18
+ delete_file: 'Sterge fisierul'
19
+ delete: 'sterge'
20
+ delete_item: 'Sterge %{item}'
21
+ download_item: 'Descarca %{item}'
22
+ download: 'Descarca'
23
+ view: 'vezi'
24
+ view_item: 'vezi %{item}'
25
+ edit: 'modifica'
26
+ edit_item: 'modifica %{item}'
27
+ detach_item: 'detaseaza %{item}'
28
+ number_of_items:
29
+ zero: '0 %{item}'
30
+ one: 'un %{item}'
31
+ other: '%{count} %{item}'
32
+ are_you_sure: 'Esti sigur?'
33
+ filters: 'Filtre'
34
+ per_page: 'Pe pagina'
35
+ more: 'Mai multe'
36
+ attach: 'Ataseaza'
37
+ cancel: 'Renunta'
38
+ save: 'Salveaza'
39
+ attach_and_attach_another: 'Ataseaza si ataseaza inca unul'
40
+ hide_content: 'Ascunde continutul'
41
+ show_content: 'Arata continutul'
42
+ no_related_item_found: 'Nu s-au gasit %{item} asociate'
43
+ no_item_found: 'Nu s-au gasit %{item}'
44
+ loading: 'Se incarca'
45
+ confirm: 'Confirm'
46
+ actions: 'Actiuni'
47
+ resources: 'Resurse'
48
+ oops_nothing_found: 'Oups! Nu am gasit rezultate...'
49
+ type_to_search: 'Cauta aici...'
50
+ and_x_other_resources: 'plus alte %{count} resources'
51
+ go_back: 'Inapoi'
52
+ home: 'Acasa'
53
+ attach_item: 'Anexeaza %{item}'
54
+ choose_item: 'Alege %{item}'
55
+ create_new_item: 'Creeaza %{item}'
56
+ table_view: 'Vezi sub forma de tabel'
57
+ grid_view: 'Vezi sub forma de grid'
58
+ next_page: 'Pagina urmatoare'
59
+ prev_page: 'Pagina anterioara'
60
+ list_is_empty: 'Lista este goala'
61
+ field_translations:
62
+ file:
63
+ zero: 'fisiere'
64
+ one: 'fisier'
65
+ other: 'fisiere'
66
+ resource_translations:
67
+ user:
68
+ zero: 'utilizatori'
69
+ one: 'utilizator'
70
+ other: 'utilizatori'