N°3190 - Edit n:n LinkedSetIndirect in object details using a tagset-like widget

- Add generic set block ui component
- Add model link set (direct and indirect) attribute (display style)
- Add model link set direct allowed values
- Create link set viewer block UI (BlockLinksSetDisplayAsProperty)
- Add set block ui factory for linkset
- Add object factory and create new endpoint in object controller (with data binder)
- Add link set model, link set repository and link set data transformer services
This commit is contained in:
bdalsass
2023-01-24 10:03:10 +01:00
committed by GitHub
parent 9482139b5a
commit fb1ceebaa4
55 changed files with 3948 additions and 234 deletions

View File

@@ -6,9 +6,21 @@
namespace Combodo\iTop\Application\UI\Links;
use ApplicationException;
use ArchivedObjectException;
use AttributeLinkedSet;
use Combodo\iTop\Application\UI\Base\Component\MedallionIcon\MedallionIcon;
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlock;
use CoreException;
use CoreWarning;
use DBObject;
use DictExceptionMissingString;
use DisplayBlock;
use Exception;
use MetaModel;
use MySQLException;
use Utils;
use WebPage;
/**
* Class AbstractBlockLinksViewTable
@@ -27,8 +39,8 @@ abstract class AbstractBlockLinksViewTable extends UIContentBlock
'js/wizardhelper.js',
];
/** @var \DBObject $oDbObject db object witch link set belongs to */
protected \DBObject $oDbObject;
/** @var DBObject $oDbObject db object witch link set belongs to */
protected DBObject $oDbObject;
/** @var string $sObjectClass db object class name */
protected string $sObjectClass;
@@ -36,27 +48,27 @@ abstract class AbstractBlockLinksViewTable extends UIContentBlock
/** @var string $sAttCode db object link set attribute code */
protected string $sAttCode;
/** @var \AttributeLinkedSet $oAttDef attribute link set */
protected \AttributeLinkedSet $oAttDef;
/** @var AttributeLinkedSet $oAttDef attribute link set */
protected AttributeLinkedSet $oAttDef;
/** @var string $sTargetClass links target classname */
protected string $sTargetClass;
protected string $sTableId;
/**
* Constructor.
*
* @param \WebPage $oPage
* @param \DBObject $oDbObject
* @param WebPage $oPage
* @param DBObject $oDbObject
* @param string $sObjectClass
* @param string $sAttCode
* @param \AttributeLinkedSet $oAttDef
* @param AttributeLinkedSet $oAttDef
*
* @throws \CoreException
* @throws \Exception
* @throws CoreException
* @throws Exception
*/
public function __construct(\WebPage $oPage, \DBObject $oDbObject, string $sObjectClass, string $sAttCode, \AttributeLinkedSet $oAttDef)
public function __construct(WebPage $oPage, DBObject $oDbObject, string $sObjectClass, string $sAttCode, AttributeLinkedSet $oAttDef)
{
parent::__construct('', ["ibo-block-links-table"]);
@@ -78,7 +90,7 @@ abstract class AbstractBlockLinksViewTable extends UIContentBlock
* Init.
*
* @return void
* @throws \Exception
* @throws Exception
*/
private function Init()
{
@@ -89,12 +101,12 @@ abstract class AbstractBlockLinksViewTable extends UIContentBlock
* Initialize UI.
*
* @return void
* @throws \CoreException
* @throws CoreException
*/
private function InitUI(\WebPage $oPage)
private function InitUI(WebPage $oPage)
{
// header
$this->InitHeader();;
$this->InitHeader();
// Table
$this->InitTable($oPage);
@@ -104,7 +116,8 @@ abstract class AbstractBlockLinksViewTable extends UIContentBlock
* InitHeader.
*
* @return void
* @throws \CoreException
* @throws CoreException
* @throws \Exception
*/
private function InitHeader()
{
@@ -117,21 +130,21 @@ abstract class AbstractBlockLinksViewTable extends UIContentBlock
/**
* InitTable.
*
* @param \WebPage $oPage
* @param WebPage $oPage
*
* @return void
* @throws \ApplicationException
* @throws \ArchivedObjectException
* @throws \CoreException
* @throws \CoreWarning
* @throws \DictExceptionMissingString
* @throws \MySQLException
* @throws ApplicationException
* @throws ArchivedObjectException
* @throws CoreException
* @throws CoreWarning
* @throws DictExceptionMissingString
* @throws MySQLException
*/
private function InitTable(\WebPage $oPage)
private function InitTable(WebPage $oPage)
{
// retrieve db object set
$oOrmLinkSet = $this->oDbObject->Get($this->sAttCode);
$oLinkSet = $oOrmLinkSet->ToDBObjectSet(\utils::ShowObsoleteData());
$oLinkSet = $oOrmLinkSet->ToDBObjectSet(utils::ShowObsoleteData());
// add list block
$oBlock = new \DisplayBlock($oLinkSet->GetFilter(), 'list', false);
@@ -163,11 +176,11 @@ abstract class AbstractBlockLinksViewTable extends UIContentBlock
*
* Provide parameters for display block as list.
*
* @see \DisplayBlock::RenderList
* @see DisplayBlock::RenderList
*
* @return array
* @throws \ArchivedObjectException
* @throws \CoreException
* @throws ArchivedObjectException
* @throws CoreException
*/
abstract function GetExtraParam(): array;
@@ -178,7 +191,7 @@ abstract class AbstractBlockLinksViewTable extends UIContentBlock
*
* @see \Combodo\iTop\Application\UI\Base\Component\DataTable\tTableRowActions
*
* @return \string[][]
* @return string[][]
*/
abstract function GetRowActions(): array;
@@ -188,12 +201,11 @@ abstract class AbstractBlockLinksViewTable extends UIContentBlock
* Return link set target class.
*
* @return string
* @throws \Exception
* @throws Exception
*/
abstract function GetTargetClass(): string;
/**
* @return string
*/
@@ -201,5 +213,5 @@ abstract class AbstractBlockLinksViewTable extends UIContentBlock
{
return $this->sAttCode;
}
}