Skip to content

Commit

Permalink
Merge branch '3.x' into fix/slug-active-column
Browse files Browse the repository at this point in the history
  • Loading branch information
ifox authored Oct 14, 2024
2 parents 36803bf + a6cd3af commit 57611d2
Show file tree
Hide file tree
Showing 82 changed files with 3,139 additions and 2,283 deletions.
56 changes: 26 additions & 30 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,18 +65,17 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.3, 8.2, 8.1, 8.0]
laravel: [9.*, 10.*, 11.*]
php: [8.3, 8.2, 8.1]
laravel: [10.*, 11.*]
dbal: [3.*, 4.*]
exclude:
- laravel: 10.*
php: 8.0
- laravel: 11.*
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.*
Expand Down Expand Up @@ -112,28 +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: Patch TestCase files for PHP < 8.1
run: |
if php -r 'exit(version_compare(PHP_VERSION, "8.1.0", "<") ? 0 : 1);'; then
for file in tests/integration/TestCase.php tests/Browser/BrowserTestCase.php; do
sed -i 's/protected function onNotSuccessfulTest(Throwable \$t): never/protected function onNotSuccessfulTest(Throwable \$t): void/' "$file";
echo "Patched $file for PHP < 8.1";
done
fi
- 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 @@ -157,11 +147,6 @@ jobs:
- name: Prepare Testbench Dusk
run: ./vendor/bin/testbench-dusk package:discover

