Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ad976c6
Unified workflow management
juliusknorr Aug 6, 2019
e7e9166
Add endpoint to test operations before submitting
juliusknorr Aug 9, 2019
aed630a
Adjust template id
juliusknorr Aug 19, 2019
9f8ccf1
Use entity/event definitions from backend
juliusknorr Aug 19, 2019
0f84696
Styling fixes
juliusknorr Aug 19, 2019
aa00f40
Adjust to new backend URLs
juliusknorr Aug 28, 2019
bd281da
Move to vuex store
juliusknorr Aug 29, 2019
af3cb9c
Use trigger hint
juliusknorr Aug 29, 2019
b3bafb1
Add missing files
juliusknorr Aug 30, 2019
f36b50c
Migrate plugins to vuex store
juliusknorr Aug 30, 2019
ae55829
Document plugins to be used by integrators
juliusknorr Aug 30, 2019
28a7721
Handle operator registration properly
juliusknorr Aug 31, 2019
69ac169
Do not use shot tag
juliusknorr Aug 31, 2019
1742f97
Allow placeholder and validation without custom vue component
juliusknorr Sep 2, 2019
11d6486
Migrate check plugins
juliusknorr Sep 2, 2019
2364fc8
Make rule listing more compact
juliusknorr Sep 2, 2019
c665d54
Fix removing checks
juliusknorr Sep 2, 2019
d6b3af9
Load checks from the backend
juliusknorr Sep 6, 2019
98666a9
Move over checker plugins
juliusknorr Sep 6, 2019
0b67062
Add moment-timezone
juliusknorr Sep 6, 2019
24aec9b
Frontend polishing
juliusknorr Sep 9, 2019
e17a666
Implement custom check components and fix linting
juliusknorr Sep 9, 2019
335d7cf
Add tag selector
juliusknorr Sep 9, 2019
370242c
Add request url selector
juliusknorr Sep 9, 2019
99e1063
Add user group selector
juliusknorr Sep 9, 2019
9e00788
Add nextcloud-router
juliusknorr Sep 9, 2019
7683208
Workflow vue cleanup
juliusknorr Sep 10, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move over checker plugins
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Sep 10, 2019
commit 98666a9f4d79a1d2bb8e9be318946e99bdcaa8b8
5 changes: 3 additions & 2 deletions apps/workflowengine/src/components/Check.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
</template>

<script>
import { Multiselect, Actions, ActionButton } from 'nextcloud-vue'
import { Multiselect } from 'nextcloud-vue/dist/Components/Multiselect'
import { Actions } from 'nextcloud-vue/dist/Components/Actions'
import { ActionButton } from 'nextcloud-vue/dist/Components/ActionButton'
import ClickOutside from 'vue-click-outside'
import { mapState } from 'vuex'

