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

Commit

Permalink
rename files with conflictive names on windows, closes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
llstarscreamll committed Jun 14, 2017
1 parent 75b74f0 commit 99f8170
Show file tree
Hide file tree
Showing 37 changed files with 140 additions and 125 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { forOwn, isNull } from 'lodash';

import { FormModelParserService } from './../../../dynamic-form/services/form-model-parser.service';
import { AppMessage } from './../../../core/models/appMessage';
import * as appMessage from './../../../core/reducers/app-message.reducer';
import * as fromRoot from './../../../reducers';

import * as bookActions from './../../actions/book.actions';
Expand Down Expand Up @@ -159,8 +158,8 @@ export abstract class BookAbstractComponent {
this.formModel$ = this.store.select(fromRoot.getBookFormModel);
this.formData$ = this.store.select(fromRoot.getBookFormData);
this.searchQuery$ = this.store.select(fromRoot.getBookSearchQuery);
this.itemsPagination$ = this.store.select(fromRoot.getBooksPagination);
this.selectedItem$ = this.store.select(fromRoot.getSelectedBook);
this.itemsPagination$ = this.store.select(fromRoot.getBookPagination);
this.selectedItem$ = this.store.select(fromRoot.getBookSelected);
this.loading$ = this.store.select(fromRoot.getBookLoading);
this.messages$ = this.store.select(fromRoot.getBookMessages);

Expand All @@ -175,7 +174,7 @@ export abstract class BookAbstractComponent {
this.formDataSubscription$ = this.formData$
.subscribe(data => {
if (data) {
let ready = false;
let ready = true;

forOwn(data, (item) => {
if (isNull(item)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<dynamic-form-fields
*ngIf="formReady"
class="dynamic-form-fields row"
class="row"
[form]="form"
[formModel]="formModel$ | async"
[formData]="formData$ | async"
Expand Down
164 changes: 91 additions & 73 deletions CrudExample/angular/components/book/book-form.component.spec.ts

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions CrudExample/angular/components/book/book-form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Router, ActivatedRoute } from '@angular/router';
import { go } from '@ngrx/router-store';

import { FormModelParserService } from './../../../dynamic-form/services/form-model-parser.service';
import * as appMessage from './../../../core/reducers/app-message.reducer';
import * as fromRoot from './../../../reducers';
import * as bookReducer from './../../reducers/book.reducer';
import * as bookActions from './../../actions/book.actions';
Expand Down Expand Up @@ -103,7 +102,7 @@ export class BookFormComponent extends BookAbstractComponent implements OnInit,
if (this.formType == 'details' || this.formType == 'edit') {
this.selectedItemSubscription$ = this.selectedItem$
.subscribe((book) => {
if (book != null && book.id && book.id.includes(this.selectedItemId)) {
if (book != null && book.id && book.id == this.selectedItemId) {
this.form.patchValue(book);
this.formReady = true;
this.selectedItemReady = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
</ng-template>
<div class="panel-body">
<dynamic-form-fields
class="dynamic-form-fields"
[form]="form.get('options')"
[formModel]="formModel.options.controls"
[formData]="{}"
Expand All @@ -34,7 +33,6 @@
</ng-template>
<div class="panel-body">
<dynamic-form-fields
class="dynamic-form-fields"
[form]="form.get('search')"
[formModel]="formModel.search.controls"
[formData]="formData$ | async"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { ES } from './../../translations/es';
import { BookService } from './../../services/book.service';
import { Book } from './../../models/book';
import * as utils from './../../utils/book-testing.util';
import { AUTH_TESTING_COMPONENTS } from "app/auth/utils/auth-testing-utils";

/**
* BookSearchAdvancedComponent Tests.
Expand All @@ -36,7 +37,7 @@ describe('BookSearchAdvancedComponent', () => {

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [BookSearchAdvancedComponent],
declarations: [...AUTH_TESTING_COMPONENTS, BookSearchAdvancedComponent],
imports: [
utils.IMPORTS
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Router, ActivatedRoute } from '@angular/router';
import { forOwn, isNull, isEmpty } from 'lodash';

import * as fromRoot from './../../../reducers';
import * as appMessage from './../../../core/reducers/app-message.reducer';
import { FormModelParserService } from './../../../dynamic-form/services/form-model-parser.service';
import * as bookReducer from './../../reducers/book.reducer';
import * as bookActions from './../../actions/book.actions';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { ES } from './../../translations/es';
import { BookService } from './../../services/book.service';
import { Book } from './../../models/book';
import * as utils from './../../utils/book-testing.util';
import { AUTH_TESTING_COMPONENTS } from "app/auth/utils/auth-testing-utils";

/**
* BookSearchBasicComponent Tests.
Expand All @@ -36,7 +37,7 @@ describe('BookSearchBasicComponent', () => {

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [BookSearchBasicComponent],
declarations: [...AUTH_TESTING_COMPONENTS, BookSearchBasicComponent],
imports: [
utils.IMPORTS
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { ES } from './../../translations/es';
import { BookService } from './../../services/book.service';
import { Book } from './../../models/book';
import * as utils from './../../utils/book-testing.util';
import { AUTH_TESTING_COMPONENTS } from "app/auth/utils/auth-testing-utils";

/**
* BooksTableComponent Tests.
Expand All @@ -37,7 +38,7 @@ describe('BooksTableComponent', () => {

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [BooksTableComponent],
declarations: [...AUTH_TESTING_COMPONENTS, BooksTableComponent],
imports: [
utils.IMPORTS
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { TranslateService } from '@ngx-translate/core';

import * as bookActions from './../../actions/book.actions';
import * as fromRoot from './../../../reducers';
import * as appMessage from './../../../core/reducers/app-message.reducer';
import { FormModelParserService } from './../../../dynamic-form/services/form-model-parser.service';
import * as bookReducer from './../../reducers/book.reducer';

Expand Down
1 change: 0 additions & 1 deletion CrudExample/angular/effects/book.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { empty } from 'rxjs/observable/empty';
import 'rxjs/add/operator/withLatestFrom';

import * as fromRoot from './../../reducers';
import * as appMsgActions from './../../core/actions/app-message.actions';
import * as book from './../actions/book.actions';
import * as reason from './../../reason/actions/reason.actions';
import * as user from './../../user/actions/user.actions';
Expand Down
14 changes: 3 additions & 11 deletions CrudExample/angular/library.module.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { Ng2BootstrapModule } from 'ngx-bootstrap';
import { TranslateService, TranslateModule } from '@ngx-translate/core';
import { TranslateService } from '@ngx-translate/core';

import { DynamicFormModule } from './../dynamic-form/dynamic-form.module';
import { CoreSharedModule } from './../core/core.shared.module';
import { environment } from './../../environments/environment';

import { PAGES } from './pages';
import { COMPONENTS } from './components';
import { ES } from './translations/es';
import { EFFECTS } from './effects';
import { SERVICES } from './services';
import { ES } from './translations/es';
import { LibraryRoutingModule } from './library-routing.module';

/**
Expand All @@ -21,12 +18,7 @@ import { LibraryRoutingModule } from './library-routing.module';
*/
@NgModule({
imports: [
CommonModule,
ReactiveFormsModule,
environment.theme,
Ng2BootstrapModule.forRoot(),
TranslateModule,
DynamicFormModule,
CoreSharedModule,
LibraryRoutingModule,
...EFFECTS,
Expand Down
2 changes: 1 addition & 1 deletion CrudExample/angular/models/book.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Reason } from './../../reason/models/reason';
* @author [name] <[<email address>]>
*/
export class Book {
id: string;
id: string | number;
reason_id: number;
name: string;
author: string;
Expand Down
1 change: 0 additions & 1 deletion CrudExample/angular/pages/book/book-abstract.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { Subscription } from 'rxjs/Subscription';
import swal from 'sweetalert2';

import { FormModelParserService } from './../../../dynamic-form/services/form-model-parser.service';
import * as appMessage from './../../../core/reducers/app-message.reducer';
import * as fromRoot from './../../../reducers';

import * as bookActions from './../../actions/book.actions';
Expand Down
2 changes: 2 additions & 0 deletions CrudExample/angular/pages/book/book-form.page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { BookFormPage } from './book-form.page';
import { BookComponents } from './../../components/book';
import { BookPages } from './../../pages/book';
import { BookService } from './../../services/book.service';
import { AUTH_TESTING_COMPONENTS } from "app/auth/utils/auth-testing-utils";

/**
* BookFormPage Tests.
Expand All @@ -35,6 +36,7 @@ describe('BookFormPage', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
...AUTH_TESTING_COMPONENTS,
...BookComponents,
...BookPages,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { ListAndSearchBooksPage } from './list-and-search-books.page';
import { BookComponents } from './../../components/book';
import { BookPages } from './../../pages/book';
import { BookService } from './../../services/book.service';
import { AUTH_TESTING_COMPONENTS } from "app/auth/utils/auth-testing-utils";

/**
* ListAndSearchBooksPage Tests.
Expand All @@ -37,6 +38,7 @@ describe('ListAndSearchBooksPage', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
...AUTH_TESTING_COMPONENTS,
...BookComponents,
...BookPages,
],
Expand Down
4 changes: 2 additions & 2 deletions CrudExample/angular/services/book.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/catch';
import { TranslateService } from '@ngx-translate/core';

import { Service } from './../../core/services/abstract.service';
import { AbstractService } from './../../core/services/abstract.service';
import { LocalStorageService } from './../../core/services/local-storage.service';
import { BookPagination } from './../models/bookPagination';
import { Book } from './../models/book';
Expand All @@ -16,7 +16,7 @@ import { AppMessage } from './../../core/models/appMessage';
* @author [name] <[<email address>]>
*/
@Injectable()
export class BookService extends Service {
export class BookService extends AbstractService {
/**
* API endpoint.
* @type string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
use App\Ship\Parents\Criterias\Criteria;

/**
* AdvancedBookSearchCriteria Class.
* Advanced:entity:SearchCriteria Class.
*
* @author [name] <[<email address>]>
*/
class AdvancedBookSearchCriteria extends Criteria
class Advanced:entity:SearchCriteria extends Criteria
{
private $input;

/**
* Create new AdvancedBookSearchCriteria instance.
* Create new Advanced:entity:SearchCriteria instance.
*
* @param Request $request
*/
Expand Down
4 changes: 2 additions & 2 deletions CrudExample/apiato/Tasks/Book/ListAndSearchBooksTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Containers\Library\Tasks\Book;

use App\Containers\Library\Data\Repositories\BookRepository;
use App\Containers\Library\Data\Criterias\AdvancedBookSearchCriteria;
use App\Containers\Library\Data\Criterias\Advanced:entity:SearchCriteria;
use Prettus\Repository\Criteria\RequestCriteria;
use App\Ship\Parents\Tasks\Task;

Expand All @@ -20,7 +20,7 @@ public function run($input) {
if ($input->get('advanced_search', false)) {
$bookRepository
->popCriteria(RequestCriteria::class)
->pushCriteria(new AdvancedBookSearchCriteria($input));
->pushCriteria(new Advanced:entity:SearchCriteria($input));
}

$books = $bookRepository->paginate();
Expand Down
8 changes: 7 additions & 1 deletion CrudExample/apiato/UI/API/Transformers/BookTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class BookTransformer extends Transformer
*/
public function transform(Book $book)
{
return $response = [
$response = [
'object' => 'Book',
'id' => $book->getHashedKey(),
'reason_id' => $this->hashKey($book->reason_id),
Expand All @@ -56,6 +56,12 @@ public function transform(Book $book)
'deleted_at' => $book->deleted_at,
'deleted_at' => $book->deleted_at ? $book->deleted_at->toDateTimeString() : null,
];

$response = $this->ifAdmin([
'real_id' => $book->id,
], $response);

return $response;
}

public function includeReason(Book $book)
Expand Down
18 changes: 9 additions & 9 deletions Tasks/CreateApiRoutesTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ class CreateApiRoutesTask
* @var array
*/
public $files = [
'Create:entity:',
'Delete:entity:',
'SelectListFrom:entity:',
'FormModelFrom:entity:',
'Get:entity:',
'ListAndSearch:entity:',
'Restore:entity:',
'Update:entity:',
'Create-entity-',
'Delete-entity-',
'SelectListFrom-entity-',
'FormModelFrom-entity-',
'Get-entity-',
'ListAndSearch-entity-',
'Restore-entity-',
'Update-entity-',
];

/**
Expand Down Expand Up @@ -77,7 +77,7 @@ public function run()
continue;
}

$plural = ($file == "ListAndSearch:entity:") ? true : false;
$plural = ($file == "ListAndSearch-entity-") ? true : false;
$atStart = in_array($file, ['_FormModel', '_FormData',]) ? true : false;

$routeFile = $this->apiRoutesFolder().'/'.$this->apiRouteFile($file, $plural);
Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreateNgUtilsTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class CreateNgUtilsTask
* @var array
*/
public $files = [
':entity:-testing',
'-entity--testing',
];

/**
Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreatePortoCriteriasTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class CreatePortoCriteriasTask
* @var array
*/
public $files = [
'Advanced:entity:Search',
'Advanced-entity-Search',
];

/**
Expand Down
2 changes: 1 addition & 1 deletion Tasks/CreateSeedersTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class CreateSeedersTask
* @var array
*/
public $files = [
':entity:PermissionsSeeder',
'-entity-PermissionsSeeder',
];

/**
Expand Down
2 changes: 1 addition & 1 deletion Traits/AngularFolderNamesResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function utilsDir()
public function utilFile(string $file)
{
$entity = $this->slugEntityName();
$file = str_replace(':entity:', $entity, $file);
$file = str_replace('-entity-', $entity, $file);

return $file.'.util.ts';
}
Expand Down
Loading

0 comments on commit 99f8170

Please sign in to comment.