- name: Set PHPUnit config for Laravel 9
if: matrix.laravel == '9.*'
run: |
cp phpunit-legacy.xml phpunit.xml
- name: Execute all tests
run: vendor/bin/phpunit --stop-on-error
env:
Expand All @@ -171,10 +156,21 @@ jobs:
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/
53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,59 @@

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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"ext-pdo": "*",
"astrotomic/laravel-translatable": "^v11.12",
"cartalyst/tags": "^12.0 || ^13.0 || ^14.0",
"doctrine/dbal": "^3.0",
"doctrine/dbal": "^3.0 || ^4.0",
"guzzlehttp/guzzle": "^7.0",
"imgix/imgix-php": "^3.0",
"kalnoy/nestedset": "^6.0",
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
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 [];
}
```

4 changes: 2 additions & 2 deletions docs/content/1_docs/6_relations/03_one-to-many.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ One to Many is one of the simpler relations to set up so let's get started:

As with any relation we need to set up a database. In this example we are using our portfolio example where we will have multiple links on a project.

We will set up 2 models, one is a Project model, you can do this using `php artisan twill:module Project`
We will set up 2 models, one is a Project model, you can do this using `php artisan twill:make:module Project`

And afterwards a Link model: `php artisan twill:module Link`, As the Link model is used for our hasMany, we do not have to add it to the routes or navigation files, so you can ignore that suggestion.
And afterwards a Link model: `php artisan twill:make:module Link`, As the Link model is used for our hasMany, we do not have to add it to the routes or navigation files, so you can ignore that suggestion.

In the **Link** migration we add a column to hold the `project_id` that we are creating it from.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Twill is a standard Laravel package, that means, we only have to require it (and

So, before we get to the process of building our CMS, let's install Twill.

We can do this using `composer require area17/twill:"^3.0"`.
We can do this using `composer require area17/twill:"^3.2"`.

This will install Twill 3 alongside all other required packages.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ npm install vue-numeric --save
in-store="value"
></a17-custom-number>
@unless($renderForBlocks || $renderForModal || (!isset($item->$name) && null == $formFieldsValue = getFormFieldsValue($form_fields, $name)))
@unless($renderForBlocks || $renderForModal || (!isset($item->$name) && is_null($formFieldsValue = getFormFieldsValue($form_fields, $name))))
@push('vuexStore')
window['{{ config('twill.js_namespace') }}'].STORE.form.fields.push({
name: '{{ $name }}',
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-page-builder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The [Laravel documentation](https://laravel.com/docs/10.x) is far more extensive
Lets require Twill:

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

And then, install this example:
Expand Down
2 changes: 1 addition & 1 deletion frontend/js/components/Previewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
name: 'preview-tablet-v'
},
{
size: 320,
size: 390,
name: 'preview-mobile'
}
]
Expand Down
4 changes: 4 additions & 0 deletions frontend/scss/vendor/_vselect.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ $multiSelectHeight: 45px;
}

.vs__dropdown-menu {
// make sure the content expand to the longest option
--vs-dropdown-min-width: fit-content;
padding:15px 0;
border-top:1px solid $color__border--light;
box-shadow: 0px 1px 3.5px 0px rgba(0, 0, 0, 0.30);
Expand Down Expand Up @@ -167,6 +169,7 @@ $multiSelectHeight: 45px;
padding:0 0 0 15px;
margin:0;
color:$color__f--text;

button {
position: absolute;
background-color: $color__black--35;
Expand Down Expand Up @@ -408,6 +411,7 @@ $multiSelectHeight: 45px;
.vs__deselect {
top:2px;
right:2px;
transform: none;
background-color:transparent;
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCIgdmlld0JveD0iMCAwIDEwIDEwIj48cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiNhNmE2YTYiIGQ9Ik0yIDJsNiA2TTggMkwyIDgiLz48L3N2Zz4=);
color:$color__fborder--hover;
Expand Down
11 changes: 11 additions & 0 deletions lang/de/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
'reset-password' => 'Passwort zurücksetzen',
'reset-send' => 'Link zum Zurücksetzen des Passworts senden',
'verify-login' => 'Anmeldung bestätigen',
'auth-causer' => 'Authentifikation',
],
'buckets' => [
'intro' => 'Was würden Sie heute gerne vorstellen?',
Expand Down Expand Up @@ -56,6 +57,9 @@
'unfeatured' => 'Hervorhebung aufgehoben',
'restored' => 'Wiederhergestellt',
'deleted' => 'Gelöscht',
'login' => 'Anmeldung',
'logout' => 'Abmeldung',
'duplicated' => 'Dupliziert',
],
'activity-row' => [
'edit' => 'Bearbeiten',
Expand Down Expand Up @@ -145,6 +149,7 @@
],
],
'editor' => 'Editor',
'options' => 'Optionen',
],
'lang-manager' => [
'published' => 'Veröffentlicht',
Expand Down Expand Up @@ -196,6 +201,7 @@
'mine' => 'Meine',
'published' => 'Veröffentlicht',
'trash' => 'Papierkorb',
'not-set' => 'Ohne Wert',
],
'filters' => [
'all-label' => 'Alle :label',
Expand Down Expand Up @@ -407,6 +413,11 @@
'scheduled' => 'Geplant',
'expired' => 'Abgelaufen',
'unsaved-changes' => 'Es gibt nicht gespeicherte Änderungen',
'draft-revision' => 'Als Entwurfs-Revision abspeichern',
'draft-revision-close' => 'Als Entwurfs-Revision abspeichern und schließen',
'draft-revision-new' => 'Als Entwurfs-Revision abspeichern und weiteren erstellen',
'draft-revisions-available' => 'Sie betrachten die aktuell veröffentlichte Version des Inhalts. Es gibt neuere Entwurfs-Revisionen.',
'editing-draft-revision' => 'Sie bearbeiten aktuell eine Entwurfs-Revision dieses Inhalts. Speichern Sie die Änderungen oder Veröffentlichen Sie diese.',
],
'select' => [
'empty-text' => 'Leider keine passenden Optionen gefunden',
Expand Down
1 change: 1 addition & 0 deletions lang/en/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
'deleted' => 'Deleted',
'login' => 'Login action',
'logout' => 'Logout action',
'duplicated' => 'Duplicated',
],
'activity-row' => [
'edit' => 'Edit',
Expand Down
Loading

0 comments on commit 57611d2

Please sign in to comment.