Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix(sq): fix code smell
  • Loading branch information
devmiguelangel committed May 24, 2024
commit b438c67277a28bf3b9141e72b853cb47954c8138
52 changes: 28 additions & 24 deletions ProcessMaker/Models/ProcessRequestToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -1170,30 +1170,34 @@ public function getElementDestinationAttribute(): ?string
$elementDestinationType = $definition['elementDestinationType'] ?? null;
$elementDestination = null;

if ($elementDestinationType) {
switch ($elementDestinationType) {
case 'customDashboard':
case 'externalURL':
$elementDestination = $definition['elementDestinationURL'] ?? null;
break;
case 'taskList':
$elementDestination = route('tasks.index');
break;
case 'homepageDashboard':
if (hasPackage('package-dynamic-ui')) {
$user = auth()->user();
$elementDestination = \ProcessMaker\Package\PackageDynamicUI\Models\DynamicUI::getHomePage($user);
} else {
$elementDestination = route('home');
}
break;
case 'processLaunchpad':
$elementDestination = route('process.browser.index', ['process' => $this->process_id, 'categorySelected' => -1]);
break;
case 'taskSource':
$elementDestination = $elementDestinationType;
break;
}
switch ($elementDestinationType) {
Comment thread
devmiguelangel marked this conversation as resolved.
Resolved
case 'customDashboard':
case 'externalURL':
$elementDestination = $definition['elementDestinationURL'] ?? null;
break;
case 'taskList':
$elementDestination = route('tasks.index');
break;
case 'homepageDashboard':
if (hasPackage('package-dynamic-ui')) {
Comment thread
devmiguelangel marked this conversation as resolved.
Resolved
$user = auth()->user();
$elementDestination = \ProcessMaker\Package\PackageDynamicUI\Models\DynamicUI::getHomePage($user);
} else {
$elementDestination = route('home');
}
break;
case 'processLaunchpad':
$elementDestination = route('process.browser.index', [
'process' => $this->process_id,
'categorySelected' => -1
]);
break;
case 'taskSource':
$elementDestination = $elementDestinationType;
break;
default:
$elementDestination = null;
break;
}

return $elementDestination;
Expand Down