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 2018/04/25 18:27:54 UTC
[airavata-django-portal] branch master updated: AIRAVATA-2759
RadioButtonInputEditor component
This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git
The following commit(s) were added to refs/heads/master by this push:
new 2ba9dd3 AIRAVATA-2759 RadioButtonInputEditor component
2ba9dd3 is described below
commit 2ba9dd3021819925cf2815dcd481061beeb0ad40
Author: Marcus Christie <ma...@iu.edu>
AuthorDate: Wed Apr 25 14:27:45 2018 -0400
AIRAVATA-2759 RadioButtonInputEditor component
---
.../js/components/experiment/ExperimentEditor.vue | 4 +-
.../input-editors/RadioButtonInputEditor.vue | 44 ++++++++++++++++++++++
2 files changed, 47 insertions(+), 1 deletion(-)
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/ExperimentEditor.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/ExperimentEditor.vue
index 564f562..34d29b0 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/ExperimentEditor.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/ExperimentEditor.vue
@@ -99,6 +99,7 @@
<script>
import ComputationalResourceSchedulingEditor from './ComputationalResourceSchedulingEditor.vue'
import GroupResourceProfileSelector from './GroupResourceProfileSelector.vue'
+import RadioButtonInputEditor from './input-editors/RadioButtonInputEditor.vue'
import StringInputEditor from './input-editors/StringInputEditor.vue'
import FileInputEditor from './input-editors/FileInputEditor.vue'
import TextareaInputEditor from './input-editors/TextareaInputEditor.vue'
@@ -131,8 +132,9 @@ export default {
components: {
ComputationalResourceSchedulingEditor,
GroupResourceProfileSelector,
- StringInputEditor,
FileInputEditor,
+ RadioButtonInputEditor,
+ StringInputEditor,
TextareaInputEditor,
},
mounted: function () {
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/RadioButtonInputEditor.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/RadioButtonInputEditor.vue
new file mode 100644
index 0000000..1584e8b
--- /dev/null
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/input-editors/RadioButtonInputEditor.vue
@@ -0,0 +1,44 @@
+<template>
+ <input-editor-form-group :label="experimentInput.name" :label-for="experimentInput.name"
+ :state="validationState" :feedback-messages="validationFeedback">
+ <b-form-radio-group :id="experimentInput.name" v-model="data"
+ :options="options"
+ stacked
+ :state="validationState"
+ @input="valueChanged"/>
+ </input-editor-form-group>
+</template>
+
+<script>
+import InputEditorFormGroup from './InputEditorFormGroup.vue'
+import InputEditorMixin from './InputEditorMixin'
+
+const CONFIG_OPTION_TEXT_KEY = 'text';
+const CONFIG_OPTION_VALUE_KEY = 'value';
+
+export default {
+ name: 'radio-button-input-editor',
+ mixins: [InputEditorMixin],
+ props: {
+ value: {
+ type: String,
+ required: true,
+ },
+ },
+ components: {
+ InputEditorFormGroup,
+ },
+ computed: {
+ options: function() {
+ return 'options' in this.experimentInput.editorConfig
+ ? this.experimentInput.editorConfig['options'].map(option => {
+ return {
+ text: option[CONFIG_OPTION_TEXT_KEY],
+ value: option[CONFIG_OPTION_VALUE_KEY],
+ };
+ })
+ : [];
+ }
+ }
+}
+</script>
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
machristie@apache.org.