Skip to content

Commit 00c6e21

Browse files
committed
Merge branch 'next' into develop
2 parents 319feed + acd2012 commit 00c6e21

File tree

712 files changed

+24467
-6729
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

712 files changed

+24467
-6729
lines changed

.env.example

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,7 @@ HORIZON_PREFIX=horizon:
3636
DOCKER_SHARED_MEMORY=256m
3737
PROXIES=*
3838
LOGOUT_OTHER_DEVICES=false
39-
BROWSER_CACHE=true
39+
BROWSER_CACHE=true
40+
VUE_APP_WEBSOCKET_PROVIDER=socket.io
41+
VUE_APP_WEBSOCKET_PROVIDER_URL=ws:127.0.0.1:1234
42+
VUE_APP_COLLABORATIVE_ENABLED=true

.github/workflows/deploy-pm4.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ env:
3636
GITHUB_COMMENT: ${{ secrets.GH_COMMENT }}
3737
pull_req_id: ${{github.event.pull_request.number}}
3838
BASE: ${{ contains(github.event.pull_request.body, 'ci:next') && 'ci-base-php82' || 'ci-base' }}
39+
CDATA_LICENSE_DOCUSIGN: ${{ secrets.CDATA_LICENSE_DOCUSIGN }}
40+
CDATA_LICENSE_EXCEL: ${{ secrets.CDATA_LICENSE_EXCEL }}
41+
CDATA_LICENSE_GITHUB: ${{ secrets.CDATA_LICENSE_GITHUB }}
42+
CDATA_LICENSE_SLACK: ${{ secrets.CDATA_LICENSE_SLACK }}
3943
concurrency:
4044
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
4145
cancel-in-progress: true
@@ -69,9 +73,9 @@ jobs:
6973
if: contains(github.event.pull_request.body, 'ci:build-base') || github.event_name == 'schedule'
7074
run: |
7175
cd pm4-stm-docker
72-
docker-compose build --no-cache base
76+
docker-compose build --no-cache base-php82
7377
docker-compose build --no-cache cache
74-
docker push ${REPOSITORY}:ci-base
78+
docker push ${REPOSITORY}:ci-base-php82
7579
docker push ${REPOSITORY}:ci-cache
7680
- name: Build and Push the image to ECR
7781
run: |
@@ -206,4 +210,3 @@ jobs:
206210
cd pm4-stm-docker/deploy-stm
207211
composer install --no-dev
208212
php run-delete-instance.php
209-

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,6 @@ cypress/downloads
4242
.php-cs-fixer.cache
4343
.phpunit.result.cache
4444
.editorconfig
45+
resources/lang/de
46+
resources/lang/es
47+
resources/lang/fr

ProcessMaker/Console/Commands/BuildScriptExecutors.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ public function buildExecutor()
110110
$success = $this->associateWithExistingImage($scriptExecutor);
111111
if ($success) {
112112
$this->info('Docker Image Associated');
113+
113114
// we associated with an existing image, no need to build
114115
return;
115116
} else {
@@ -141,7 +142,7 @@ public function buildExecutor()
141142
$cmd .= ' --user-id=' . $this->userId;
142143
}
143144
$this->artisan($cmd);
144-
$this->info("SDK is at ${sdkDir}");
145+
$this->info("SDK is at {$sdkDir}");
145146
}
146147

147148
$dockerfile = ScriptExecutor::initDockerfile($lang) . "\n" . $scriptExecutor->config;
@@ -152,7 +153,7 @@ public function buildExecutor()
152153
$this->info('Building the docker executor');
153154

154155
$image = $scriptExecutor->dockerImageName();
155-
$command = Docker::command() . " build --build-arg SDK_DIR=/sdk -t ${image} -f ${packagePath}/Dockerfile.custom ${packagePath}";
156+
$command = Docker::command() . " build --build-arg SDK_DIR=/sdk -t {$image} -f {$packagePath}/Dockerfile.custom {$packagePath}";
156157

