Skip to content

Commit

Permalink
Merge pull request #26 from outl1ne/v4
Browse files Browse the repository at this point in the history
Support for nova-4
  • Loading branch information
Kaspar Rosin authored Jun 29, 2022
2 parents 1f906cc + 63fcf0e commit b3d9130
Show file tree
Hide file tree
Showing 39 changed files with 15,201 additions and 7,647 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/php-cs-fixer.yml

This file was deleted.

66 changes: 33 additions & 33 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,42 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [7.4]
laravel: [7.*, 8.*]
php: [8.1, 8.0]
laravel: [8.*, 9.*]
dependency-version: [prefer-stable]
include:
- laravel: 8.*
testbench: 6.*
- laravel: 7.*
testbench: 5.*
- laravel: 8.*
testbench: 6.*
- laravel: 9.*
testbench: ^7.0

name: P${{ matrix.php }} - L${{ matrix.laravel }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer config http-basic.nova.laravel.com ${NOVA_USERNAME} ${NOVA_PASSWORD}
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
env:
NOVA_PASSWORD: ${{ secrets.NOVA_PASSWORD }}
NOVA_USERNAME: ${{ secrets.NOVA_USERNAME }}

- name: Execute tests
run: vendor/bin/phpunit tests
- name: Checkout code
uses: actions/checkout@v2

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer config http-basic.nova.laravel.com ${NOVA_USERNAME} ${NOVA_PASSWORD}
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
env:
NOVA_PASSWORD: ${{ secrets.NOVA_4_PASSWORD }}
NOVA_USERNAME: ${{ secrets.NOVA_USERNAME }}

- name: Execute tests
run: vendor/bin/phpunit tests
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ phpunit.xml
Thumbs.db
.php_cs
.php_cs.cache
auth.json
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.0] - 22-06-29

### Added

- Support for Laravel Nova 4
- Upgrade components to vue 3
- Added tailwind with `o1-` prefix.

### Changed

- Requirements
- php: `>= 8.0`
- laravel/framework: `>= 9.0`
- laravel/nova: `^4.0`

### Removed

- Resources per page selector: `withPerPage`.
- There might be a way to re-integrate this feature, but as of now, I've hidden this feature.

## [1.1.0] - 2021-05-06

### Changed
Expand Down
18 changes: 0 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,24 +193,6 @@ public function cards(Request $request)
}
```

### Per page options - NOVA <= 3.15.0

Shows the `per-page` dropdown on `DetachedFilter` card. You need to pass in the `perPageOptions` defined in your resource.
**NB: Only works with version 3.15.0 or higher of laravel/nova**

Optionally you can pass in `false / true` as a second parameter to `hide / show` the `per-page` filter in dropdown menu. This will be `true` by default.

```php
public function cards(Request $request)
{
return [
(new NovaDetachedFilters([
// ...
]))->withPerPage($request->resource()::perPageOptions(), false),
];
}
```

### Columns

When working with large boolean filters or pill filters that are the height of multiple regular filters, you can wrap filters inside `DetachedFiltersColumn` to easily wrap them in columns.
Expand Down
14 changes: 8 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,20 @@
"role": "Developer"
},
{
"name": "Optimist Digital",
"email": "info@optimistdigital.com",
"name": "Outl1ne",
"email": "info@outl1ne.com",
"role": "Maintainer"
}
],
"require": {
"php": ">=7.1.0",
"laravel/nova": "^2.0 || ^3.0"
"php": ">=8.0.0",
"laravel/framework": "^9.0",
"laravel/nova": "~4.0"
},
"require-dev": {
"orchestra/testbench": "^6.3",
"phpunit/phpunit": "^9.4"
"laravel/pint": "^0.2.1",
"orchestra/testbench": "^7.0.0",
"phpunit/phpunit": "^9.5"
},
"autoload": {
"psr-4": {
Expand Down
1 change: 1 addition & 0 deletions dist/css/entry.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10,497 changes: 10,496 additions & 1 deletion dist/js/card.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dist/js/entry.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/js/entry.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
3 changes: 2 additions & 1 deletion dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"/js/card.js": "/js/card.js"
"/js/entry.js": "/js/entry.js",
"/css/entry.css": "/css/entry.css"
}
37 changes: 37 additions & 0 deletions nova.mix.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const mix = require('laravel-mix');
const webpack = require('webpack');
const path = require('path');

class NovaExtension {
name() {
return 'nova-extension';
}

register(name) {
this.name = name;
}

webpackPlugins() {
return new webpack.ProvidePlugin({
_: 'lodash',
Errors: 'form-backend-validation',
});
}

webpackConfig(webpackConfig) {
webpackConfig.externals = {
vue: 'Vue',
};

webpackConfig.resolve.alias = {
...(webpackConfig.resolve.alias || {}),
'laravel-nova': path.join(__dirname, 'vendor/laravel/nova/resources/js/mixins/packages.js'),
};

webpackConfig.output = {
uniqueName: this.name,
};
}
}

mix.extend('nova', new NovaExtension());
Loading

0 comments on commit b3d9130

Please sign in to comment.