1
0
mirror of https://github.com/1C-Company/v8-code-style.git synced 2026-05-20 10:41:08 +02:00

G5V8DT-23274 Регистрируется ошибка для поля таблицы значений

This commit is contained in:
Mikhail Begletsov
2026-03-12 16:34:24 +03:00
parent 51d633ee48
commit 8e885b0444
5 changed files with 515 additions and 1 deletions
@@ -24,6 +24,7 @@ import org.eclipse.emf.common.util.EList;
import org.eclipse.xtext.EcoreUtil2;
import com._1c.g5.v8.dt.form.model.AbstractDataPath;
import com._1c.g5.v8.dt.form.model.DynamicListTableExtInfo;
import com._1c.g5.v8.dt.form.model.FormField;
import com._1c.g5.v8.dt.form.model.Table;
import com._1c.g5.v8.dt.metadata.mdclass.AdjustableBoolean;
@@ -82,7 +83,7 @@ public class FormListRefUserVisibilityEnabledCheck
&& isRefPath(((FormField)adjBoolean.eContainer()).getDataPath()))
{
Table table = EcoreUtil2.getContainerOfType(adjBoolean, Table.class);
if (table == null)
if (table == null || !(table.getExtInfo() instanceof DynamicListTableExtInfo))
{
return;
}
@@ -49,6 +49,9 @@ public class FormListRefUserVisibilityEnabledCheckTest
private static final String FQN_FORM_EN = "Catalog.TestCatalog.Form.TestListForm.Form";
private static final String FQN_FORM_RU = "Catalog.TestCatalog.Form.TestListFormRu.Form";
private static final String TABLE_FQN_FORM_EN = "Catalog.TestCatalog.Form.TestTableForm.Form";
private static final String TABLE_FQN_FORM_RU = "Catalog.TestCatalog.Form.TestTableFormRu.Form";
/**
* Test User Visibility is enabled for the Ref field in dynamic list (En Script variant).
*
@@ -197,4 +200,54 @@ public class FormListRefUserVisibilityEnabledCheckTest
Marker marker = getFirstNestedMarker(CHECK_ID, object.bmGetId(), dtProject);
assertNull(marker);
}
/**
* Test User Visibility is enabled for the Ref field in dynamic list (En Script variant).
*
* @throws Exception the exception
*/
@Test
public void testUserVisibilityEnabledForRefNotInDynList() throws Exception
{
IDtProject dtProject = openProjectAndWaitForValidationFinish(PROJECT_NAME);
assertNotNull(dtProject);
IBmObject object = getTopObjectByFqn(TABLE_FQN_FORM_EN, dtProject);
assertTrue(object instanceof Form);
Form form = (Form)object;
FormItem item = form.getItems().get(0);
assertTrue(item instanceof Table);
Table table = (Table)item;
assertEquals("TableRef", table.getItems().get(0).getName());
Marker marker = getFirstNestedMarker(CHECK_ID, object.bmGetId(), dtProject);
assertNull(marker);
}
/**
* Test User Visibility is enabled for the Ref field in dynamic list (Ru Script variant).
*
* @throws Exception the exception
*/
@Test
public void testUserVisibilityEnabledForRefNotInDynListRu() throws Exception
{
IDtProject dtProject = openProjectAndWaitForValidationFinish(PROJECT_NAME);
assertNotNull(dtProject);
IBmObject object = getTopObjectByFqn(TABLE_FQN_FORM_RU, dtProject);
assertTrue(object instanceof Form);
Form form = (Form)object;
FormItem item = form.getItems().get(0);
assertTrue(item instanceof Table);
Table table = (Table)item;
assertEquals("ТаблицаСсылка", table.getItems().get(0).getName());
Marker marker = getFirstNestedMarker(CHECK_ID, object.bmGetId(), dtProject);
assertNull(marker);
}
}
@@ -0,0 +1,221 @@
<?xml version="1.0" encoding="UTF-8"?>
<form:Form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:core="http://g5.1c.ru/v8/dt/mcore" xmlns:form="http://g5.1c.ru/v8/dt/form">
<items xsi:type="form:Table">
<name>Table</name>
<id>1</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<dataPath xsi:type="form:DataPath">
<segments>Table</segments>
</dataPath>
<titleLocation>None</titleLocation>
<items xsi:type="form:FormField">
<name>TableRef</name>
<id>14</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<dataPath xsi:type="form:DataPath">
<segments>Table.Ref</segments>
</dataPath>
<extendedTooltip>
<name>TableRefExtendedTooltip</name>
<id>16</id>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>TableRefContextMenu</name>
<id>15</id>
<autoFill>true</autoFill>
</contextMenu>
<type>InputField</type>
<editMode>EnterOnInput</editMode>
<showInHeader>true</showInHeader>
<headerHorizontalAlign>Left</headerHorizontalAlign>
<showInFooter>true</showInFooter>
<extInfo xsi:type="form:InputFieldExtInfo">
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<wrap>true</wrap>
<chooseType>true</chooseType>
<typeDomainEnabled>true</typeDomainEnabled>
<textEdit>true</textEdit>
</extInfo>
</items>
<autoCommandBar>
<name>TableCommandBar</name>
<id>2</id>
<horizontalAlign>Left</horizontalAlign>
<autoFill>true</autoFill>
</autoCommandBar>
<searchStringAddition>
<name>TableSearchString</name>
<id>5</id>
<extendedTooltip>
<name>TableSearchStringExtendedTooltip</name>
<id>7</id>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>TableSearchStringContextMenu</name>
<id>6</id>
<autoFill>true</autoFill>
</contextMenu>
<source>Table</source>
<extInfo xsi:type="form:SearchStringAdditionExtInfo">
<autoMaxWidth>true</autoMaxWidth>
</extInfo>
</searchStringAddition>
<viewStatusAddition>
<name>TableViewStatus</name>
<id>11</id>
<extendedTooltip>
<name>TableViewStatusExtendedTooltip</name>
<id>13</id>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>TableViewStatusContextMenu</name>
<id>12</id>
<autoFill>true</autoFill>
</contextMenu>
<type>ViewStatusAddition</type>
<source>Table</source>
<extInfo xsi:type="form:ViewStatusAdditionExtInfo">
<autoMaxWidth>true</autoMaxWidth>
</extInfo>
</viewStatusAddition>
<searchControlAddition>
<name>TableSearchControl</name>
<id>8</id>
<extendedTooltip>
<name>TableSearchControlExtendedTooltip</name>
<id>10</id>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>TableSearchControlContextMenu</name>
<id>9</id>
<autoFill>true</autoFill>
</contextMenu>
<type>SearchControlAddition</type>
<source>Table</source>
<extInfo xsi:type="form:SearchControlAdditionExtInfo">
<autoMaxWidth>true</autoMaxWidth>
</extInfo>
</searchControlAddition>
<extendedTooltip>
<name>TableExtendedTooltip</name>
<id>4</id>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>TableContextMenu</name>
<id>3</id>
<autoFill>true</autoFill>
</contextMenu>
<changeRowSet>true</changeRowSet>
<changeRowOrder>true</changeRowOrder>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<autoMaxRowsCount>true</autoMaxRowsCount>
<selectionMode>MultiRow</selectionMode>
<header>true</header>
<headerHeight>1</headerHeight>
<footerHeight>1</footerHeight>
<horizontalScrollBar>AutoUse</horizontalScrollBar>
<verticalScrollBar>AutoUse</verticalScrollBar>
<horizontalLines>true</horizontalLines>
<verticalLines>true</verticalLines>
<autoInsertNewRow>true</autoInsertNewRow>
<searchOnInput>Auto</searchOnInput>
<initialListView>Auto</initialListView>
<horizontalStretch>true</horizontalStretch>
<verticalStretch>true</verticalStretch>
<enableStartDrag>true</enableStartDrag>
<enableDrag>true</enableDrag>
<fileDragMode>AsFileRef</fileDragMode>
<rowFilter xsi:type="core:UndefinedValue"/>
</items>
<autoCommandBar>
<name>FormCommandBar</name>
<id>-1</id>
<horizontalAlign>Left</horizontalAlign>
<autoFill>true</autoFill>
</autoCommandBar>
<autoTitle>true</autoTitle>
<autoUrl>true</autoUrl>
<group>Vertical</group>
<autoFillCheck>true</autoFillCheck>
<allowFormCustomize>true</allowFormCustomize>
<enabled>true</enabled>
<showTitle>true</showTitle>
<showCloseButton>true</showCloseButton>
<attributes>
<name>Table</name>
<title>
<key>en</key>
<value>Table</value>
</title>
<id>1</id>
<valueType>
<types>ValueTable</types>
</valueType>
<view>
<common>true</common>
</view>
<edit>
<common>true</common>
</edit>
<columns>
<name>Ref</name>
<title>
<key>en</key>
<value>Ref1</value>
</title>
<id>2</id>
<valueType>
<types>String</types>
<stringQualifiers/>
</valueType>
<view/>
<edit>
<common>true</common>
</edit>
</columns>
</attributes>
<commandInterface>
<navigationPanel/>
<commandBar/>
</commandInterface>
</form:Form>
@@ -0,0 +1,221 @@
<?xml version="1.0" encoding="UTF-8"?>
<form:Form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:core="http://g5.1c.ru/v8/dt/mcore" xmlns:form="http://g5.1c.ru/v8/dt/form">
<items xsi:type="form:Table">
<name>Таблица</name>
<id>17</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<dataPath xsi:type="form:DataPath">
<segments>Таблица</segments>
</dataPath>
<titleLocation>None</titleLocation>
<items xsi:type="form:FormField">
<name>ТаблицаСсылка</name>
<id>30</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<dataPath xsi:type="form:DataPath">
<segments>Таблица.Ссылка</segments>
</dataPath>
<extendedTooltip>
<name>ТаблицаСсылкаExtendedTooltip</name>
<id>32</id>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>ТаблицаСсылкаContextMenu</name>
<id>31</id>
<autoFill>true</autoFill>
</contextMenu>
<type>InputField</type>
<editMode>EnterOnInput</editMode>
<showInHeader>true</showInHeader>
<headerHorizontalAlign>Left</headerHorizontalAlign>
<showInFooter>true</showInFooter>
<extInfo xsi:type="form:InputFieldExtInfo">
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<wrap>true</wrap>
<chooseType>true</chooseType>
<typeDomainEnabled>true</typeDomainEnabled>
<textEdit>true</textEdit>
</extInfo>
</items>
<autoCommandBar>
<name>ТаблицаCommandBar</name>
<id>18</id>
<horizontalAlign>Left</horizontalAlign>
<autoFill>true</autoFill>
</autoCommandBar>
<searchStringAddition>
<name>ТаблицаSearchString</name>
<id>21</id>
<extendedTooltip>
<name>ТаблицаSearchStringExtendedTooltip</name>
<id>23</id>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>ТаблицаSearchStringContextMenu</name>
<id>22</id>
<autoFill>true</autoFill>
</contextMenu>
<source>Таблица</source>
<extInfo xsi:type="form:SearchStringAdditionExtInfo">
<autoMaxWidth>true</autoMaxWidth>
</extInfo>
</searchStringAddition>
<viewStatusAddition>
<name>ТаблицаViewStatus</name>
<id>27</id>
<extendedTooltip>
<name>ТаблицаViewStatusExtendedTooltip</name>
<id>29</id>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>ТаблицаViewStatusContextMenu</name>
<id>28</id>
<autoFill>true</autoFill>
</contextMenu>
<type>ViewStatusAddition</type>
<source>Таблица</source>
<extInfo xsi:type="form:ViewStatusAdditionExtInfo">
<autoMaxWidth>true</autoMaxWidth>
</extInfo>
</viewStatusAddition>
<searchControlAddition>
<name>ТаблицаSearchControl</name>
<id>24</id>
<extendedTooltip>
<name>ТаблицаSearchControlExtendedTooltip</name>
<id>26</id>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>ТаблицаSearchControlContextMenu</name>
<id>25</id>
<autoFill>true</autoFill>
</contextMenu>
<type>SearchControlAddition</type>
<source>Таблица</source>
<extInfo xsi:type="form:SearchControlAdditionExtInfo">
<autoMaxWidth>true</autoMaxWidth>
</extInfo>
</searchControlAddition>
<extendedTooltip>
<name>ТаблицаExtendedTooltip</name>
<id>20</id>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>ТаблицаContextMenu</name>
<id>19</id>
<autoFill>true</autoFill>
</contextMenu>
<changeRowSet>true</changeRowSet>
<changeRowOrder>true</changeRowOrder>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<autoMaxRowsCount>true</autoMaxRowsCount>
<selectionMode>MultiRow</selectionMode>
<header>true</header>
<headerHeight>1</headerHeight>
<footerHeight>1</footerHeight>
<horizontalScrollBar>AutoUse</horizontalScrollBar>
<verticalScrollBar>AutoUse</verticalScrollBar>
<horizontalLines>true</horizontalLines>
<verticalLines>true</verticalLines>
<autoInsertNewRow>true</autoInsertNewRow>
<searchOnInput>Auto</searchOnInput>
<initialListView>Auto</initialListView>
<horizontalStretch>true</horizontalStretch>
<verticalStretch>true</verticalStretch>
<enableStartDrag>true</enableStartDrag>
<enableDrag>true</enableDrag>
<fileDragMode>AsFileRef</fileDragMode>
<rowFilter xsi:type="core:UndefinedValue"/>
</items>
<autoCommandBar>
<name>FormCommandBar</name>
<id>-1</id>
<horizontalAlign>Left</horizontalAlign>
<autoFill>true</autoFill>
</autoCommandBar>
<autoTitle>true</autoTitle>
<autoUrl>true</autoUrl>
<group>Vertical</group>
<autoFillCheck>true</autoFillCheck>
<allowFormCustomize>true</allowFormCustomize>
<enabled>true</enabled>
<showTitle>true</showTitle>
<showCloseButton>true</showCloseButton>
<attributes>
<name>Таблица</name>
<title>
<key>en</key>
<value>Таблица</value>
</title>
<id>1</id>
<valueType>
<types>ValueTable</types>
</valueType>
<view>
<common>true</common>
</view>
<edit>
<common>true</common>
</edit>
<columns>
<name>Ссылка</name>
<title>
<key>en</key>
<value>Ссылка1</value>
</title>
<id>2</id>
<valueType>
<types>String</types>
<stringQualifiers/>
</valueType>
<view/>
<edit>
<common>true</common>
</edit>
</columns>
</attributes>
<commandInterface>
<navigationPanel/>
<commandBar/>
</commandInterface>
</form:Form>
@@ -53,4 +53,22 @@
<usePurposes>PersonalComputer</usePurposes>
<usePurposes>MobileDevice</usePurposes>
</forms>
<forms uuid="b7d4e7be-7f3a-49a3-9afa-60e32f350c04">
<name>TestTableForm</name>
<synonym>
<key>en</key>
<value>Test table form</value>
</synonym>
<usePurposes>PersonalComputer</usePurposes>
<usePurposes>MobileDevice</usePurposes>
</forms>
<forms uuid="7982315e-5cf7-46df-995d-4ca25bd931ca">
<name>TestTableFormRu</name>
<synonym>
<key>en</key>
<value>Test table form ru</value>
</synonym>
<usePurposes>PersonalComputer</usePurposes>
<usePurposes>MobileDevice</usePurposes>
</forms>
</mdclass:Catalog>