avo 2.9.1.pre7 → 2.9.2.pre1

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 (50) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/app/assets/builds/action_cable.js +2 -0
  4. data/app/assets/builds/action_cable.js.map +7 -0
  5. data/app/assets/builds/application.js +2 -0
  6. data/app/assets/builds/application.js.map +7 -0
  7. data/app/assets/builds/avo.css +9028 -0
  8. data/app/assets/builds/avo.js +512 -0
  9. data/app/assets/builds/avo.js.map +7 -0
  10. data/app/assets/builds/avo_custom.js +6 -0
  11. data/app/assets/builds/avo_custom.js.map +7 -0
  12. data/app/components/avo/actions_component.rb +2 -6
  13. data/app/components/avo/fields/common/key_value_component.html.erb +2 -2
  14. data/app/components/avo/fields/common/single_file_viewer_component.rb +1 -1
  15. data/app/components/avo/fields/date_field/edit_component.html.erb +0 -1
  16. data/app/components/avo/fields/date_time_field/edit_component.html.erb +25 -10
  17. data/app/components/avo/fields/date_time_field/index_component.html.erb +9 -1
  18. data/app/components/avo/fields/date_time_field/show_component.html.erb +9 -1
  19. data/app/components/avo/index/ordering/button_component.rb +13 -5
  20. data/app/components/avo/index/resource_controls_component.html.erb +2 -2
  21. data/app/components/avo/index/resource_controls_component.rb +1 -5
  22. data/app/components/avo/views/resource_edit_component.rb +1 -1
  23. data/app/components/avo/views/resource_index_component.rb +2 -2
  24. data/app/controllers/avo/application_controller.rb +3 -24
  25. data/app/javascript/avo.js +1 -5
  26. data/app/javascript/js/controllers/fields/date_field_controller.js +87 -25
  27. data/app/views/avo/partials/_javascript.html.erb +1 -1
  28. data/config/routes.rb +1 -1
  29. data/lib/avo/app.rb +4 -11
  30. data/lib/avo/base_card.rb +7 -1
  31. data/lib/avo/base_resource.rb +1 -1
  32. data/lib/avo/concerns/handles_field_args.rb +1 -1
  33. data/lib/avo/dashboards/base_dashboard.rb +1 -1
  34. data/lib/avo/fields/date_field.rb +0 -2
  35. data/lib/avo/fields/date_time_field.rb +21 -9
  36. data/lib/avo/fields/has_base_field.rb +1 -3
  37. data/lib/avo/fields/has_one_field.rb +1 -4
  38. data/lib/avo/menu/builder.rb +7 -8
  39. data/lib/avo/version.rb +1 -1
  40. data/lib/avo.rb +0 -1
  41. data/public/avo-assets/avo.js +68 -68
  42. data/public/avo-assets/avo.js.map +2 -2
  43. metadata +11 -9
  44. data/app/javascript/js/controllers/tabs_controller.js +0 -80
  45. data/db/migrate/20210421064037_add_color_to_teams.rb +0 -5
  46. data/db/migrate/20210423075924_add_progress_to_projects.rb +0 -5
  47. data/db/migrate/20210525143134_add_slug_to_users.rb +0 -6
  48. data/lib/avo/concerns/model_class_constantized.rb +0 -23
  49. data/lib/avo/services/uri_service.rb +0 -71
  50. data/lib/generators/avo/templates/locales/avo.fr.yml +0 -115
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.1.pre7
4
+ version: 2.9.2.pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Marin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-07-04 00:00:00.000000000 Z
12
+ date: 2022-07-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -248,6 +248,15 @@ files:
248
248
  - Gemfile.lock
249
249
  - README.md
250
250
  - Rakefile
251
+ - app/assets/builds/action_cable.js
252
+ - app/assets/builds/action_cable.js.map
253
+ - app/assets/builds/application.js
254
+ - app/assets/builds/application.js.map
255
+ - app/assets/builds/avo.css
256
+ - app/assets/builds/avo.js
257
+ - app/assets/builds/avo.js.map
258
+ - app/assets/builds/avo_custom.js
259
+ - app/assets/builds/avo_custom.js.map
251
260
  - app/assets/config/avo_manifest.js
252
261
  - app/assets/stylesheets/avo.css
253
262
  - app/assets/stylesheets/css/active-storage.css
@@ -1087,7 +1096,6 @@ files:
1087
1096
  - app/javascript/js/controllers/search_controller.js
1088
1097
  - app/javascript/js/controllers/select_controller.js
