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

feat(scopes): added scopes support #18

Merged
merged 21 commits into from
Feb 24, 2022
Merged

feat(scopes): added scopes support #18

merged 21 commits into from
Feb 24, 2022

Conversation

nicolasalexandre9
Copy link
Member

Definition of Done

General

  • Write an explicit title for the Pull Request, following Conventional Commits specification
  • Test manually the implemented changes
  • Validate the code quality (indentation, syntax, style, simplicity, readability)

Security

  • Consider the security impact of the changes made

* @throws GuzzleException
* @throws \JsonException
*/
protected function fetchScopes(int $renderingId): array
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

case 'previous_month_to_date':
case 'previous_quarter_to_date':
case 'previous_year_to_date':
$period = $operator === 'yesterday' ? 'Day' : Str::ucfirst(Str::of($operator)->explode('_')->get(1));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

* @param string|null $value
* @return Builder
*/
public function dateFilters(Builder $query, string $field, string $operator, ?string $value = null): Builder
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method dateFilters has 46 lines of code (exceeds 30 allowed). Consider refactoring.

* @return array
* @throws \JsonException
*/
public function appendPreviousPeriod(): array
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function appendPreviousPeriod has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.

@nicolasalexandre9 nicolasalexandre9 changed the title feat(scopes): add scopes support feat(scopes): added scopes support Feb 24, 2022
matthv
matthv previously approved these changes Feb 24, 2022
Copy link
Member

@matthv matthv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

tests/Unit/ScopeManagerTest.php Outdated Show resolved Hide resolved
tests/Unit/ScopeManagerTest.php Outdated Show resolved Hide resolved
tests/Unit/ScopeManagerTest.php Outdated Show resolved Hide resolved
@codeclimate
Copy link

codeclimate bot commented Feb 24, 2022

Code Climate has analyzed commit 4665292 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (90% is the threshold).

This pull request will bring the total coverage in the repository to 100.0% (0.0% change).

View more on Code Climate.

@nicolasalexandre9 nicolasalexandre9 merged commit 59edad6 into main Feb 24, 2022
@nicolasalexandre9 nicolasalexandre9 deleted the feat/scopes branch February 24, 2022 09:50
forest-bot added a commit that referenced this pull request Mar 9, 2022
# 1.0.0 (2022-03-09)

### Features

