Skip to content

Commit

Permalink
Merge pull request #46 from casejs/feature/add-loaders
Browse files Browse the repository at this point in the history
feat (dynamic-entity-list): add logical condition to loader
  • Loading branch information
SebConejo authored Jul 26, 2023
2 parents 6444adb + 1222d4b commit 1669269
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions packages/case/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ ng serve --configuration=contribution

## Contribute (server app)

```
# From packages/case/server
npm i
```bash
cd packages/case/server
npm install
npm run start:dev

# Seed in dev mode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ <h2 class="title is-5">Filters</h2>
</div>

<app-list-meta [paginator]="paginator" *ngIf="paginator"> </app-list-meta>
<div class="is-loading">
<div class="is-loading" *ngIf="loadingPaginator">
<span class="list-meta"></span>
</div>
<div class="card p-0 mb-6">
Expand All @@ -57,7 +57,7 @@ <h2 class="title is-5">Filters</h2>
<th
*ngFor="let prop of props"
[ngClass]="{
'has-text-right':prop.type === PropType.Currency || prop.type === PropType.Number || prop.type === PropType.Date,
'has-text-right':prop.type === PropType.Currency || prop.type === PropType.Number || prop.type === PropType.Date,
}"
>
{{ prop.label }}
Expand All @@ -70,7 +70,7 @@ <h2 class="title is-5">Filters</h2>
<td
*ngFor="let prop of props"
[ngClass]="{
'has-text-right':prop.type === PropType.Currency || prop.type === PropType.Number || prop.type === PropType.Date,
'has-text-right':prop.type === PropType.Currency || prop.type === PropType.Number || prop.type === PropType.Date,
}"
>
<app-yield
Expand Down Expand Up @@ -118,7 +118,9 @@ <h2 class="title is-5">Filters</h2>
</tbody>
</table>
</div>
<div class="is-loading p-t-xl">

<!-- Loader paginator -->
<div class="is-loading p-t-xl" *ngIf="loadingPaginator">
<div></div>
<div></div>
<div></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { DynamicEntityService } from '../../dynamic-entity.service'
})
export class DynamicEntityListComponent implements OnInit {
paginator: Paginator<any>
loadingPaginator = true
itemToDelete: any

entityMeta: EntityMeta
Expand All @@ -39,10 +40,6 @@ export class DynamicEntityListComponent implements OnInit {
this.dynamicEntityService
.loadEntityMeta()
.subscribe((res: EntityMeta[]) => {
if (!res.length) {
return
}

combineLatest([
this.activatedRoute.queryParams,
this.activatedRoute.params
Expand Down Expand Up @@ -75,6 +72,7 @@ export class DynamicEntityListComponent implements OnInit {
this.entityMeta.definition.slug,
queryParams
)
this.loadingPaginator = false
})
})
}
Expand Down

0 comments on commit 1669269

Please sign in to comment.