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

Vite 🚀 #5155

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .browserlistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
> 0.25%
not dead
4 changes: 2 additions & 2 deletions .github/workflows/deploy-pm4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
echo "CACHEBUSTER="$(date +%s) >> $GITHUB_ENV
- name: Clone Repo STM
run: |
git clone --depth 1 -b cicd "https://[email protected]/ProcessMaker/pm4-stm-docker.git" pm4-stm-docker
git clone --depth 1 -b vite "https://[email protected]/ProcessMaker/pm4-stm-docker.git" pm4-stm-docker
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
echo "STM_TOKEN=${{env.STM_TOKEN}}" >> $GITHUB_ENV
- name: Clone Repo STM
run: |
git clone --depth 1 -b cicd "https://[email protected]/ProcessMaker/pm4-stm-docker.git" pm4-stm-docker
git clone --depth 1 -b vite "https://[email protected]/ProcessMaker/pm4-stm-docker.git" pm4-stm-docker
cd pm4-stm-docker
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down
5 changes: 4 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
engine-strict=true
engine-strict=true
shamefully-hoist=true
auto-install-peers=true
shamefully-hoist=true
2 changes: 1 addition & 1 deletion ProcessMaker/Http/Controllers/Api/BookmarkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function store(Request $request, Process $process)
try {
$bookmark->updateOrCreate([
'process_id' => $process->id,
'user_id' => Auth::user()->id
'user_id' => Auth::user()->id,
]);
} catch (\Exception $e) {
return response()->json(['error' => $e->getMessage()], 400);
Expand Down
1 change: 1 addition & 0 deletions ProcessMaker/Http/Controllers/Api/ProcessController.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class ProcessController extends Controller
'bpmn',
'svg',
];

public $doNotSanitizeMustache = [
'case_title',
];
Expand Down
1 change: 0 additions & 1 deletion ProcessMaker/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ public function login(Request $request, User $user)
// the IP address of the client making these requests into this application.
if (method_exists($this, 'hasTooManyLoginAttempts') &&
$this->hasTooManyLoginAttempts($request)) {

// Block the user
$user->status = 'BLOCKED';
$user->save();
Expand Down
2 changes: 1 addition & 1 deletion ProcessMaker/Http/Controllers/RequestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function show(ProcessRequest $request, Media $mediaItems)
->orderBy('id')->first();

return redirect(route('tasks.edit', [
'task' => $active ? $active->getKey() : $startEvent->getKey()
'task' => $active ? $active->getKey() : $startEvent->getKey(),
]));
}
}
Expand Down
1 change: 1 addition & 0 deletions ProcessMaker/Http/Middleware/SanitizeInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class SanitizeInput extends TransformsRequest
public $except = [
//
];

public $allowExpressions = [];

