Skip to content

Commit 6417074

Browse files
authored
5.0.2 - Addresses #633 + some styling (#634)
1 parent 57c679a commit 6417074

9 files changed

Lines changed: 54 additions & 21 deletions

File tree

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ jobs:
1414
- run: python -Im pip install --user ruff
1515

1616
- name: Run ruff
17-
run: ruff --output-format=github explorer
17+
run: ruff check --output-format=github explorer

HISTORY.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ Change Log
55
This document records all notable changes to `django-sql-explorer <https://github.com/explorerhq/django-sql-explorer>`_.
66
This project adheres to `Semantic Versioning <https://semver.org/>`_.
77

8+
`5.0.2`_ (2024-07-3)
9+
===========================
10+
* `#633`_: Missing migration
11+
* CSS tweaks to tighten up the Query UI
12+
813
`5.0.1`_ (2024-06-26)
914
===========================
1015
* `#631`_: Pandas is only required if EXPLORER_USER_UPLOADS_ENABLED is True
@@ -477,6 +482,7 @@ Initial Release
477482
.. _4.3.0: https://github.com/explorerhq/django-sql-explorer/compare/4.2.0...4.3.0
478483
.. _5.0.0: https://github.com/explorerhq/django-sql-explorer/compare/4.3.0...5.0.0
479484
.. _5.0.1: https://github.com/explorerhq/django-sql-explorer/compare/5.0.0...5.0.1
485+
.. _5.0.2: https://github.com/explorerhq/django-sql-explorer/compare/5.0.1...5.0.2
480486

481487

482488
.. _#254: https://github.com/explorerhq/django-sql-explorer/pull/254
@@ -580,5 +586,6 @@ Initial Release
580586
.. _#618: https://github.com/explorerhq/django-sql-explorer/issues/618
581587
.. _#619: https://github.com/explorerhq/django-sql-explorer/issues/619
582588
.. _#631: https://github.com/explorerhq/django-sql-explorer/issues/631
589+
.. _#633: https://github.com/explorerhq/django-sql-explorer/issues/633
583590

584591
.. _furo: https://github.com/pradyunsg/furo

explorer/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
__version_info__ = {
22
"major": 5,
33
"minor": 0,
4-
"patch": 1,
4+
"patch": 2,
55
"releaselevel": "final",
66
"serial": 0
77
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 5.0.5 on 2024-07-03 12:38
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('explorer', '0018_alter_databaseconnection_host_and_more'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='databaseconnection',
15+
name='engine',
16+
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),
17+
),
18+
]

explorer/src/js/pivot-setup.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export function pivotSetup($) {
2121
let csvButton = document.querySelector("#button-excel");
2222
if (csvButton) {
2323
csvButton.addEventListener("click", e => {
24+
e.preventDefault();
2425
let table = document.querySelector(".pvtTable");
2526
if (typeof (table) != 'undefined' && table != null) {
2627
csvFromTable(table);

explorer/src/scss/assistant.scss

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,3 @@
2424
overflow: hidden;
2525
}
2626

27-
#response_block::after {
28-
content: "";
29-
position: absolute;
30-
top: -20px;
31-
right: 10px;
32-
border-width: 10px;
33-
border-style: solid;
34-
border-color: transparent transparent var(--bs-border-color) transparent;
35-
}

explorer/src/scss/variables.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,13 @@ $font-size-base: .8rem;
1717
--bs-btn-color: white !important;
1818
}
1919

20+
$card-border-radius: 0;
21+
$card-spacer-x: 0;
22+
.card-header {
23+
padding-left: 1rem !important;
24+
padding-right: 1rem !important;
25+
}
26+
27+
.card {
28+
border-top: 0 !important;
29+
}

explorer/templates/explorer/assistant.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% load i18n %}
2-
<div class ="accordion accordion-flush my-3 border" id="assistant_accordion">
2+
<div class ="accordion accordion-flush mt-4" id="assistant_accordion">
33
<div class="accordion-item">
44
<div class="accordion-header" id="assistant_accordion_header">
55
<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">
@@ -8,15 +8,15 @@
88
</div>
99
</div>
1010
<div id="assistant_collapse" class="accordion-collapse collapse" aria-labelledby="assistant_accordion_header" data-bs-parent="#assistant_accordion">
11-
<div class="accordion-body">
11+
<div class="accordion-body card">
1212
<div class="row assistant_input_parent">
1313
<div class="mt-3 col-8" id="assistant_input_wrapper">
1414
<textarea
1515
class="form-control mb-4" id="id_assistant_input"
1616
name="sql_assistant" rows="5" placeholder="What do you need help with?"></textarea>
1717
<label for="id_assistant_input" class="form-label d-none" id="id_assistant_input_label">Assistant prompt</label>
1818
<div id="id_error_help_message" class="d-none text-secondary small">
19-
Hit "Ask Assistant" to try and fix the issue. The assistant is automatically aware of error messages & context.
19+
"Ask Assistant" to try and automatically fix the issue. The assistant is already aware of error messages & context.
2020
</div>
2121
</div>
2222
<div id="additional_table_container" class="col-4">

explorer/templates/explorer/preview_pane.html

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{% load i18n %}
22

33
{% if headers %}
4-
<div class="container">
4+
<div class="container mt-4">
55
<nav>
6-
<div class="nav nav-tabs mb-3" role="tablist" id="nav-tab">
6+
<div class="nav nav-tabs" role="tablist" id="nav-tab">
77
<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>
88
{% if query.id and query.snapshot %}
99
<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>
@@ -129,18 +129,24 @@ <h3>{{ snapshots|length }} Snapshots <small>(oldest first)</small></h3>
129129

130130
{% if data %}
131131
<div class="tab-pane" id="nav-pivot" role="tabpanel" area-labelledby="nav-pivot-tab">
132-
<button id="button-excel">{% trans "Download as CSV" %}</button>
133-
<small>
134-
<a id="pivot-bookmark"
132+
<div class="card p-3">
133+
<ul class="nav justify-content-end">
134+
<li class="nav-item">
135+
<a id="pivot-bookmark" class="nav-link"
135136
data-baseurl="{% url 'explorer_playground' %}?querylog_id={{ ql_id }}"
136137
href="#">
137-
<i class="bi-link"></i>
138+
<i class="bi-link"></i> Link to this
138139
</a>
139-
</small>
140+
</li>
141+
<li class="nav-item">
142+
<a id="button-excel" class="nav-link" href="#"><i class="bi-download"></i> Download CSV</a>
143+
</li>
144+
</ul>
140145
<div class="overflow-wrapper">
141146
<div class="pivot-table"></div>
142147
</div>
143148
</div>
149+
</div>
144150
{% if charts_enabled %}
145151
<div class="tab-pane" id="nav-piechart" role="tabpanel" area-labelledby="nav-piechart-tab">
146152
<div class="overflow-wrapper">

0 commit comments

Comments
 (0)