Skip to content

Commit

Permalink
Fix command locales
Browse files Browse the repository at this point in the history
  • Loading branch information
aguingand committed Dec 9, 2024
1 parent b585668 commit ab2f4f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/EntityList/Commands/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Code16\Sharp\Utils\Fields\FieldsContainer;
use Code16\Sharp\Utils\Fields\HandleFormFields;
use Code16\Sharp\Utils\SharpNotification;
use Code16\Sharp\Utils\Traits\HandleLocalizedFields;
use Code16\Sharp\Utils\Traits\HandlePageAlertMessage;
use Code16\Sharp\Utils\Traits\HandleValidation;
use Code16\Sharp\Utils\Transformers\WithCustomTransformers;
Expand All @@ -20,6 +21,7 @@ abstract class Command
use HandleValidation;
use HasModalFormLayout;
use WithCustomTransformers;
use HandleLocalizedFields;

protected int $groupIndex = 0;
protected ?string $commandKey = null;
Expand Down
8 changes: 3 additions & 5 deletions src/Http/Controllers/Api/Commands/HandlesCommandForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ protected function getCommandForm(InstanceCommand|EntityCommand|DashboardCommand
return [];
}

$locales = $commandHandler->getDataLocalizations();

return [
'fields' => $formFields,
'layout' => $commandHandler->formLayout(),
Expand All @@ -26,9 +24,9 @@ protected function getCommandForm(InstanceCommand|EntityCommand|DashboardCommand
'description' => $commandHandler->getFormModalDescription($formData) ?? $commandHandler->getDescription(),
'buttonLabel' => $commandHandler->getFormModalButtonLabel(),
],
...$locales ? [
'locales' => $locales,
] : [],
'locales' => $commandHandler->hasDataLocalizations()
? $commandHandler->getDataLocalizations()
: null,
];
}
}

0 comments on commit ab2f4f5

Please sign in to comment.