You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2020/05/12 22:45:29 UTC

[airavata-django-portal] branch AIRAVATA-3324-custom-input-editor-autocomplete-input-editor updated (fe7a713 -> f1ef162)

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a change to branch AIRAVATA-3324-custom-input-editor-autocomplete-input-editor
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git.


    from fe7a713  Lint: fix import sort order
     add 5f011bc  AIRAVATA-3276 Automatically add showOptions for managing isRequired
     add edecf49  AIRAVATA-3276 Removing backwards compat
     add 06664cd  AIRAVATA-3243 Send email to user when added to group
     add ade0d51  AIRAVATA-3243 Wrap links in a tags
     add ee2c247  AIRAVATA-3243 auth: activate signal receivers on startup
     add ad4b2e4  AIRAVATA-3243 Add Save button to groups editor
     add a7452b4  AIRAVATA-3243 Send one email when user added to multiple groups at once
     add 0a7ba8d  AIRAVATA-3243 Set Reply-To to PORTAL_ADMINS
     add 7448824  AIRAVATA-3243 Don't send signal when user not added to group
     add 5535b32  AIRAVATA-3243 Fixing tests, lint errors
     add d5c3215  Merge branch 'airavata-3243'
     add 9800b7a  AIRAVATA-3281 Capture content type of uploaded file
     add 162fe78  AIRAVATA-3281 Tests for data_products_helper
     add d359854  AIRAVATA-3281 Check if file is text
     add 41c0aad  AIRAVATA-3299 Update list of queues when GRP changes
     add 405f484  Merge branch 'AIRAVATA-3299-bug-unselected-queues-in-grp-is-listed-in-create'
     add 53bd781  AIRAVATA-3268 Add overrideFilename for URI type inputs
     add 66cb438  Fix focusApplicationInputKey
     add 6b07e76  Vuejs warning fixes
     add 4a0c407  Merge branch 'airavata-3268'
     add 97975d8  AIRAVATA-3126 UI for managing reservations
     add ac818b4  AIRAVATA-3216 ComputeResourceReservation validations
     add 1a4b756  AIRAVATA-3126 Add support for deleting all expired reservations
     add 6f9ed0d  AIRAVATA-3216: Remove dynamic sorting, but sort new reservations by start time
     add 4afb2c9  AIRAVATA-3126 remove parts of hour from reservation default start/end time
     add f7aed1c  AIRAVATA-3216 Don't allow picking an end time before start time
     add b54d480  AIRAVATA-3126 Fix save/cancel to bottom; summarize reservations
     add f322b37  AIRAVATA-3126 reservation badges
     add 8bd42d0  AIRAVATA-3126 Default reservations to empty array
     add eb52ef3  Merge branch 'AIRAVATA-3126--Implement-compute-resource-reservation-addition'
     add 3a05aab  Revert "AIRAVATA-3299 Update list of queues when GRP changes"
     add 72f2886  Adding physicell theme
     add df0e92d  Add missing @login_required to output view functions
     add f173389  Remove white background of Uppy StatusBar
     add 3ed7872  AIRAVATA-3331 Mask sensitive login variables out of error emails
     add b23f2c3  AIRAVATA-3332 Log password failures at warning level
     add 0c4b13c  Merge branch 'AIRAVATA-3332'
     new 738ad5d  AIRAVATA-3324 Add AutocompleteInputEditor
     new 7499431  AIRAVATA-3324 Improve UI for canceling selection
     new 812fdd7  AIRAVATA-3324 Debounce search queries
     new f1ef162  AIRAVATA-3324 Handle loading exact value and 404 error case

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .travis.yml                                        |    1 +
 .../appcatalog/groupresourceprofile/ttypes.py      |  217 +-
 airavata/model/application/io/ttypes.py            |   16 +-
 airavata/model/sharing/ttypes.py                   |   15 +-
 .../service/profile/user/cpi/UserProfileService.py |    8 +
 .../ComputePreference.vue                          |  119 +-
 .../ComputeResourceReservationEditor.vue           |  158 +
 .../ComputeResourceReservationList.vue             |  251 ++
 .../ComputeResourceReservationsSummary.vue         |   45 +
 .../GroupComputeResourcePreference.vue             |  108 +-
 .../applications/ApplicationInputFieldEditor.vue   |   17 +-
 .../applications/ApplicationInterfaceEditor.vue    |    7 +-
 .../src/components/applications/JSONEditor.vue     |    1 -
 .../gatewayprofile/StoragePreferenceList.vue       |    2 +-
 .../src/components/users/UserDetailsContainer.vue  |   50 +-
 django_airavata/apps/api/data_products_helper.py   |   93 +-
 django_airavata/apps/api/output_views.py           |    2 +-
 django_airavata/apps/api/serializers.py            |    9 +-
 django_airavata/apps/api/signals.py                |    9 +-
 .../api/static/django_airavata_api/js/index.js     |    2 +
 .../django_airavata_api/js/models/BaseModel.js     |  229 +-
 .../js/models/ComputeResourceReservation.js        |   65 +
 .../django_airavata_api/js/models/DataProduct.js   |    9 +
 .../js/models/GroupComputeResourcePreference.js    |    9 +-
 .../js/models/InputDataObjectType.js               |   12 +-
 django_airavata/apps/api/tests.py                  |    2 -
 .../management => apps/api/tests}/__init__.py      |    0
 .../apps/api/tests/test_data_products_helper.py    |  180 +
 django_airavata/apps/api/tests/test_views.py       |  470 +++
 django_airavata/apps/api/tus.py                    |    5 +-
 django_airavata/apps/api/views.py                  |   68 +-
 django_airavata/apps/auth/apps.py                  |    3 +
 django_airavata/apps/auth/backends.py              |   50 +-
 .../auth/migrations/0005_auto_20191211_2011.py     |   66 +
 django_airavata/apps/auth/models.py                |    2 +
 django_airavata/apps/auth/signals.py               |   25 +
 django_airavata/apps/auth/tests.py                 |   82 +-
 django_airavata/apps/auth/utils.py                 |   18 +
 django_airavata/apps/auth/views.py                 |   24 +-
 django_airavata/apps/workspace/package.json        |    1 +
 .../input-editors/AutocompleteInputEditor.vue      |  151 +
 .../experiment/input-editors/FileInputEditor.vue   |    6 +-
 .../input-editors/InputEditorContainer.vue         |    4 +-
 .../components/storage/UserStoragePathViewer.vue   |    2 +-
 .../media/images/SARS-CoV-2.max-165x165.png        |  Bin 0 -> 56685 bytes
 .../media/images/SARS-CoV-2.max-800x600.png        |  Bin 0 -> 48306 bytes
 .../media/images/SARS-CoV-2.original.png           |  Bin 0 -> 48306 bytes
 .../media/images/SARS-CoV-2.width-800.png          |  Bin 0 -> 48306 bytes
 .../media/images/bg-header.max-165x165.jpg         |  Bin 0 -> 11402 bytes
 .../media/images/bg-header.max-800x600.jpg         |  Bin 0 -> 158955 bytes
 .../media/images/bg-header.original.jpg            |  Bin 0 -> 496849 bytes
 ...e-brasil-guys-avpaulista-109919.max-165x165.jpg |  Bin 0 -> 18423 bytes
 ...ople-brasil-guys-avpaulista-109919.original.jpg |  Bin 0 -> 153370 bytes
 ...ding-laboratory-flask-2280571_1.max-165x165.jpg |  Bin 0 -> 16783 bytes
 ...holding-laboratory-flask-2280571_1.original.jpg |  Bin 0 -> 249563 bytes
 ...g-laboratory-flask-2280571_1_Zd.max-165x165.jpg |  Bin 0 -> 16783 bytes
 .../media/images/physicell-logo-01.max-165x165.png |  Bin 0 -> 52343 bytes
 .../media/images/physicell-logo-01.max-800x600.png |  Bin 0 -> 52962 bytes
 .../media/images/physicell-logo-01.original.png    |  Bin 0 -> 52962 bytes
 .../media/images/physicell-logo-01.width-800.png   |  Bin 0 -> 52962 bytes
 .../media/images/snapshot00000240.max-165x165.jpg  |  Bin 0 -> 31904 bytes
 .../media/images/snapshot00000240.max-800x600.jpg  |  Bin 0 -> 76941 bytes
 .../media/images/snapshot00000240.width-800.jpg    |  Bin 0 -> 76941 bytes
 .../images/virus-1812092_1920.max-165x165.jpg      |  Bin 0 -> 11402 bytes
 .../images/virus-1812092_1920.max-800x600.jpg      |  Bin 0 -> 158955 bytes
 .../media/images/virus-1812092_1920.original.jpg   |  Bin 0 -> 496849 bytes
 django_airavata/media/images/virus.max-165x165.png |  Bin 0 -> 17297 bytes
 django_airavata/media/images/virus.original.png    |  Bin 0 -> 34360 bytes
 .../media/images/virus_1.max-165x165.png           |  Bin 0 -> 23232 bytes
 django_airavata/media/images/virus_1.original.png  |  Bin 0 -> 48171 bytes
 .../media/images/virus_2.max-165x165.png           |  Bin 0 -> 24997 bytes
 django_airavata/media/images/virus_2.original.png  |  Bin 0 -> 50386 bytes
 .../media/images/virus_3.max-165x165.png           |  Bin 0 -> 24997 bytes
 django_airavata/media/images/virus_3.original.png  |  Bin 0 -> 50386 bytes
 .../media/images/virus_3_8bogaM1.max-165x165.png   |  Bin 0 -> 24997 bytes
 django_airavata/settings.py                        |    1 +
 django_airavata/settings_local.py.ide              |    6 +-
 .../common/js/components/AutocompleteTextInput.vue |    9 +-
 .../common/js/components/DataProductViewer.vue     |   10 +-
 .../static/common/js/components/DeleteButton.vue   |    6 +-
 .../static/common/js/components/HumanDate.vue      |    2 +-
 .../static/common/js/components/Uppy.vue           |    3 +
 .../static/common/js/layouts/ListLayout.vue        |    2 +
 django_airavata/static/common/js/utils.js          |   25 +-
 .../wagtailapps/base/fixtures/physicell.json       | 3527 ++++++++++++++++++++
 85 files changed, 5892 insertions(+), 312 deletions(-)
 create mode 100644 django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputeResourceReservationEditor.vue
 create mode 100644 django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputeResourceReservationList.vue
 create mode 100644 django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputeResourceReservationsSummary.vue
 create mode 100644 django_airavata/apps/api/static/django_airavata_api/js/models/ComputeResourceReservation.js
 delete mode 100644 django_airavata/apps/api/tests.py
 copy django_airavata/{wagtailapps/base/tests/management => apps/api/tests}/__init__.py (100%)
 create mode 100644 django_airavata/apps/api/tests/test_data_products_helper.py
 create mode 100644 django_airavata/apps/api/tests/test_views.py
 create mode 100644 django_airavata/apps/auth/migrations/0005_auto_20191211_2011.py
 create mode 100644 django_airavata/apps/auth/signals.py
 create mode 100644 django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/AutocompleteInputEditor.vue
 create mode 100644 django_airavata/media/images/SARS-CoV-2.max-165x165.png
 create mode 100644 django_airavata/media/images/SARS-CoV-2.max-800x600.png
 create mode 100644 django_airavata/media/images/SARS-CoV-2.original.png
 create mode 100644 django_airavata/media/images/SARS-CoV-2.width-800.png
 create mode 100644 django_airavata/media/images/bg-header.max-165x165.jpg
 create mode 100644 django_airavata/media/images/bg-header.max-800x600.jpg
 create mode 100644 django_airavata/media/images/bg-header.original.jpg
 create mode 100644 django_airavata/media/images/people-brasil-guys-avpaulista-109919.max-165x165.jpg
 create mode 100644 django_airavata/media/images/people-brasil-guys-avpaulista-109919.original.jpg
 create mode 100644 django_airavata/media/images/person-holding-laboratory-flask-2280571_1.max-165x165.jpg
 create mode 100644 django_airavata/media/images/person-holding-laboratory-flask-2280571_1.original.jpg
 create mode 100644 django_airavata/media/images/person-holding-laboratory-flask-2280571_1_Zd.max-165x165.jpg
 create mode 100644 django_airavata/media/images/physicell-logo-01.max-165x165.png
 create mode 100644 django_airavata/media/images/physicell-logo-01.max-800x600.png
 create mode 100644 django_airavata/media/images/physicell-logo-01.original.png
 create mode 100644 django_airavata/media/images/physicell-logo-01.width-800.png
 create mode 100644 django_airavata/media/images/snapshot00000240.max-165x165.jpg
 create mode 100644 django_airavata/media/images/snapshot00000240.max-800x600.jpg
 create mode 100644 django_airavata/media/images/snapshot00000240.width-800.jpg
 create mode 100644 django_airavata/media/images/virus-1812092_1920.max-165x165.jpg
 create mode 100644 django_airavata/media/images/virus-1812092_1920.max-800x600.jpg
 create mode 100644 django_airavata/media/images/virus-1812092_1920.original.jpg
 create mode 100644 django_airavata/media/images/virus.max-165x165.png
 create mode 100644 django_airavata/media/images/virus.original.png
 create mode 100644 django_airavata/media/images/virus_1.max-165x165.png
 create mode 100644 django_airavata/media/images/virus_1.original.png
 create mode 100644 django_airavata/media/images/virus_2.max-165x165.png
 create mode 100644 django_airavata/media/images/virus_2.original.png
 create mode 100644 django_airavata/media/images/virus_3.max-165x165.png
 create mode 100644 django_airavata/media/images/virus_3.original.png
 create mode 100644 django_airavata/media/images/virus_3_8bogaM1.max-165x165.png
 create mode 100644 django_airavata/wagtailapps/base/fixtures/physicell.json


