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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,10 @@ _%>
</div>

<div>
<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

<button pButton type="submit" id="save-entity" icon="pi pi-save" [disabled]="editForm.invalid || isSaving" [label]="'entity.action.save' | translate" class="btn btn-primary"></button>
</div>
</form>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</p-button>
<%_ } _%>
</h2>
<%_ if (searchEngine === 'elasticsearch') { _%>
<!-- <%_ if (searchEngine === 'elasticsearch') { _%>
<div class="row">
<div class="col-sm-12">
<form name="searchForm" class="form-inline">
Expand All @@ -39,7 +39,7 @@
</form>
</div>
</div>
<%_ } _%>
<%_ } _%> -->
<br/>
<p-table #<%= entityInstance %>Table [value]="<%= entityInstancePlural %>" [rowTrackBy]="trackId" [responsive]="true"<%
if (pagination !== 'no') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export class <%= entityAngularName %>Component implements OnInit, OnDestroy {

@ViewChild('<%= entityInstance %>Table', { static: true })
<%= entityInstance %>Table!: Table;
currentSearch: string;

constructor(
protected <%= entityInstance %>Service: <%= entityAngularName %>Service,
Expand Down Expand Up @@ -195,7 +196,7 @@ export class <%= entityAngularName %>Component implements OnInit, OnDestroy {
<%_ if (searchEngine === 'elasticsearch') { _%>
switchMap(() => {
if (this.currentSearch) {
this.<%= entityInstance %>Service.search(this.<%= entityInstance %>Table.filters.global.value)
return this.<%= entityInstance %>Service.search(this.<%= entityInstance %>Table.filters.global.value);
} else {
return this.<%= entityInstance %>Service.query(lazyLoadEventToServerQueryParams(this.<%= entityInstance %>Table.createLazyLoadMetadata()));
}
Expand Down