po-angular icon indicating copy to clipboard operation
po-angular copied to clipboard

PoPageDynamicTableComponent - URL inadequada

Open wsteixeira opened this issue 3 years ago • 4 comments

Discussed in https://github.com/po-ui/po-angular/discussions/1138

Originally posted by wsteixeira December 21, 2021 Olá,

Estou tentando usar o atributo "range" na busca avançada do "Page Dynamic Table", porem creio que a URL está sendo gerada de forma inadequada. Segue abaixo o objeto "fields" e a URL gerada.

  readonly fields: Array<PoPageDynamicTableFilters> = [
    { property: 'id', label: 'Id', key: true, visible: false },
    { property: 'date', label: 'Data', type: 'date', filter: true, range: true },
  ];

http://localhost:4200/api/visitors?page=1&pageSize=10&date=%5Bobject%20Object%5D

wsteixeira avatar Feb 24 '22 22:02 wsteixeira

Olá, Eu estou tentando fazer uma simulação, mas está apresentando erro no https://stackblitz.com/edit/po-ui e o range parece que não é suportado naquela versão.

ERROR
Error: No component factory found for PoLoadingOverlayComponent. Did you add it to @NgModule.entryComponents?

Segue o link https://stackblitz.com/edit/po-ui-fm5hj2?devtoolsheight=33&file=src/app/app.component.ts

wsteixeira avatar Feb 25 '22 17:02 wsteixeira

Oi @wsteixeira, tudo bom? Tenta atualizar o arquivo package.json por estes dados abaixo. Fico no aguardo.

{
  "name": "angular",
  "version": "0.0.0",
  "private": true,
  "dependencies": {
    "@angular/animations": "^13.0.2",
    "@angular/common": "^13.0.2",
    "@angular/compiler": "^13.0.2",
    "@angular/core": "^13.0.2",
    "@angular/forms": "^13.0.2",
    "@angular/platform-browser": "^13.0.2",
    "@angular/platform-browser-dynamic": "^13.0.2",
    "@angular/router": "^13.0.2",
    "@ionic-native/core": "5.33.0",
    "@ionic-native/network": "5.33.0",
    "@po-ui/ng-code-editor": "^6.4.0",
    "@po-ui/ng-components": "^6.4.0",
    "@po-ui/ng-storage": "^6.4.0",
    "@po-ui/ng-sync": "^6.4.0",
    "@po-ui/ng-templates": "^6.4.0",
    "@po-ui/style": "^6.4.0",
    "core-js": "3.13.0",
    "custom-idle-queue": "2.1.2",
    "http-status-codes": "^2.1.4",
    "localforage": "1.9.0",
    "lokijs": "1.5.12",
    "monaco-editor": "0.24.0",
    "rxjs": "~7.4.0",
    "rxjs-compat": "~6.6.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.11.4"
  },
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^13.0.3",
    "@angular/cli": "^13.2.2",
    "@angular/compiler-cli": "^13.0.2",
    "@angular/language-service": "^13.0.2",
    "@types/node": "^14.0.0",
    "@types/jasmine": "~3.7.6",
    "@types/jasminewd2": "~2.0.9",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~3.8.0",
    "jasmine-spec-reporter": "~7.0.0",
    "karma": "~6.3.2",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.0.3",
    "karma-jasmine": "~4.0.1",
    "karma-jasmine-html-reporter": "^1.7.0",
    "protractor": "~7.0.0",
    "ts-node": "~10.0.0",
    "tslint": "~6.1.0",
    "typescript": "~4.5.2"
  }
}

brunoromeiro avatar Mar 02 '22 16:03 brunoromeiro

Olá @brunoromeiro,

Deu certo a atualização do simulador.

Segue a simulação https://stackblitz.com/edit/po-ui-fm5hj2?devtoolsheight=33&file=src/app/app.component.ts.

Esta é a URL https://po-sample-api.herokuapp.com/v1/people?page=1&pageSize=10&birthdate=%5Bobject%20Object%5D gerada, quando se aplica o filtro avançado na data.

wsteixeira avatar Mar 02 '22 18:03 wsteixeira

Olá @brunoromeiro,

Eu vou preparar uma contribuição usando o $filter do Guia de APIs da Totvs - Filtros complexos.

wsteixeira avatar Mar 02 '22 18:03 wsteixeira