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

Fix of #16 Prettier error when [re]generating entity #18

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

smunir
Copy link

@smunir smunir commented Jun 26, 2020

template updated for fix of #16. currentSearch property declaration added.

@yelhouti
Copy link
Contributor

@smunir it seems liks tests are not passing, if elastic search is not used the field should not be added, please add tests and try again. Thank you

@smunir
Copy link
Author

smunir commented Jun 27, 2020

I just fixed compilation errors, couldn't manage to study your blueprint fully yet, I am afraid you would have to fix

@yelhouti
Copy link
Contributor

@smunir could you rebase your PR please, we improved the design, I can't understand what your are trying to do

@yelhouti
Copy link
Contributor

@smunir please add some tests, you will see the problem with your code and will be able to fix it.

<button pButton type="button" id="cancel-save" icon="pi pi-ban" class="ui-button-secondary" (click)="previousState()" [label]="'entity.action.cancel' | translate"></button>
<button pButton type="submit" id="save-entity" icon="pi pi-save" [disabled]="editForm.invalid || isSaving" [label]="'entity.action.save' | translate"></button>
<br />
<button pButton type="button" id="cancel-save" icon="pi pi-ban" class="ui-button-secondary" (click)="previousState()" [label]="'entity.action.cancel' | translate" class="btn btn-secondary"></button>

Choose a reason for hiding this comment

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

The class attribute is repeated.
Consider putting all classes in one class attribute

@smunir
Copy link
Author

smunir commented Jul 23, 2020

@smunir could you rebase your PR please, we improved the design, I can't understand what your are trying to do

Yup I checked out the improvements. In fact I just fixed 2 compile errors in entity-management.component.ts.ejs

  • Declared currentSearch: string;
  • Added return in below snippet. Updated from
if (this.currentSearch) {
    this.<%= entityInstance %>Service.search(this.<%= entityInstance %>Table.filters.global.value)
} else {
    return this.<%= entityInstance %>Service.query(lazyLoadEventToServerQueryParams(this.<%= entityInstance %>Table.createLazyLoadMetadata()));
}

to

if (this.currentSearch) {
    return this.<%= entityInstance %>Service.search(this.<%= entityInstance %>Table.filters.global.value)
} else {
    return this.<%= entityInstance %>Service.query(lazyLoadEventToServerQueryParams(this.<%= entityInstance %>Table.createLazyLoadMetadata()));
}

You can fix them and discard my PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants