Skip to content

Commit

Permalink
Cambia chosen-select por tom-select. Closes #295
Browse files Browse the repository at this point in the history
  • Loading branch information
vtamara committed Aug 31, 2024
1 parent ddb3be2 commit 4fda7cb
Show file tree
Hide file tree
Showing 23 changed files with 92 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .env.plantilla
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ if (test "$MSIP_RUTA_VOLCADOS" = "") then {
export MSIP_RUTA_VOLCADOS=${DIRAP}/archivos/bd
} fi;
if (test "$MSIP_TITULO" = "") then {
export MSIP_TITULO="SIVeL"
export MSIP_TITULO="SISFASOL"
} fi;


Expand Down
1 change: 0 additions & 1 deletion app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
//= link_directory ../../../node_modules/chosen-js .png
//
//= link application.css
//= link_tree ../builds
Expand Down
13 changes: 5 additions & 8 deletions app/javascript/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import '../../vendor/assets/javascripts/jquery-ui.js'

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.js'
window.Msip__Motor = Msip__Motor

import TomSelect from 'tom-select';
window.TomSelect = TomSelect
Expand All @@ -29,12 +31,6 @@ window.configuracionTomSelect = {
}
}

import Msip__Motor from './controllers/msip/motor.js'
window.Msip__Motor = Msip__Motor

import 'bootstrap-datepicker'
import 'bootstrap-datepicker/dist/locales/bootstrap-datepicker.es.min.js'

