Skip to content

Commit

Permalink
5.0.2 - Addresses #633 + some styling (#634)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisclark authored Jul 3, 2024
1 parent 57c679a commit 6417074
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
- run: python -Im pip install --user ruff

- name: Run ruff
run: ruff --output-format=github explorer
run: ruff check --output-format=github explorer
7 changes: 7 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ Change Log
This document records all notable changes to `django-sql-explorer <https://github.com/explorerhq/django-sql-explorer>`_.
This project adheres to `Semantic Versioning <https://semver.org/>`_.

`5.0.2`_ (2024-07-3)
===========================
* `#633`_: Missing migration
* CSS tweaks to tighten up the Query UI

`5.0.1`_ (2024-06-26)
===========================
* `#631`_: Pandas is only required if EXPLORER_USER_UPLOADS_ENABLED is True
Expand Down Expand Up @@ -477,6 +482,7 @@ Initial Release
.. _4.3.0: https://github.com/explorerhq/django-sql-explorer/compare/4.2.0...4.3.0
.. _5.0.0: https://github.com/explorerhq/django-sql-explorer/compare/4.3.0...5.0.0
.. _5.0.1: https://github.com/explorerhq/django-sql-explorer/compare/5.0.0...5.0.1
.. _5.0.2: https://github.com/explorerhq/django-sql-explorer/compare/5.0.1...5.0.2


.. _#254: https://github.com/explorerhq/django-sql-explorer/pull/254
Expand Down Expand Up @@ -580,5 +586,6 @@ Initial Release
.. _#618: https://github.com/explorerhq/django-sql-explorer/issues/618
.. _#619: https://github.com/explorerhq/django-sql-explorer/issues/619
.. _#631: https://github.com/explorerhq/django-sql-explorer/issues/631
.. _#633: https://github.com/explorerhq/django-sql-explorer/issues/633

.. _furo: https://github.com/pradyunsg/furo
2 changes: 1 addition & 1 deletion explorer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__version_info__ = {
"major": 5,
"minor": 0,
"patch": 1,
"patch": 2,
"releaselevel": "final",
"serial": 0
}
Expand Down
18 changes: 18 additions & 0 deletions explorer/migrations/0019_alter_databaseconnection_engine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.0.5 on 2024-07-03 12:38

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('explorer', '0018_alter_databaseconnection_host_and_more'),
]

operations = [
migrations.AlterField(
model_name='databaseconnection',
name='engine',
field=models.CharField(choices=[('django.db.backends.sqlite3', 'SQLite3'), ('django.db.backends.postgresql', 'PostgreSQL'), ('django.db.backends.mysql', 'MySQL'), ('django.db.backends.oracle', 'Oracle'), ('django.db.backends.mysql', 'MariaDB'), ('django_cockroachdb', 'CockroachDB'), ('django.db.backends.sqlserver', 'SQL Server (mssql-django)')], max_length=255),
),
]
1 change: 1 addition & 0 deletions explorer/src/js/pivot-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export function pivotSetup($) {
let csvButton = document.querySelector("#button-excel");
if (csvButton) {
csvButton.addEventListener("click", e => {
e.preventDefault();
let table = document.querySelector(".pvtTable");
if (typeof (table) != 'undefined' && table != null) {
csvFromTable(table);
Expand Down
9 changes: 0 additions & 9 deletions explorer/src/scss/assistant.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,3 @@
overflow: hidden;
}

#response_block::after {
content: "";
position: absolute;
top: -20px;
right: 10px;
border-width: 10px;
border-style: solid;
border-color: transparent transparent var(--bs-border-color) transparent;
}
10 changes: 10 additions & 0 deletions explorer/src/scss/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,13 @@ $font-size-base: .8rem;
--bs-btn-color: white !important;
}

$card-border-radius: 0;
$card-spacer-x: 0;
.card-header {
padding-left: 1rem !important;
padding-right: 1rem !important;
}

.card {
border-top: 0 !important;
}
6 changes: 3 additions & 3 deletions explorer/templates/explorer/assistant.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% load i18n %}
<div class ="accordion accordion-flush my-3 border" id="assistant_accordion">
<div class ="accordion accordion-flush mt-4" id="assistant_accordion">
<div class="accordion-item">
<div class="accordion-header" id="assistant_accordion_header">
<button class="accordion-button bg-light collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#assistant_collapse" aria-expanded="false" aria-controls="assistant_collapse">
Expand All @@ -8,15 +8,15 @@
</div>
</div>
<div id="assistant_collapse" class="accordion-collapse collapse" aria-labelledby="assistant_accordion_header" data-bs-parent="#assistant_accordion">
<div class="accordion-body">
<div class="accordion-body card">
<div class="row assistant_input_parent">
<div class="mt-3 col-8" id="assistant_input_wrapper">
<textarea
class="form-control mb-4" id="id_assistant_input"
name="sql_assistant" rows="5" placeholder="What do you need help with?"></textarea>
<label for="id_assistant_input" class="form-label d-none" id="id_assistant_input_label">Assistant prompt</label>
<div id="id_error_help_message" class="d-none text-secondary small">
Hit "Ask Assistant" to try and fix the issue. The assistant is automatically aware of error messages & context.
"Ask Assistant" to try and automatically fix the issue. The assistant is already aware of error messages & context.
</div>
</div>
<div id="additional_table_container" class="col-4">
Expand Down
20 changes: 13 additions & 7 deletions explorer/templates/explorer/preview_pane.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% load i18n %}

{% if headers %}
<div class="container">
<div class="container mt-4">
<nav>
<div class="nav nav-tabs mb-3" role="tablist" id="nav-tab">
<div class="nav nav-tabs" role="tablist" id="nav-tab">
<button class="nav-link active" id="nav-preview-tab" data-bs-toggle="tab" data-bs-target="#nav-preview" type="button" role="tab" area-controls="nav-preview" aria-selected="true">{% trans "Preview" %}</button>
{% if query.id and query.snapshot %}
<button class="nav-link" id="nav-snapshots-tab" data-bs-toggle="tab" data-bs-target="#nav-snapshots" type="button" role="tab" area-controls="nav-snapshots" aria-selected="false">{% trans "Snapshots" %}</button>
Expand Down Expand Up @@ -129,18 +129,24 @@ <h3>{{ snapshots|length }} Snapshots <small>(oldest first)</small></h3>

{% if data %}
<div class="tab-pane" id="nav-pivot" role="tabpanel" area-labelledby="nav-pivot-tab">
<button id="button-excel">{% trans "Download as CSV" %}</button>
<small>
<a id="pivot-bookmark"
<div class="card p-3">
<ul class="nav justify-content-end">
<li class="nav-item">
<a id="pivot-bookmark" class="nav-link"
data-baseurl="{% url 'explorer_playground' %}?querylog_id={{ ql_id }}"
href="#">
<i class="bi-link"></i>
<i class="bi-link"></i> Link to this
</a>
</small>
</li>
<li class="nav-item">
<a id="button-excel" class="nav-link" href="#"><i class="bi-download"></i> Download CSV</a>
</li>
</ul>
<div class="overflow-wrapper">
<div class="pivot-table"></div>
</div>
</div>
</div>
{% if charts_enabled %}
<div class="tab-pane" id="nav-piechart" role="tabpanel" area-labelledby="nav-piechart-tab">
<div class="overflow-wrapper">
Expand Down

0 comments on commit 6417074

Please sign in to comment.