Open the matching workspace tab after specialty stage advance.
Deploy Ladill Care / deploy (push) Successful in 45s
Deploy Ladill Care / deploy (push) Successful in 45s
Stage Move CTAs and pills previously always redirected to overview; map each stage to its tab via shell config so examination lands on exam, etc. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -226,6 +226,30 @@ class SpecialtyShellService
|
||||
return $merged;
|
||||
}
|
||||
|
||||
/**
|
||||
* Workspace tab to open after advancing/setting a visit specialty stage.
|
||||
* Uses module `stage_tabs` config, then same-named tab, then overview.
|
||||
*/
|
||||
public function workspaceTabForStage(string $moduleKey, string $stage): string
|
||||
{
|
||||
$stage = trim($stage);
|
||||
$tabs = $this->workspaceTabs($moduleKey);
|
||||
$map = $this->definition($moduleKey)['stage_tabs'] ?? [];
|
||||
|
||||
if (is_array($map) && isset($map[$stage]) && is_string($map[$stage]) && $map[$stage] !== '') {
|
||||
$candidate = $map[$stage];
|
||||
if (array_key_exists($candidate, $tabs)) {
|
||||
return $candidate;
|
||||
}
|
||||
}
|
||||
|
||||
if ($stage !== '' && array_key_exists($stage, $tabs)) {
|
||||
return $stage;
|
||||
}
|
||||
|
||||
return array_key_exists('overview', $tabs) ? 'overview' : (array_key_first($tabs) ?: 'overview');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user