From 5e6a65e5e80162d12e576dc0d34bfd44b5872706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladimir=20T=C3=A1mara=20Pati=C3=B1o?= Date: Tue, 5 Dec 2023 14:31:24 -0500 Subject: [PATCH] Actualiza y arregla problemita de https://gitlab.com/pasosdeJesus/sivel2_gen/-/merge_requests/478 --- Gemfile.lock | 24 ++-- .../enviar_ficha_caso_controller.js | 2 +- test/dummy/db/structure.sql | 122 +++++++++++++++--- test/dummy/yarn.lock | 6 +- 4 files changed, 120 insertions(+), 34 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b3295b239..4216c77c1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -38,7 +38,7 @@ GIT GIT remote: https://gitlab.com/pasosdeJesus/msip.git - revision: 932966920f125f0f47e37ace5574ec80ca7a8366 + revision: 64e8d7fec274570f73a41f19fded74d236fa413f branch: main specs: msip (2.2.0.beta4) @@ -138,7 +138,7 @@ GEM bindex (0.8.1) bootsnap (1.17.0) msgpack (~> 1.2) - brakeman (6.0.1) + brakeman (6.1.0) builder (3.2.4) bundler-audit (0.9.1) bundler (>= 1.2.0, < 3) @@ -205,7 +205,7 @@ GEM i18n (1.14.1) concurrent-ruby (~> 1.0) io-console (0.6.0) - irb (1.9.1) + irb (1.10.1) rdoc reline (>= 0.3.8) jbuilder (2.11.5) @@ -213,7 +213,7 @@ GEM activesupport (>= 5.0.0) jsbundling-rails (1.2.1) railties (>= 6.0.0) - json (2.6.3) + json (2.7.1) language_server-protocol (3.17.0.3) libxml-ruby (4.1.2) loofah (2.22.0) @@ -239,7 +239,7 @@ GEM minitest (>= 5.0) ruby-progressbar msgpack (1.7.2) - net-imap (0.4.6) + net-imap (0.4.7) date net-protocol net-pop (0.1.2) @@ -248,7 +248,7 @@ GEM timeout net-smtp (0.4.0) net-protocol - nio4r (2.6.1) + nio4r (2.7.0) nokogiri (1.15.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) @@ -322,11 +322,11 @@ GEM zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.1.0) - rdoc (6.6.0) + rdoc (6.6.1) psych (>= 4.0.0) redcarpet (3.6.0) - regexp_parser (2.8.2) - reline (0.4.0) + regexp_parser (2.8.3) + reline (0.4.1) io-console (~> 0.5) responders (3.1.1) actionpack (>= 5.2) @@ -335,7 +335,7 @@ GEM rspreadsheet (0.5.3) andand (>= 1.3) rubyzip (>= 1.3) - rubocop (1.57.2) + rubocop (1.58.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -343,7 +343,7 @@ GEM rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.30.0) @@ -387,7 +387,7 @@ GEM sprockets (>= 3.0.0) stimulus-rails (1.3.0) railties (>= 6.0.0) - stringio (3.0.9) + stringio (3.1.0) terrapin (0.6.0) climate_control (>= 0.0.3, < 1.0) thor (1.3.0) diff --git a/app/javascript/controllers/enviar_ficha_caso_controller.js b/app/javascript/controllers/enviar_ficha_caso_controller.js index f1faa91e2..69d472f6b 100644 --- a/app/javascript/controllers/enviar_ficha_caso_controller.js +++ b/app/javascript/controllers/enviar_ficha_caso_controller.js @@ -45,7 +45,7 @@ export default class extends Controller { for (let [key, value] of datosFormulario.entries()) { let coincidencia = key.match(/^caso\[(.+?)\]$/); if (coincidencia) { - let ruta = match[1].split(/\]\[|\[|\]/).filter(p => p !== ""); + let ruta = coincidencia[1].split(/\]\[|\[|\]/).filter(p => p !== ""); let actual = objetoFormulario; for (let i = 0; i < ruta.length; i++) { diff --git a/test/dummy/db/structure.sql b/test/dummy/db/structure.sql index bccd1f0bc..5e2396274 100644 --- a/test/dummy/db/structure.sql +++ b/test/dummy/db/structure.sql @@ -258,6 +258,95 @@ CREATE FUNCTION public.msip_eliminar_familiar_inverso() RETURNS trigger $$; +-- +-- Name: msip_nombre_vereda(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.msip_nombre_vereda() RETURNS character varying + LANGUAGE sql + AS $$ + SELECT 'Vereda ' + $$; + + +-- +-- Name: msip_ubicacionpre_id_rtablabasica(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.msip_ubicacionpre_id_rtablabasica() RETURNS integer + LANGUAGE sql + AS $$ + SELECT min(id+1) FROM msip_ubicacionpre WHERE + (id+1) NOT IN (SELECT id FROM msip_ubicacionpre) AND + id<10000000 + $$; + + +-- +-- Name: msip_ubicacionpre_nomenclatura(character varying, character varying, character varying, character varying, character varying, character varying, character varying); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.msip_ubicacionpre_nomenclatura(pais character varying, departamento character varying, municipio character varying, vereda character varying, centropoblado character varying, lugar character varying, sitio character varying) RETURNS text[] + LANGUAGE sql + AS $$ + SELECT CASE + WHEN pais IS NULL OR pais = '' THEN + array[NULL, NULL] + WHEN departamento IS NULL OR departamento = '' THEN + array[pais, NULL] + WHEN municipio IS NULL OR municipio = '' THEN + array[departamento || ' / ' || pais, departamento] + WHEN (vereda IS NULL OR vereda = '') AND + (centropoblado IS NULL OR centropoblado = '') THEN + array[ municipio || ' / ' || departamento || ' / ' || pais, + municipio || ' / ' || departamento ] + WHEN (vereda IS NULL OR vereda = '') AND + (lugar IS NULL OR lugar = '') THEN + array[ centropoblado || ' / ' || municipio || ' / ' || + departamento || ' / ' || pais, + centropoblado || ' / ' || municipio || ' / ' || + departamento ] + WHEN (lugar IS NULL OR lugar = '') THEN + array[ msip_nombre_vereda() || vereda || ' / ' || + municipio || ' / ' || + departamento || ' / ' || pais, + msip_nombre_vereda() || vereda || ' / ' || + municipio || ' / ' || departamento] + WHEN (vereda IS NULL OR vereda = '') AND + (sitio IS NULL OR sitio = '') THEN + array[ lugar || ' / ' || centropoblado || ' / ' || + municipio || ' / ' || departamento || ' / ' || pais, + lugar || ' / ' || centropoblado || ' / ' || + municipio || ' / ' || departamento] + WHEN (sitio IS NULL OR sitio = '') THEN + array[ lugar || ' / ' || + msip_nombre_vereda() || vereda || ' / ' || + municipio || ' / ' || departamento || ' / ' || pais, + lugar || ' / ' || + msip_nombre_vereda() || vereda || ' / ' || + municipio || ' / ' || departamento] + WHEN (vereda IS NULL OR vereda = '') THEN + array[ sitio || ' / ' || lugar || ' / ' || + centropoblado || ' / ' || + municipio || ' / ' || + departamento || ' / ' || pais, + sitio || ' / ' || lugar || ' / ' || + centropoblado || ' / ' || + municipio || ' / ' || + departamento ] + ELSE + array[ sitio || ' / ' || lugar || ' / ' || + msip_nombre_vereda() || vereda || ' / ' || + municipio || ' / ' || + departamento || ' / ' || pais, + sitio || ' / ' || lugar || ' / ' || + msip_nombre_vereda() || vereda || ' / ' || + municipio || ' / ' || + departamento ] + END + $$; + + -- -- Name: probapellido(text); Type: FUNCTION; Schema: public; Owner: - -- @@ -2561,7 +2650,8 @@ CREATE TABLE public.msip_ubicacionpre ( longitud double precision, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, - nombre_sin_pais character varying(500) + nombre_sin_pais character varying(500), + vereda_id integer ); @@ -6303,14 +6393,6 @@ 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: - -- @@ -6559,6 +6641,14 @@ ALTER TABLE ONLY public.mr519_gen_encuestapersona ADD CONSTRAINT fk_rails_54b3e0ed5c FOREIGN KEY (persona_id) REFERENCES public.msip_persona(id); +-- +-- Name: msip_ubicacionpre fk_rails_558c98f353; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.msip_ubicacionpre + ADD CONSTRAINT fk_rails_558c98f353 FOREIGN KEY (vereda_id) REFERENCES public.msip_vereda(id); + + -- -- Name: msip_etiqueta_municipio fk_rails_5672729520; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -7031,14 +7121,6 @@ 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: - -- @@ -7754,6 +7836,10 @@ INSERT INTO "schema_migrations" (version) VALUES ('20231120094041'), ('20231120175125'), ('20231121135551'), -('20231121203443'); +('20231121203443'), +('20231124200056'), +('20231125152802'), +('20231125152810'), +('20231125230000'); diff --git a/test/dummy/yarn.lock b/test/dummy/yarn.lock index 2a50b447b..e1f6422d8 100644 --- a/test/dummy/yarn.lock +++ b/test/dummy/yarn.lock @@ -96,9 +96,9 @@ ansi-styles@^3.2.1: color-convert "^1.9.0" apexcharts@^3.28.3: - version "3.44.0" - resolved "https://registry.yarnpkg.com/apexcharts/-/apexcharts-3.44.0.tgz#b52f95b0d0c2a5357b4614fa42faac956b69a4a9" - integrity sha512-u7Xzrbcxc2yWznN78Jh5NMCYVAsWDfBjRl5ea++rVzFAqjU2hLz4RgKIFwYOBDRQtW1e/Qz8azJTqIJ1+Vu9Qg== + version "3.44.2" + resolved "https://registry.yarnpkg.com/apexcharts/-/apexcharts-3.44.2.tgz#9e3010d949c508810ee0eded3a4802d7fb39ad8c" + integrity sha512-QWOFS/SC1TDsuI8VudVuIwLhs1qE6kwixRvmABMUgTVeVzizRWgQh8pdEIgwl+Zvr0TlM3vHPz6Dc5NP1hJ7BA== dependencies: "@yr/monotone-cubic-spline" "^1.0.3" svg.draggable.js "^2.2.2"