-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Workflow frontend overhaul #16706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Workflow frontend overhaul #16706
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
ad976c6
Unified workflow management
juliusknorr e7e9166
Add endpoint to test operations before submitting
juliusknorr aed630a
Adjust template id
juliusknorr 9f8ccf1
Use entity/event definitions from backend
juliusknorr 0f84696
Styling fixes
juliusknorr aa00f40
Adjust to new backend URLs
juliusknorr bd281da
Move to vuex store
juliusknorr af3cb9c
Use trigger hint
juliusknorr b3bafb1
Add missing files
juliusknorr f36b50c
Migrate plugins to vuex store
juliusknorr ae55829
Document plugins to be used by integrators
juliusknorr 28a7721
Handle operator registration properly
juliusknorr 69ac169
Do not use shot tag
juliusknorr 1742f97
Allow placeholder and validation without custom vue component
juliusknorr 11d6486
Migrate check plugins
juliusknorr 2364fc8
Make rule listing more compact
juliusknorr c665d54
Fix removing checks
juliusknorr d6b3af9
Load checks from the backend
juliusknorr 98666a9
Move over checker plugins
juliusknorr 0b67062
Add moment-timezone
juliusknorr 24aec9b
Frontend polishing
juliusknorr e17a666
Implement custom check components and fix linting
juliusknorr 335d7cf
Add tag selector
juliusknorr 370242c
Add request url selector
juliusknorr 99e1063
Add user group selector
juliusknorr 9e00788
Add nextcloud-router
juliusknorr 7683208
Workflow vue cleanup
juliusknorr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Move over checker plugins
Signed-off-by: Julius Härtl <[email protected]>
- Loading branch information
commit 98666a9f4d79a1d2bb8e9be318946e99bdcaa8b8
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
68 changes: 68 additions & 0 deletions
68
apps/workflowengine/src/components/Checks/FileSystemTag.vue
This file contains hidden or 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,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> |
This file contains hidden or 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,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
122
apps/workflowengine/src/components/Checks/RequestUserAgent.vue
This file contains hidden or 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,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> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.