Skip to content
Snippets Groups Projects
Unverified Commit 2c7178ea authored by Cal Herries's avatar Cal Herries Committed by GitHub
Browse files

Use slugs for card template tags in the native query editor + autocomplete (#25319)

* Allow slugs in question template tags, like `{{#123-a-question}}`

* Update CardTagEditor to add slug names to the query text, instead of IDs

* Fix dispatchApiErrorEvent prop for entity object loader

* Ignore errors loading names of referenced questions

* Fix e2e tests

* Implement autocomplete for model slugs

* Prioritize models above questions

* Make the ace_autocomplete popup slightly wider to account for longer question names

* Reorder requires

* Remove unnecessary ? from endpoint string

* Add e2e test for card tag autocomplete

* Fix NativeQueryEditor not swapping back to standard completers

* Refactor replaceCardSlug

* Add e2e test for updating tags when card name is changed

* Refactor updateReferencedQuestionNames

* Add slug method to Question class

* Use map for autocomplete API results

* Rename endpoint path

* Rename for consistency

* Add docstrings

* Update slug() to guard against undefined names

* Fix read permissions for the endpoint

* Add backend test

* Fix unit tests

* Fix permissions error

* Make regex simpler

* Undo change of value on QuestionPicker

* Fix tests

* Fix models e2e test

* Simplify updateReferencedQuestionNames

* Fix bugs in updateReferencedQuestionNames

* Rename variable

* Move NativeQuery methods to new native-query utils module

* Fix typescript errors

* Fix e2e tests

* Fix e2e test

* Fix BE tests

* Actually fix BE test

* Refactor updateQuestionTagNames

* Align comments

* Reorder autocomplete results

* Refactor: move all query text tag utils in one place

* Add tests for regex

* Add unit tests for cardIdFromTagName

* Add schema to autocomplete_suggestions endpoints

* Add perms checks to autocomplete tests

* Add unit test for updateCardTagNames

* Rename updateQuestionTagNames -> updateCardTagNames

* Tidy card-autocomplete-suggestions-test

* Rename questionReference-> cardTag for consistency

* Rename card-reference -> card-tag for consistency

* Use ternary operator for comprehension

* Fix broken swapCompleters

* Use prefix match on name for 123-foo case
parent 56791a6c
No related branches found
No related tags found
No related merge requests found
Showing
with 504 additions and 129 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment