Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/v3.7.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
llstarscreamll committed Jun 19, 2017
2 parents a4c68fb + ca8995b commit dbeef30
Show file tree
Hide file tree
Showing 189 changed files with 1,496 additions and 1,412 deletions.
5 changes: 5 additions & 0 deletions Actions/GenerateAngular2ModuleAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class GenerateAngular2ModuleAction
{
public function run(Collection $request)
{
// prevent persist data generated from factories
\DB::beginTransaction();

// generate the base folders
$createAngular2DirsTask = new CreateAngular2DirsTask($request);
$createAngular2DirsTask->run();
Expand Down Expand Up @@ -72,5 +75,7 @@ public function run(Collection $request)
// generate utils
$createNgUtilsTask = new CreateNgUtilsTask($request);
$createNgUtilsTask->run();

\DB::rollback();
}
}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Release Notes

## 3.7.1 (2017-06-18)

### Fixed

- Prevent persist data when Angular module test utils are generated from Laravel models factories.

### Changed

- Rename templates variable `$gen` to `$crud`.
- Rename changelog, lisence and readme files.
- Rename test folder to Tests.

## 3.7 (2017-06-14)

### Added
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion Providers/ControllerGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function run()
$content = view(
$this->templatesDir().'.controller',
[
'gen' => $this,
'crud' => $this,
'fields' => $this->advanceFields($this->request),
'foreign_keys' => $this->getForeignKeys($this->table_name),
'request' => $this->request,
Expand Down
2 changes: 1 addition & 1 deletion Providers/FormRequestGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function run()
$content = view(
$this->templatesDir().'.formRequests.create-form-request',
[
'gen' => $this,
'crud' => $this,
'fields' => $this->advanceFields($this->request),
'request' => $this->request,
]
Expand Down
2 changes: 1 addition & 1 deletion Providers/LangGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function generateLangFiles()
$content = view(
$this->templatesDir().'.lang',
[
'gen' => $this,
'crud' => $this,
'fields' => $this->advanceFields($this->request),
'request' => $this->request,
]
Expand Down
2 changes: 1 addition & 1 deletion Providers/ModelFactoryGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function run()
$content = view(
$this->templatesDir().'.model-factory',
[
'gen' => $this,
'crud' => $this,
'fields' => $this->advanceFields($this->request),
'request' => $this->request,
]
Expand Down
2 changes: 1 addition & 1 deletion Providers/ModelGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function run()
$content = view(
$this->templatesDir().'.model',
[
'gen' => $this,
'crud' => $this,
'fields' => $this->advanceFields($this->request),
'request' => $this->request,
]
Expand Down
6 changes: 3 additions & 3 deletions Providers/RepositoryGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function buildContract()
$content = view(
$this->templatesDir().'.repositoryInterface',
[
'gen' => $this,
'crud' => $this,
'fields' => $this->advanceFields($this->request),
'request' => $this->request,
]
Expand All @@ -101,7 +101,7 @@ public function buildImplementation()
$content = view(
$this->templatesDir().'.repositoryEloquentImplementation',
[
'gen' => $this,
'crud' => $this,
'fields' => $this->advanceFields($this->request),
'request' => $this->request,
]
Expand All @@ -128,7 +128,7 @@ public function buildCriteria()
$content = view(
$this->templatesDir().'.repositoryCriteria',
[
'gen' => $this,
'crud' => $this,
'fields' => $this->advanceFields($this->request),
'request' => $this->request,
]
Expand Down
4 changes: 2 additions & 2 deletions Providers/SeedersGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function generatePermissionSeeder()
$content = view(
$this->templatesDir().'.seeders.module-permissions-seeder',
[
'gen' => $this,
'crud' => $this,
'fields' => $this->advanceFields($this->request),
'request' => $this->request,
]
Expand All @@ -88,7 +88,7 @@ public function generateFakeDataSeeder()
$content = view(
$this->templatesDir().'.seeders.module-fake-data-seeder',
[
'gen' => $this,
'crud' => $this,
'fields' => $this->advanceFields($this->request),
'request' => $this->request,
]
Expand Down
2 changes: 1 addition & 1 deletion Providers/ServiceGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function run()
$content = view(
$this->templatesDir().'.service',
[
'gen' => $this,
'crud' => $this,
'fields' => $this->advanceFields($this->request),
'request' => $this->request,
'foreign_keys' => $this->getForeignKeys($this->table_name),
Expand Down
4 changes: 2 additions & 2 deletions Providers/TestsGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function generatePageObject($test)
$content = view(
$this->templatesDir().'.pageObjects.'.$test,
[
'gen' => $this,
'crud' => $this,
'fields' => $this->advanceFields($this->request),
'test' => $test,
'request' => $this->request,
Expand All @@ -134,7 +134,7 @@ public function generateFunctionalTests($test)
$content = view(
$this->templatesDir().'.tests.'.$test,
[
'gen' => $this,
'crud' => $this,
'fields' => $this->advanceFields($this->request),
'test' => $test,
'request' => $this->request,
Expand Down
2 changes: 1 addition & 1 deletion Providers/ViewsGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function run()
$content = view(
$this->templatesDir().'.views.'.$this->request->get('UI_theme').'.'.$view,
[
'gen' => $this,
'crud' => $this,
'fields' => $this->advanceFields($this->request),
'request' => $this->request,
]
Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreateActionsTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function run()
$template = $this->templatesDir().'.Porto/Actions/'.$file;

$content = view($template, [
'gen' => $this,
'crud' => $this,
'fields' => $this->parsedFields
]);

Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreateApiControllerTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function run()
$template = $this->templatesDir().'.Porto/UI/API/Controllers/'.$file;

$content = view($template, [
'gen' => $this,
'crud' => $this,
'fields' => $this->parsedFields
]);

Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreateApiRequestsTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function run()
$template = $this->templatesDir().'.Porto/UI/API/Requests/'.$file;

$content = view($template, [
'gen' => $this,
'crud' => $this,
'fields' => $this->parsedFields
]);

Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreateApiRoutesTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function run()
$routeFile = $this->apiRoutesFolder().'/'.$this->apiRouteFile($file, $plural);
$template = $this->templatesDir().'.Porto/UI/API/Routes/'.$file;

$content = view($template, ['gen' => $this]);
$content = view($template, ['crud' => $this]);

file_put_contents($routeFile, $content) === false
? session()->push('error', "Error creating $file task file")
Expand Down
8 changes: 4 additions & 4 deletions Tasks/CreateCodeceptionTestsTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private function configureCodeceptSuite(string $suite, string $modules)
public function copyRootBoostrapFile()
{
$fileContents = view($this->templatesDir().'.Porto.tests._bootstrap', [
'gen' => $this,
'crud' => $this,
'fields' => $this->parsedFields
]);

Expand Down Expand Up @@ -142,7 +142,7 @@ public function getHelperClassContents(): string
$template = $this->templatesDir().'.Porto.tests._support.Helper.-container-Helper';

return (string) view($template, [
'gen' => $this,
'crud' => $this,
'fields' => $this->parsedFields
]);
}
Expand All @@ -161,7 +161,7 @@ public function addMethodToHelper(string $helperFileContents): string
$methodTemplate = $this->templatesDir().'.Porto.tests._support.Helper.helperFunction';
$helperMethodName = "function init{$this->entityName()}Data";
$fullMethod = "\n ".view($methodTemplate, [
'gen' => $this,
'crud' => $this,
'fields' => $this->parsedFields
]);

Expand Down Expand Up @@ -251,7 +251,7 @@ private function generateApiTests()
$template = $this->templatesDir().'.Porto/tests/api/'.$file;

$content = view($template, [
'gen' => $this,
'crud' => $this,
'fields' => $this->parsedFields
]);

Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreateComposerFileTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function run(string $container)
$composerFile = $this->containerFolder().'/composer.json';
$template = $this->templatesDir().'.Porto/composer';

$content = view($template, ['gen' => $this]);
$content = view($template, ['crud' => $this]);

file_put_contents($composerFile, $content) === false
? session()->push('error', 'Error creating composer file')
Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreateExceptionsTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function run()
$exceptionFile = $this->exceptionsFolder()."/{$this->entityName()}{$file}.php";
$template = $this->templatesDir().'.Porto/Exceptions/'.$file;

$content = view($template, ['gen' => $this]);
$content = view($template, ['crud' => $this]);

file_put_contents($exceptionFile, $content) === false
? session()->push('error', "Error creating $file task file")
Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreateFormModelConfigTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function run()
$template = $this->templatesDir().'.Porto.Configs.form-model';

$content = view($template, [
'gen' => $this,
'crud' => $this,
'fields' => $this->parsedFields
]);

Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreateModelFactoryAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function run()
$template = $this->templatesDir().'.Porto/Data/Factories/'.$file;

$content = view($template, [
'gen' => $this,
'crud' => $this,
'fields' => $this->parsedFields
]);

Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreateModelFactoryTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function run()
$template = $this->templatesDir().'.Porto/Data/Factories/'.$file;

$content = view($template, [
'gen' => $this,
'crud' => $this,
'fields' => $this->parsedFields
]);

Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreateModelTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function run()
$template = $this->templatesDir().'.Porto/Models/'.$file;

$content = view($template, [
'gen' => $this,
'crud' => $this,
'fields' => $this->parsedFields
]);

Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreateNgActionsTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function run()
$template = $this->templatesDir().'.Angular2/actions/actions';

$content = view($template, [
'gen' => $this,
'crud' => $this,
'fields' => $this->parsedFields
]);

Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreateNgComponentsTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function run()
$template = $this->templatesDir().'.Angular2.components.'.$file;

$content = view($template, [
'gen' => $this,
'crud' => $this,
'fields' => $this->parsedFields
]);

Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreateNgContainersTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function run()
$template = $this->templatesDir().'.Angular2.pages.'.$file;

$content = view($template, [
'gen' => $this,
'crud' => $this,
'fields' => $this->parsedFields
]);

Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreateNgEffectsTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function run()
$template = $this->templatesDir().'.Angular2/effects/effects';

$content = view($template, [
'gen' => $this,
'crud' => $this,
'fields' => $this->parsedFields
]);

Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreateNgModelTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function generateModel($template, $model)
$template = $this->templatesDir().'.Angular2/models/'.$template;

$content = view($template, [
'gen' => $this,
'crud' => $this,
'fields' => $this->parsedFields
]);

Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreateNgModulesTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function run()
$template = $this->templatesDir().'.Angular2.'.$file;

$content = view($template, [
'gen' => $this,
'crud' => $this,
'fields' => $this->parsedFields
]);

Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreateNgReducerTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function run()
$template = $this->templatesDir().'.Angular2/reducers/reducer';

$content = view($template, [
'gen' => $this,
'crud' => $this,
'fields' => $this->parsedFields
]);

Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreateNgRoutesTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function run()
$template = $this->templatesDir().'.Angular2.routes.routes';

$content = view($template, [
'gen' => $this,
'crud' => $this,
'fields' => $this->parsedFields
]);

Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreateNgServiceTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function run()
$template = $this->templatesDir().'.Angular2/services/service';

$content = view($template, [
'gen' => $this,
'crud' => $this,
'fields' => $this->parsedFields
]);

Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreateNgTranslationsTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function run()
$template = $this->templatesDir().'.Angular2.translations.'.$file;

$content = view($template, [
'gen' => $this,
'crud' => $this,
'fields' => $this->parsedFields
]);

Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreateNgUtilsTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function run()
$template = $this->templatesDir().'.Angular2.utils.'.$file;

$content = view($template, [
'gen' => $this,
'crud' => $this,
'request' => $this->request,
'fields' => $this->parsedFields
]);
Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreatePortoCriteriasTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function run()
$template = $this->templatesDir().'.Porto/Data/Criterias/'.$file;

$content = view($template, [
'gen' => $this,
'crud' => $this,
'fields' => $this->parsedFields
]);

Expand Down
Loading

0 comments on commit dbeef30

Please sign in to comment.