forked from Open-EO/openeo-web-editor
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Open-EO:master' into master
- Loading branch information
Showing
3 changed files
with
106 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
src/components/wizards/tabs/ChooseUserDefinedProcess.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |