Skip to content

Commit

Permalink
Merge branch '3.x' into fix/2278
Browse files Browse the repository at this point in the history
  • Loading branch information
ifox authored Oct 14, 2024
2 parents 0ad0510 + cc26b32 commit 019a135
Show file tree
Hide file tree
Showing 140 changed files with 4,052 additions and 2,748 deletions.
51 changes: 36 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

- name: Install dependencies
run: |
composer require "laravel/framework:10.*" "doctrine/dbal:^3.0" --no-interaction --no-update
composer require "laravel/framework:11.*" --no-interaction --no-update
composer install
- name: Execute tests
Expand All @@ -48,7 +48,7 @@ jobs:
run: vendor/bin/phpcs

test:
name: PHP ${{ matrix.php }} - LARAVEL ${{ matrix.laravel }}
name: PHP ${{ matrix.php }} - LARAVEL ${{ matrix.laravel }} - DBAL ${{ matrix.dbal }}
timeout-minutes: 30
runs-on: ${{ matrix.os }}
services:
Expand All @@ -65,16 +65,21 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.3, 8.2, 8.1, 8.0]
laravel: [9.*, 10.*]
php: [8.3, 8.2, 8.1]
laravel: [10.*, 11.*]
dbal: [3.*, 4.*]
exclude:
- laravel: 10.*
php: 8.0
dbal: 4.*
- laravel: 11.*
php: 8.1
- laravel: 11.*
dbal: 3.*
include:
- laravel: 9.*
testbench: 7.*
- laravel: 10.*
testbench: 8.*
- laravel: 11.*
testbench: 9.*

steps:
- name: Set timezone?
Expand Down Expand Up @@ -106,19 +111,19 @@ jobs:
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.os }}-${{ matrix.laravel }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
key: ${{ matrix.os }}-${{ matrix.laravel }}-${{ matrix.php }}-${{ matrix.dbal }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.laravel }}-${{ matrix.php }}-composer-
${{ matrix.os }}-${{ matrix.laravel }}-${{ matrix.php }}-${{ matrix.dbal }}-composer-
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "doctrine/dbal:^3.0" --no-interaction --no-update
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "doctrine/dbal:${{ matrix.dbal }}" --no-interaction --no-update
composer install --prefer-dist --no-interaction --no-plugins
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '18.x'
node-version: '20.x'

- name: Build npm dependencies.
run: |
Expand All @@ -130,26 +135,42 @@ jobs:
- name: Build twill.
run: ./vendor/bin/testbench twill:build --forTesting
env:
CACHE_STORE: array

- name: Upgrade Chrome
uses: browser-actions/setup-chrome@latest

- name: Upgrade Chrome Driver
run: ./vendor/bin/testbench dusk:chrome-driver --detect

- name: Prepare Testbench Dusk
run: ./vendor/bin/testbench-dusk package:discover

- name: Execute all tests
run: vendor/bin/phpunit
run: vendor/bin/phpunit --stop-on-error
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}

- uses: codecov/codecov-action@v2
with:
files: .github/clover.xml

- uses: actions/upload-artifact@v2
if: always()
- name: Replace asterisks in Laravel
run: echo "REPLACED_LARAVEL=${MATRIX_LARAVEL//\*/_}" >> $GITHUB_ENV
env:
MATRIX_LARAVEL: ${{ matrix.laravel }}

- name: Replace asterisks in DBAL
id: replace_dbal
run: echo "REPLACED_DBAL=${MATRIX_DBAL//\*/_}" >> $GITHUB_ENV
env:
MATRIX_DBAL: ${{ matrix.dbal }}

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: screenshots
name: screenshots-${{ matrix.os }}-${{ matrix.php }}-${{ env.REPLACED_LARAVEL }}-${{ env.REPLACED_DBAL }}
path: |
tests/Browser/screenshots/
tests/Browser/console/
59 changes: 59 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,65 @@

All notable changes to `twill` will be documented in this file.

## 3.3.1

