Skip to content

Commit

Permalink
Add single setConfigurableArea (#1706)
Browse files Browse the repository at this point in the history
* Add setConfigurableArea

* Update Workflows

---------

Co-authored-by: lrljoe <lrljoe@users.noreply.github.com>
  • Loading branch information
lrljoe and lrljoe authored Apr 30, 2024
1 parent 020fec4 commit 037ed12
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 97 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/run-tests-pcov-pull.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: run-tests-pcov-pull

on: [pull_request]
on:
pull_request:
branches:
- 'develop'
- 'master'

jobs:
test:
Expand Down Expand Up @@ -41,6 +45,13 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Cache extensions
uses: actions/cache@v3
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

Expand Down
92 changes: 0 additions & 92 deletions .github/workflows/run-tests-pcov.yml

This file was deleted.

11 changes: 9 additions & 2 deletions .github/workflows/run-tests-pull.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: run-tests-pull

on: [pull_request]
on:
pull_request:
branches:
- 'develop'
- 'master'

jobs:
test:
Expand All @@ -10,8 +14,11 @@ jobs:
matrix:
os: [ubuntu-latest]
php: [8.1, 8.2, 8.3]
laravel: [10]
laravel: [10.*,11.*]
stability: [prefer-dist]
exclude:
- laravel: 11.*
php: 8.1

name: STD-PULL - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }}
env:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ jobs:
matrix:
os: [ubuntu-latest]
php: [8.1, 8.2, 8.3]
laravel: [10]
laravel: [10.*,11.*]
stability: [prefer-dist]
exclude:
- laravel: 11.*
php: 8.1

name: STD-PUSH - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }}
env:
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to `laravel-livewire-tables` will be documented in this file

## UNRELEASED
### New Features
- Add setConfigurableArea by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1706

### Tweaks
- Adjust Workflow behaviour for PCOV by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1706

## [v3.2.4] - 2024-03-01
### Bug Fixes
- Collapsing Columns fix when multiple tables are displayed on a page by @lrljoe
Expand Down
13 changes: 12 additions & 1 deletion docs/datatable/configurable-areas.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,20 @@ There are certain areas of the datatable as of `v2.3` where you can include your

## Available Methods

### setConfigurableArea

You can use the `setConfigurableArea` method to set an area that you want to configure.

```php
public function configure(): void
{
$this->setConfigurableArea('before-tools', 'path.to.my.view');
}
```

### setConfigurableAreas

You can use the `setConfigurableAreas` method to set the areas that you want to be configurable.
You can use the `setConfigurableAreas` method to set multiple areas that you want to configure.

```php
public function configure(): void
Expand Down
9 changes: 9 additions & 0 deletions src/Traits/Configuration/ConfigurableAreasConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ public function setConfigurableAreas(array $areas): self
return $this;
}

public function setConfigurableArea(string $configurableArea, mixed $config): self
{
if (array_key_exists($configurableArea, $this->configurableAreas)) {
$this->configurableAreas[$configurableArea] = $config;
}

return $this;
}

public function setHideConfigurableAreasWhenReorderingStatus(bool $status): self
{
$this->hideConfigurableAreasWhenReorderingStatus = $status;
Expand Down

0 comments on commit 037ed12

Please sign in to comment.