Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev - 1.5 #152

Merged
merged 54 commits into from
Nov 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
32c16c8
Filters blank/null/empty + Tests in different dbs
dansysanalyst Nov 23, 2021
bd27b38
prevent xss attack
NathanaelGT Nov 24, 2021
29ccabc
fix editable colum xss
NathanaelGT Nov 24, 2021
199fd09
Merge branch 'Power-Components:main' into filters_blank_null_dbs_test
dansysanalyst Nov 24, 2021
1dfa39d
fix: primitive type of the `name` property changed to `string`.
vs0uz4 Nov 24, 2021
f5dc0ec
add disabled input text
luanfreitasdev Nov 24, 2021
23c651f
Merge pull request #147 from dansysanalyst/filters_blank_null_dbs_test
luanfreitasdev Nov 24, 2021
e6a7064
Merge pull request #148 from Power-Components/tests
luanfreitasdev Nov 24, 2021
8c8e812
wip
luanfreitasdev Nov 24, 2021
f5d0436
Merge branch 'dev' of github.com:Power-Components/livewire-powergrid …
luanfreitasdev Nov 24, 2021
68e5075
Merge pull request #146 from NathanaelGT/prevent-xss-attack
luanfreitasdev Nov 24, 2021
6b244d9
feature: added "docker-compose.yml" for orchestration of all database…
vs0uz4 Nov 25, 2021
368a27a
fix: remove duplicated entry for php-cs-fixer
vs0uz4 Nov 25, 2021
e4c8311
feature: added support for all databases supported by laravel to the …
vs0uz4 Nov 25, 2021
80f0532
style: apply php-cs-fixer
vs0uz4 Nov 25, 2021
ea1c76e
fix: changed type of cast value on database
vs0uz4 Nov 25, 2021
745b9f2
Merge branch 'dev' into dev
vs0uz4 Nov 25, 2021
9493921
Update WithSorting.php
throwExceptions Nov 25, 2021
96548a9
Update WithSorting.php
throwExceptions Nov 25, 2021
1469ce0
Merge pull request #151 from throwexceptions/main
luanfreitasdev Nov 25, 2021
ef2dd43
Merge branch 'Power-Components:dev' into dev
vs0uz4 Nov 25, 2021
66580d2
Merge pull request #149 from vs0uz4/dev
luanfreitasdev Nov 25, 2021
595fbeb
add langs to empty null filter
luanfreitasdev Nov 25, 2021
be3458d
add langs to empty null filter
luanfreitasdev Nov 25, 2021
a203482
update composer
luanfreitasdev Nov 25, 2021
e66cc3c
update ci
luanfreitasdev Nov 25, 2021
5ddb9ac
update ci
luanfreitasdev Nov 25, 2021
8187e53
fix getsortFieldType
luanfreitasdev Nov 25, 2021
4cd8c7b
add throw column not found
luanfreitasdev Nov 25, 2021
1c7482b
wip
luanfreitasdev Nov 25, 2021
9ece04b
fix stan warning
luanfreitasdev Nov 25, 2021
7a923a9
fix inputText
luanfreitasdev Nov 25, 2021
eacff73
Stubs passing static analysis
dansysanalyst Nov 25, 2021
1c0ace4
Rename to test:dbs for consistence
dansysanalyst Nov 25, 2021
6fca742
dev - wip
luanfreitasdev Nov 25, 2021
77c87f7
Merge pull request #153 from dansysanalyst/dev
luanfreitasdev Nov 25, 2021
1b3b7cb
fix: Database service ports, adjusted according to the `docker-compos…
vs0uz4 Nov 26, 2021
ac4df72
feature: Enabled Pest tests using SQL Server database.
vs0uz4 Nov 26, 2021
ebc3bc6
feature: implemented the `getDriverVersion` method, responsible for p…
vs0uz4 Nov 26, 2021
4c6840c
chore: changed name of method `getDriverVersion` to `getServerVersion`
vs0uz4 Nov 26, 2021
e89a5b1
style: Applying php-cs-fixer
vs0uz4 Nov 26, 2021
1f8cf04
Merge pull request #155 from vs0uz4/dev
luanfreitasdev Nov 26, 2021
3fafd0e
Downgrade postgres
dansysanalyst Nov 26, 2021
5fc27cc
Refactor SqlSupport
dansysanalyst Nov 26, 2021
2955304
Change mysql to match main version
dansysanalyst Nov 26, 2021
98415a0
Update password according to docker file
dansysanalyst Nov 26, 2021
8e3481d
Improve method name and add comments
dansysanalyst Nov 26, 2021
73f7fc8
Adds test for SqlSupport::like
dansysanalyst Nov 26, 2021
77f8a74
Merge pull request #156 from dansysanalyst/dev
luanfreitasdev Nov 26, 2021
deb8ad9
add preg_replace
luanfreitasdev Nov 26, 2021
5d4bdbb
dev - wip
luanfreitasdev Nov 26, 2021
032e174
dev - wip
luanfreitasdev Nov 26, 2021
a7a4140
fix disabled input
luanfreitasdev Nov 27, 2021
6b7c11d
wip
luanfreitasdev Nov 27, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 36 additions & 6 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,32 @@ on:

pull_request:
types: [ ready_for_review, synchronize, opened ]
branches: [ main ]
branches: [ main, dev ]

jobs:
build:
runs-on: ubuntu-latest

services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: powergridtest
ports:
- 3307:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

postgres:
image: postgres:9.6
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: powergridtest
ports:
- 5433:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

strategy:
matrix:
php: [ 7.4, 8.0 ]
Expand Down Expand Up @@ -49,10 +70,19 @@ jobs:
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction

- name: Cs Fixer
run: vendor/bin/php-cs-fixer fix --verbose --dry-run --using-cache=no --stop-on-violation
run: ./vendor/bin/php-cs-fixer fix --verbose --dry-run --using-cache=no --stop-on-violation

- name: Larastan
run: vendor/bin/phpstan analyse --ansi --memory-limit=-1
- name: Testing with SQLite
run: |
./vendor/bin/pest --configuration phpunit.sqlite.xml

- name: Pest tests
run: vendor/bin/pest
- name: Testing with MySQL
run: |
./vendor/bin/pest --configuration phpunit.mysql.xml

- name: Testing with PostgreSQL
run: |
./vendor/bin/pest --configuration phpunit.pgsql.xml

- name: Larastan
run: ./vendor/bin/phpstan analyse --ansi --memory-limit=-1
27 changes: 16 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "power-components/livewire-powergrid",
"description": "A Laravel Livewire table component with searching, sorting, checkboxes, pagination and export data.",
"description": "PowerGrid generates Advanced Datatables using Laravel Livewire.",
"homepage": "https://github.com/power-components/livewire-powergrid",
"license": "MIT",
"minimum-stability": "dev",
Expand Down Expand Up @@ -36,22 +36,27 @@
"php": "^7.4.1 | ^8.0 | ^8.1",
"livewire/livewire": "^2.4",
"box/spout": "^3",
"doctrine/dbal": "^3.1",
"friendsofphp/php-cs-fixer": "^3.2"
"doctrine/dbal": "^3.1"
},
"scripts": {
"stan": "phpstan analyse --ansi --memory-limit=-1",
"pest": "php ./vendor/bin/pest --colors=always",
"cs-check": "./vendor/bin/php-cs-fixer fix --verbose --dry-run --using-cache=no --stop-on-violation",
"cs-fixer": "./vendor/bin/php-cs-fixer fix --verbose --dry-run --using-cache=no --stop-on-violation",
"fix": "./vendor/bin/php-cs-fixer fix",
"test": [
"@pest",
"@stan",
"@cs-check"
"test": "@test:sqlite",
"test:sqlite": "./vendor/bin/pest --configuration phpunit.sqlite.xml",
"test:mysql": "./vendor/bin/pest --configuration phpunit.mysql.xml",
"test:pgsql": "./vendor/bin/pest --configuration phpunit.pgsql.xml",
"test:sqlsrv": "./vendor/bin/pest --configuration phpunit.sqlsrv.xml",
"test:types": "./vendor/bin/phpstan analyse --ansi --memory-limit=-1",
"test:dbs": [
"@test:sqlite",
"@test:mysql",
"@test:pgsql",
"@test:sqlsrv"
],
"check": [
"@cs-fixer",
"@test"
"@test",
"@test:types"
]
},
"require-dev": {
Expand Down
54 changes: 54 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
version: '3'
services:
mysql:
container_name: 'mysql_test'
image: 'mysql/mysql-server:8.0'
ports:
- '3307:3306'
command: '--default-authentication-plugin=mysql_native_password'
environment:
MYSQL_ROOT_PASSWORD: 'password'
MYSQL_ROOT_HOST: "%"
MYSQL_DATABASE: 'powergridtest'
MYSQL_USER: 'powergrid'
MYSQL_PASSWORD: 'password'
MYSQL_ALLOW_EMPTY_PASSWORD: 1
networks:
- sail
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-ppassword" ]
retries: 3
timeout: 5s
pgsql:
container_name: 'pgsql_test'
image: 'postgres:13'
ports:
- '5433:5432'
environment:
PGPASSWORD: 'password'
POSTGRES_DB: 'powergridtest'
POSTGRES_USER: 'postgres'
POSTGRES_PASSWORD: 'password'
networks:
- sail
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "powergridtest", "-U", "postgres" ]
retries: 3
timeout: 5s
sqlsrv:
container_name: 'sqlsrv_test'
image: 'mcr.microsoft.com/mssql/server:2017-latest'
ports:
- '1434:1433'
environment:
ACCEPT_EULA: 'Y'
SA_PASSWORD: 'yourStrong(!)Password'
networks:
- sail
healthcheck:
test: [ "CMD", "/opt/mssql-tools/bin/sqlcmd", "-S", "localhost", "-U", "sa", "-P", "yourStrong(!)Password", "-Q", "select 1" ]
retries: 3
timeout: 5s
networks:
sail:
driver: bridge
22 changes: 22 additions & 0 deletions phpunit.mysql.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true">
<testsuites>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./app</directory>
</include>
</coverage>
<php>
<server name="APP_ENV" value="testing"/>
<server name="DB_DRIVER" value="mysql"/>
<server name="DB_HOST" value="127.0.0.1"/>
<server name="DB_PORT" value="3307"/>
<server name="DB_USERNAME" value="root"/>
<server name="DB_PASSWORD" value="password"/>
<server name="DB_DATABASE" value="powergridtest"/>
</php>
</phpunit>
26 changes: 26 additions & 0 deletions phpunit.pgsql.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./app</directory>
</include>
</coverage>
<php>
<server name="APP_ENV" value="testing"/>
<server name="DB_DRIVER" value="pgsql"/>
<server name="DB_HOST" value="127.0.0.1"/>
<server name="DB_PORT" value="5433"/>
<server name="DB_USERNAME" value="postgres"/>
<server name="DB_PASSWORD" value="password"/>
<server name="DB_DATABASE" value="powergridtest"/>
</php>
</phpunit>
26 changes: 26 additions & 0 deletions phpunit.sqlite.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./app</directory>
</include>
</coverage>
<php>
<server name="APP_ENV" value="testing"/>
<server name="DB_DRIVER" value="sqlite"/>
<server name="DB_HOST" value="127.0.0.1"/>
<server name="DB_PORT" value="0"/>
<server name="DB_USERNAME" value=""/>
<server name="DB_PASSWORD" value=""/>
<server name="DB_DATABASE" value=":memory:"/>
</php>
</phpunit>
22 changes: 22 additions & 0 deletions phpunit.sqlsrv.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true">
<testsuites>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./app</directory>
</include>
</coverage>
<php>
<server name="APP_ENV" value="testing"/>
<server name="DB_DRIVER" value="sqlsrv"/>
<server name="DB_HOST" value="127.0.0.1"/>
<server name="DB_PORT" value="1434"/>
<server name="DB_USERNAME" value="sa"/>
<server name="DB_PASSWORD" value="yourStrong(!)Password"/>
<server name="DB_DATABASE" value="tempdb"/>
</php>
</phpunit>
12 changes: 9 additions & 3 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
colors="true"
>
<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
<testsuite name="Test Suite">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
Expand All @@ -18,4 +15,13 @@
<directory suffix=".php">./src</directory>
</include>
</coverage>
<php>
<server name="APP_ENV" value="testing"/>
<server name="DB_DRIVER" value="sqlite"/>
<server name="DB_HOST" value=""/>
<server name="DB_PORT" value="0"/>
<server name="DB_USERNAME" value=""/>
<server name="DB_PASSWORD" value=""/>
<server name="DB_DATABASE" value=":memory:"/>
</php>
</phpunit>
6 changes: 6 additions & 0 deletions resources/lang/ca/datatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
'contains_not' => 'No té contingut',
'starts_with' => 'Comença per',
'ends_with' => 'Acaba en',
'is_null' => 'is_null',
'is_not_null' => 'is_not_null',
'is_blank' => 'is_blank',
'is_not_blank' => 'is_not_blank',
'is_empty' => 'is_empty',
'is_not_empty' => 'is_not_empty',
],
'export' => [
'exporting' => 'Espereu, si us plau!',
Expand Down
6 changes: 6 additions & 0 deletions resources/lang/de/datatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
'contains_not' => 'enthält nicht',
'starts_with' => 'beginnt mit',
'ends_with' => 'endet with',
'is_null' => 'is_null',
'is_not_null' => 'is_not_null',
'is_blank' => 'is_blank',
'is_not_blank' => 'is_not_blank',
'is_empty' => 'is_empty',
'is_not_empty' => 'is_not_empty',
],
'export' => [
'exporting' => 'Warten Sie mal!',
Expand Down
7 changes: 7 additions & 0 deletions resources/lang/en/datatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@
'contains_not' => 'Does not contain',
'starts_with' => 'Starts with',
'ends_with' => 'Ends with',
'is_empty' => 'Is empty',
'is_not_empty' => 'Is not empty',
'is_null' => 'Is null',
'is_not_null' => 'Is not null',
'is_blank' => 'Is blank',
'is_not_blank' => 'Is not blank',

],
'export' => [
'exporting' => 'Please wait!',
Expand Down
6 changes: 6 additions & 0 deletions resources/lang/es/datatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
'contains_not' => 'No contiene',
'starts_with' => 'Comienza por',
'ends_with' => 'Termina en',
'is_null' => 'is_null',
'is_not_null' => 'is_not_null',
'is_blank' => 'is_blank',
'is_not_blank' => 'is_not_blank',
'is_empty' => 'is_empty',
'is_not_empty' => 'is_not_empty',
],
'export' => [
'exporting' => '¡Espere por favor!',
Expand Down
6 changes: 6 additions & 0 deletions resources/lang/fa/datatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
'contains_not' => 'شامل نباشد',
'starts_with' => 'شروع شود با',
'ends_with' => 'خاتمه یابد با',
'is_null' => 'is_null',
'is_not_null' => 'is_not_null',
'is_blank' => 'is_blank',
'is_not_blank' => 'is_not_blank',
'is_empty' => 'is_empty',
'is_not_empty' => 'is_not_empty',
],
'export' => [
'exporting' => 'لطفا صبر کنید!',
Expand Down
10 changes: 10 additions & 0 deletions resources/lang/id/datatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,15 @@
'contains_not' => 'Tidak terkait',
'starts_with' => 'Dimulai dengan',
'ends_with' => 'Diakhiri dengan',
'is_null' => 'is_null',
'is_not_null' => 'is_not_null',
'is_blank' => 'is_blank',
'is_not_blank' => 'is_not_blank',
'is_empty' => 'is_empty',
'is_not_empty' => 'is_not_empty',
],
'export' => [
'exporting' => 'Please wait!',
'completed' => 'Export completed! Your files are ready for download',
],
];
6 changes: 6 additions & 0 deletions resources/lang/it/datatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
'contains_not' => 'Non contiene',
'starts_with' => 'Inizia con',
'ends_with' => 'Termina con',
'is_null' => 'is_null',
'is_not_null' => 'is_not_null',
'is_blank' => 'is_blank',
'is_not_blank' => 'is_not_blank',
'is_empty' => 'is_empty',
'is_not_empty' => 'is_not_empty',
],
'export' => [
'exporting' => 'Attendere prego!',
Expand Down
6 changes: 6 additions & 0 deletions resources/lang/ms_MY/datatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
'contains_not' => 'Tidak mengandungi',
'starts_with' => 'Bermula dengan',
'ends_with' => 'Berakhir dengan',
'is_null' => 'is_null',
'is_not_null' => 'is_not_null',
'is_blank' => 'is_blank',
'is_not_blank' => 'is_not_blank',
'is_empty' => 'is_empty',
'is_not_empty' => 'is_not_empty',
],
'export' => [
'exporting' => 'Sila tunggu!',
Expand Down
Loading