* **authentication:** add login & callback actions ([#6](#6)) ([04edd06](04edd06))
* **charts:** add charts support ([#17](#17)) ([8d850b1](8d850b1))
* **crud:** create, update & delete actions ([#13](#13)) ([ed9e7ce](ed9e7ce))
* **crud:** list and show actions [#12](#12) ([4cb9a74](4cb9a74))
* **filters:** add filters behaviour ([#15](#15)) ([bba17bc](bba17bc))
* **onboarding:** add new setup command ([#19](#19)) ([ac9ac85](ac9ac85))
* **onboarding:** update package to laravel9 ([#21](#21)) ([9a4bca1](9a4bca1))
* **permission:** added permission layer ([#16](#16)) ([9273bc7](9273bc7))
* **schema:** build schema json file ([#10](#10)) ([7e795d8](7e795d8))
* **scopes:** added scopes support  ([#18](#18)) ([59edad6](59edad6))
* **search:** add search behaviour ([#14](#14)) ([920af78](920af78))
* **smart-actions:** added smart-actions support ([#22](#22)) ([bdef099](bdef099))
@forest-bot
Copy link
Member

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

forest-bot added a commit that referenced this pull request Mar 9, 2022
# 1.0.0 (2022-03-09)

### Features

* **authentication:** add login & callback actions ([#6](#6)) ([04edd06](04edd06))
* **charts:** add charts support ([#17](#17)) ([8d850b1](8d850b1))
* **crud:** create, update & delete actions ([#13](#13)) ([ed9e7ce](ed9e7ce))
* **crud:** list and show actions [#12](#12) ([4cb9a74](4cb9a74))
* **filters:** add filters behaviour ([#15](#15)) ([bba17bc](bba17bc))
* **onboarding:** add new setup command ([#19](#19)) ([ac9ac85](ac9ac85))
* **onboarding:** update package to laravel9 ([#21](#21)) ([9a4bca1](9a4bca1))
* **permission:** added permission layer ([#16](#16)) ([9273bc7](9273bc7))
* **schema:** build schema json file ([#10](#10)) ([7e795d8](7e795d8))
* **scopes:** added scopes support  ([#18](#18)) ([59edad6](59edad6))
* **search:** add search behaviour ([#14](#14)) ([920af78](920af78))
* **smart-actions:** added smart-actions support ([#22](#22)) ([bdef099](bdef099))
@forest-bot
Copy link
Member

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

forest-bot added a commit that referenced this pull request Mar 9, 2022
# 1.0.0 (2022-03-09)

### Features

* **authentication:** add login & callback actions ([#6](#6)) ([04edd06](04edd06))
* **charts:** add charts support ([#17](#17)) ([8d850b1](8d850b1))
* **crud:** create, update & delete actions ([#13](#13)) ([ed9e7ce](ed9e7ce))
* **crud:** list and show actions [#12](#12) ([4cb9a74](4cb9a74))
* **filters:** add filters behaviour ([#15](#15)) ([bba17bc](bba17bc))
* **onboarding:** add new setup command ([#19](#19)) ([ac9ac85](ac9ac85))
* **onboarding:** update package to laravel9 ([#21](#21)) ([9a4bca1](9a4bca1))
* **permission:** added permission layer ([#16](#16)) ([9273bc7](9273bc7))
* **schema:** build schema json file ([#10](#10)) ([7e795d8](7e795d8))
* **scopes:** added scopes support  ([#18](#18)) ([59edad6](59edad6))
* **search:** add search behaviour ([#14](#14)) ([920af78](920af78))
* **smart-actions:** added smart-actions support ([#22](#22)) ([bdef099](bdef099))
@forest-bot
Copy link
Member

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

jeffladiray pushed a commit that referenced this pull request Mar 9, 2022
* **authentication:** add login & callback actions ([#6](#6)) ([04edd06](04edd06))
* **charts:** add charts support ([#17](#17)) ([8d850b1](8d850b1))
* **crud:** create, update & delete actions ([#13](#13)) ([ed9e7ce](ed9e7ce))
* **crud:** list and show actions [#12](#12) ([4cb9a74](4cb9a74))
* **filters:** add filters behaviour ([#15](#15)) ([bba17bc](bba17bc))
* **onboarding:** add new setup command ([#19](#19)) ([ac9ac85](ac9ac85))
* **onboarding:** update package to laravel9 ([#21](#21)) ([9a4bca1](9a4bca1))
* **permission:** added permission layer ([#16](#16)) ([9273bc7](9273bc7))
* **schema:** build schema json file ([#10](#10)) ([7e795d8](7e795d8))
* **scopes:** added scopes support  ([#18](#18)) ([59edad6](59edad6))
* **search:** add search behaviour ([#14](#14)) ([920af78](920af78))
* **smart-actions:** added smart-actions support ([#22](#22)) ([bdef099](bdef099))
forest-bot added a commit that referenced this pull request Mar 9, 2022
# 1.0.0 (2022-03-09)

### Features

* initial beta release ([b5485ca](b5485ca))
* **authentication:** add login & callback actions ([#6](#6)) ([04edd06](04edd06))
* **charts:** add charts support ([#17](#17)) ([8d850b1](8d850b1))
* **crud:** create, update & delete actions ([#13](#13)) ([ed9e7ce](ed9e7ce))
* **crud:** list and show actions [#12](#12) ([4cb9a74](4cb9a74))
* **filters:** add filters behaviour ([#15](#15)) ([bba17bc](bba17bc))
* **onboarding:** add new setup command ([#19](#19)) ([ac9ac85](ac9ac85))
* **onboarding:** update package to laravel9 ([#21](#21)) ([9a4bca1](9a4bca1))
* **permission:** added permission layer ([#16](#16)) ([9273bc7](9273bc7))
* **schema:** build schema json file ([#10](#10)) ([7e795d8](7e795d8))
* **scopes:** added scopes support  ([#18](#18)) ([59edad6](59edad6))
* **search:** add search behaviour ([#14](#14)) ([920af78](920af78))
* **smart-actions:** added smart-actions support ([#22](#22)) ([bdef099](bdef099))

### BREAKING CHANGES

* users should now be able to onboarding using packagist
@forest-bot
Copy link
Member

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

forest-bot added a commit that referenced this pull request Mar 9, 2022
# 1.0.0-beta.1 (2022-03-09)

### Features

* initial beta-release ([a5e39cb](a5e39cb))
* **authentication:** add login & callback actions ([#6](#6)) ([04edd06](04edd06))
* **charts:** add charts support ([#17](#17)) ([8d850b1](8d850b1))
* **crud:** create, update & delete actions ([#13](#13)) ([ed9e7ce](ed9e7ce))
* **crud:** list and show actions [#12](#12) ([4cb9a74](4cb9a74))
* **filters:** add filters behaviour ([#15](#15)) ([bba17bc](bba17bc))
* **onboarding:** add new setup command ([#19](#19)) ([ac9ac85](ac9ac85))
* **onboarding:** update package to laravel9 ([#21](#21)) ([9a4bca1](9a4bca1))
* **permission:** added permission layer ([#16](#16)) ([9273bc7](9273bc7))
* **schema:** build schema json file ([#10](#10)) ([7e795d8](7e795d8))
* **scopes:** added scopes support  ([#18](#18)) ([59edad6](59edad6))
* **search:** add search behaviour ([#14](#14)) ([920af78](920af78))
* **smart-actions:** added smart-actions support ([#22](#22)) ([bdef099](bdef099))

### BREAKING CHANGES

* package will be available on packagist
@forest-bot
Copy link
Member

🎉 This PR is included in version 1.0.0-beta.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

forest-bot added a commit that referenced this pull request Apr 22, 2022
# 1.0.0 (2022-04-22)

### Features

* **authentication:** add login & callback actions ([#6](#6)) ([04edd06](04edd06))
* **charts:** add charts support ([#17](#17)) ([8d850b1](8d850b1))
* **crud:** create, update & delete actions ([#13](#13)) ([ed9e7ce](ed9e7ce))
* **crud:** list and show actions [#12](#12) ([4cb9a74](4cb9a74))
* **filters:** add filters behaviour ([#15](#15)) ([bba17bc](bba17bc))
* **onboarding:** add new setup command ([#19](#19)) ([ac9ac85](ac9ac85))
* **onboarding:** update package to laravel9 ([#21](#21)) ([9a4bca1](9a4bca1))
* **permission:** added permission layer ([#16](#16)) ([9273bc7](9273bc7))
* **schema:** build schema json file ([#10](#10)) ([7e795d8](7e795d8))
* **scopes:** added scopes support  ([#18](#18)) ([59edad6](59edad6))
* **search:** add search behaviour ([#14](#14)) ([920af78](920af78))
* **smart-actions:** added smart-actions support ([#22](#22)) ([bdef099](bdef099))
@forest-bot
Copy link
Member

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

forest-bot added a commit that referenced this pull request Jun 7, 2022
# 1.0.0 (2022-06-07)

### Bug Fixes

* **schema:** fix method that get the driver of the database ([#43](#43)) ([0770647](0770647))
* authentication on production environment ([#30](#30)) ([3ba7872](3ba7872))
* deploy on production ([#35](#35)) ([9db8471](9db8471))
* readme update documentation link ([#36](#36)) ([3dee307](3dee307))
* **dependency:** fix the dependency that serialize api response ([#34](#34)) ([69f0f74](69f0f74))
* searchExtended on model without relations ([#31](#31)) ([c14a7a7](c14a7a7))
* **schema:** add support on Mariadb enum ([#27](#27)) ([db1d3e6](db1d3e6))
* **schema:** added support enum for mariaDB ([#26](#26)) ([9206a3d](9206a3d))
* fix dependency psr/simple-cache on installation ([#24](#24)) ([3d55fb2](3d55fb2))
* onboarding installation on php8.1 ([#25](#25)) ([ef22634](ef22634))

### Features

* **auth:** add logout route ([#49](#49)) ([369394a](369394a))
* **authentication:** add login & callback actions ([#6](#6)) ([04edd06](04edd06))
* **charts:** add charts support ([#17](#17)) ([8d850b1](8d850b1))
* **config:** add include/exclude models settings ([#46](#46)) ([1dcab5a](1dcab5a))
* **cors:** add access controll allow private network handling  ([#40](#40)) ([036fb08](036fb08))
* **crud:** create, update & delete actions ([#13](#13)) ([ed9e7ce](ed9e7ce))
* **crud:** list and show actions [#12](#12) ([4cb9a74](4cb9a74))
* **deploy:** add FOREST_SEND_APIMAP_AUTOMATIC env to enable automatic sending of the apimap ([#39](#39)) ([781f199](781f199))
* **filters:** add filters behaviour ([#15](#15)) ([bba17bc](bba17bc))
* **ip-whitelist:** add ip-whitelist support ([#38](#38)) ([1fd2585](1fd2585))
* **onboard:** allow user to onboard with laravel valet ([#45](#45)) ([47fa556](47fa556))
* **onboarding:** add a url control on forest install command ([#44](#44)) ([181da4c](181da4c))
* **onboarding:** add new setup command ([#19](#19)) ([ac9ac85](ac9ac85))
* **onboarding:** update package to laravel9 ([#21](#21)) ([9a4bca1](9a4bca1))
* **permission:** added permission layer ([#16](#16)) ([9273bc7](9273bc7))
* **schema:** build schema json file ([#10](#10)) ([7e795d8](7e795d8))
* **scopes:** added scopes support  ([#18](#18)) ([59edad6](59edad6))
* **search:** add search behaviour ([#14](#14)) ([920af78](920af78))
* **smart-actions:** added smart-actions support ([#22](#22)) ([bdef099](bdef099))
* **smart-collections:** add smart-collections support ([1e9f7a7](1e9f7a7))
* **smart-field:** added smart-fields and smart-relationships support ([#28](#28)) ([ee09b7c](ee09b7c))
* **smart-segment:** add smart-segments support ([#33](#33)) ([66d33d3](66d33d3))
* **tests:** improve all tests with factories ([#37](#37)) ([427b22d](427b22d))
* add deactivate count and refactor smart features ([#32](#32)) ([49cddf4](49cddf4))
* initial beta-release ([a5e39cb](a5e39cb))

### BREAKING CHANGES

* package will be available on packagist
@forest-bot
Copy link
Member

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

arnaud-moncel pushed a commit that referenced this pull request Jul 17, 2023
# 1.0.0 (2022-06-07)

### Bug Fixes

* **schema:** fix method that get the driver of the database ([#43](#43)) ([0770647](0770647))
* authentication on production environment ([#30](#30)) ([3ba7872](3ba7872))
* deploy on production ([#35](#35)) ([9db8471](9db8471))
* readme update documentation link ([#36](#36)) ([3dee307](3dee307))
* **dependency:** fix the dependency that serialize api response ([#34](#34)) ([69f0f74](69f0f74))
* searchExtended on model without relations ([#31](#31)) ([c14a7a7](c14a7a7))
* **schema:** add support on Mariadb enum ([#27](#27)) ([db1d3e6](db1d3e6))
* **schema:** added support enum for mariaDB ([#26](#26)) ([9206a3d](9206a3d))
* fix dependency psr/simple-cache on installation ([#24](#24)) ([3d55fb2](3d55fb2))
* onboarding installation on php8.1 ([#25](#25)) ([ef22634](ef22634))

### Features

* **auth:** add logout route ([#49](#49)) ([369394a](369394a))
* **authentication:** add login & callback actions ([#6](#6)) ([04edd06](04edd06))
* **charts:** add charts support ([#17](#17)) ([8d850b1](8d850b1))
* **config:** add include/exclude models settings ([#46](#46)) ([1dcab5a](1dcab5a))
* **cors:** add access controll allow private network handling  ([#40](#40)) ([036fb08](036fb08))
* **crud:** create, update & delete actions ([#13](#13)) ([ed9e7ce](ed9e7ce))
* **crud:** list and show actions [#12](#12) ([4cb9a74](4cb9a74))
* **deploy:** add FOREST_SEND_APIMAP_AUTOMATIC env to enable automatic sending of the apimap ([#39](#39)) ([781f199](781f199))
* **filters:** add filters behaviour ([#15](#15)) ([bba17bc](bba17bc))
* **ip-whitelist:** add ip-whitelist support ([#38](#38)) ([1fd2585](1fd2585))
* **onboard:** allow user to onboard with laravel valet ([#45](#45)) ([47fa556](47fa556))
* **onboarding:** add a url control on forest install command ([#44](#44)) ([181da4c](181da4c))
* **onboarding:** add new setup command ([#19](#19)) ([ac9ac85](ac9ac85))
* **onboarding:** update package to laravel9 ([#21](#21)) ([9a4bca1](9a4bca1))
* **permission:** added permission layer ([#16](#16)) ([9273bc7](9273bc7))
* **schema:** build schema json file ([#10](#10)) ([7e795d8](7e795d8))
* **scopes:** added scopes support  ([#18](#18)) ([59edad6](59edad6))
* **search:** add search behaviour ([#14](#14)) ([920af78](920af78))
* **smart-actions:** added smart-actions support ([#22](#22)) ([bdef099](bdef099))
* **smart-collections:** add smart-collections support ([1e9f7a7](1e9f7a7))
* **smart-field:** added smart-fields and smart-relationships support ([#28](#28)) ([ee09b7c](ee09b7c))
* **smart-segment:** add smart-segments support ([#33](#33)) ([66d33d3](66d33d3))
* **tests:** improve all tests with factories ([#37](#37)) ([427b22d](427b22d))
* add deactivate count and refactor smart features ([#32](#32)) ([49cddf4](49cddf4))
* initial beta-release ([a5e39cb](a5e39cb))

### BREAKING CHANGES

* package will be available on packagist
arnaud-moncel pushed a commit that referenced this pull request Jul 17, 2023
# 1.0.0 (2022-06-07)

### Bug Fixes

* **schema:** fix method that get the driver of the database ([#43](#43)) ([0770647](0770647))
* authentication on production environment ([#30](#30)) ([3ba7872](3ba7872))
* deploy on production ([#35](#35)) ([9db8471](9db8471))
* readme update documentation link ([#36](#36)) ([3dee307](3dee307))
* **dependency:** fix the dependency that serialize api response ([#34](#34)) ([69f0f74](69f0f74))
* searchExtended on model without relations ([#31](#31)) ([c14a7a7](c14a7a7))
* **schema:** add support on Mariadb enum ([#27](#27)) ([db1d3e6](db1d3e6))
* **schema:** added support enum for mariaDB ([#26](#26)) ([9206a3d](9206a3d))
* fix dependency psr/simple-cache on installation ([#24](#24)) ([3d55fb2](3d55fb2))
* onboarding installation on php8.1 ([#25](#25)) ([ef22634](ef22634))

### Features

* **auth:** add logout route ([#49](#49)) ([369394a](369394a))
* **authentication:** add login & callback actions ([#6](#6)) ([04edd06](04edd06))
* **charts:** add charts support ([#17](#17)) ([8d850b1](8d850b1))
* **config:** add include/exclude models settings ([#46](#46)) ([1dcab5a](1dcab5a))
* **cors:** add access controll allow private network handling  ([#40](#40)) ([036fb08](036fb08))
* **crud:** create, update & delete actions ([#13](#13)) ([ed9e7ce](ed9e7ce))
* **crud:** list and show actions [#12](#12) ([4cb9a74](4cb9a74))
* **deploy:** add FOREST_SEND_APIMAP_AUTOMATIC env to enable automatic sending of the apimap ([#39](#39)) ([781f199](781f199))
* **filters:** add filters behaviour ([#15](#15)) ([bba17bc](bba17bc))
* **ip-whitelist:** add ip-whitelist support ([#38](#38)) ([1fd2585](1fd2585))
* **onboard:** allow user to onboard with laravel valet ([#45](#45)) ([47fa556](47fa556))
* **onboarding:** add a url control on forest install command ([#44](#44)) ([181da4c](181da4c))
* **onboarding:** add new setup command ([#19](#19)) ([ac9ac85](ac9ac85))
* **onboarding:** update package to laravel9 ([#21](#21)) ([9a4bca1](9a4bca1))
* **permission:** added permission layer ([#16](#16)) ([9273bc7](9273bc7))
* **schema:** build schema json file ([#10](#10)) ([7e795d8](7e795d8))
* **scopes:** added scopes support  ([#18](#18)) ([59edad6](59edad6))
* **search:** add search behaviour ([#14](#14)) ([920af78](920af78))
* **smart-actions:** added smart-actions support ([#22](#22)) ([bdef099](bdef099))
* **smart-collections:** add smart-collections support ([1e9f7a7](1e9f7a7))
* **smart-field:** added smart-fields and smart-relationships support ([#28](#28)) ([ee09b7c](ee09b7c))
* **smart-segment:** add smart-segments support ([#33](#33)) ([66d33d3](66d33d3))
* **tests:** improve all tests with factories ([#37](#37)) ([427b22d](427b22d))
* add deactivate count and refactor smart features ([#32](#32)) ([49cddf4](49cddf4))
* initial beta-release ([a5e39cb](a5e39cb))

### BREAKING CHANGES

* package will be available on packagist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants