Skip to content

Commit

Permalink
Merge branch 'Open-EO:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Nov 3, 2023
2 parents 5467b60 + 893d62a commit 13e300a
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/components/modals/ImportProcessModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,11 @@ export default {
if (!Utils.isObject(data)) {
throw new Error('Process does not contain any data');
}
if (typeof data.id !== 'string' && !Utils.isObject(data.process_graph)) {
throw new Error('Process does not contain `id` or `process graph`');
if (!Utils.hasText(data.id)) {
throw new Error('Process does not contain an id');
}
if (!Utils.isObject(data.process_graph)) {
throw new Error('Process does not contain a process graph');
}
return data;
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/modals/WizardModal.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<Modal id="WizardModal" :show="show" :width="width" :title="title" @closed="$emit('closed')">
<Modal id="WizardModal" :show="show" :width="width" :title="title" :submitFunction="nextTab" @closed="$emit('closed')">
<template #default>
<div v-if="selected" class="wizard">
<div class="wizard-navigation">
Expand Down
100 changes: 100 additions & 0 deletions src/components/wizards/tabs/ChooseUserDefinedProcess.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<template>
<div class="step choose-process">
<p>Please select the user-defined process to execute:</p>
<Processes heading="" :processes="filteredProcesses" :offerDetails="false">
<template #summary="{ item }">
<div :class="{element: true, selected: item.id == value}">
<div class="summary" @click="update(item)">
<strong :title="item.id">{{ item.id }}</strong>
<small v-if="item.title" :title="item.title">{{ item.title }}</small>
</div>
<button class="button" type="button" @click="showProcess(item)" title="Show process details"><i class="fas fa-info"></i></button>
</div>
</template>
</Processes>
<hr />
<p>Alternatively, provide a URL to a user-defined process:</p>
<input type="url" name="url" class="url" :value="url" @blur="updateUrl" />
</div>
</template>

<script>
import Processes from '@openeo/vue-components/components/Processes.vue';
import Utils from '../../../utils';
import EventBusMixin from '../../EventBusMixin';
export default {
name: 'ChooseUserDefinedProcess',
mixins: [
EventBusMixin
],
components: {
Processes
},
props: {
value: {
type: String,
default: null
},
namespace: {
type: String,
default: 'user'
},
url: {
type: String,
default: null
}
},
computed: {
...Utils.mapGetters(['processes']),
filteredProcesses() {
return this.processes.namespace(this.namespace);
}
},
methods: {
...Utils.mapActions(['describeUserProcess']),
update(id) {
this.$emit('input', id);
},
updateUrl(event) {
const url = event.target.value;
if (!url) {
return;
}
else if (Utils.isUrl(url)) {
this.$emit('input', url, true);
}
else {
throw new Error('The provided URL is not valid.');
}
},
showProcess(item) {
this.broadcast('showProcess', item);
}
}
}
</script>

<style lang="scss">
.choose-process {
input.url {
width: 100%;
box-sizing: border-box;
}
.vue-component.searchable-list ul.list > li {
margin-bottom: 0;
> summary {
margin: 0;
line-height: inherit;
&:before {
content: '';
margin-left: 0;
float: none;
}
}
}
}
</style>

0 comments on commit 13e300a

Please sign in to comment.