Skip to content

Commit

Permalink
Merge pull request #243 from lara-zeus/fix-status
Browse files Browse the repository at this point in the history
add new status for thunder: open
  • Loading branch information
atmonshi authored Jan 19, 2024
2 parents fa986ba + 4f5cfdc commit fcea543
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/Contracts/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public function label(): string;
* before displaying the form, do some checks
* for example check if the $data['extensionSlug'] param is existed, or the user is logged in !
*
* @param Form $form Bolt form
* @param array $data extra data
* @param Form $form Bolt form
* @param array $data extra data
*/
public function canView(Form $form, array $data): bool | array | null;

Expand All @@ -22,8 +22,8 @@ public function canView(Form $form, array $data): bool | array | null;
*
* return a blade file with view()->render()
*
* @param Form $form Bolt form
* @param array $data extra data
* @param Form $form Bolt form
* @param array $data extra data
*/
public function render(Form $form, array $data): ?string;

Expand All @@ -38,8 +38,8 @@ public function formComponents(Form $form): ?array;
* the store logic for the app, insert ticket or any DB ONLY calls, don't send here anything,
* and you must return the saved app, if you want to depend on it in the postStore
*
* @param Form $form Bolt form
* @param array $data extra data
* @param Form $form Bolt form
* @param array $data extra data
*
* @throws \Exception
*/
Expand All @@ -48,15 +48,15 @@ public function store(Form $form, array $data): ?array;
/**
* this typically used for sending only, it will execute after the DB::transaction
*
* @param Form $form Bolt form
* @param Form $form Bolt form
*/
public function postStore(Form $form, array $data): void;

/**
* this will show any info after saving the form, like ticket num or more buttons and links
* also it's better to use blade file, view()->render()
*
* @param Form $form Bolt form
* @param Form $form Bolt form
*/
public function SubmittedRender(Form $form, array $data): ?string;
}
9 changes: 9 additions & 0 deletions src/Models/FormsStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ public function getRows(): array
'icon' => 'heroicon-o-document',
'class' => 'px-2 py-0.5 text-xs rounded-xl text-success-700 bg-success-500/10',
],
[
'key' => 'OPEN',
'label' => __('Open'),
'description' => 'used when a new form created by the user or an employee',
'color' => 'success',
'chartColor' => '#21C55D',
'icon' => 'heroicon-o-document',
'class' => 'px-2 py-0.5 text-xs rounded-xl text-success-700 bg-success-500/10',
],
[
'key' => 'CLOSE',
'label' => __('closed'),
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function statusDetails(): array

return [
'class' => $getStatues->class ?? '',
'icon' => $getStatues->icon ?? 'heroicon-o-status-online',
'icon' => $getStatues->icon ?? 'heroicon-s-document',
'label' => $getStatues->label ?? $this->status,
'key' => $getStatues->key ?? '',
'color' => $getStatues->color ?? '',
Expand Down

0 comments on commit fcea543

Please sign in to comment.