From 5b5a0ed1f5c6f5c25f4899a8977786b36769d537 Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Tue, 23 Jan 2024 20:07:34 -0300 Subject: [PATCH 1/3] FIX: Link a buscar propietario --- app/resources/views/search.blade.php | 6 +++--- app/setup/setups/database.php | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/resources/views/search.blade.php b/app/resources/views/search.blade.php index 0827590..e150ff8 100644 --- a/app/resources/views/search.blade.php +++ b/app/resources/views/search.blade.php @@ -56,7 +56,7 @@ unidad.html(unidad.html() + ' (I)') } propietario = $('') - .attr('href','{{$urls->base}}/search/' + encodeURIComponent(this.venta.propietario.nombre_completo) + '/propietario') + .attr('href','{{$urls->base}}/search/"' + encodeURIComponent(this.venta.propietario.nombre_completo) + '"/propietario') .html(this.venta.propietario.nombre_completo) fecha = dateFormatter.format(new Date(this.venta.fecha)) if (typeof this.venta.entrega !== 'undefined') { @@ -315,9 +315,9 @@ $('#tipo').dropdown().dropdown('set selected', '*') @if (trim($post) !== '') - $("[name='query']").val('{{$post}}') + $("[name='query']").val('{!! $post !!}') @elseif (trim($query) !== '') - $("[name='query']").val('{{$query}}') + $("[name='query']").val('{!! $query !!}') @endif @if (trim($tipo) !== '') $('#tipo').dropdown('set selected', '{{$tipo}}') diff --git a/app/setup/setups/database.php b/app/setup/setups/database.php index 5ef8d8f..cdea0d2 100644 --- a/app/setup/setups/database.php +++ b/app/setup/setups/database.php @@ -4,10 +4,10 @@ use Psr\Container\ContainerInterface; return [ Incoviba\Common\Define\Database::class => function(ContainerInterface $container) { return new Incoviba\Common\Implement\Database\MySQL( - $container->has('MYSQL_HOST') ? $container->get('MYSQL_HOST') : 'db', - $container->get('MYSQL_DATABASE'), - $container->get('MYSQL_USER'), - $container->get('MYSQL_PASSWORD') + $container->has('DB_HOST') ? $container->get('DB_HOST') : 'db', + $container->get('DB_DATABASE'), + $container->get('DB_USER'), + $container->get('DB_PASSWORD') ); }, Incoviba\Common\Define\Connection::class => function(ContainerInterface $container) { From ac6c5b7d3d3315d607e5c863193c46295c87d7fb Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Tue, 23 Jan 2024 20:18:02 -0300 Subject: [PATCH 2/3] FIX: activar busqueda cuando tiene query definido --- app/resources/views/search.blade.php | 2 ++ docker-compose.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/resources/views/search.blade.php b/app/resources/views/search.blade.php index e150ff8..a1edf69 100644 --- a/app/resources/views/search.blade.php +++ b/app/resources/views/search.blade.php @@ -316,8 +316,10 @@ $('#tipo').dropdown().dropdown('set selected', '*') @if (trim($post) !== '') $("[name='query']").val('{!! $post !!}') + this.get().results() @elseif (trim($query) !== '') $("[name='query']").val('{!! $query !!}') + this.get().results() @endif @if (trim($tipo) !== '') $('#tipo').dropdown('set selected', '{{$tipo}}') diff --git a/docker-compose.yml b/docker-compose.yml index e73d660..ca32980 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,7 +25,7 @@ services: <<: *restart env_file: - ${APP_PATH:-.}/.env - - ${APP_PATH:-.}/.db.env +# - ${APP_PATH:-.}/.db.env - ./.key.env #- ${APP_PATH:-.}/.remote.env volumes: From 62edca53359633858db7ceaf20342ee0f05d61e6 Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Tue, 23 Jan 2024 20:41:52 -0300 Subject: [PATCH 3/3] Simplify set post or query --- app/resources/views/search.blade.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/resources/views/search.blade.php b/app/resources/views/search.blade.php index a1edf69..7bd41b6 100644 --- a/app/resources/views/search.blade.php +++ b/app/resources/views/search.blade.php @@ -309,17 +309,23 @@ } } }, + set: function() { + return { + query: value => { + $("[name='query']").val(value) + this.get().results() + } + } + }, setup: function(id) { this.id = id this.get().results() $('#tipo').dropdown().dropdown('set selected', '*') @if (trim($post) !== '') - $("[name='query']").val('{!! $post !!}') - this.get().results() + this.set().query('{!! $post !!}') @elseif (trim($query) !== '') - $("[name='query']").val('{!! $query !!}') - this.get().results() + this.set().query('{!! $query !!}') @endif @if (trim($tipo) !== '') $('#tipo').dropdown('set selected', '{{$tipo}}')