Releases: llstarscreamll/Crud
v3.7.1
v3.7
Added
- Add example code generated from the functional tests on the CrudExample folder.
Fixed
- Fix conflictive template names for windows, closes #2.
Changed
- Use own layout, no external layout needed now.
- Add GUI to regenerate several apps from existing config files with one click.
- Real paths are now used to generate de Angular and apiato container, nothing to move or copy. This improves the app performance.
- [Angular]:
- use acl directives from Hello-Angular.
- more detailed and descriptive tests generated.
- add loader component while getting data from API on table list and form components.
- API msgs state are now isolated per module instead of the global approeach.
- make components more decupled and reusable, not need to recreate the entire store selector stuff for use a simple compenent.
- components and pages uses abstract classes to share common logic.
- rename many class methods.
- other improvements setting up ngrx actions and effects.
- add a few more stuff for mockbackend on tests.
- rename containers folder to pages.
- add dockBlock to generated classes/files, developer should make an IDE search and replace to set the desired values.
- many improvements, fixes and clean up on generated module.
- [API]:
- remove action to bootstrap Codeception test suit, the developer must do it after generate de container, this improves the app performance.
- remove action to format generated code with php-cs-fixer, the developer should do it manually, this improves the app performance.
- add option on GUI to decide if group main container classes like actions, tasks, tests, etc...
- append real id attr on transformer if current user is admin.
- update permissions names to fit the format plural.action, e.g. books.list_and_seacrch
- improvements on generated factories for testing stuff
- use one main container helper class on tests instead of having one per entity.
- add db assertions on generated tests.
- rename tests class methods.
- add classes docBlock whit author tag, developer should make an IDE search and replace to set the desired values.
- Rename readme and changelog files.
Removed
- [Angular]:
- remove empty generated files, like the css components files.
- [API]:
- remove empty UI/CLI generated folder.
V3.5
- no external base layout needed anymore, now using own layout with vanilla bootstrap 3.3.7
- many setup GUI fixes and improvements
- many bug fixes and improvements on generated API container
- many bug fixes and improvements on generated Angular module
Upgrade Generated API Code to apiato 4.0.2 and many features and bug fixes on Angular module
- Upgrade the generated API code to the latest release from apiato 4.0.2.
- Added English translations files for templates generation.
- Add ability to generate the desired language translations for API and Angular code (es, en, ru, etc...).
- Add some DocBlocks to generated API controllers methods.
- Setup the
url
parameter on Laravel Codeception moduleapi.suit.yml
test suit according to theAPI_URL
.env
var. - The generated Angular module has upgrades usage on all libraries.
- Generated Angular components have now several tests, so a few testing utils are generated too.
- Append Criteria to Repositories for search trashed (softDeleted) records if the given database table has the
deleted_at
column, so this criteria should be created on the respective folder:
<?php
namespace App\Ship\Criterias\Eloquent;
use App\Ship\Parents\Criterias\Criteria;
use Illuminate\Support\Facades\DB;
use Prettus\Repository\Contracts\RepositoryInterface as PrettusRepositoryInterface;
/**
* Class TrashedCriteria
*
* @author Johan Alvarez <llstarscreaml@hotmail.com>
*/
class TrashedCriteria extends Criteria
{
/**
* @var
*/
private $trashed;
/**
* ThisFieldCriteria constructor.
*
* @param $trashed
*/
public function __construct($trashed)
{
$this->trashed = $trashed;
}
/**
* @param $model
* @param \Prettus\Repository\Contracts\RepositoryInterface $repository
*
* @return mixed
*/
public function apply($model, PrettusRepositoryInterface $repository)
{
switch ($this->trashed) {
case 'withTrashed':
return $model->withTrashed();
break;
case 'onlyTrashed':
return $model->onlyTrashed();
break;
default:
return $model;
break;
}
}
}
The files/folder generated for a container called Library with a table called books:
─── Library
├── Actions
│ └── Book
│ ├── BookFormDataAction.php
│ ├── CreateBookAction.php
│ ├── DeleteBookAction.php
│ ├── GetBookAction.php
│ ├── ListAndSearchBooksAction.php
│ ├── RestoreBookAction.php
│ └── UpdateBookAction.php
├── codeception.yml
├── composer.json
├── Configs
│ └── book-form-model.php
├── Data
│ ├── Criterias
│ │ └── Book
│ │ └── AdvancedBookSearchCriteria.php
│ ├── Factories
│ │ └── BookFactory.php
│ ├── Migrations
│ ├── Repositories
│ │ └── BookRepository.php
│ └── Seeders
├── Exceptions
│ ├── BookCreationFailedException.php
│ └── BookNotFoundException.php
├── Models
│ └── Book.php
├── Tasks
│ └── Book
│ ├── CreateBookTask.php
│ ├── DeleteBookTask.php
│ ├── GetBookTask.php
│ ├── ListAndSearchBooksTask.php
│ ├── RestoreBookTask.php
│ └── UpdateBookTask.php
├── tests
│ ├── acceptance
│ │ └── _bootstrap.php
│ ├── acceptance.suite.yml
│ ├── api
│ │ ├── Book
│ │ │ ├── BookFormDataCest.php
│ │ │ ├── BookFormModelCest.php
│ │ │ ├── CreateBookCest.php
│ │ │ ├── DeleteBookCest.php
│ │ │ ├── GetBookCest.php
│ │ │ ├── ListAndSearchBooksCest.php
│ │ │ ├── RestoreBookCest.php
│ │ │ └── UpdateBookCest.php
│ │ └── _bootstrap.php
│ ├── api.suite.yml
│ ├── _bootstrap.php
│ ├── _data
│ │ └── dump.sql
│ ├── _envs
│ ├── functional
│ │ └── _bootstrap.php
│ ├── functional.suite.yml
│ ├── _output
│ ├── _support
│ │ ├── AcceptanceTester.php
│ │ ├── ApiTester.php
│ │ ├── FunctionalTester.php
│ │ ├── _generated
│ │ │ ├── AcceptanceTesterActions.php
│ │ │ ├── ApiTesterActions.php
│ │ │ ├── FunctionalTesterActions.php
│ │ │ └── UnitTesterActions.php
│ │ ├── Helper
│ │ │ ├── Acceptance.php
│ │ │ ├── Api.php
│ │ │ ├── Functional.php
│ │ │ ├── Unit.php
│ │ │ └── UserHelper.php
│ │ └── UnitTester.php
│ ├── unit
│ │ └── _bootstrap.php
│ └── unit.suite.yml
└── UI
├── API
│ ├── Controllers
│ │ └── BookController.php
│ ├── Requests
│ │ └── Book
│ │ ├── CreateBookRequest.php
│ │ ├── DeleteBookRequest.php
│ │ ├── GetBookRequest.php
│ │ ├── ListAndSearchBooksRequest.php
│ │ ├── RestoreBookRequest.php
│ │ └── UpdateBookRequest.php
│ ├── Routes
│ │ ├── BookFormData.v1.private.php
│ │ ├── BookFormModel.v1.private.php
│ │ ├── CreateBook.v1.private.php
│ │ ├── DeleteBook.v1.private.php
│ │ ├── GetBook.v1.private.php
│ │ ├── ListAndSearchBooks.v1.private.php
│ │ ├── RestoreBook.v1.private.php
│ │ └── UpdateBook.v1.private.php
│ └── Transformers
│ └── BookTransformer.php
├── CLI
└── WEB
├── Controllers
├── Requests
├── Routes
└── Views
For the above library example the generated Angular module files/folders are:
─── library
├── actions
│ └── book.actions.ts
├── components
│ ├── book
│ │ ├── book-form-fields.component.css
│ │ ├── book-form-fields.component.html
│ │ ├── book-form-fields.component.spec.ts
│ │ ├── book-form-fields.component.ts
│ │ ├── book-search-advanced.component.css
│ │ ├── book-search-advanced.component.html
│ │ ├── book-search-advanced.component.spec.ts
│ │ ├── book-search-advanced.component.ts
│ │ ├── book-search-basic.component.css
│ │ ├── book-search-basic.component.html
│ │ ├── book-search-basic.component.spec.ts
│ │ ├── book-search-basic.component.ts
│ │ ├── books-table.component.css
│ │ ├── books-table.component.html
│ │ ├── books-table.component.spec.ts
│ │ ├── books-table.component.ts
│ │ └── index.ts
│ └── index.ts
├── containers
│ ├── book
│ │ ├── book-abstract.page.ts
│ │ ├── book-form.page.css
│ │ ├── book-form.page.html
│ │ ├── book-form.page.spec.ts
│ │ ├── book-form.page.ts
│ │ ├── index.ts
│ │ ├── list-and-search-books.page.css
│ │ ├── list-and-search-books.page.html
│ │ ├── list-and-search-books.page.spec.ts
│ │ └── list-and-search-books.page.ts
│ └── index.ts
├── effects
│ ├── book.effects.ts
│ └── index.ts
├── library.module.ts
├── library-routing.module.ts
├── models
│ ├── bookPagination.ts
│ └── book.ts
├── reducers
│ └── book.reducer.ts
├── routes
│ ├── book.routes.ts
│ └── index.ts
├── services
│ ├── book.service.ts
│ └── index.ts
├── translations
│ └── es
│ ├── book.ts
│ └── index.ts
└── utils
├── book-testing-util.ts
└── book-testing.util.ts
Porting as PORTO Container for Hello-API
The package now works as a PORTO Container for Hello-API. To install you should run this command from the Hello-API roo folder:
git clone https://github.com/llstarscreamll/Crud.git app/Containers/Crud
composer update
It's all. Now login on admin area and visit admin.hello.dev/crud, digit a database table name and set the CRUD app options.
Plus many new bugs fixes and improvements for the PORTO Container and the Angular 2 module.
PS: this package needs some layout, at the moment this layout can be used.
Angular Module and PORTO container improvements
Add optional feature to generate Angular module that works under Hello-Angular base application, the generated Angular Module consumes the generated PORTO container generated. There are many work to do and optimizations for the generated Angular module and PORTO container.
Basic Porto API Container Generation
Generate PORTO container implementing the API ui only, here are the folder structure with the files generated having a books
table and container name as Library
:
LibraryContainer
├── Actions
│ └── Book
│ ├── CreateBookAction.php
│ ├── DeleteBookAction.php
│ ├── GetBookAction.php
│ ├── ListAndSearchBooksAction.php
│ ├── RestoreBookAction.php
│ └── UpdateBookAction.php
├── codeception.yml
├── composer.json
├── Data
│ ├── Criterias
│ ├── Factories
│ │ └── BookFactory.php
│ ├── Migrations
│ │ └── 2016_05_19_155018_create_books_table.php
│ ├── Repositories
│ │ └── BookRepository.php
│ └── Seeders
├── Exceptions
│ ├── BookCreationFailedException.php
│ └── BookNotFoundException.php
├── Models
│ └── Book.php
├── Tasks
│ └── Book
│ ├── CreateBookTask.php
│ ├── DeleteBookTask.php
│ ├── GetBookTask.php
│ ├── ListAndSearchBooksTask.php
│ ├── ListBooksTask.php
│ ├── RestoreBookTask.php
│ └── UpdateBookTask.php
├── tests
│ ├── acceptance
│ │ └── _bootstrap.php
│ ├── acceptance.suite.yml
│ ├── api
│ │ ├── Book
│ │ │ ├── CreateBookCest.php
│ │ │ ├── DeleteBookCest.php
│ │ │ ├── GetBookCest.php
│ │ │ ├── ListAndSearchBooksCest.php
│ │ │ ├── RestoreBookCest.php
│ │ │ └── UpdateBookCest.php
│ │ └── _bootstrap.php
│ ├── api.suite.yml
│ ├── _bootstrap.php
│ ├── _data
│ │ └── dump.sql
│ ├── _envs
│ ├── functional
│ │ └── _bootstrap.php
│ ├── functional.suite.yml
│ ├── _output
│ ├── _support
│ │ ├── AcceptanceTester.php
│ │ ├── ApiTester.php
│ │ ├── FunctionalTester.php
│ │ ├── Helper
│ │ │ ├── Acceptance.php
│ │ │ ├── Api.php
│ │ │ ├── Functional.php
│ │ │ ├── Unit.php
│ │ │ └── UserHelper.php
│ │ └── UnitTester.php
│ ├── unit
│ │ └── _bootstrap.php
│ └── unit.suite.yml
└── UI
├── API
│ ├── Controllers
│ │ └── Controller.php
│ ├── Requests
│ │ └── Book
│ │ ├── CreateBookRequest.php
│ │ ├── DeleteBookRequest.php
│ │ ├── GetBookRequest.php
│ │ ├── ListAllBooksRequest.php
│ │ ├── ListAndSearchBooksRequest.php
│ │ ├── RestoreBookRequest.php
│ │ └── UpdateBookRequest.php
│ ├── Routes
│ │ ├── CreateBook.v1.private.php
│ │ ├── DeleteBook.v1.private.php
│ │ ├── GetBook.v1.private.php
│ │ ├── ListAndSearchBooks.v1.private.php
│ │ ├── ListBooks.v1.private.php
│ │ ├── RestoreBook.v1.private.php
│ │ └── UpdateBook.v1.private.php
│ └── Transformers
│ └── BookTransformer.php
├── CLI
└── WEB
├── Controllers
├── Requests
├── Routes
└── Views
v2.0
Actualizaciones menores
v1.0
Actualizaciones menores