[airavata-django-portal] 03/04: AIRAVATA-3324 Debounce search queries

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch AIRAVATA-3324-custom-input-editor-autocomplete-input-editor
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit 812fdd7a3149230d9eca3f07b84c191859ccbed4
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed Apr 29 09:50:34 2020 -0400

    AIRAVATA-3324 Debounce search queries
---
 django_airavata/apps/workspace/package.json                         | 1 +
 .../components/experiment/input-editors/AutocompleteInputEditor.vue | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/django_airavata/apps/workspace/package.json b/django_airavata/apps/workspace/package.json
index 7ffab05..424c5ed 100644
--- a/django_airavata/apps/workspace/package.json
+++ b/django_airavata/apps/workspace/package.json
@@ -19,6 +19,7 @@
     "django-airavata-api": "link:../api",
     "django-airavata-common-ui": "link:../../static/common",
     "django-airavata-workspace-plugin-api": "link:django-airavata-workspace-plugin-api",
+    "lodash": "^4.17.15",
     "moment": "^2.21.0",
     "terser": "^4.1.2",
     "vue": "^2.5.22",
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/AutocompleteInputEditor.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/AutocompleteInputEditor.vue
index 83934d5..b107471 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/AutocompleteInputEditor.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/AutocompleteInputEditor.vue
@@ -20,6 +20,7 @@
 import { utils } from "django-airavata-api";
 import { InputEditorMixin } from "django-airavata-workspace-plugin-api";
 import { components } from "django-airavata-common-ui";
+import _ from "lodash";
 
 export default {
   name: "autocomplete-input-editor",
@@ -99,7 +100,8 @@ export default {
       this.text = suggestion.name;
       this.valueChanged();
     },
-    searchChanged(newValue) {
+    searchChanged: _.debounce(function(newValue) {
+      // TODO: don't query when search value is empty string
       this.searchString = newValue;
       const currentTime = Date.now();
       if (this.autocompleteUrl) {
@@ -117,7 +119,7 @@ export default {
           }
         });
       }
-    }
+    }, 200),
   },
   created() {
     if (this.value) {


[airavata-django-portal] 04/04: AIRAVATA-3324 Handle loading exact value and 404 error case

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch AIRAVATA-3324-custom-input-editor-autocomplete-input-editor
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit f1ef162905f8f1c2fafc8a06b445c6b99f16bfb9
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Tue May 5 10:20:54 2020 -0400

    AIRAVATA-3324 Handle loading exact value and 404 error case
---
 .../input-editors/AutocompleteInputEditor.vue      | 29 +++++++++++++++++++---
 1 file changed, 25 insertions(+), 4 deletions(-)

diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/AutocompleteInputEditor.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/AutocompleteInputEditor.vue
index b107471..6efd81e 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/AutocompleteInputEditor.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/AutocompleteInputEditor.vue
@@ -84,9 +84,30 @@ export default {
   methods: {
     loadTextForValue(value) {
       if (this.autocompleteUrl) {
-        return utils.FetchUtils.get(this.autocompleteUrl, {
-          id: value
-        }).then(resp => resp.text);
+        return utils.FetchUtils.get(
+          this.autocompleteUrl,
+          {
+            exact: value
+          },
+          {
+            ignoreErrors: true // don't automatically report errors to user - code will handle 404s
+          }
+        )
+          .then(resp => {
+            if (resp.results && resp.results.length > 0) {
+              return resp.results[0].text;
+            } else {
+              return `value: ${value}`;
+            }
+          })
+          .catch(error => {
+            if (error.details.status === 404) {
+              // if we can't fine an exact match, just return the value as the text
+              return `value: ${value}`;
+            } else {
+              throw error;
+            }
+          });
       } else {
         return Promise.resolve(null);
       }
@@ -119,7 +140,7 @@ export default {
           }
         });
       }
-    }, 200),
+    }, 200)
   },
   created() {
     if (this.value) {


[airavata-django-portal] 01/04: AIRAVATA-3324 Add AutocompleteInputEditor

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch AIRAVATA-3324-custom-input-editor-autocomplete-input-editor
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit 738ad5d027b1b42eb308f7a7cab10e22cf5f71dd
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon Apr 27 16:04:35 2020 -0400

    AIRAVATA-3324 Add AutocompleteInputEditor
---
 .../input-editors/AutocompleteInputEditor.vue      | 126 +++++++++++++++++++++
 .../input-editors/InputEditorContainer.vue         |   4 +-
 .../common/js/components/AutocompleteTextInput.vue |   9 +-
 3 files changed, 136 insertions(+), 3 deletions(-)

diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/AutocompleteInputEditor.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/AutocompleteInputEditor.vue
new file mode 100644
index 0000000..067bb24
--- /dev/null
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/AutocompleteInputEditor.vue
@@ -0,0 +1,126 @@
+<template>
+  <!-- TODO: replace with better display and x to clear out selected value -->
+  <div v-if="value">
+    {{ text }}
+    <b-link @click="cancel">Cancel</b-link>
+  </div>
+  <div v-else>
+    <autocomplete-text-input
+      :suggestions="suggestions"
+      @selected="selected"
+      @search-changed="searchChanged"
+      :max-matches="10"
+    />
+  </div>
+</template>
+
+<script>
+import { utils } from "django-airavata-api";
+import { InputEditorMixin } from "django-airavata-workspace-plugin-api";
+import { components } from "django-airavata-common-ui";
+
+export default {
+  name: "autocomplete-input-editor",
+  mixins: [InputEditorMixin],
+  components: {
+    "autocomplete-text-input": components.AutocompleteTextInput
+  },
+  props: {
+    value: {
+      type: String
+    }
+  },
+  data() {
+    return {
+      text: null,
+      searchString: "",
+      searchResults: null,
+      lastUpdate: Date.now()
+    };
+  },
+  computed: {
+    suggestions() {
+      return this.searchResults
+        ? this.searchResults.results.map(r => {
+            return {
+              id: r.value,
+              name: r.text
+            };
+          })
+        : [];
+    },
+    autocompleteUrl() {
+      if (
+        this.experimentInput.editorConfig &&
+        "url" in this.experimentInput.editorConfig
+      ) {
+        return this.experimentInput.editorConfig.url;
+      } else {
+        // eslint-disable-next-line no-console
+        console.warn(
+          "editor config is missing 'url'. Make sure input " +
+            this.experimentInput.name +
+            " has metadata configuration something like:\n" +
+            JSON.stringify(
+              {
+                editor: {
+                  "ui-component-id": "autocomplete-input-editor",
+                  config: {
+                    url: "/some/custom/search/"
+                  }
+                }
+              },
+              null,
+              4
+            )
+        );
+        return null;
+      }
+    }
+  },
+  methods: {
+    loadTextForValue(value) {
+      if (this.autocompleteUrl) {
+        return utils.FetchUtils.get(this.autocompleteUrl, {
+          id: value
+        }).then(resp => resp.text);
+      } else {
+        return Promise.resolve(null);
+      }
+    },
+    cancel() {
+      this.data = null;
+      this.valueChanged();
+    },
+    selected(suggestion) {
+      this.data = suggestion.id;
+      this.text = suggestion.name;
+      this.valueChanged();
+    },
+    searchChanged(newValue) {
+      this.searchString = newValue;
+      const currentTime = Date.now();
+      if (this.autocompleteUrl) {
+        utils.FetchUtils.get(
+          this.autocompleteUrl,
+          {
+            search: this.searchString
+          },
+          { showSpinner: false }
+        ).then(resp => {
+          // Prevent older responses from overwriting newer ones
+          if (currentTime > this.lastUpdate) {
+            this.searchResults = resp;
+            this.lastUpdate = currentTime;
+          }
+        });
+      }
+    }
+  },
+  created() {
+    if (this.value) {
+      this.loadTextForValue(this.value).then(text => (this.text = text));
+    }
+  }
+};
+</script>
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/InputEditorContainer.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/InputEditorContainer.vue
index 44b4489..afb7571 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/InputEditorContainer.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/InputEditorContainer.vue
@@ -17,6 +17,7 @@
 <script>
 
 import UserFileInputEditor from "./UserFileInputEditor.vue";
+import AutocompleteInputEditor from "./AutocompleteInputEditor";
 import CheckboxInputEditor from "./CheckboxInputEditor.vue";
 import FileInputEditor from './FileInputEditor.vue'
 import InputEditorFormGroup from './InputEditorFormGroup.vue'
@@ -43,8 +44,8 @@ export default {
         }
     },
     components: {
+        AutocompleteInputEditor,
         CheckboxInputEditor,
-        UserFileInputEditor,
         FileInputEditor,
         InputEditorFormGroup,
         MultiFileInputEditor,
@@ -52,6 +53,7 @@ export default {
         SelectInputEditor,
         StringInputEditor,
         TextareaInputEditor,
+        UserFileInputEditor,
     },
     created() {
       if (!this.show) {
diff --git a/django_airavata/static/common/js/components/AutocompleteTextInput.vue b/django_airavata/static/common/js/components/AutocompleteTextInput.vue
index 59071e6..5579af0 100644
--- a/django_airavata/static/common/js/components/AutocompleteTextInput.vue
+++ b/django_airavata/static/common/js/components/AutocompleteTextInput.vue
@@ -8,7 +8,7 @@
         @keydown.native.down='down' @keydown.native.up='up'></b-form-input>
     </b-input-group>
     <b-list-group class="autocomplete-suggestion-list" v-if="open">
-      <b-list-group-item v-for="(suggestion, index) in filtered.slice(0,5)" v-bind:class="{'active': isActive(index)}" href="#"
+      <b-list-group-item v-for="(suggestion, index) in filtered" v-bind:class="{'active': isActive(index)}" href="#"
         @click="suggestionClick(index)" v-bind:key="suggestion.id">
         <slot name="suggestion" :suggestion="suggestion">
           {{ suggestion.name }}
@@ -29,6 +29,10 @@ export default {
     placeholder: {
       type: String,
       default: "Type to get suggestions..."
+    },
+    maxMatches: {
+      type: Number,
+      default: 5
     }
   },
   data() {
@@ -46,7 +50,7 @@ export default {
         return (
           data.name.toLowerCase().indexOf(this.searchValue.toLowerCase()) >= 0
         );
-      }).slice(0,5);
+      }).slice(0,this.maxMatches);
     }
   },
   methods: {
@@ -59,6 +63,7 @@ export default {
         this.open = false;
       }
       this.searchValue = value;
+      this.$emit('search-changed', value);
     },
     enter() {
       if (this.filtered.length === 0) {


[airavata-django-portal] 02/04: AIRAVATA-3324 Improve UI for canceling selection

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch AIRAVATA-3324-custom-input-editor-autocomplete-input-editor
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit 749943189035da9c82c18b42bf4ae732c258e3ba
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed Apr 29 09:36:29 2020 -0400

    AIRAVATA-3324 Improve UI for canceling selection
---
 .../experiment/input-editors/AutocompleteInputEditor.vue          | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/AutocompleteInputEditor.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/AutocompleteInputEditor.vue
index 067bb24..83934d5 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/AutocompleteInputEditor.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/AutocompleteInputEditor.vue
@@ -1,8 +1,10 @@
 <template>
-  <!-- TODO: replace with better display and x to clear out selected value -->
-  <div v-if="value">
+  <div v-if="value" class="d-flex pl-3">
     {{ text }}
-    <b-link @click="cancel">Cancel</b-link>
+    <b-link @click="cancel" class="ml-auto text-danger"
+      >Cancel
+      <i class="fa fa-times" aria-hidden="true"></i>
+    </b-link>
   </div>
   <div v-else>
     <autocomplete-text-input