export default {
name: 'Check',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<template>
<div>

<multiselect
:value="currentValue"
placeholder="Select a file type"
placeholder="Select a user agent"
label="label"
track-by="pattern"
:options="options" :multiple="false" :tagging="false" @input="setValue">
Expand All @@ -21,7 +20,7 @@
</template>

<script>
import { Multiselect } from 'nextcloud-vue'
import { Multiselect } from 'nextcloud-vue/dist/Components/Multiselect'

export default {
name: 'FileMimeType',
Expand Down
68 changes: 68 additions & 0 deletions apps/workflowengine/src/components/Checks/FileSystemTag.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<!--
- @copyright Copyright (c) 2019 Julius Härtl <[email protected]>
-
- @author Julius Härtl <[email protected]>
-
- @license GNU AGPL version 3 or any later version
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-->

<template>
<MultiselectTag v-model="newValue" :multiple="false" type="text" placeholder="1 MB"
@input="update"/>
</template>

<script>
import { MultiselectTag } from 'nextcloud-vue'

export default {
name: 'SizeValue',
components: {
MultiselectTag
},
props: {
value: {
type: String,
default: ''
}
},
data() {
return {
valid: false,
newValue: this.value
}
},
watch: {
value() {
this.newValue = this.value
}
},
methods: {
update() {
if (this.validate()) {
this.$emit('input', this.newValue)
this.valid = false
} else {
this.valid = false
}
}
}
}
</script>

<style scoped>

</style>
94 changes: 94 additions & 0 deletions apps/workflowengine/src/components/Checks/RequestTime.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<template>
<div class="timeslot">
<multiselect v-model="newValue.timezone" :options="timezones"></multiselect>
<input type="text" class="timeslot--start" v-model="newValue.startTime" placeholder="08:00" @input="update"/>
<input type="text" v-model="newValue.endTime" placeholder="18:00" @input="update"/>
</div>
</template>

<script>
import { Multiselect } from 'nextcloud-vue/dist/Components/Multiselect'
import moment from 'moment-timezone'

const zones = moment.tz.names()
export default {
name: 'RequestTime',
components: {
Multiselect
},
props: {
value: {
type: String,
default: '1 MB'
}
},
data() {
return {
valid: false,
newValue: {
startTime: null,
endTime: null,
timezone: moment.tz.guess()
},
}
},
computed: {
timezones() {
return zones
}
},
watch: {
'value': function(value) {
var data = JSON.parse(value)
var startTime = data[0].split(' ', 2)[0]
var endTime = data[1].split(' ', 2)[0]
var timezone = data[0].split(' ', 2)[1]
this.newValue = {
startTime: startTime,
endTime: endTime,
timezone: timezone
}
}
},
methods: {
validate() {
return this.newValue.startTime && this.newValue.startTime.match(/^(0[0-9]|1[0-9]|2[0-3]|[0-9]):[0-5][0-9]$/i) !== null &&
this.newValue.endTime && this.newValue.endTime.match(/^(0[0-9]|1[0-9]|2[0-3]|[0-9]):[0-5][0-9]$/i) !== null &&
moment.tz.zone(this.newValue.timezone) !== null
},
update() {
if (this.validate()) {
const output = `["${this.newValue.startTime} ${this.newValue.timezone}","${this.newValue.endTime} ${this.newValue.timezone}"]`
this.$emit('input', output)
this.valid = true
} else {
this.valid = false
}
}
}
}
</script>

<style scoped lang="scss">
.timeslot {
display: flex;
flex-grow: 1;
flex-wrap: wrap;
max-width: 200px;

.multiselect {
width: 100%;
margin-bottom: 5px;
}

input[type=text] {
width: 50%;
margin: 0;
margin-bottom: 5px;
&.timeslot--start {
margin-right: 5px;
width: calc(50% - 5px);
}
}
}
</style>
122 changes: 122 additions & 0 deletions apps/workflowengine/src/components/Checks/RequestUserAgent.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<!--
- @copyright Copyright (c) 2019 Julius Härtl <[email protected]>
-
- @author Julius Härtl <[email protected]>
-
- @license GNU AGPL version 3 or any later version
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-->

<template>
<div>

<multiselect
:value="currentValue"
placeholder="Select a file type"
label="label"
track-by="pattern"
group-values="children",
group-label="text",
:options="options" :multiple="false" :tagging="false" @input="setValue">
<template slot="singleLabel" slot-scope="props">
<span class="option__icon" :class="props.option.icon"></span>
<span class="option__title option__title_single">{{ props.option.label }}</span>
</template>
<template slot="option" slot-scope="props">
<span class="option__icon" :class="props.option.icon"></span>
<span class="option__title">{{ props.option.label }}</span>
</template>
</multiselect>
<input type="text" :value="currentValue.pattern" @input="updateCustom"/>
</div>
</template>

<script>
import { Multiselect } from 'nextcloud-vue/dist/Components/Multiselect'

export default {
name: 'UserAgent',
components: {
Multiselect
},
data() {
return {
value: '',
predefinedTypes: [
{
text: t('workflowengine', 'Sync clients'),
children: [
{ id: 'android', text: t('workflowengine', 'Android client') },
{ id: 'ios', text: t('workflowengine', 'iOS client') },
{ id: 'desktop', text: t('workflowengine', 'Desktop client') },
{ id: 'mail', text: t('workflowengine', 'Thunderbird & Outlook addons') }
]
}
]
}
},
computed: {
options() {
return [...this.predefinedTypes, this.customValue]
},
customValue() {
const matchingPredefined = this.predefinedTypes.find((type) => this.value.pattern === type.pattern)
return {
icon: 'icon-settings-dark',
label: t('workflowengine', 'Custom pattern'),
pattern: '',
}
},
currentValue() {
const matchingPredefined = this.predefinedTypes.find((type) => this.value === type.pattern)
if (matchingPredefined) {
return matchingPredefined
}
return {
icon: 'icon-settings-dark',
label: t('workflowengine', 'Custom pattern'),
pattern: this.value,
}
}
},
methods: {
validateRegex(string) {
var regexRegex = /^\/(.*)\/([gui]{0,3})$/
var result = regexRegex.exec(string)
return result !== null
},
setValue (value) {
// TODO: check if value requires a regex and set the check operator according to that
if (value !== null) {
this.value = value.pattern
}
},
updateCustom (event) {
console.log(event)
this.value = event.target.value
}
}
}
</script>

<style scoped>
.multiselect::v-deep .multiselect__single {
display: flex;
}
input, .multiselect {
width: 100%;
}
</style>
Loading