157158
if ($this->userId) {
158159
$this->runProc(
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
3+
namespace ProcessMaker\Console\Commands;
4+
5+
use Illuminate\Console\Command;
6+
use Illuminate\Support\Facades\Storage;
7+
8+
class ProcessMakerLicenseRemove extends Command
9+
{
10+
/**
11+
* The name and signature of the console command.
12+
*
13+
* @var string
14+
*/
15+
protected $signature = 'processmaker:license-remove';
16+
17+
/**
18+
* The console command description.
19+
*
20+
* @var string
21+
*/
22+
protected $description = 'Remove the license.json file from the system';
23+
24+
/**
25+
* Execute the console command.
26+
*
27+
* @return int
28+
*/
29+
/**
30+
* Execute the console command.
31+
*
32+
* @return int
33+
*/
34+
public function handle()
35+
{
36+
if (Storage::disk('local')->exists('license.json')) {
37+
if ($this->confirm('Are you sure you want to remove the license.json file?')) {
38+
Storage::disk('local')->delete('license.json');
39+
$this->info('license.json removed successfully!');
40+
} else {
41+
$this->info('Operation cancelled. license.json was not removed.');
42+
}
43+
} else {
44+
$this->error('license.json does not exist on the local disk.');
45+
}
46+
47+
return 0;
48+
}
49+
}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?php
2+
3+
namespace ProcessMaker\Console\Commands;
4+
5+
use Carbon\Carbon;
6+
use Exception;
7+
use Illuminate\Console\Command;
8+
use Illuminate\Support\Facades\Artisan;
9+
use Illuminate\Support\Facades\Http;
10+
use Illuminate\Support\Facades\Storage;
11+
12+
class ProcessMakerLicenseUpdate extends Command
13+
{
14+
/**
15+
* The name and signature of the console command.
16+
*
17+
* @var string
18+
*/
19+
protected $signature = 'processmaker:license-update {licenseFile}';
20+
21+
/**
22+
* The console command description.
23+
*
24+
* @var string
25+
*/
26+
protected $description = 'Update the license from a given URL or local path and store it in local disk';
27+
28+
/**
29+
* Execute the console command.
30+
*
31+
* @return int
32+
*/
33+
public function handle()
34+
{
35+
$input = $this->argument('licenseFile');
36+
37+
try {
38+
$content = file_get_contents($input);
39+
if (!$this->isValidLicenseContent($content)) {
40+
return 1;
41+
}
42+
43+
Storage::disk('local')->put('license.json', $content);
44+
45+
Artisan::call('package:discover');
46+
$this->info('License updated successfully');
47+
} catch (Exception $e) {
48+
$this->error('An error occurred: ' . $e->getMessage());
49+
}
50+
51+
return 0;
52+
}
53+
54+
/**
55+
* Validates the license content.
56+
*
57+
* @param string $content
58+
* @return bool
59+
*/
60+
protected function isValidLicenseContent(string $content): bool
61+
{
62+
$data = json_decode($content, true);
63+
64+
if (json_last_error() !== JSON_ERROR_NONE) {
65+
$this->error('The provided license does not have a valid format.');
66+
67+
return false;
68+
}
69+
70+
if (!isset($data['expires_at']) || !is_string($data['expires_at'])) {
71+
$this->error('The provided license does not have a valid "expires_at" property.');
72+
73+
return false;
74+
}
75+
76+
try {
77+
Carbon::parse($data['expires_at']);
78+
} catch (Exception $e) {
79+
$this->error('The "expires_at" property is not a valid date.');
80+
return false;
81+
}
82+
83+
if (!isset($data['packages']) || !is_array($data['packages'])) {
84+
$this->error('The provided license does not have a valid "packages" property.');
85+
86+
return false;
87+
}
88+
89+
return true;
90+
}
91+
}

ProcessMaker/Console/Commands/ProcessMakerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ private function checkMigrationStatus()
9999
private function testHorizonService()
100100
{
101101
$testDispatchNow = 'Test immediate Jobs';
102-
TestStatusJob::dispatchNow($testDispatchNow);
102+
TestStatusJob::dispatchSync($testDispatchNow);
103103
$this->waitTestPassed($testDispatchNow, 5);
104104

105105
$testDelayedWorkers = 'Test dispatch Jobs';

ProcessMaker/Console/Commands/SyncDefaultTemplates.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function handle()
4343
$randomDelay = random_int(10, 120);
4444
Job::dispatch()->delay(now()->addMinutes($randomDelay));
4545
} else {
46-
Job::dispatchNow();
46+
Job::dispatchSync();
4747
}
4848

4949
return 0;

ProcessMaker/Contracts/WorkflowManagerInterface.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,19 @@ public function existsServiceImplementation($implementation);
178178
/**
179179
* Run the service task implementation
180180
* @param string $implementation
181-
* @param array $dat
181+
* @param array $data
182182
* @param array $config
183183
* @param string $tokenId
184184
*
185185
* @return mixed
186186
*/
187187
public function runServiceImplementation($implementation, array $data, array $config, $tokenId = '');
188+
189+
/**
190+
* Get the service task class implementation
191+
*
192+
* @param string $implementation
193+
* @return string
194+
*/
195+
public function getServiceClassImplementation($implementation);
188196
}

ProcessMaker/Enums/ExporterMap.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace ProcessMaker\Enums;
4+
5+
enum ExporterMap
6+
{
7+
const TYPES = [
8+
'screen' => [\ProcessMaker\Models\Screen::class, \ProcessMaker\ImportExport\Exporters\ScreenExporter::class],
9+
'process' => [\ProcessMaker\Models\Process::class, \ProcessMaker\ImportExport\Exporters\ProcessExporter::class],
10+
'script' => [\ProcessMaker\Models\Script::class, \ProcessMaker\ImportExport\Exporters\ScriptExporter::class],
11+
'process_templates' => [\ProcessMaker\Models\ProcessTemplates::class, \ProcessMaker\ImportExport\Exporters\TemplateExporter::class],
12+
'data_source' => [\ProcessMaker\Packages\Connectors\DataSources\Models\DataSource::class, \ProcessMaker\Packages\Connectors\DataSources\ImportExport\DataSourceExporter::class],
13+
'decision_table' => [\ProcessMaker\Package\PackageDecisionEngine\Models\DecisionTable::class, \ProcessMaker\Package\PackageDecisionEngine\ImportExport\DecisionTableExporter::class],
14+
];
15+
16+
public static function getModelClass(string $type): ?string
17+
{
18+
return self::TYPES[$type][0] ?? null;
19+
}
20+
21+
public static function getExporterClass(string $type): ?string
22+
{
23+
return self::TYPES[$type][1] ?? null;
24+
}
25+
}

0 commit comments

Comments
 (0)