// Apexcharts
import ApexCharts from 'apexcharts'
window.ApexCharts = ApexCharts
Expand Down Expand Up @@ -84,13 +80,14 @@ promesaRecursosSprocketsYDocumento.then((mensaje) => {
var root = window;

msip_prepara_eventos_comunes(root, null, false);
window.Msip__Motor.prepararEventosComunes(root, null, false);
heb412_gen_prepara_eventos_comunes(root);
mr519_gen_prepara_eventos_comunes(root);
sivel2_gen_prepara_eventos_comunes(root);
cor1440_gen_prepara_eventos_comunes(root);
sivel2_gen_prepara_eventos_unicos(root);

Msip__Motor.ejecutarAlCargarDocumentoYRecursos()

var p = new URL(document.URL).pathname.split('/')
var p2ult = ''
if (p.length>2) {
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/plotly_actos.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function seleccionmAsignarOpciones(selector, opciones, seltodo = true) {
opcionActual.text = opciones[i];
selector.appendChild(opcionActual);
}
$(selector).trigger('chosen:updated')
Msip__Motor.configurarElementoTomSelect(selector)
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
value_method: :id,
selected: Msip::ModeloHelper.poromision(params, :busultima_entidad_nombre),
input_html: {
class: 'chosen-select',
class: 'tom-select',
'data-enviarautomatico' => ''
}
%>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
value_method: :id,
input_html: {
style: 'width: 10em',
class: 'chosen-select',
class: 'tom-select',
}
%>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
selected: f.object.responsable_id ? f.object.responsable_id :
current_usuario.id,
input_html: {
#class: 'chosen-select',
#class: 'tom-select',
'data-action': 'usuario-con-grupo#cambiar_grupo'
}
%>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
value_method: :id,
include_blank: "POR CONTRATAR",
input_html: {
#class: 'chosen-select',
#class: 'tom-select',
'data-action': 'usuario-con-grupo#cambiar_grupo'
} %>
</td>
Expand Down
2 changes: 1 addition & 1 deletion app/views/msip/orgsociales/_campo_subde_id.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
collection: col.order(Msip::Orgsocial.send(:orden_presenta_nombre)),
label_method: :presenta_nombre,
value_method: :id,
input_html: { class: 'chosen-select' }
input_html: { class: 'tom-select' }
} %>
<!--% if @registro.respond_to?(n) && @registro.send(n) &&
@registro.send(n).id %-->
Expand Down
2 changes: 1 addition & 1 deletion app/views/msip/orgsociales/_filtro_subde_id.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
value_method: :id,
selected: Msip::ModeloHelper.poromision(params, :bussubde_id),
input_html: {
class: 'chosen-select',
class: 'tom-select',
'data-enviarautomatico' => ''
}
%>
2 changes: 1 addition & 1 deletion app/views/msip/personas/_filtro_actividad_ids.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
label: false,
selected: Msip::ModeloHelper.poromision(params, :busactividad_ids),
input_html: {
class: 'chosen-select',
class: 'tom-select',
'data-enviarautomatico' => '',
value: params && params[:filtro] && params[:filtro][:busactividad_ids] ?
params[:filtro][:busactividad_ids] : 'Todos'
Expand Down
2 changes: 1 addition & 1 deletion app/views/msip/personas/_filtro_caso_ids.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
label: false,
selected: Msip::ModeloHelper.poromision(params, :buscaso_ids),
input_html: {
class: 'chosen-select',
class: 'tom-select',
'data-enviarautomatico' => '',
value: params && params[:filtro] && params[:filtro][:buscaso_ids] ?
params[:filtro][:buscaso_ids] : 'Todos'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
label: false,
selected: Msip::ModeloHelper.poromision(params, :busfamiliarvictima_ids),
input_html: {
class: 'chosen-select',
class: 'tom-select',
'data-enviarautomatico' => '',
value: params && params[:filtro] && params[:filtro][:busfamiliarvictima_ids] ?
params[:filtro][:busfamiliarvictima_ids] : 'Todos'
Expand Down
2 changes: 1 addition & 1 deletion app/views/msip/personas/_filtro_mesnac.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
label: false,
selected: Msip::ModeloHelper.poromision(params, :busmesnac),
input_html: {
class: 'chosen-select',
class: 'tom-select',
'data-enviarautomatico' => '',
value: params && params[:filtro] && params[:filtro][:busmesnac] ?
params[:filtro][:busmesnac] : 'Todos'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
value_method: :id,
include_bank: false,
input_html: {
class: 'chosen-select',
class: 'tom-select',
"data-toggle" => 'tooltip'
} %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/usuarios/_filtro_sexonac.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_blank: true,
selected: Msip::ModeloHelper.poromision(params, :bussexonac),
input_html: {
class: 'chosen-select',
class: 'tom-select',
"data-enviarautomatico" => ""
}
%>
4 changes: 3 additions & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
module Sivel2
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
config.load_defaults(7.0)
config.load_defaults Rails::VERSION::STRING.to_f

config.autoload_lib(ignore: %w(assets tasks))

config.action_view.form_with_generates_remote_forms = false

Expand Down
3 changes: 3 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,7 @@

# Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
# config.generators.apply_rubocop_autocorrect_after_generate!

config.web_console.permissions = ENV.fetch("WEB_CONSOLE_PERMISSIONS", "").
split(",")
end
3 changes: 0 additions & 3 deletions config/initializers/punto_montaje.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# frozen_string_literal: true

Sivel2::Application.config.relative_url_root = ENV.fetch(
"RUTA_RELATIVA", "/si/fasol"
)
Sivel2::Application.config.assets.prefix = if ENV.fetch(
"RUTA_RELATIVA", "/si/fasol"
) == "/"
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"babel-plugin-macros": "^3.1.0",
"bootstrap": "^5.3.2",
"bootstrap-datepicker": "^1.10.0",
"chosen-js": "^1.8.7",
"css-loader": "^5.0.0",
"esbuild": "^0.19.4",
"gridstack": "^0.6.0",
Expand Down
66 changes: 66 additions & 0 deletions public/500.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<!DOCTYPE html>
<html>
<head>
<title>We're sorry, but something went wrong (500)</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<style>
.rails-default-error-page {
background-color: #EFEFEF;
color: #2E2F30;
text-align: center;
font-family: arial, sans-serif;
margin: 0;
}

.rails-default-error-page div.dialog {
width: 95%;
max-width: 33em;
margin: 4em auto 0;
}

.rails-default-error-page div.dialog > div {
border: 1px solid #CCC;
border-right-color: #999;
border-left-color: #999;
border-bottom-color: #BBB;
border-top: #B00100 solid 4px;
border-top-left-radius: 9px;
border-top-right-radius: 9px;
background-color: white;
padding: 7px 12% 0;
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
}

.rails-default-error-page h1 {
font-size: 100%;
color: #730E15;
line-height: 1.5em;
}

.rails-default-error-page div.dialog > p {
margin: 0 0 1em;
padding: 1em;
background-color: #F7F7F7;
border: 1px solid #CCC;
border-right-color: #999;
border-left-color: #999;
border-bottom-color: #999;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-top-color: #DADADA;
color: #666;
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
}
</style>
</head>

<body class="rails-default-error-page">
<!-- This file lives in public/500.html -->
<div class="dialog">
<div>
<h1>We're sorry, but something went wrong.</h1>
</div>
<p>If you are the application owner check the logs for more information.</p>
</div>
</body>
</html>
1 change: 1 addition & 0 deletions public/fasol/si/assets/tom-select.bootstrap5.min.css.map

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1261,11 +1261,6 @@ char-regex@^1.0.2:
resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf"
integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==

chosen-js@^1.8.7:
version "1.8.7"
resolved "https://registry.yarnpkg.com/chosen-js/-/chosen-js-1.8.7.tgz#9bfa5597f5081d602ff4ae904af9aef33265bb1d"
integrity sha512-eVdrZJ2U5ISdObkgsi0od5vIJdLwq1P1Xa/Vj/mgxkMZf14DlgobfB6nrlFi3kW4kkvKLsKk4NDqZj1MU1DCpw==

chownr@^1.1.1:
version "1.1.4"
resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b"
Expand Down

0 comments on commit 4fda7cb

Please sign in to comment.