Skip to content

Commit

Permalink
Actualiza
Browse files Browse the repository at this point in the history
  • Loading branch information
alejocruzrcc authored and vtamara committed Sep 28, 2024
1 parent 6792c6c commit 4c55db6
Show file tree
Hide file tree
Showing 9 changed files with 368 additions and 123 deletions.
68 changes: 68 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
require:
- rubocop-minitest
- rubocop-rails

inherit_gem:
rubocop-shopify: rubocop.yml

Style/FrozenStringLiteralComment:
Enabled: true
# SafeAutoCorrect: false

Minitest/AssertPredicate:
Enabled: false
# 1. Hace más largo el assert porque transforma `assert caso.valid?` en
# `assert_predicate caso, :valid?`
# 2. EMHO no facilita legibilidad
# 3. No es homogéneo, no transforma `assert_not caso.valid?`
# La ventaja de assert_predicate es que presenta mejor
# mensaje de error cuando la aserción falla.

Minitest/MultipleAssertions:
Enabled: false

Rails/ApplicationRecord:
Enabled: false

Rails/LexicallyScopedActionFilter:
Enabled: false

Rails/SquishedSQLHeredocs:
Enabled: false

Rails/OutputSafety:
Exclude:
- lib/msip/engine.rb
- app/helpers/msip/*

Rails/Exit:
Exclude:
- lib/generators/msip/*

Rails/Output:
Exclude:
- lib/generators/msip/*

# En generadores Rails.root es nil
Rails/FilePath:
Exclude:
- lib/msip/engine.rb

Lint/RedundantStringCoercion:
Exclude:
- lib/msip/engine.rb

Rails/RenderInline:
Enabled: false

Naming/AsciiIdentifiers:
Enabled: false

Metrics/ParameterLists:
Enabled: false

AllCops:
NewCops: enable
SuggestExtensions: false


27 changes: 13 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ GIT

GIT
remote: https://gitlab.com/pasosdeJesus/apo214.git
revision: 29af106b4eaa77f0eecc0a6764fcecf0c9270edf
revision: c0047aa4146769c145d7b716f86288c5a677fe0c
branch: main
specs:
apo214 (2.2.0.beta4)
Expand All @@ -35,7 +35,7 @@ GIT

GIT
remote: https://gitlab.com/pasosdeJesus/heb412_gen.git
revision: 721bffbad28fc9570fcc8137ca8677b4f90689eb
revision: 731c20a491c622123f7b7990d7c5103b2a8a7ff9
branch: main
specs:
heb412_gen (2.3.0.alfa2)
Expand All @@ -46,7 +46,7 @@ GIT

GIT
remote: https://gitlab.com/pasosdeJesus/mr519_gen.git
revision: 1f252269fe870dd2794a0a1ced0a090581834e37
revision: 8dd29640445450ea9958ad9a6e3fb067299854ad
branch: main
specs:
mr519_gen (2.3.0.alfa2)
Expand All @@ -55,7 +55,7 @@ GIT

GIT
remote: https://gitlab.com/pasosdeJesus/msip.git
revision: 0f3194d499e681b342e3c015befd6d85c4758acf
revision: 12574b5c700a9af702969fa0e42264d3e1daa9ca
branch: main
specs:
msip (2.3.0.alfa2)
Expand All @@ -75,7 +75,7 @@ GIT

GIT
remote: https://gitlab.com/pasosdeJesus/sivel2_gen.git
revision: df1cdd240c272f09ee7ab5ec72aca14dc388f8ca
revision: 92ae33e3d1705f87737f85b10122ad885792bd9f
branch: main
specs:
sivel2_gen (2.3.0.alfa2)
Expand Down Expand Up @@ -221,9 +221,9 @@ GEM
devise-i18n (1.12.1)
devise (>= 4.9.0)
docile (1.4.1)
dotenv (3.1.2)
dotenv-rails (3.1.2)
dotenv (= 3.1.2)
dotenv (3.1.4)
dotenv-rails (3.1.4)
dotenv (= 3.1.4)
railties (>= 6.1)
drb (2.2.1)
erd (0.8.2)
Expand Down Expand Up @@ -252,7 +252,7 @@ GEM
i18n (1.14.6)
concurrent-ruby (~> 1.0)
io-console (0.7.2)
irb (1.14.0)
irb (1.14.1)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jbuilder (2.13.0)
Expand Down Expand Up @@ -324,7 +324,7 @@ GEM
psych (5.1.2)
stringio
public_suffix (6.0.1)
puma (6.4.2)
puma (6.4.3)
nio4r (~> 2.0)
racc (1.8.1)
rack (2.2.9)
Expand Down Expand Up @@ -429,9 +429,8 @@ GEM
timeout (0.4.1)
ttfunk (1.8.0)
bigdecimal (~> 3.1)
turbo-rails (2.0.7)
turbo-rails (2.0.10)
actionpack (>= 6.0.0)
activejob (>= 6.0.0)
railties (>= 6.0.0)
twitter_cldr (6.12.1)
camertron-eprun
Expand All @@ -450,7 +449,7 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webrick (1.8.1)
webrick (1.8.2)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand Down Expand Up @@ -530,4 +529,4 @@ DEPENDENCIES
will_paginate

BUNDLED WITH
2.5.18
2.5.20
31 changes: 24 additions & 7 deletions app/javascript/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,25 @@ import 'popper.js' // Dialogos emergentes usados por bootstrap
import * as bootstrap from 'bootstrap' // Maquetacion y elementos de diseño
import 'chosen-js/chosen.jquery'; // Cuadros de seleccion potenciados

import Msip__Motor from "./controllers/msip/motor"
window.Msip__Motor = Msip__Motor
Msip__Motor.iniciar() // Este se ejecuta una vez cuando se está cargando la aplicación tal vez antes que la página completa o los recursos

import L from 'leaflet'
window.L = L
import 'leaflet.markercluster'

import Msip__Motor from "./controllers/msip/motor"
window.Msip__Motor = Msip__Motor
Msip__Motor.iniciar()
import Mr519Gen__Motor from "./controllers/mr519_gen/motor"
window.Mr519Gen__Motor = Mr519Gen__Motor
Mr519Gen__Motor.iniciar()
import Heb412Gen__Motor from "./controllers/heb412_gen/motor"
window.Heb412Gen__Motor = Heb412Gen__Motor
Heb412Gen__Motor.iniciar()
import Apo214__Motor from "./controllers/apo214/motor"
window.Apo214__Motor = Apo214__Motor
Apo214__Motor.iniciar()
import Sivel2Gen__Motor from "./controllers/sivel2_gen/motor"
window.Sivel2Gen__Motor = Sivel2Gen__Motor
Sivel2Gen__Motor.iniciar() // Este cargará leaflet en window.L
Sivel2Gen__Motor.iniciar()

// Apexcharts
import ApexCharts from 'apexcharts'
Expand Down Expand Up @@ -60,6 +68,9 @@ let promesaRecursosSprocketsYDocumento = new Promise((resolver, rechazar) => {


promesaRecursosSprocketsYDocumento.then((mensaje) => {
// Este se ejecuta cada vez que se carga una página que no está en
// cache y tipicamente después de que se ha cargado la página completa
// y los recursos
console.log(mensaje)
var root = window;

Expand All @@ -70,7 +81,10 @@ promesaRecursosSprocketsYDocumento.then((mensaje) => {
apo214_prepara_eventos_comunes(root);
sivel2_gen_prepara_eventos_unicos(root);

Msip__Motor.ejecutarAlCargarDocumentoYRecursos() // Este se ejecuta cada vez que se carga una página que no está en cache y tipicamente después de que se ha cargado la página completa y los recursos
Msip__Motor.ejecutarAlCargarDocumentoYRecursos()
Mr519Gen__Motor.ejecutarAlCargarDocumentoYRecursos()
Heb412Gen__Motor.ejecutarAlCargarDocumentoYRecursos()
Apo214__Motor.ejecutarAlCargarDocumentoYRecursos()
Sivel2Gen__Motor.ejecutarAlCargarDocumentoYRecursos()

var p = new URL(document.URL).pathname.split('/')
Expand All @@ -94,8 +108,11 @@ document.addEventListener('turbo:load', (e) => {

console.log('Escuchador turbo:load')

msip_ejecutarAlCargarPagina(window) // Establece puntomontaje
msip_ejecutarAlCargarPagina(window) // Establece root.puntomontaje
Msip__Motor.ejecutarAlCargarPagina()
Mr519Gen__Motor.ejecutarAlCargarPagina()
Heb412Gen__Motor.ejecutarAlCargarPagina()
Apo214__Motor.ejecutarAlCargarPagina()
Sivel2Gen__Motor.ejecutarAlCargarPagina()

})
Expand Down
3 changes: 3 additions & 0 deletions app/javascript/controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ application.register("msip--geodep", Msip__GeodepController)
import Msip__SindocautController from "./msip/sindocaut_controller"
application.register("msip--sindocaut", Msip__SindocautController)

import Sivel2Gen__ContarAutomaticoController from "./sivel2_gen/contar_automatico_controller"
application.register("sivel2-gen--contar-automatico", Sivel2Gen__ContarAutomaticoController)

import Sivel2Gen__EdadController from "./sivel2_gen/edad_controller"
application.register("sivel2-gen--edad", Sivel2Gen__EdadController)

Expand Down
8 changes: 4 additions & 4 deletions config/initializers/msip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

config.descripcion = "Sistema de Información de Violencia Política en Línea"

config.codigofuente = "https://gitlab.com/pasosdeJesus/sivel2/-/tree/v2.2"
config.urlcontribuyentes = "https://gitlab.com/pasosdeJesus/sivel2/-/graphs/v2.2"
config.urllicencia = "https://gitlab.com/pasosdeJesus/sivel2/-/blob/v2.2/LICENCIA.md"
config.urlcreditos = "https://gitlab.com/pasosdeJesus/sivel2/-/blob/v2.2/CREDITOS.md"
config.codigofuente = "https://gitlab.com/pasosdeJesus/sivel2/-/tree/main"
config.urlcontribuyentes = "https://gitlab.com/pasosdeJesus/sivel2/-/graphs/main"
config.urllicencia = "https://gitlab.com/pasosdeJesus/sivel2/-/blob/main/LICENCIA.md"
config.urlcreditos = "https://gitlab.com/pasosdeJesus/sivel2/-/blob/main/CREDITOS.md"
config.agradecimientoDios = "<p>
El mayor agradecimiento al Dios trino, el de la Biblia, a quien dedicamos
este trabajo y a quien oramos para que no sea usado por estructuras armadas
Expand Down
17 changes: 17 additions & 0 deletions db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8267,6 +8267,14 @@ ALTER TABLE ONLY public.sivel2_gen_categoria
ADD CONSTRAINT categoria_contada_en_fkey FOREIGN KEY (contadaen) REFERENCES public.sivel2_gen_categoria(id);


--
-- Name: sivel2_gen_categoria categoria_contadaen_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sivel2_gen_categoria
ADD CONSTRAINT categoria_contadaen_fkey FOREIGN KEY (contadaen) REFERENCES public.sivel2_gen_categoria(id);


--
-- Name: sivel2_gen_contextovictima_victima contextovictima_victima_contextovictima_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
Expand Down Expand Up @@ -9275,6 +9283,14 @@ ALTER TABLE ONLY public.msip_persona
ADD CONSTRAINT persona_tdocumento_id_fkey FOREIGN KEY (tdocumento_id) REFERENCES public.msip_tdocumento(id);


--
-- Name: sivel2_gen_presponsable presponsable_papa_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.sivel2_gen_presponsable
ADD CONSTRAINT presponsable_papa_fkey FOREIGN KEY (papa_id) REFERENCES public.sivel2_gen_presponsable(id);


--
-- Name: sivel2_gen_caso_presponsable presuntos_responsables_caso_id_caso_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
Expand Down Expand Up @@ -9663,6 +9679,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20221102145906'),
('20221102144613'),
('20221025025402'),
('20221024222000'),
('20221024221557'),
('20221024000000'),
('20221005165307'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ControlAccesoCamposControllerTest < ActionDispatch::IntegrationTest

test "sin autenticar no debe acceder a campos/new" do
assert_raise CanCan::AccessDenied do
get mr519_gen.new_campo_path
post mr519_gen.crear_campo_path(index: 0), params: nil
end
end

Expand All @@ -49,7 +49,7 @@ class ControlAccesoCamposControllerTest < ActionDispatch::IntegrationTest
current_usuario = ::Usuario.find(PRUEBA_USUARIO_OP)
sign_in current_usuario
assert_raise CanCan::AccessDenied do
get mr519_gen.new_campo_path
post mr519_gen.crear_campo_path(index: 0), params: nil
end
end

Expand All @@ -70,7 +70,7 @@ class ControlAccesoCamposControllerTest < ActionDispatch::IntegrationTest
current_usuario = ::Usuario.find(PRUEBA_USUARIO_AN)
sign_in current_usuario
assert_raise CanCan::AccessDenied do
get mr519_gen.new_campo_path
post mr519_gen.crear_campo_path(index: 0), params: nil
end
end

Expand Down
Loading

0 comments on commit 4c55db6

Please sign in to comment.