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(table): corrige requisição de múltiplas tabelas #2406

Merged
merged 1 commit into from
Mar 7, 2025
Merged
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 @@ -60,7 +60,7 @@ describe('PoTableComponent:', () => {
let tableHeaderElement;
let tableElement;
let tableFooterElement;
let poTableService: PoTableService;
const poTableService: jasmine.SpyObj<PoTableService> = jasmine.createSpyObj('PoTableService', ['scrollListener']);

// mocks
let actions: Array<PoTableAction>;
Expand Down Expand Up @@ -229,7 +229,7 @@ describe('PoTableComponent:', () => {
PoDateService,
DecimalPipe,
PoColorPaletteService,
PoTableService,
{ provide: PoTableService, useValue: poTableService },
{ provide: CdkVirtualScrollViewport, useValue: mockViewPort },
{ provide: changeDetector, useValue: changeDetector }
]
Expand All @@ -248,8 +248,6 @@ describe('PoTableComponent:', () => {

component.infiniteScroll = false;

poTableService = TestBed.inject(PoTableService);

nativeElement = fixture.debugElement.nativeElement;

component.tableVirtualScroll = fixture.debugElement;
Expand Down Expand Up @@ -2924,7 +2922,7 @@ describe('PoTableComponent:', () => {
component.height = 100;
component.infiniteScroll = true;

component['subscriptionScrollEvent'] = poTableService.scrollListener(dummyElement).subscribe();
component['subscriptionScrollEvent'] = component['defaultService'].scrollListener(dummyElement).subscribe();

component['removeListeners']();

Expand Down Expand Up @@ -3013,7 +3011,7 @@ describe('PoTableComponent:', () => {

component.tableScrollable = new ElementRef(mockScrollableElement);

const spyScrollListener = spyOn(poTableService, 'scrollListener').and.returnValue(
const spyScrollListener = spyOn(component['defaultService'], 'scrollListener').and.returnValue(
of({ target: { offsetHeight: 100, scrollTop: 100, scrollHeight: 1 } })
);

Expand All @@ -3036,7 +3034,7 @@ describe('PoTableComponent:', () => {

component.tableVirtualScroll = mockTableVirtualScroll;

const spyScrollListener = spyOn(poTableService, 'scrollListener').and.returnValue(
const spyScrollListener = spyOn(component['defaultService'], 'scrollListener').and.returnValue(
of({ target: { offsetHeight: 100, scrollTop: 100, scrollHeight: 1 } })
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ import { ICONS_DICTIONARY, PoIconDictionary } from '../po-icon';
@Component({
selector: 'po-table',
templateUrl: './po-table.component.html',
providers: [PoDateService]
providers: [PoDateService, PoTableService]
})
export class PoTableComponent extends PoTableBaseComponent implements AfterViewInit, DoCheck, OnDestroy, OnInit {
@ContentChild(PoTableRowTemplateDirective, { static: true }) tableRowTemplate: PoTableRowTemplateDirective;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ describe('PoTableService', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [HttpClientTestingModule]
imports: [HttpClientTestingModule],
providers: [PoTableService]
});
service = TestBed.inject(PoTableService);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import { isTypeof } from '../../../utils/util';
import { PoTableFilter } from '../interfaces/po-table-filter.interface';
import { PoTableFilteredItemsParams } from '../interfaces/po-table-filtered-items-params.interface';

@Injectable({
providedIn: 'root'
})
@Injectable()
export class PoTableService implements PoTableFilter {
readonly headers: HttpHeaders = new HttpHeaders({
'X-PO-No-Message': 'true'
Expand Down
Loading