Skip to content

Commit

Permalink
feat(dynamic-table): implementa opção de esconder gerenciador de colunas
Browse files Browse the repository at this point in the history
Esconde gerenciador de colunas no dynamic-table

fixes DTHFUI-7637
  • Loading branch information
CSimoesJr authored and rafaellmarques committed Oct 4, 2023
1 parent b6bc966 commit 1cd1ba9
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
[p-items]="items"
[p-height]="height"
[p-hide-batch-actions]="true"
[p-hide-columns-manager]="hideColumnsManager"
[p-infinite-scroll]="infiniteScroll"
[p-show-more-disabled]="!hasNext"
(p-show-more)="showMore()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ describe('PoPageDynamicTableComponent:', () => {
});

it('hideRemoveAllDisclaimer: should update property `p-hide-remove-all-disclaimer` to `true` with valid values', () => {
component.hideRemoveAllDisclaimer = utilsFunctions.convertToBoolean(3);
component.hideRemoveAllDisclaimer = utilsFunctions.convertToBoolean(1);

expect(component.hideRemoveAllDisclaimer).toBe(false);
expect(component.hideRemoveAllDisclaimer).toBe(true);
});

it('hideCloseDisclaimers: should set property `p-hide-close-disclaimers` to `[]` if not Array value', () => {
Expand All @@ -141,6 +141,18 @@ describe('PoPageDynamicTableComponent:', () => {

expectPropertiesValues(component, 'hideCloseDisclaimers', validValues, validValues);
});

it('hideColumnsManager: should set property `p-hide-columns-manager` to `false` if invalid value', () => {
component.hideColumnsManager = utilsFunctions.convertToBoolean(3);

expect(component.hideColumnsManager).toBe(false);
});

it('hideColumnsManager: should update property `p-hide-columns-manager` to `true` with valid values', () => {
component.hideColumnsManager = utilsFunctions.convertToBoolean('true');

expect(component.hideColumnsManager).toBe(true);
});
});

describe('Methods:', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,18 @@ export class PoPageDynamicTableComponent extends PoPageDynamicListBaseComponent
*/
@Input({ alias: 'p-concat-filters', transform: convertToBoolean }) concatFilters: boolean = false;

/**
* @optional
*
* @description
*
* Permite que o gerenciador de colunas, responsável pela definição de quais colunas serão exibidas, seja escondido.
*
* @default `false`
*/
@Input({ alias: 'p-hide-columns-manager', transform: convertToBoolean })
hideColumnsManager: boolean = false;

/**
* @optional
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
p-keep-filters
p-title="People"
[p-height]="300"
[p-hide-columns-manager]="true"
[p-infinite-scroll]="true"
[p-fields]="fields"
[p-service-api]="serviceApi"
Expand Down

0 comments on commit 1cd1ba9

Please sign in to comment.