1089
1098
  - app/javascript/js/controllers/select_filter_controller.js
1090
- - app/javascript/js/controllers/tabs_controller.js
1091
1099
  - app/javascript/js/controllers/text_filter_controller.js
1092
1100
  - app/javascript/js/controllers/tippy_controller.js
1093
1101
  - app/javascript/js/controllers/toggle_panel_controller.js
@@ -1154,9 +1162,6 @@ files:
1154
1162
  - config/routes.rb
1155
1163
  - config/spring.rb
1156
1164
  - db/factories.rb
1157
- - db/migrate/20210421064037_add_color_to_teams.rb
1158
- - db/migrate/20210423075924_add_progress_to_projects.rb
1159
- - db/migrate/20210525143134_add_slug_to_users.rb
1160
1165
  - lib/avo.rb
1161
1166
  - lib/avo/action_model.rb
1162
1167
  - lib/avo/app.rb
@@ -1171,7 +1176,6 @@ files:
1171
1176
  - lib/avo/concerns/has_model.rb
1172
1177
  - lib/avo/concerns/has_stimulus_controllers.rb
1173
1178
  - lib/avo/concerns/has_tools.rb
1174
- - lib/avo/concerns/model_class_constantized.rb
1175
1179
  - lib/avo/configuration.rb
1176
1180
  - lib/avo/dashboards/base_dashboard.rb
1177
1181
  - lib/avo/dashboards/base_divider.rb
@@ -1255,7 +1259,6 @@ files:
1255
1259
  - lib/avo/menu/section.rb
1256
1260
  - lib/avo/reloader.rb
1257
1261
  - lib/avo/services/authorization_service.rb
1258
- - lib/avo/services/uri_service.rb
1259
1262
  - lib/avo/tools_manager.rb
1260
1263
  - lib/avo/version.rb
1261
1264
  - lib/generators/avo/action_generator.rb
@@ -1293,7 +1296,6 @@ files:
1293
1296
  - lib/generators/avo/templates/filters/text_filter.tt
1294
1297
  - lib/generators/avo/templates/initializer/avo.tt
1295
1298
  - lib/generators/avo/templates/locales/avo.en.yml
1296
- - lib/generators/avo/templates/locales/avo.fr.yml
1297
1299
  - lib/generators/avo/templates/locales/avo.nb-NO.yml
1298
1300
  - lib/generators/avo/templates/locales/avo.pt-BR.yml
1299
1301
  - lib/generators/avo/templates/locales/avo.ro.yml
