N°3750 - Behat: Add metadata about logs label

This commit is contained in:
Molkobain
2021-08-17 17:49:22 +02:00
parent 007e1ded0d
commit 4458f26379
4 changed files with 17 additions and 4 deletions

View File

@@ -10,6 +10,7 @@ use Combodo\iTop\Application\UI\Base\Component\Input\RichText\RichText;
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlock;
use Combodo\iTop\Application\UI\Base\UIBlock;
use DBObject;
use MetaModel;
/**
* Class CaseLogEntryForm
@@ -103,6 +104,16 @@ class CaseLogEntryForm extends UIContentBlock
return $this->sAttCode;
}
/**
* @see static::$sAttCode
* @return string
* @throws \Exception
*/
public function GetAttLabel(): string
{
return MetaModel::GetLabel($this->GetObjectClass(), $this->GetAttCode());
}
/**
* @see $sSubmitMode
*

View File

@@ -5,6 +5,7 @@
data-object-class="{{ oUIBlock.GetObjectClass() }}"
data-object-id="{{ oUIBlock.GetObjectId() }}"
data-attribute-code="{{ oUIBlock.GetAttCode() }}"
data-attribute-label="{{ oUIBlock.GetAttLabel() }}"
data-submit-mode="{{ oUIBlock.GetSubmitMode() }}"
method="post">
<div class="ibo-caselog-entry-form--actions">

View File

@@ -12,6 +12,7 @@
data-role="ibo-activity-panel--tab-toggler"
data-tab-type="caselog"
data-caselog-attribute-code="{{ sCaseLogAttCode }}"
data-caselog-attribute-label="{{ aCaseLogData.title }}"
data-caselog-rank="{{ loop.index }}">
<a href="#" class="ibo-activity-panel--tab-title" data-role="ibo-activity-panel--tab-title">
<span class="ibo-activity-panel--tab-title-decoration" data-role="ibo-activity-panel--tab-title-decoration"></span>
@@ -52,7 +53,7 @@
</div>
<div class="ibo-activity-panel--tabs-toolbars" data-role="ibo-activity-panel--tabs-toolbars">
{% for sCaseLogAttCode, aCaseLogData in oUIBlock.GetCaseLogTabs() %}
{{ include('base/layouts/activity-panel/tab-toolbar/caselog.html.twig', {oUIBlock: oUIBlock, iRank: loop.index, bIsActive: (loop.index == 1), aFilteredCaseLogsAttCodes: [sCaseLogAttCode]}) }}
{{ include('base/layouts/activity-panel/tab-toolbar/caselog.html.twig', {oUIBlock: oUIBlock, iRank: loop.index, bIsActive: (loop.index == 1), sAttCode: sCaseLogAttCode, aData: aCaseLogData, aFilteredCaseLogsAttCodes: [sCaseLogAttCode]}) }}
{% endfor %}
{{ include('base/layouts/activity-panel/tab-toolbar/activity.html.twig', {oUIBlock: oUIBlock, bIsActive: (oUIBlock.GetCaseLogTabs()|length == 0), bPrefilterStateChanges: true, bPrefilterEdits: true}) }}
<div class="ibo-activity-panel--entry-forms-confirmation-dialog" data-role="ibo-activity-panel--entry-forms-confirmation-dialog" title="{{ 'UI:Layout:ActivityPanel:MultipleEntriesSaveConfirmation:Title'|dict_s }}">

View File

@@ -4,12 +4,12 @@
{% block bDataTabType %}caselog{% endblock %}
{% block bExtraDataAttributes %}data-caselog-attribute-code="{{ sCaseLogAttCode }}" data-caselog-rank="{{ loop.index }}"{% endblock %}
{% block bExtraDataAttributes %}data-caselog-attribute-code="{{ sAttCode }}"data-caselog-attribute-label="{{ aData.title }}" data-caselog-rank="{{ loop.index }}"{% endblock %}
{% block bTabToolbarFirstRow %}
{% if oUIBlock.HasCaseLogTabEntryForm(sCaseLogAttCode) %}
{% if oUIBlock.HasCaseLogTabEntryForm(sAttCode) %}
<div class="ibo-activity-panel--tab-entry-form" data-role="ibo-activity-panel--tab-entry-form">
{{ render_block(oUIBlock.GetCaseLogTabEntryForm(sCaseLogAttCode), {bInitOpened: oUIBlock.IsEntryFormOpened()}) }}
{{ render_block(oUIBlock.GetCaseLogTabEntryForm(sAttCode), {bInitOpened: oUIBlock.IsEntryFormOpened()}) }}
</div>
{% endif %}
{% endblock %}