Skip to content
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

🚧 [WIP] Backport workflow engine 🚧 #602

Merged
merged 32 commits into from
Aug 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
bc6c05a
Add workflowengine
MorrisJobke Jul 26, 2016
6eabcf1
create an operation based on the correct model
MorrisJobke Jul 26, 2016
497954c
Move template to workflowengine app
MorrisJobke Jul 26, 2016
80eeedc
Add app to provisioning output
nickvergessen Jul 26, 2016
b2e4a8c
fix unit tests
MorrisJobke Jul 26, 2016
01ec62e
fix enabled apps tests
MorrisJobke Jul 27, 2016
155e4ce
Generate the checks list in JS
nickvergessen Jul 26, 2016
6a21289
Remove php side of check registration
nickvergessen Jul 27, 2016
34f46c8
Fix morris comments
nickvergessen Jul 27, 2016
0ebc3bb
Fix default value of operator
nickvergessen Jul 27, 2016
ec8ec17
Allow to reuse the template
nickvergessen Jul 27, 2016
2a4a127
Allow DI of the workflow manager by the OCP interface
nickvergessen Jul 27, 2016
8e0e85c
Fix loading icon for workflowengine
MorrisJobke Jul 27, 2016
f814ef6
Add L10N support
nickvergessen Jul 27, 2016
c425a67
Add workflowengine to check-code call
MorrisJobke Aug 3, 2016
df3ca56
Make sure each plugin is only added once
nickvergessen Jul 27, 2016
7b73c0f
Add the systemtag js files
nickvergessen Jul 27, 2016
7b87935
Add system tag check
nickvergessen Jul 27, 2016
627f243
Add file size as check
nickvergessen Jul 27, 2016
d146df5
Add file mime type
nickvergessen Jul 28, 2016
45c74cd
User agent check
nickvergessen Jul 28, 2016
01d269b
Add Request URL
nickvergessen Jul 28, 2016
af3eaa8
Add remote address
nickvergessen Jul 28, 2016
f1869cd
Add request time
nickvergessen Jul 28, 2016
e978c39
add a UI to render proper time picker
MorrisJobke Jul 29, 2016
66fd216
Load the timezones via select2
nickvergessen Aug 1, 2016
cc719c9
Translate the errors
nickvergessen Aug 1, 2016
c12c083
Tags need to be loaded before
nickvergessen Aug 1, 2016
7d71535
Allow to define the operation
nickvergessen Aug 2, 2016
065763f
No multi support, less magic
nickvergessen Aug 2, 2016
8d23405
Ooops
nickvergessen Aug 2, 2016
fc7bd03
Add access control and automated tagging as shipped
nickvergessen Aug 3, 2016
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
!/apps/admin_audit
!/apps/updatenotification
!/apps/theming
!/apps/workflowengine
/apps/files_external/3rdparty/irodsphp/PHPUnitTest
/apps/files_external/3rdparty/irodsphp/web
/apps/files_external/3rdparty/irodsphp/prods/test
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ install:

script:
- sh -c "if [ '$TC' = 'syntax' ]; then composer install && lib/composer/bin/parallel-lint --exclude lib/composer/jakub-onderka/ --exclude 3rdparty/symfony/polyfill-php70/Resources/stubs/ --exclude 3rdparty/patchwork/utf8/src/Patchwork/Utf8/Bootup/ --exclude 3rdparty/paragonie/random_compat/lib/ --exclude lib/composer/composer/autoload_static.php --exclude 3rdparty/composer/autoload_static.php .; fi"
- sh -c "if [ '$TC' = 'app:check-code' ]; then ./occ app:check-code admin_audit; ./occ app:check-code comments; ./occ app:check-code federation; fi"
- sh -c "if [ '$TC' = 'app:check-code' ]; then ./occ app:check-code admin_audit; ./occ app:check-code comments; ./occ app:check-code federation; ./occ app:check-code workflowengine; fi"
- sh -c "if [ '$TEST_DAV' != '1' ]; then echo \"Not testing DAV\"; fi"
- sh -c "if [ '$TEST_DAV' = '1' ]; then echo \"Testing DAV\"; fi"

Expand Down
23 changes: 23 additions & 0 deletions apps/workflowengine/appinfo/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
/**
* @copyright Copyright (c) 2016 Morris Jobke <hey@morrisjobke.de>
*
* @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/>.
*
*/

$application = new \OCA\WorkflowEngine\AppInfo\Application();
$application->registerHooksAndListeners();
90 changes: 90 additions & 0 deletions apps/workflowengine/appinfo/database.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<database>
<name>*dbname*</name>
<create>true</create>
<overwrite>false</overwrite>
<charset>utf8</charset>

<table>
<name>*dbprefix*flow_checks</name>
<declaration>
<field>
<name>id</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<autoincrement>1</autoincrement>
<length>4</length>
</field>

<field>
<name>class</name>
<type>text</type>
<notnull>true</notnull>
<length>256</length>
</field>
<field>
<name>operator</name>
<type>text</type>
<notnull>true</notnull>
<length>16</length>
</field>
<field>
<name>value</name>
<type>clob</type>
<notnull>false</notnull>
</field>
<field>
<name>hash</name>
<type>text</type>
<notnull>true</notnull>
<length>32</length>
</field>

<index>
<name>flow_unique_hash</name>
<unique>true</unique>
<field>
<name>hash</name>
</field>
</index>
</declaration>
</table>

<table>
<name>*dbprefix*flow_operations</name>
<declaration>
<field>
<name>id</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<autoincrement>1</autoincrement>
<length>4</length>
</field>

<field>
<name>class</name>
<type>text</type>
<notnull>true</notnull>
<length>256</length>
</field>
<field>
<name>name</name>
<type>text</type>
<notnull>true</notnull>
<length>256</length>
</field>
<field>
<name>checks</name>
<type>clob</type>
<notnull>false</notnull>
</field>
<field>
<name>operation</name>
<type>clob</type>
<notnull>false</notnull>
</field>
</declaration>
</table>
</database>
23 changes: 23 additions & 0 deletions apps/workflowengine/appinfo/info.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<info>
<id>workflowengine</id>
<name>Files Workflow Engine</name>
<description></description>
<licence>AGPL</licence>
<author>Morris Jobke</author>
<version>1.0.0</version>
<namespace>WorkflowEngine</namespace>

<category>other</category>
<website>https://github.com/nextcloud/server</website>
<bugs>https://github.com/nextcloud/server/issues</bugs>
<repository type="git">https://github.com/nextcloud/server.git</repository>

<types>
<filesystem/>
</types>

<dependencies>
<owncloud min-version="9.2" max-version="9.2" />
</dependencies>
</info>
30 changes: 30 additions & 0 deletions apps/workflowengine/appinfo/routes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* @copyright Copyright (c) 2016 Morris Jobke <hey@morrisjobke.de>
*
* @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/>.
*
*/

return [
'routes' => [
['name' => 'flowOperations#getOperations', 'url' => '/operations', 'verb' => 'GET'],
['name' => 'flowOperations#addOperation', 'url' => '/operations', 'verb' => 'POST'],
['name' => 'flowOperations#updateOperation', 'url' => '/operations/{id}', 'verb' => 'PUT'],
['name' => 'flowOperations#deleteOperation', 'url' => '/operations/{id}', 'verb' => 'DELETE'],
['name' => 'requestTime#getTimezones', 'url' => '/timezones', 'verb' => 'GET'],
]
];
52 changes: 52 additions & 0 deletions apps/workflowengine/css/admin.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.workflowengine .operation {
padding: 5px;
border-bottom: #eee 1px solid;
border-left: rgba(0,0,0,0) 1px solid;
}
.workflowengine .operation.modified {
border-left: rgb(255, 94, 32) 1px solid;
}
.workflowengine .operation button {
margin-bottom: 0;
}
.workflowengine .operation span.info {
padding: 7px;
color: #eee;
}
.workflowengine .rules .operation:nth-last-child(2) {
margin-bottom: 5px;
}

.workflowengine .pull-right {
float: right
}

.workflowengine .operation .msg {
border-radius: 3px;
margin: 3px 3px 3px 0;
padding: 5px;
transition: opacity .5s;
}

.workflowengine .operation .button-delete,
.workflowengine .operation .button-delete-check {
opacity: 0.5;
padding: 7px;
}
.workflowengine .operation .button-delete:hover,
.workflowengine .operation .button-delete:focus,
.workflowengine .operation .button-delete-check:hover,
.workflowengine .operation .button-delete-check:focus {
opacity: 1;
cursor: pointer;
}

.workflowengine .rules .icon-loading-small {
display: inline-block;
margin-right: 5px;
}

.workflowengine .invalid-input {
border-color: #aa0000;
}

Loading