Skip to content

Commit

Permalink
fix(Field): hide action buttons on update/detail/creation views by de…
Browse files Browse the repository at this point in the history
…fault, #2
  • Loading branch information
pavloniym authored Mar 7, 2023
1 parent fef44f0 commit a0a9897
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/ActionButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,29 @@ class ActionButton extends Field
*/
public $component = 'action-button';


/**
* Indicates if the element should be shown on the update view.
*
* @var bool
*/
public $showOnUpdate = false;


/**
* Indicates if the element should be shown on the detail view.
*
* @var bool
*/
public $showOnDetail = false;


/**
* Indicates if the element should be shown on the creation view.
*
* @var bool
*/
public $showOnCreation = false;

/**
* @param Action $action
Expand Down
25 changes: 25 additions & 0 deletions src/ActionButtons.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class ActionButtons extends Field
*/
public $component = 'action-buttons';


/**
* The text alignment for the field's text in tables.
*
Expand All @@ -21,6 +22,30 @@ class ActionButtons extends Field
public $textAlign = 'center';


/**
* Indicates if the element should be shown on the update view.
*
* @var bool
*/
public $showOnUpdate = false;


/**
* Indicates if the element should be shown on the detail view.
*
* @var bool
*/
public $showOnDetail = false;


/**
* Indicates if the element should be shown on the creation view.
*
* @var bool
*/
public $showOnCreation = false;


/**
* @param array<ActionButton> $collection
* @return $this
Expand Down

0 comments on commit a0a9897

Please sign in to comment.