From d0398c28656c23de99ad280c54d5bdf7e47845c1 Mon Sep 17 00:00:00 2001 From: Chris Clark Date: Fri, 26 Apr 2024 09:52:36 -0400 Subject: [PATCH] 4.2 final --- HISTORY.rst | 4 ++-- explorer/__init__.py | 4 ++-- explorer/src/js/assistant.js | 25 ---------------------- explorer/src/scss/assistant.scss | 2 +- explorer/telemetry.py | 2 +- explorer/templates/explorer/assistant.html | 20 ++++++----------- 6 files changed, 13 insertions(+), 44 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 1cf63023..7959f263 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -5,13 +5,13 @@ Change Log This document records all notable changes to `django-sql-explorer `_. This project adheres to `Semantic Versioning `_. -`4.2.0b1`_ (2024-04-25) +`4.2.0`_ (2024-04-26) =========================== * `#609`_: Tracking should be opt-in and not use the SECRET_KEY * `#610`_: Import error (sql_metadata) with 4.1 version * `#612`_: Accessing the database during app initialization * Regex-injection vulnerability -* Better anonymization for telemetry +* Improved assistant UI `4.1.0`_ (2024-04-23) =========================== diff --git a/explorer/__init__.py b/explorer/__init__.py index d760f262..c9d92291 100644 --- a/explorer/__init__.py +++ b/explorer/__init__.py @@ -2,8 +2,8 @@ "major": 4, "minor": 2, "patch": 0, - "releaselevel": "beta", - "serial": 1 + "releaselevel": "final", + "serial": 0 } diff --git a/explorer/src/js/assistant.js b/explorer/src/js/assistant.js index b826581d..d9adcc93 100644 --- a/explorer/src/js/assistant.js +++ b/explorer/src/js/assistant.js @@ -10,10 +10,6 @@ function getErrorMessage() { return errorElement ? errorElement.textContent.trim() : null; } -function assistantSearchFocus() { - document.getElementById("search_assistant_tables").focus(); -} - export function setUpAssistant(expand = false) { const error = getErrorMessage(); @@ -71,27 +67,6 @@ export function setUpAssistant(expand = false) { console.error('Error retrieving JSON schema:', error); }); - const checkbox = document.getElementById('include_other_tables'); - const additionalTableContainer = document.getElementById('additional_table_container'); - const assistantInputWrapper = document.getElementById('assistant_input_wrapper'); - - function showHideExtraTables(checked) { - if (checked) { - additionalTableContainer.classList.remove('d-none'); - assistantInputWrapper.classList.remove('col-12'); - assistantInputWrapper.classList.add('col-9'); - assistantSearchFocus(); - } else { - additionalTableContainer.classList.add('d-none'); - assistantInputWrapper.classList.remove('col-9'); - assistantInputWrapper.classList.add('col-12'); - } - } - checkbox.addEventListener('change', function() { - showHideExtraTables(this.checked); - }); - showHideExtraTables(checkbox.checked); - document.getElementById('id_assistant_input').addEventListener('keydown', function(event) { if ((event.ctrlKey || event.metaKey) && (event.key === 'Enter')) { event.preventDefault(); diff --git a/explorer/src/scss/assistant.scss b/explorer/src/scss/assistant.scss index 4e0a6e99..70c239ae 100644 --- a/explorer/src/scss/assistant.scss +++ b/explorer/src/scss/assistant.scss @@ -16,7 +16,7 @@ #additional_table_container { overflow-y: auto; - max-height: 120px; + max-height: 10rem; } #assistant_input_parent { diff --git a/explorer/telemetry.py b/explorer/telemetry.py index d4e8108c..b8947b28 100644 --- a/explorer/telemetry.py +++ b/explorer/telemetry.py @@ -18,7 +18,7 @@ def instance_identifier(): from explorer.models import ExplorerValue - key = "explorer_instance_identifier" + key = "explorer_instance_uuid" r = cache.get(key) if not r: r = ExplorerValue.objects.get_uuid() diff --git a/explorer/templates/explorer/assistant.html b/explorer/templates/explorer/assistant.html index a3aa0548..077f28f5 100644 --- a/explorer/templates/explorer/assistant.html +++ b/explorer/templates/explorer/assistant.html @@ -10,39 +10,33 @@
-
+
+ name="sql_assistant" rows="5" placeholder="What do you need help with?">
Hit "Ask Assistant" to try and fix the issue. The assistant is automatically aware of error messages & context.
-
+
+ (?)
-
-
- - -
-
-
+
-