@@ -1,80 +0,0 @@
1
- import { AttributeObserver } from '@stimulus/mutation-observers'
2
- import { Controller } from '@hotwired/stimulus'
3
- import { castBoolean } from '../helpers/cast_boolean'
4
-
5
- export default class extends Controller {
6
- static targets = ['tab'];
7
-
8
- static values = {
9
- activeTab: String,
10
- };
11
-
12
- get currentTab() {
13
- return this.tabTargets.find(
14
- (element) => element.dataset.tabId === this.activeTabValue,
15
- )
16
- }
17
-
18
- targetTab(id) {
19
- return this.tabTargets.find((element) => element.dataset.tabId === id)
20
- }
21
-
22
- changeTab(e) {
23
- e.preventDefault()
24
-
25
- const { params } = e
26
- const { id } = params
27
-
28
- this.setTheTargetPanelHeight(id)
29
-
30
- this.hideTabs()
31
- this.showTab(id)
32
- this.markTabLoaded(id)
33
-
34
- this.activeTabValue = id
35
- }
36
-
37
- /**
38
- * Sets the target container height to the previous panel height so we don't get jerky tab changes.
39
- */
40
- setTheTargetPanelHeight(id) {
41
- // We don't need to add a height to this panel because it was loaded before
42
- if (castBoolean(this.targetTab(id).dataset.loaded)) {
43
- return
44
- }
45
-
46
- // Get the height of the active panel
47
- const { height } = this.currentTab.getBoundingClientRect()
48
- // Set it to the target panel
49
- this.targetTab(id).style.height = `${height}px`
50
-
51
- // Wait until the panel loaded it's content and then remove the forced height
52
- const observer = new AttributeObserver(this.targetTab(id), 'busy', {
53
- elementUnmatchedAttribute: () => {
54
- // The content is not available in an instant so delay the height reset a bit.
55
- setTimeout(() => {
56
- this.targetTab(id).style.height = ''
57
- }, 300)
58
- if (observer) observer.stop()
59
- },
60
- })
61
- observer.start()
62
- }
63
-
64
- markTabLoaded(id) {
65
- this.targetTab(id).dataset.loaded = true
66
- }
67
-
68
- showTab(id) {
69
- this.tabTargets.forEach((element) => {
70
- if (element.dataset.tabId === id) {
71
- element.classList.remove('hidden')
72
- }
73
- })
74
- // this.tabTargets.map((element) => element.clasList.add('hidden'))
75
- }
76
-
77
- hideTabs() {
78
- this.tabTargets.map((element) => element.classList.add('hidden'))
79
- }
80
- }
@@ -1,5 +0,0 @@
1
- class AddColorToTeams < ActiveRecord::Migration[6.0]
2
- def change
3
- add_column :teams, :color, :string
4
- end
5
- end
@@ -1,5 +0,0 @@
1
- class AddProgressToProjects < ActiveRecord::Migration[6.0]
2
- def change
3
- add_column :projects, :progress, :integer
4
- end
5
- end
@@ -1,6 +0,0 @@
1
- class AddSlugToUsers < ActiveRecord::Migration[6.0]
2
- def change
3
- add_column :users, :slug, :string
4
- add_index :users, :slug, unique: true
5
- end
6
- end
@@ -1,23 +0,0 @@
1
- module Avo
2
- module Concerns
3
- module ModelClassConstantized
4
- extend ActiveSupport::Concern
5
-
6
- class_methods do
7
- attr_reader :model_class
8
-
9
- # Cast the model class to a constantized version and memoize it like that
10
- def model_class=(value)
11
- @model_class = case value
12
- when Class
13
- value
14
- when String, Symbol
15
- value.to_s.safe_constantize
16
- else
17
- raise ArgumentError.new "Failed to find a proper model class for #{self.to_s}"
18
- end
19
- end
20
- end
21
- end
22
- end
23
- end
@@ -1,71 +0,0 @@
1
- module Avo
2
- module Services
3
- class URIService
4
- class << self
5
- def parse(path)
6
- self.new path
7
- end
8
- end
9
-
10
- attr_reader :uri
11
-
12
- def initialize(path = '')
13
- @uri = Addressable::URI.parse(path)
14
- end
15
-
16
- def append_paths(*paths)
17
- paths = Array.wrap(paths).flatten
18
-
19
- return self if paths.blank?
20
-
21
- # Add the intermediary forward slash
22
- @uri.path = @uri.path.concat("/") unless @uri.path.ends_with? "/"
23
-
24
- # Add the paths to the URI
25
- @uri.merge!(path: @uri.path.concat(join_paths(paths)))
26
-
27
- self
28
- end
29
- alias_method :append_path, :append_paths
30
-
31
- def append_query(params)
32
- params = if params.is_a? Hash
33
- params.map do |key, value|
34
- "#{key}=#{value}"
35
- end
36
- else
37
- {}
38
- end
39
-
40
- return self if params.blank?
41
-
42
- # Add the query params to the URI
43
- @uri.merge!(query: [@uri.query, *params].compact.join("&"))
44
-
45
- self
46
- end
47
-
48
- def to_s
49
- @uri.to_s
50
- end
51
-
52
- private
53
-
54
- def join_paths(paths)
55
- paths.map do |path|
56
- sanitize_path path
57
- end
58
- .join("/")
59
- end
60
-
61
- # Removes the forward slash if it's present at the start of the path
62
- def sanitize_path(path)
63
- if path.to_s.starts_with? '/'
64
- path = path[1..-1]
65
- end
66
-
67
- path
68
- end
69
- end
70
- end
71
- end
@@ -1,115 +0,0 @@
1
- fr:
2
- avo:
3
- dashboard: 'Tableau de bord'
4
- dashboards: 'Tableaux de bord'
5
- choose_a_country: 'Sélectionnez un pays'
6
- choose_an_option: 'Sélectionnez une option'
7
- are_you_sure_you_want_to_run_this_option: 'Etes-vous sûr de vouloir exécuter cette action ?'
8
- are_you_sure_detach_item: 'Êtes-vous sûr de vouloir détacher %{item}.'
9
- run: 'Exécuter'
10
- cancel: 'Annuler'
11
- action_ran_successfully: "L'action s'est exécutée avec succès !"
12
- details: "détails"
13
- unauthorized: 'Non autorisé'
14
- attachment_class_attached: '%{attachment_class} attaché.'
15
- attachment_class_detached: '%{attachment_class} détaché.'
16
- resource_updated: 'Ressource mise à jour'
17
- resource_created: 'Ressource créee'
18
- resource_destroyed: 'Ressource détruite'
19
- switch_to_view: "Passez à la vue %{view_type}"
20
- click_to_reveal_filters: "Cliquez pour révéler les filtres"
21
- attachment_destroyed: 'Pièce jointe détruite'
22
- failed_to_find_attachment: 'Impossible de trouver la pièce jointe'
23
- you_missed_something_check_form: 'Vous avez peut-être oublié quelque chose. Veuillez vérifier le formulaire'
24
- remove_selection: 'Supprimer la sélection'
25
- select_item: 'Sélectionnez un élément'
26
- select_all: 'Sélectionner tout sur la page'
27
- delete_file: 'Supprimer le fichier'
28
- delete: 'supprimer'
29
- delete_item: 'Supprimer %{item}'
30
- download_item: 'Télécharger %{item}'
31
- download_file: 'Télécharger le fichier'
32
- download: 'Télécharger'
33
- view: 'Vue'
34
- view_item: 'voir %{item}'
35
- edit: 'éditer'
36
- edit_item: 'éditer %{item}'
37
- detach_item: 'détacher %{item}'
38
- number_of_items:
39
- zero: 'aucun %{item}'
40
- one: 'un %{item}'
41
- other: '%{count} %{item}'
42
- x_items_more:
43
- zero: 'aucun élément supplémentaire'
44
- one: 'un élément de plus'
45
- other: '%{count} éléments en plus'
46
- are_you_sure: 'Êtes-vous sûr ?'
47
- filters: 'Filtres'
48
- per_page: 'Par page'
49
- more: 'Plus'
50
- attach: 'Attacher'
51
- cancel: 'Annuler'
52
- save: 'Enregistrer'
53
- attach_and_attach_another: 'joindre et joindre un autre'
54
- hide_content: 'Cacher le contenu'
55
- show_content: 'Afficher le contenu'
56
- no_related_item_found: "Aucun %{item} apparenté n'a été trouvé"
57
- no_item_found: 'Aucun %{item} trouvé'
58
- loading: 'Chargement'
59
- confirm: 'Confirmer'
60
- actions: 'Actions'
61
- resources: 'Ressources'
62
- oops_nothing_found: "Oups ! Rien n'a été trouvé..."
63
- type_to_search: 'Type à rechercher.'
64
- and_x_other_resources: 'et %{count} autres ressources'
65
- go_back: 'Retourner en arrière'
66
- home: 'Accueil'
67
- new: 'Nouveau'
68
- attach_item: 'Attacher %{item}'
69
- choose_item: 'Choisir %{item}'
70
- create_new_item: 'Créer un nouveau %{item}'
71
- table_view: 'Vue table'
72
- grid_view: 'Vue grille'
73
- next_page: 'Page suivante'
74
- prev_page: 'Page précédente'
75
- list_is_empty: 'La liste est vide'
76
- field_translations:
77
- file:
78
- zero: 'fichier'
79
- one: 'fichier'
80
- other: 'fichiers'
81
- people:
82
- zero: 'personne'
83
- one: 'personne'
84
- other: 'personnes'
85
- resource_translations:
86
- user:
87
- zero: 'utilisateur'
88
- one: 'utilisateurs'
89
- other: 'utilisateurs'
90
- reset_filters: 'Réinitialiser les filtres'
91
- not_authorized: "Vous n'êtes pas autorisé à effectuer cette action."
92
- search:
93
- placeholder: 'Rechercher'
94
- cancel_button: 'Annuler'
95
- sign_out: 'Se déconnecter'
96
- failed: 'Échec'
97
- failed_to_load: 'Impossible de charger'
98
- key_value_field:
99
- key: 'Clé'
100
- value: 'Valeur'
101
- add_row: 'Ajouter une ligne'
102
- delete_row: 'Supprimer une ligne'
103
- was_successfully_created: 'a été créé avec succès'
104
- was_successfully_updated: 'a été mis à jour avec succès'
105
- clear_value: "Effacer la valeur"
106
- tools: Outils
107
- order:
108
- reorder_record: Réorganiser
109
- higher: Déplacer plus haut
110
- lower: Déplacer plus bas
111
- to_top: Déplacer tout en haut
112
- to_bottom: Déplacer tout en bas
113
- empty_dashboard_message: Ajouter des cartes à ce tableau de bord
114
- no_cards_present: Aucune carte présente
115
- no_options_available: Aucune option disponible