### Fixed
- Fix dbal 4 conflict by [@ifox](https://github.com/ifox) in https://github.com/area17/twill/pull/2596

## 3.3.0

### Added

- Laravel 11 support by [@ifox](https://github.com/ifox) in https://github.com/area17/twill/pull/2473
- Add support for `medias` fields in JSON repeaters by [@zeezo887](https://github.com/zeezo887) in https://github.com/area17/twill/pull/2554
- Add support for multiple JSON repeaters (of the same type) in one form by [@zeezo887](https://github.com/zeezo887) in https://github.com/area17/twill/pull/2517
- Add support for nested module on the dashboard by [@zeezo887](https://github.com/zeezo887) in https://github.com/area17/twill/pull/2547
- Add `connectedTo` for inline repeater and documentation about `connectedTo` by [@Tofandel](https://github.com/Tofandel) in https://github.com/area17/twill/pull/2565
- Add error reporting to block rendering by [@AidasK](https://github.com/AidasK) in https://github.com/area17/twill/pull/2580
- Allow `buttonAsLink` option on inline repeaters by [@danieldevine](https://github.com/danieldevine) in https://github.com/area17/twill/pull/2522
- Allow singular capsules on navigation by [@antonioribeiro](https://github.com/antonioribeiro) in https://github.com/area17/twill/pull/2572

### Fixed

- Tags in media library are not refreshed while updating & browsing images by [@zeezo887](https://github.com/zeezo887) in https://github.com/area17/twill/pull/2523
- Clicking cancel in the block editor deletes all the unsaved blocks by [@zeezo887](https://github.com/zeezo887) in https://github.com/area17/twill/pull/2578
- Allow single deletion in form builder inline repeater by [@zeezo887](https://github.com/zeezo887) in https://github.com/area17/twill/pull/2504
- Allow deleting media after records bulk destroy by [@zeezo887](https://github.com/zeezo887) in https://github.com/area17/twill/pull/2519
- Allow case-insensitive search for translated models for postgres by [@zeezo887](https://github.com/zeezo887) in https://github.com/area17/twill/pull/2528
- 404 error when restoring revision in nested modules by [@zeezo887](https://github.com/zeezo887) in https://github.com/area17/twill/pull/2541
- Fix alt text stripping accents and single quotes by [@Tofandel](https://github.com/Tofandel) in https://github.com/area17/twill/pull/2514
- Changing twill user password in admin to use the laravel algo by [@Tofandel](https://github.com/Tofandel) in https://github.com/area17/twill/pull/2582
- Undefined variable $formBuilder error when extending form layout in custom pages by [@zeezo887](https://github.com/zeezo887) in https://github.com/area17/twill/pull/2577
- Error with time-picker when `allowInput` is true by [@zeezo887](https://github.com/zeezo887) in https://github.com/area17/twill/pull/2576
- Don't delete and recreate existing `mediables` and `fileables` by [@Tofandel](https://github.com/Tofandel) in https://github.com/area17/twill/pull/2567
- Make `twillTrans` exportable so it can be used in config by [@Tofandel](https://github.com/Tofandel) in https://github.com/area17/twill/pull/2563
- Table builder `Browser` column overrides parent module field by [@zeezo887](https://github.com/zeezo887) in https://github.com/area17/twill/pull/2506
- Disable heading extension if it's not in the Tiptap toolbar by [@Tofandel](https://github.com/Tofandel) in https://github.com/area17/twill/pull/2511
- Relation field of datatable does not allow sorting by [@zeezo887](https://github.com/zeezo887) in https://github.com/area17/twill/pull/2526
- Default login redirect to admin url by [@Tofandel](https://github.com/Tofandel) in https://github.com/area17/twill/pull/2569
- Different datetime parsing for publish date on listing and edit screen by [@zeezo887](https://github.com/zeezo887) in https://github.com/area17/twill/pull/2510
- Fix created at is null in slug table by [@Tofandel](https://github.com/Tofandel) in https://github.com/area17/twill/pull/2588

### Docs

- Fix typo by [@k-msalehi](https://github.com/k-msalehi) in https://github.com/area17/twill/pull/2564
- Change `admin.` route to `twill.` by [@LucaRed](https://github.com/LucaRed) in https://github.com/area17/twill/pull/2585
- Prettify instructions and add the capsules>list array keys to improve DX by [@antonioribeiro](https://github.com/antonioribeiro) in https://github.com/area17/twill/pull/2527
- Update twill version during installation by [@Mavv3006](https://github.com/Mavv3006) in https://github.com/area17/twill/pull/2584

### Chores

- Refactor form services to avoid repeating code by [@Tofandel](https://github.com/Tofandel) in https://github.com/area17/twill/pull/2553
- Bump express from 4.18.2 to 4.19.2 by [@dependabot](https://github.com/dependabot) in https://github.com/area17/twill/pull/2560
- Bump webpack-dev-middleware from 5.3.3 to 5.3.4 by [@dependabot](https://github.com/dependabot) in https://github.com/area17/twill/pull/2556
- Bump follow-redirects from 1.15.5 to 1.15.6 by [@dependabot](https://github.com/dependabot) in https://github.com/area17/twill/pull/2545

## 3.2.1

### Fixed
- Fix datatable and buckets filters error caused by Axios breaking changes in 0.28.0 by @zeezo887 in https://github.com/area17/twill/pull/2520


## 3.2.0

### Added
Expand Down
2 changes: 1 addition & 1 deletion UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ If you are relying on Quill.js specifics (like css classes), use `'type' => 'qui
Previously `withVideo` was true by default, if you relied on this you have to update these media fields to
`'withVideo' => true`.

#### SVG's are now no longer passing thorough glide
#### SVG's are now no longer passing through glide

These are now rendered directly, you can change this by updating config `twill.glide.original_media_for_extensions` to an empty array `[]`

Expand Down
27 changes: 13 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,38 +27,37 @@
"ext-json": "*",
"ext-pdo": "*",
"astrotomic/laravel-translatable": "^v11.12",
"cartalyst/tags": "^12.0|^13.0",
"doctrine/dbal": "^3.0",
"cartalyst/tags": "^12.0 || ^13.0 || ^14.0",
"doctrine/dbal": "^3.0 || ^4.0",
"guzzlehttp/guzzle": "^7.0",
"imgix/imgix-php": "^3.0",
"kalnoy/nestedset": "^6.0",
"laravel/framework": "^9.0|^10.0",
"laravel/framework": "^9.0 || ^10.0 || ^11.0",
"laravel/socialite": "^5.3",
"laravel/ui": "^4.0",
"league/flysystem-aws-s3-v3": "^3.0",
"league/glide-laravel": "^1.0",
"league/glide-symfony": "^1.0 || ^2.0",
"matthewbdaly/laravel-azure-storage": "^2.0",
"myclabs/php-enum": "^1.5",
"pragmarx/google2fa-qrcode": "^2.0",
"spatie/laravel-activitylog": "^4.0",
"spatie/laravel-analytics": "^4.0|^5.0",
"spatie/laravel-analytics": "^4.0 || ^5.0",
"spatie/once": "^3.0"
},
"require-dev": {
"area17/phptorch": "dev-main",
"chillerlan/php-qrcode": "~4.0",
"friendsofphp/php-cs-fixer": "^3.0",
"nette/php-generator": "^4.0.3",
"nunomaduro/collision": "^6.0|^7.0|^8.0",
"nunomaduro/collision": "^6.0 || ^7.0 || ^8.0",
"nunomaduro/larastan": "^2.0",
"orchestra/testbench": "^7.8|^8.0",
"orchestra/testbench-dusk": "^7.8|^8.0",
"phpunit/php-invoker": "^3.1",
"phpunit/phpunit": "~9.0",
"rector/rector": "^0.12.15",
"orchestra/testbench": "^7.8 || ^8.0 || ^9.0",
"orchestra/testbench-dusk": "^7.8 || ^8.0 || ^9.0",
"phpunit/php-invoker": "^3.1 || ^4.0",
"phpunit/phpunit": "~9.0 || ~10.0",
"rector/rector": "^0.19.2 || ^1.0 ",
"spatie/invade": "^1.1",
"squizlabs/php_codesniffer": "*",
"torchlight/torchlight-commonmark": "^0.5"
"squizlabs/php_codesniffer": "*"
},
"autoload": {
"psr-4": {
Expand All @@ -71,7 +70,7 @@
"A17\\Twill\\Tests\\Integration\\": "tests/integration",
"A17\\Twill\\Tests\\Browser\\": "tests/Browser",
"A17\\Docs\\": "docs/generator",
"App\\": "vendor/orchestra/testbench-core/laravel/app"
"App\\": "vendor/orchestra/testbench-dusk/laravel/app"
}
},
"scripts": {
Expand Down
12 changes: 10 additions & 2 deletions config/twill.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

/*
|--------------------------------------------------------------------------
| Application strict url handeling
| Application strict url handling
|--------------------------------------------------------------------------
|
| Setting this value to true will enable strict domain handling.
Expand Down Expand Up @@ -172,7 +172,7 @@
|--------------------------------------------------------------------------
|
*/
'auth_login_redirect_path' => '/',
'auth_login_redirect_path' => null,

'templates_on_frontend_domain' => false,

Expand Down Expand Up @@ -282,6 +282,14 @@
*/
'debug' => env('APP_DEBUG', false),

/*
|--------------------------------------------------------------------------
| This parameter will throw errors if some error occurs instead of failing
| silently (eg. when rendering blocks)
|--------------------------------------------------------------------------
*/
'strict' => env('TWILL_STRICT', false),

/*
|--------------------------------------------------------------------------
| Base classes for automatic generation of Modules and Capsules
Expand Down
4 changes: 2 additions & 2 deletions docs/content/1_docs/2_getting-started/2_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The starter kit setup is a basic page builder. It comes with:
You can install it in a Laravel application using:

```bash
composer require area17/twill:"^3.0"
composer require area17/twill:"^3.2"
```

:::alert=type.warning:::
Expand All @@ -40,7 +40,7 @@ See [`examples/basic-page-builder`](https://github.com/area17/twill/tree/3.x/exa
Twill package can be added to your application using Composer:

```bash
composer require area17/twill:"^3.0"
composer require area17/twill:"^3.2"
```

:::alert=type.warning:::
Expand Down
25 changes: 0 additions & 25 deletions docs/content/1_docs/2_getting-started/3_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,31 +79,6 @@ return [
];
```

Twill registers its own exception handler in all controllers. If you need to customize it (to report errors on a 3rd party service like Sentry or Rollbar for example), you can opt-out from it in your `config/twill.php` file:

```php
<?php

return [
'bind_exception_handler' => false,
];
```

And then extend it from your own `app/Exceptions/Handler.php` class:

```php
<?php

namespace App\Exceptions;

use A17\Twill\Exceptions\Handler as ExceptionHandler;
use Exception;
use Illuminate\Auth\AuthenticationException;

class Handler extends ExceptionHandler
...
```

If you would like to provide custom tables names, use the following configuration options:

```php
Expand Down
3 changes: 2 additions & 1 deletion docs/content/1_docs/3_modules/5_controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ Below is a list of the methods and their purpose:
- **setModuleName**('`yourModuleName`'): Set the name of the module you are working with.
- **setFeatureField**('`fieldname`'): Set the field to use for featuring content.
- **setSearchColumns**(`['title', 'year']`): Set the columns to search in.
- **setSearchQuery**(`
fn (Builder $q, string $search) => $q->orWhereHas('profile', fn (Builder $q) => $q->where('first_name', 'like', "$search%")->orWhere('last_name', 'like', "$search%"))`): For finer controller over the search
- **setPermalinkBase**('`example`'): The static permalink base to your module. Defaults to `setModuleName` when empty.
- **setTitleColumnKey**('`title`'): Sets the field to use as title, defaults to `title`.
- **setModelName**('`Project`'): Usually not required, but in case customization is needed you can use this method to set
Expand Down Expand Up @@ -240,4 +242,3 @@ protected function formData($request)
return [];
}
```

Loading

0 comments on commit 019a135

Please sign in to comment.