From 2d1e53e1374839929b1491fee48f60a876454ca1 Mon Sep 17 00:00:00 2001 From: bjverde Date: Sat, 18 Jul 2020 23:47:31 -0300 Subject: [PATCH] :hammer: #112 setheight --- .../FormDin5/webform/TFormDinGrid.class.php | 110 ++++++------------ .../FormDin5/webform/TFormDinGridTest.php | 12 +- 2 files changed, 42 insertions(+), 80 deletions(-) diff --git a/appexemplo_v1.0/app/lib/widget/FormDin5/webform/TFormDinGrid.class.php b/appexemplo_v1.0/app/lib/widget/FormDin5/webform/TFormDinGrid.class.php index 953ce656..75d4c044 100644 --- a/appexemplo_v1.0/app/lib/widget/FormDin5/webform/TFormDinGrid.class.php +++ b/appexemplo_v1.0/app/lib/widget/FormDin5/webform/TFormDinGrid.class.php @@ -114,8 +114,8 @@ class TFormDinGrid * @param string $strName - 2: ID da grid * @param string $strTitle - 3: Titulo da grip * @param array $mixData - 4: Array de dados. Pode ser form formato Adianti, FormDin ou PDO - * @param mixed $strHeight - 5: DEPRECATED Altura - * @param mixed $strWidth - 6: DEPRECATED Largura + * @param mixed $strHeight - 5: Altura + * @param mixed $strWidth - 6: NOT_IMPLEMENTED Largura * @param mixed $strKeyField - 7: NOT_IMPLEMENTED Chave primaria * @param array $mixUpdateFields - 8: NOT_IMPLEMENTED Campos do form origem que serão atualizados ao selecionar o item desejado. Separados por virgulas seguindo o padrão | , | * @param mixed $intMaxRows - 9: NOT_IMPLEMENTED Qtd Max de linhas @@ -153,30 +153,20 @@ public function __construct( $objForm ,$track[0]['file'] ); }else{ - $this->validateDeprecated($strHeight,$strWidth); $this->setObjForm($objForm); $bootgrid = new BootstrapDatagridWrapper(new TDataGrid); $bootgrid->width = '100%'; $this->setAdiantiObj($bootgrid); $this->setId($strName); + $this->setHeight($strHeight); + //$this->setWidth($strWidth); + $panel = new TPanelGroup($strTitle); $this->setPanelGroupGrid($panel); } } - public function validateDeprecated($strHeigh,$strWidth) - { - ValidateHelper::validadeParam('strHeigh',$strHeigh - ,ValidateHelper::WARNING - ,ValidateHelper::MSG_DECREP - ,__CLASS__,__METHOD__,__LINE__); - - ValidateHelper::validadeParam('strWidth',$strWidth - ,ValidateHelper::WARNING - ,ValidateHelper::MSG_DECREP - ,__CLASS__,__METHOD__,__LINE__); - } public function setObjForm($objForm) { @@ -207,6 +197,37 @@ public function getAdiantiObj(){ return $this->adiantiObj; } + public function getId(){ + return $this->idGrid; + } + + public function setId(string $idGrid){ + if(empty($idGrid)){ + throw new InvalidArgumentException(TFormDinMessage::ERROR_EMPTY_INPUT); + } + $this->getAdiantiObj()->setId($idGrid); + $this->idGrid = $idGrid; + } + + public function getHeight(){ + return $this->getAdiantiObj()->height; + } + + public function setHeight($Height){ + $this->getAdiantiObj()->setHeight($Height); + } + + + public function getWidth() + { + //return $this->getAdiantiObj()->getWidth(); + return null; + } + public function setWidth( $width ) + { + //$this->getAdiantiObj()->setWidth($width); + } + public function setData( $data ) { $this->data = $data; @@ -260,17 +281,7 @@ public function setAction($action){ $this->action = $action; } - public function getId(){ - return $this->idGrid; - } - public function setId(string $idGrid){ - if(empty($idGrid)){ - throw new InvalidArgumentException(TFormDinMessage::ERROR_EMPTY_INPUT); - } - $this->getAdiantiObj()->setId($idGrid); - $this->idGrid = $idGrid; - } public function getTitle(){ return $this->title; @@ -366,53 +377,4 @@ public function addCheckColumn( $strName $this->columns[ strtolower( $strName )] = $col; return $col; } - - //------------------------------------------------------------------------------------ - /** - * @deprecated mantido apenas para diminir o impacto na migração do FormDin 4 para FormDin 5 sobre Adianti 7.1 - * @return void - */ - public function getWidth() - { - ValidateHelper::validadeParam('strWidth','deprecated' - ,ValidateHelper::WARNING - ,ValidateHelper::MSG_DECREP - ,__CLASS__,__METHOD__,__LINE__); - } - - /** - * @deprecated mantido apenas para diminir o impacto na migração do FormDin 4 para FormDin 5 sobre Adianti 7.1 - * @return void - */ - public function setWidth( $strNewValue = null ) - { - ValidateHelper::validadeParam('strWidth',$strNewValue - ,ValidateHelper::WARNING - ,ValidateHelper::MSG_DECREP - ,__CLASS__,__METHOD__,__LINE__); - } - - /** - * @deprecated mantido apenas para diminir o impacto na migração do FormDin 4 para FormDin 5 sobre Adianti 7.1 - * @return void - */ - public function getHeight() - { - ValidateHelper::validadeParam('strWidth','deprecated' - ,ValidateHelper::WARNING - ,ValidateHelper::MSG_DECREP - ,__CLASS__,__METHOD__,__LINE__); - } - - /** - * @deprecated mantido apenas para diminir o impacto na migração do FormDin 4 para FormDin 5 sobre Adianti 7.1 - * @return void - */ - public function setHeight( $strNewValue = null ) - { - ValidateHelper::validadeParam('strHeight',$strNewValue - ,ValidateHelper::WARNING - ,ValidateHelper::MSG_DECREP - ,__CLASS__,__METHOD__,__LINE__); - } } \ No newline at end of file diff --git a/appexemplo_v1.0/app/tests/lib/widget/FormDin5/webform/TFormDinGridTest.php b/appexemplo_v1.0/app/tests/lib/widget/FormDin5/webform/TFormDinGridTest.php index d18d817e..0c00dee0 100644 --- a/appexemplo_v1.0/app/tests/lib/widget/FormDin5/webform/TFormDinGridTest.php +++ b/appexemplo_v1.0/app/tests/lib/widget/FormDin5/webform/TFormDinGridTest.php @@ -71,13 +71,13 @@ protected function tearDown(): void { public function testConstruct_Height() { - $this->expectWarning(); + $this->expectNotToPerformAssertions(); $mock = new StdClass; $grid = new TFormDinGrid($mock,'grid',null,null,700); } public function testConstruct_Width() { - $this->expectWarning(); + $this->expectNotToPerformAssertions(); $mock = new StdClass; $grid = new TFormDinGrid($mock,'grid',null,null,null,700); } @@ -136,25 +136,25 @@ public function testSetAdiantiObj_fail() public function testGetWidth_fail() { - $this->expectWarning(); + $this->expectNotToPerformAssertions(); $this->classTest->getWidth(); } public function testSetWidth_fail() { - $this->expectWarning(); + $this->expectNotToPerformAssertions(); $this->classTest->setWidth(100); } public function testGetHeight_fail() { - $this->expectWarning(); + $this->expectNotToPerformAssertions(); $this->classTest->getHeight(); } public function testSetHeight_fail() { - $this->expectWarning(); + $this->expectNotToPerformAssertions(); $this->classTest->setHeight(100); }