From eebffd42eba68e5ca7a14b1b6bdc020cc102e101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jarda=20Kot=C4=9B=C5=A1ovec?= Date: Tue, 21 May 2024 11:42:31 +0200 Subject: [PATCH 1/2] pkp/pkp-lib#9951 Run ui-library unit tests on CI --- .github/workflows/unittest.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/unittest.yml diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml new file mode 100644 index 000000000..ca94fe960 --- /dev/null +++ b/.github/workflows/unittest.yml @@ -0,0 +1,16 @@ +name: unit-tests + +on: + pull_request: + types: [opened, synchronize, reopened] + push: + branches: + - main + +jobs: + run-tests: + runs-on: ubuntu-latest + steps: + - uses: withanage/pkp-ui-library-action@main + with: + node_version: 20 From 4c99d7c1a51d52ffb542f15710d8130ac9dd5a21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jarda=20Kot=C4=9B=C5=A1ovec?= Date: Tue, 21 May 2024 12:54:01 +0200 Subject: [PATCH 2/2] pkp/pkp-lib@9973 Prevent multiple API calls when user type multiple characters --- src/components/Form/fields/FieldControlledVocab.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/Form/fields/FieldControlledVocab.vue b/src/components/Form/fields/FieldControlledVocab.vue index c2028a954..6c463b305 100644 --- a/src/components/Form/fields/FieldControlledVocab.vue +++ b/src/components/Form/fields/FieldControlledVocab.vue @@ -9,6 +9,7 @@ export default { return { allSuggestions: [], suggestionsLoaded: false, + suggestionsLoading: false, allowCustom: true, }; }, @@ -21,6 +22,9 @@ export default { this.suggestions = []; return; } + if (this.suggestionsLoading) { + return; + } if (!this.suggestionsLoaded) { this.loadSuggestions(this.setSuggestions); } @@ -31,6 +35,7 @@ export default { * Load suggestions from the API */ loadSuggestions(successCallback) { + this.suggestionsLoading = true; $.ajax({ url: this.apiUrl, type: 'GET', @@ -47,6 +52,7 @@ export default { }; }); this.suggestionsLoaded = true; + this.suggestionsLoading = false; if (successCallback) { successCallback.apply(this); }