Skip to content

Commit

Permalink
1372 datepicker cant reset the datepicker filter undefined array key …
Browse files Browse the repository at this point in the history
…start (#1375)

* Fix "Undefined array key start

* Rollback pipelines - mysql and pgsql

* Remove FilterDateTimeTest - "As we deal with javascript, I need to test using cypress later"
  • Loading branch information
luanfreitasdev authored Feb 2, 2024
1 parent 4ffab6f commit 7fd887c
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 202 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/mysql.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
name: MySQL

on:
workflow_dispatch:
push:
branches:
- "**"
paths-ignore:
- "art/**"
- "README.md"
pull_request:
types: [ready_for_review, synchronize, opened]
paths-ignore:
- "art/**"
- "README.md"

jobs:
build:
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/pgsql.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
name: PostGreSQL

on:
workflow_dispatch:
push:
branches:
- "**"
paths-ignore:
- "art/**"
- "README.md"
pull_request:
types: [ready_for_review, synchronize, opened]
paths-ignore:
- "art/**"
- "README.md"

jobs:
build:
Expand Down
8 changes: 8 additions & 0 deletions src/Components/Filters/Builders/DatePicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ public function builder(EloquentBuilder|QueryBuilder $builder, string $field, in
return;
}

if (!isset($values['start']) || isset($values['end'])) {
return;
}

/** @var array $values */
[$startDate, $endDate] = [
0 => Carbon::parse($values['start'])->format('Y-m-d'),
Expand All @@ -34,6 +38,10 @@ public function builder(EloquentBuilder|QueryBuilder $builder, string $field, in

public function collection(Collection $collection, string $field, int|array|string|null $values): Collection
{
if (!isset($values['start']) || isset($values['end'])) {
return $collection;
}

/** @var array $values */
[$startDate, $endDate] = [
0 => Carbon::parse($values[0])->format('Y-m-d'),
Expand Down
8 changes: 8 additions & 0 deletions src/Components/Filters/Builders/DateTimePicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ public function builder(EloquentBuilder|QueryBuilder $builder, string $field, in
return;
}

if (!isset($values['start']) || isset($values['end'])) {
return;
}

/** @var array $values */
[$startDate, $endDate] = [
0 => Carbon::parse($values['start']),
Expand All @@ -34,6 +38,10 @@ public function builder(EloquentBuilder|QueryBuilder $builder, string $field, in

public function collection(Collection $collection, string $field, int|array|string|null $values): Collection
{
if (!isset($values['start']) || isset($values['end'])) {
return $collection;
}

/** @var array $values */
[$startDate, $endDate] = [
0 => Carbon::parse($values['start']),
Expand Down
200 changes: 0 additions & 200 deletions tests/Feature/Filters/FilterDateTimeTest.php

This file was deleted.

0 comments on commit 7fd887c

Please sign in to comment.