/**
Expand Down
1 change: 1 addition & 0 deletions ProcessMaker/Managers/ScreenBuilderManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public function addPackageScripts($type = 'DISPLAY')
$installed = app(PackageManifest::class)->list();
$directories = array_values(array_filter($directories, function ($directory) use ($installed) {
$package = 'processmaker/' . basename($directory);

return in_array($package, $installed);
}));
foreach ($directories as $directory) {
Expand Down
2 changes: 2 additions & 0 deletions ProcessMaker/Models/ProcessRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -934,12 +934,14 @@ public function evaluateCaseTitle(array $data): string
$mustacheTitle = $this->process()->select('case_title')->first()->case_title;
}
$mustache = new MustacheExpressionEvaluator();

return $mustache->render($mustacheTitle, $data);
}

public function isSystem()
{
$systemCategories = ProcessCategory::where('is_system', true)->pluck('id');

return DB::table('category_assignments')
->where('assignable_type', Process::class)
->where('assignable_id', $this->process_id)
Expand Down
3 changes: 2 additions & 1 deletion ProcessMaker/Nayra/Managers/WorkflowManagerDefault.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public function throwSignalEventDefinition(EventDefinitionInterface $sourceEvent
/**
* Retrieves IDs of all instances collaborating with the given instance.
*
* This function compiles a list of IDs from execution instances associated
* This function compiles a list of IDs from execution instances associated
* with the same process as the input instance, including the instance itself.
*
* @param ProcessRequest $instance The instance to find collaborators for.
Expand All @@ -285,6 +285,7 @@ protected function getCollaboratingInstanceIds($instance)
foreach ($instances as $instance) {
$ids[] = $instance->getId();
}

return $ids;
}

Expand Down
1 change: 1 addition & 0 deletions ProcessMaker/Nayra/Managers/WorkflowManagerRabbitMq.php
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ protected function getCollaboratingInstanceIds($instance)
where('process_collaboration_id', $instance->process_collaboration_id)
->pluck('id')
->toArray();

return $ids;
}

Expand Down
2 changes: 2 additions & 0 deletions ProcessMaker/Nayra/Repositories/PersistenceTokenTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,13 @@ public function persistGatewayTokenPassed(array $transaction)
$gateway = $this->deserializer->unserializeEntity($transaction['gateway']);
if (!is_numeric($transaction['transition'])) {
Log::info('Invalid transition id for gateway token passed. ' . json_encode($transaction));

return;
}
$transition = $gateway->getTransitions()[$transaction['transition']] ?? null;
if (empty($transition)) {
Log::info('Invalid transition for gateway token passed. ' . json_encode($transaction));

return;
}
$tokens = $this->deserializer->unserializeTokensCollection($transaction['tokens']);
Expand Down
2 changes: 1 addition & 1 deletion ProcessMaker/Observers/ProcessRequestObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function created(ProcessRequest $request)
->select('case_number')
->first()
->case_number;

$request->save();

return;
Expand Down
2 changes: 1 addition & 1 deletion ProcessMaker/SanitizeHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ private static function getRichTextElements($items, $parent = null)
$elements = array_merge($elements, self::getRichTextElements($item['items'], ($parent ? $parent . '.' . $item['config']['name'] : $item['config']['name'])));
} elseif (isset($item['component']) && $item['component'] === 'FormTextArea' && isset($item['config']['richtext']) && $item['config']['richtext'] === true) {
$elements[] = ($parent ? $parent . '.' . $item['config']['name'] : $item['config']['name']);
// Inside a table ..
// Inside a table ..
} elseif ($item['component'] == 'FormMultiColumn') {
foreach ($item['items'] as $cell) {
if (
Expand Down
6 changes: 3 additions & 3 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"plugins": ["istanbul"],
"presets": ["@babel/preset-env"]
}
"presets": ["@babel/preset-env"],
"plugins": ["@babel/plugin-transform-runtime", "istanbul"]
}
4 changes: 2 additions & 2 deletions bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
use Illuminate\Contracts\Console\Kernel as ConsoleKernelContract;
use Illuminate\Contracts\Debug\ExceptionHandler;
use Illuminate\Contracts\Http\Kernel as HttpKernelContract;
use Monolog\Formatter\LineFormatter;
use Monolog\Handler\RotatingFileHandler;
use ProcessMaker\Application;
use ProcessMaker\Console\Kernel as ConsoleKernel;
use ProcessMaker\Exception\Handler;
use ProcessMaker\Http\Kernel as HttpKernel;
use Monolog\Formatter\LineFormatter;
use Monolog\Handler\RotatingFileHandler;

/*
|--------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions bootstrap/autoload.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

// Bring in our composer autoloader
require __DIR__ . '/../vendor/autoload.php';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
return new class extends Migration {
/**
* Run the migrations.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
return new class extends Migration {
/**
* Run the migrations.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
return new class extends Migration {
/**
* Run the migrations.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
return new class extends Migration {
/**
* Run the migrations.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
return new class extends Migration {
/**
* Run the migrations.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
return new class extends Migration {
/**
* Run the migrations.
*/
Expand Down
Loading
Loading