From f4777c5ae9d872c7eeba4d6e931ff91d22c10ff4 Mon Sep 17 00:00:00 2001 From: Vadim Goncharov Date: Tue, 18 Apr 2023 01:11:07 +0300 Subject: [PATCH 1/2] =?UTF-8?q?#546=20-=20=D0=A4=D1=83=D0=BD=D0=BA=D1=86?= =?UTF-8?q?=D0=B8=D1=8F=20"=D0=A0=D0=BE=D0=BB=D1=8C=D0=94=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D1=83=D0=BF=D0=BD=D0=B0"=20=D1=81=D1=81=D1=8B=D0=BB?= =?UTF-8?q?=D0=B0=D0=B5=D1=82=D1=81=D1=8F=20=D0=BD=D0=B0=20=D0=BD=D0=B5?= =?UTF-8?q?=D1=81=D1=83=D1=89=D0=B5=D1=81=D1=82=D0=B2=D1=83=D1=8E=D1=89?= =?UTF-8?q?=D1=83=D1=8E=20=D1=80=D0=BE=D0=BB=D1=8C=20=D0=BA=D0=BE=D0=BD?= =?UTF-8?q?=D1=84=D0=B8=D0=B3=D1=83=D1=80=D0=B0=D1=86=D0=B8=D0=B8=20(#1274?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + .../META-INF/MANIFEST.MF | 1 + .../markdown/method-isinrole-role-exist.md | 11 ++ .../markdown/ru/method-isinrole-role-exist.md | 11 ++ bundles/com.e1c.v8codestyle.bsl/plugin.xml | 4 + .../check/IsInRoleMethodRoleExistCheck.java | 160 ++++++++++++++++++ .../e1c/v8codestyle/bsl/check/Messages.java | 6 + .../v8codestyle/bsl/check/messages.properties | 6 + .../bsl/check/messages_ru.properties | 6 + .../bsl/ExternalDependenciesModule.java | 2 + .../IsInRoleMethodRoleExistCheckTest.java | 74 ++++++++ .../IsInRoleMethodRoleExist/.project | 18 ++ .../org.eclipse.core.resources.prefs | 2 + .../DT-INF/PROJECT.PMF | 2 + .../RolesCommonModule/Module.bsl | 19 +++ .../RolesCommonModule/RolesCommonModule.mdo | 9 + .../src/CommonModules/Users/Module.bsl | 8 + .../src/CommonModules/Users/Users.mdo | 9 + .../src/Configuration/CommandInterface.cmi | 2 + .../src/Configuration/Configuration.mdo | 44 +++++ .../MainSectionCommandInterface.cmi | 2 + .../src/Roles/TestRole1/Rights.rights | 45 +++++ .../src/Roles/TestRole1/TestRole1.mdo | 8 + 23 files changed, 450 insertions(+) create mode 100644 bundles/com.e1c.v8codestyle.bsl/markdown/method-isinrole-role-exist.md create mode 100644 bundles/com.e1c.v8codestyle.bsl/markdown/ru/method-isinrole-role-exist.md create mode 100644 bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/IsInRoleMethodRoleExistCheck.java create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/IsInRoleMethodRoleExistCheckTest.java create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/.project create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/.settings/org.eclipse.core.resources.prefs create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/DT-INF/PROJECT.PMF create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/CommonModules/RolesCommonModule/Module.bsl create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/CommonModules/RolesCommonModule/RolesCommonModule.mdo create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/CommonModules/Users/Module.bsl create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/CommonModules/Users/Users.mdo create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/Configuration/CommandInterface.cmi create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/Configuration/Configuration.mdo create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/Configuration/MainSectionCommandInterface.cmi create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/Roles/TestRole1/Rights.rights create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/Roles/TestRole1/TestRole1.mdo diff --git a/CHANGELOG.md b/CHANGELOG.md index a8215eb8..36751a6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ - Обращение к несуществующему параметру формы - Необязательный параметр процедуры/функции стоит перед обязательным - Обращение к опциональному параметру формы +- Функция "РольДоступна" ссылается на несуществующие роли #### Запросы diff --git a/bundles/com.e1c.v8codestyle.bsl/META-INF/MANIFEST.MF b/bundles/com.e1c.v8codestyle.bsl/META-INF/MANIFEST.MF index 6ad695c1..61e46907 100644 --- a/bundles/com.e1c.v8codestyle.bsl/META-INF/MANIFEST.MF +++ b/bundles/com.e1c.v8codestyle.bsl/META-INF/MANIFEST.MF @@ -39,6 +39,7 @@ Import-Package: com._1c.g5.v8.bm.core;version="[7.0.0,8.0.0)", com._1c.g5.v8.dt.bsl.util;version="[7.0.0,8.0.0)", com._1c.g5.v8.dt.bsl.validation;version="[16.0.0,17.0.0)", com._1c.g5.v8.dt.common;version="[6.0.0,7.0.0)", + com._1c.g5.v8.dt.core.naming;version="[6.0.0,7.0.0)", com._1c.g5.v8.dt.core.platform;version="[10.0.0,11.0.0)", com._1c.g5.v8.dt.form.model;version="[11.0.0,12.0.0)", com._1c.g5.v8.dt.lcore.ui.editor;version="[2.3.0,3.0.0)", diff --git a/bundles/com.e1c.v8codestyle.bsl/markdown/method-isinrole-role-exist.md b/bundles/com.e1c.v8codestyle.bsl/markdown/method-isinrole-role-exist.md new file mode 100644 index 00000000..22fb6034 --- /dev/null +++ b/bundles/com.e1c.v8codestyle.bsl/markdown/method-isinrole-role-exist.md @@ -0,0 +1,11 @@ +# Referring to a non-existent role + +In the parameter of the function "IsInRole" must existing role to be specified. + +## Noncompliant Code Example + + +## Compliant Solution + + +## See diff --git a/bundles/com.e1c.v8codestyle.bsl/markdown/ru/method-isinrole-role-exist.md b/bundles/com.e1c.v8codestyle.bsl/markdown/ru/method-isinrole-role-exist.md new file mode 100644 index 00000000..0edb6644 --- /dev/null +++ b/bundles/com.e1c.v8codestyle.bsl/markdown/ru/method-isinrole-role-exist.md @@ -0,0 +1,11 @@ +# Обращение к несуществующей роли + +В параметре функции "РольДоступна" должна быть указана существующая роль. + +## Неправильно + + +## Правильно + + +## См. diff --git a/bundles/com.e1c.v8codestyle.bsl/plugin.xml b/bundles/com.e1c.v8codestyle.bsl/plugin.xml index 7d0a4e42..89649747 100644 --- a/bundles/com.e1c.v8codestyle.bsl/plugin.xml +++ b/bundles/com.e1c.v8codestyle.bsl/plugin.xml @@ -347,6 +347,10 @@ category="com.e1c.v8codestyle.bsl" class="com.e1c.v8codestyle.internal.bsl.ExecutableExtensionFactory:com.e1c.v8codestyle.bsl.check.DeprecatedProcedureOutsideDeprecatedRegionCheck"> + + diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/IsInRoleMethodRoleExistCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/IsInRoleMethodRoleExistCheck.java new file mode 100644 index 00000000..4e0fe216 --- /dev/null +++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/IsInRoleMethodRoleExistCheck.java @@ -0,0 +1,160 @@ +/******************************************************************************* + * Copyright (C) 2023, 1C-Soft LLC and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * 1C-Soft LLC - initial API and implementation + *******************************************************************************/ + +package com.e1c.v8codestyle.bsl.check; + +import static com._1c.g5.v8.dt.bsl.model.BslPackage.Literals.INVOCATION; +import static com._1c.g5.v8.dt.bsl.model.BslPackage.Literals.STRING_LITERAL__LINES; +import static com._1c.g5.v8.dt.metadata.mdclass.MdClassPackage.Literals.CONFIGURATION__ROLES; +import static com._1c.g5.v8.dt.metadata.mdclass.MdClassPackage.Literals.ROLE; + +import java.text.MessageFormat; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.emf.common.util.EList; +import org.eclipse.xtext.naming.IQualifiedNameConverter; +import org.eclipse.xtext.resource.IEObjectDescription; +import org.eclipse.xtext.scoping.IScope; +import org.eclipse.xtext.scoping.IScopeProvider; + +import com._1c.g5.v8.dt.bsl.model.Expression; +import com._1c.g5.v8.dt.bsl.model.Invocation; +import com._1c.g5.v8.dt.bsl.model.StaticFeatureAccess; +import com._1c.g5.v8.dt.bsl.model.StringLiteral; +import com._1c.g5.v8.dt.common.StringUtils; +import com._1c.g5.v8.dt.core.naming.ITopObjectFqnGenerator; +import com.e1c.g5.v8.dt.check.CheckComplexity; +import com.e1c.g5.v8.dt.check.ICheckParameters; +import com.e1c.g5.v8.dt.check.components.BasicCheck; +import com.e1c.g5.v8.dt.check.settings.IssueSeverity; +import com.e1c.g5.v8.dt.check.settings.IssueType; +import com.e1c.v8codestyle.check.CommonSenseCheckExtension; +import com.e1c.v8codestyle.internal.bsl.BslPlugin; +import com.google.inject.Inject; + +/** + * Check the method IsInRole, that first param contains exists roles. + * @author Vadim Goncharov + */ +public class IsInRoleMethodRoleExistCheck + extends BasicCheck +{ + + private static final String CHECK_ID = "method-isinrole-role-exist"; //$NON-NLS-1$ + + private static final String METHOD_ISINROLE_NAME = "IsInRole"; //$NON-NLS-1$ + + private static final String METHOD_ISINROLE_NAME_RU = "РольДоступна"; //$NON-NLS-1$ + + private final IScopeProvider scopeProvider; + + private final IQualifiedNameConverter qualifiedNameConverter; + + private final ITopObjectFqnGenerator topObjectFqnGenerator; + + /** + * Instantiates a new invocation role check access exist role check. + * + * @param scopeProvider the scope provider + * @param qualifiedNameConverter the qualified name converter + * @param topObjectFqnGenerator the top object fqn generator + */ + @Inject + public IsInRoleMethodRoleExistCheck(IScopeProvider scopeProvider, IQualifiedNameConverter qualifiedNameConverter, + ITopObjectFqnGenerator topObjectFqnGenerator) + { + super(); + this.scopeProvider = scopeProvider; + this.qualifiedNameConverter = qualifiedNameConverter; + this.topObjectFqnGenerator = topObjectFqnGenerator; + } + + @Override + public String getCheckId() + { + return CHECK_ID; + } + + @Override + protected void configureCheck(CheckConfigurer builder) + { + builder.title(Messages.IsInRoleMethodRoleExistCheck_title) + .description(Messages.IsInRoleMethodRoleExistCheck_description) + .complexity(CheckComplexity.NORMAL) + .severity(IssueSeverity.MAJOR) + .issueType(IssueType.WARNING) + .extension(new CommonSenseCheckExtension(getCheckId(), BslPlugin.PLUGIN_ID)) + .module() + .checkedObjectType(INVOCATION); + } + + @Override + protected void check(Object object, ResultAcceptor resultAcceptor, ICheckParameters parameters, + IProgressMonitor monitor) + { + + Invocation inv = (Invocation)object; + if (monitor.isCanceled() || !isValidInvocation(inv)) + { + return; + } + + EList params = inv.getParams(); + if (monitor.isCanceled() || params.isEmpty() || !(params.get(0) instanceof StringLiteral)) + { + return; + } + + StringLiteral literal = (StringLiteral)params.get(0); + String roleName = literal.lines(true).get(0); + + if (StringUtils.isEmpty(roleName)) + { + return; + } + + IEObjectDescription roleDesc = getRoleDescFromScope(inv, roleName); + if (!monitor.isCanceled() && roleDesc == null) + { + String message = MessageFormat + .format(Messages.IsInRoleMethodRoleExistCheck_Role_named_not_exists_in_configuration, roleName); + resultAcceptor.addIssue(message, literal, STRING_LITERAL__LINES); + } + + } + + private boolean isValidInvocation(Invocation invocation) + { + + if (invocation.getMethodAccess() instanceof StaticFeatureAccess) + { + StaticFeatureAccess sfa = (StaticFeatureAccess)invocation.getMethodAccess(); + if (sfa.getName().equalsIgnoreCase(METHOD_ISINROLE_NAME) + || sfa.getName().equalsIgnoreCase(METHOD_ISINROLE_NAME_RU)) + { + return true; + } + } + + return false; + + } + + private IEObjectDescription getRoleDescFromScope(Invocation inv, String roleName) + { + IScope scope = scopeProvider.getScope(inv, CONFIGURATION__ROLES); + String fqn = topObjectFqnGenerator.generateStandaloneObjectFqn(ROLE, roleName); + return scope.getSingleElement(qualifiedNameConverter.toQualifiedName(fqn)); + } + +} diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/Messages.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/Messages.java index 9a39f56d..f7544978 100644 --- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/Messages.java +++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/Messages.java @@ -440,6 +440,12 @@ final class Messages public static String IsInRoleCheck_Using_IsInRole; + public static String IsInRoleMethodRoleExistCheck_description; + + public static String IsInRoleMethodRoleExistCheck_Role_named_not_exists_in_configuration; + + public static String IsInRoleMethodRoleExistCheck_title; + public static String ModuleUndefinedVariableCheck_Title; public static String ModuleUndefinedVariableCheck_Description; public static String ModuleUndefinedVariable_msg; diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/messages.properties b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/messages.properties index 5c5dac8e..0f670fd8 100644 --- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/messages.properties +++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/messages.properties @@ -216,6 +216,12 @@ IsInRoleCheck_Use_AccessRight_instead_IsInRole = Use the AccessRight() function IsInRoleCheck_Using_IsInRole = Using "IsInRole" method +IsInRoleMethodRoleExistCheck_Role_named_not_exists_in_configuration=Role named {0} not exists in configuration + +IsInRoleMethodRoleExistCheck_description=Referring to a non-existent role + +IsInRoleMethodRoleExistCheck_title=Referring to a non-existent role + LockOutOfTry_Checks_for_init_of_the_data_lock = Checks for initialization of the data lock. If the creation of a lock is found, the call of the Lock() method is checked, and the call must be in a try. LockOutOfTry_Lock_out_of_try = Lock out of Try diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/messages_ru.properties b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/messages_ru.properties index 968afd55..fa0c59d9 100644 --- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/messages_ru.properties +++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/messages_ru.properties @@ -216,6 +216,12 @@ IsInRoleCheck_Use_AccessRight_instead_IsInRole = Используйте функ IsInRoleCheck_Using_IsInRole = Использован не рекомендованный метод "РольДоступна" +IsInRoleMethodRoleExistCheck_Role_named_not_exists_in_configuration = Роль {0} не существует в конфигурации + +IsInRoleMethodRoleExistCheck_description = Обращение к несуществующей роли + +IsInRoleMethodRoleExistCheck_title = Обращение к несуществующей роли + LockOutOfTry_Checks_for_init_of_the_data_lock = Правило проверяет наличие инициализации блокировки данных. В случае если найдено создание блокировки, проверяется вызов метода "Заблокировать()", при этом вызов должен быть в попытке. LockOutOfTry_Lock_out_of_try = Метод Заблокировать() вне блока Попытка-Исключение diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/internal/bsl/ExternalDependenciesModule.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/internal/bsl/ExternalDependenciesModule.java index 38931405..3ed8c9a2 100644 --- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/internal/bsl/ExternalDependenciesModule.java +++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/internal/bsl/ExternalDependenciesModule.java @@ -43,6 +43,7 @@ import com._1c.g5.v8.dt.platform.version.IRuntimeVersionSupport; import com._1c.g5.wiring.AbstractServiceAwareModule; import com.e1c.g5.v8.dt.check.qfix.IFixRepository; import com.e1c.g5.v8.dt.check.settings.ICheckRepository; +import com._1c.g5.v8.dt.core.naming.ITopObjectFqnGenerator; /** * The external dependencies for plugin @@ -67,6 +68,7 @@ class ExternalDependenciesModule bind(IBslPreferences.class).toService(); bind(IQualifiedNameConverter.class).toService(); bind(IBslModuleContextDefService.class).toService(); + bind(ITopObjectFqnGenerator.class).toService(); bind(ICheckRepository.class).toService(); bind(IFixRepository.class).toService(); diff --git a/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/IsInRoleMethodRoleExistCheckTest.java b/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/IsInRoleMethodRoleExistCheckTest.java new file mode 100644 index 00000000..46e10153 --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/IsInRoleMethodRoleExistCheckTest.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * Copyright (C) 2023, 1C-Soft LLC and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * 1C-Soft LLC - initial API and implementation + *******************************************************************************/ + +package com.e1c.v8codestyle.bsl.check.itests; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import java.util.List; +import java.util.stream.Collectors; + +import org.eclipse.core.runtime.Path; +import org.junit.Test; + +import com._1c.g5.v8.dt.validation.marker.IExtraInfoKeys; +import com._1c.g5.v8.dt.validation.marker.Marker; +import com.e1c.v8codestyle.bsl.check.IsInRoleMethodRoleExistCheck; + +/** + * The test for {@link IsInRoleMethodRoleExistCheck} class. + * @author Vadim Goncharov + */ +public class IsInRoleMethodRoleExistCheckTest + extends AbstractSingleModuleTestBase +{ + + private static final String PROJECT_NAME = "IsInRoleMethodRoleExist"; //$NON-NLS-1$ + + private static final String COMMON_MODULE_FILE_NAME = "/src/CommonModules/RolesCommonModule/Module.bsl"; //$NON-NLS-1$ + + public IsInRoleMethodRoleExistCheckTest() + { + super(IsInRoleMethodRoleExistCheck.class); + } + + @Override + protected String getTestConfigurationName() + { + return PROJECT_NAME; + } + + @Override + protected String getModuleFileName() + { + return COMMON_MODULE_FILE_NAME; + } + + /** + * Test invocation role check access exist role check. + * + * @throws Exception the exception + */ + @Test + public void testIsInRoleMethodRoleExistCheck() throws Exception + { + + List markers = getModuleMarkers(); + assertEquals(2, markers.size()); + + assertEquals("2", markers.get(0).getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY)); + assertEquals("9", markers.get(1).getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY)); + } + +} diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/.project b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/.project new file mode 100644 index 00000000..4c1ad59a --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/.project @@ -0,0 +1,18 @@ + + + IsInRoleMethodRoleExist + + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + + org.eclipse.xtext.ui.shared.xtextNature + com._1c.g5.v8.dt.core.V8ConfigurationNature + + diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/.settings/org.eclipse.core.resources.prefs b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000..99f26c02 --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/DT-INF/PROJECT.PMF b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/DT-INF/PROJECT.PMF new file mode 100644 index 00000000..6835f1cd --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/DT-INF/PROJECT.PMF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 +Runtime-Version: 8.3.19 diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/CommonModules/RolesCommonModule/Module.bsl b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/CommonModules/RolesCommonModule/Module.bsl new file mode 100644 index 00000000..272d4b71 --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/CommonModules/RolesCommonModule/Module.bsl @@ -0,0 +1,19 @@ +Procedure TestIsInRole() + If IsInRole("TestRole3") Then + EndIf; + If IsInRole("TestRole1") Then + EndIf; +EndProcedure + +Процедура ТестРольДоступна() + Если РольДоступна("TestRole3") Тогда + КонецЕсли; + Если РольДоступна("TestRole1") Тогда + КонецЕсли; +КонецПроцедуры + +Procedure TestStaff() + If Users.RolesAvailable("TestRole1,TestRole2,TestRole3") Then + Message("Test message"); + EndIf; +EndProcedure diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/CommonModules/RolesCommonModule/RolesCommonModule.mdo b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/CommonModules/RolesCommonModule/RolesCommonModule.mdo new file mode 100644 index 00000000..ac320a0d --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/CommonModules/RolesCommonModule/RolesCommonModule.mdo @@ -0,0 +1,9 @@ + + + RolesCommonModule + + en + Roles common module + + true + diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/CommonModules/Users/Module.bsl b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/CommonModules/Users/Module.bsl new file mode 100644 index 00000000..e24f3d9d --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/CommonModules/Users/Module.bsl @@ -0,0 +1,8 @@ +Function RolesAvailable(RolesNames, User = Undefined, ForPrivilegedMode = True) Export + //Some checks + Return True; +EndFunction + +Function IsFullUser(User = Undefined) Export + Return True; +EndFunction \ No newline at end of file diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/CommonModules/Users/Users.mdo b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/CommonModules/Users/Users.mdo new file mode 100644 index 00000000..a61c3524 --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/CommonModules/Users/Users.mdo @@ -0,0 +1,9 @@ + + + Users + + en + Users + + true + diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/Configuration/CommandInterface.cmi b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/Configuration/CommandInterface.cmi new file mode 100644 index 00000000..0cf6de8a --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/Configuration/CommandInterface.cmi @@ -0,0 +1,2 @@ + + diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/Configuration/Configuration.mdo b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/Configuration/Configuration.mdo new file mode 100644 index 00000000..7ef2b01c --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/Configuration/Configuration.mdo @@ -0,0 +1,44 @@ + + + IsInRoleMethodRoleExist + + en + IsInRoleMethodRoleExistCheck + + + + + + + + + 8.3.19 + ManagedApplication + PersonalComputer + + + true + + + OSBackup + true + + + Language.English + Managed + NotAutoFree + DontUse + DontUse + 8.3.19 + + English + + en + English + + en + + Role.TestRole1 + CommonModule.RolesCommonModule + CommonModule.Users + diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/Configuration/MainSectionCommandInterface.cmi b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/Configuration/MainSectionCommandInterface.cmi new file mode 100644 index 00000000..0cf6de8a --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/Configuration/MainSectionCommandInterface.cmi @@ -0,0 +1,2 @@ + + diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/Roles/TestRole1/Rights.rights b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/Roles/TestRole1/Rights.rights new file mode 100644 index 00000000..67fd5321 --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/Roles/TestRole1/Rights.rights @@ -0,0 +1,45 @@ + + + false + true + false + + Configuration.IsInRoleMethodRoleExist + + SaveUserData + true + + + ThinClient + true + + + WebClient + true + + + MainWindowModeEmbeddedWorkplace + true + + + MainWindowModeKiosk + true + + + MainWindowModeNormal + true + + + MainWindowModeFullscreenWorkplace + true + + + MainWindowModeWorkplace + true + + + AnalyticsSystemClient + true + + + diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/Roles/TestRole1/TestRole1.mdo b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/Roles/TestRole1/TestRole1.mdo new file mode 100644 index 00000000..e3f3f8a3 --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/IsInRoleMethodRoleExist/src/Roles/TestRole1/TestRole1.mdo @@ -0,0 +1,8 @@ + + + TestRole1 + + en + Test role1 + + From 6ea583d940438aa07ed94505acbd0267863eddd0 Mon Sep 17 00:00:00 2001 From: Vadim Goncharov Date: Tue, 18 Apr 2023 09:28:23 +0300 Subject: [PATCH 2/2] =?UTF-8?q?#262=20=D0=9F=D1=80=D0=BE=D0=B2=D0=B5=D1=80?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D1=83=D1=81=D0=BB=D0=BE=D0=B2?= =?UTF-8?q?.=20=D0=BE=D1=84=D0=BE=D1=80=D0=BC=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=B2=20=D0=B4=D0=B8=D0=BD.=20=D1=81=D0=BF=D0=B8?= =?UTF-8?q?=D1=81=D0=BA=D0=B5=20=D0=B8=20=D0=BD=D0=B0=20=D1=84=D0=BE=D1=80?= =?UTF-8?q?=D0=BC=D0=B5=20(#1252)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Реализована проверка на использование условного оформления в динамическом списке (стандарт 710). * #262 Добавлена проверка использования усл. оформления на форме --------- Co-authored-by: Dmitriy Marmyshev --- CHANGELOG.md | 1 + .../META-INF/MANIFEST.MF | 3 + ...-composition-conditional-appearance-use.md | 7 + ...-composition-conditional-appearance-use.md | 7 + bundles/com.e1c.v8codestyle.form/plugin.xml | 4 + ...positionConditionalAppearanceUseCheck.java | 139 +++++++ .../e1c/v8codestyle/form/check/Messages.java | 4 + .../form/check/messages.properties | 10 +- .../form/check/messages_ru.properties | 8 + .../form/ExternalDependenciesModule.java | 3 + ...tionConditionalAppearanceUseCheckTest.java | 103 +++++ .../.project | 18 + .../org.eclipse.core.resources.prefs | 2 + .../DT-INF/PROJECT.PMF | 2 + .../Attributes/List/ExtInfo/ListSettings.dcss | 37 ++ .../TestCatalog1/Forms/ListForm/Form.form | 380 ++++++++++++++++++ .../Catalogs/TestCatalog1/TestCatalog1.mdo | 43 ++ .../Attributes/List/ExtInfo/ListSettings.dcss | 17 + .../TestCatalog2/Forms/ListForm/Form.form | 380 ++++++++++++++++++ .../Catalogs/TestCatalog2/TestCatalog2.mdo | 43 ++ .../ItemForm/ConditionalAppearance.dcssca | 13 + .../TestCatalog3/Forms/ItemForm/Form.form | 143 +++++++ .../Catalogs/TestCatalog3/TestCatalog3.mdo | 43 ++ .../TestCatalog4/Forms/ItemForm/Form.form | 143 +++++++ .../Catalogs/TestCatalog4/TestCatalog4.mdo | 43 ++ .../src/Configuration/CommandInterface.cmi | 2 + .../src/Configuration/Configuration.mdo | 45 +++ .../MainSectionCommandInterface.cmi | 2 + 28 files changed, 1644 insertions(+), 1 deletion(-) create mode 100644 bundles/com.e1c.v8codestyle.form/markdown/data-composition-conditional-appearance-use.md create mode 100644 bundles/com.e1c.v8codestyle.form/markdown/ru/data-composition-conditional-appearance-use.md create mode 100644 bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/DataCompositionConditionalAppearanceUseCheck.java create mode 100644 tests/com.e1c.v8codestyle.form.itests/src/com/e1c/v8codestyle/form/check/itests/DataCompositionConditionalAppearanceUseCheckTest.java create mode 100644 tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/.project create mode 100644 tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/.settings/org.eclipse.core.resources.prefs create mode 100644 tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/DT-INF/PROJECT.PMF create mode 100644 tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog1/Forms/ListForm/Attributes/List/ExtInfo/ListSettings.dcss create mode 100644 tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog1/Forms/ListForm/Form.form create mode 100644 tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog1/TestCatalog1.mdo create mode 100644 tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog2/Forms/ListForm/Attributes/List/ExtInfo/ListSettings.dcss create mode 100644 tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog2/Forms/ListForm/Form.form create mode 100644 tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog2/TestCatalog2.mdo create mode 100644 tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog3/Forms/ItemForm/ConditionalAppearance.dcssca create mode 100644 tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog3/Forms/ItemForm/Form.form create mode 100644 tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog3/TestCatalog3.mdo create mode 100644 tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog4/Forms/ItemForm/Form.form create mode 100644 tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog4/TestCatalog4.mdo create mode 100644 tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Configuration/CommandInterface.cmi create mode 100644 tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Configuration/Configuration.mdo create mode 100644 tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Configuration/MainSectionCommandInterface.cmi diff --git a/CHANGELOG.md b/CHANGELOG.md index 36751a6b..50cb7b31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ #### Формы - Использована ролевая настройка видимости, редактирования, использования для элемента формы +- Проверка на использование условного оформления в динамеческих списках #### Код модулей diff --git a/bundles/com.e1c.v8codestyle.form/META-INF/MANIFEST.MF b/bundles/com.e1c.v8codestyle.form/META-INF/MANIFEST.MF index e9bf35c5..e0f1619f 100644 --- a/bundles/com.e1c.v8codestyle.form/META-INF/MANIFEST.MF +++ b/bundles/com.e1c.v8codestyle.form/META-INF/MANIFEST.MF @@ -16,15 +16,18 @@ Bundle-ActivationPolicy: lazy Bundle-Localization: plugin Import-Package: com._1c.g5.v8.bm.core;version="[7.5.0,8.0.0)", com._1c.g5.v8.bm.core.event;version="[2.1.0,3.0.0)", + com._1c.g5.v8.bm.integration;version="[10.0.100,11.0.0)", com._1c.g5.v8.dt.common;version="[6.0.0,7.0.0)", com._1c.g5.v8.dt.core.platform;version="[10.4.0,11.0.0)", com._1c.g5.v8.dt.dcs.model.core;version="[2.6.0,3.0.0)", com._1c.g5.v8.dt.dcs.model.schema;version="[2.2.0,3.0.0)", + com._1c.g5.v8.dt.dcs.model.settings;version="[3.2.0,4.0.0)", com._1c.g5.v8.dt.form.model;version="[11.0.0,12.0.0)", com._1c.g5.v8.dt.form.model.util;version="[7.2.0,8.0.0)", com._1c.g5.v8.dt.form.service;version="[6.1.0,7.0.0)", com._1c.g5.v8.dt.form.service.datasourceinfo;version="[3.0.0,4.0.0)", com._1c.g5.v8.dt.mcore;version="[6.0.0,7.0.0)", + com._1c.g5.v8.dt.metadata;version="[5.0.0,6.0.0)", com._1c.g5.v8.dt.metadata.dbview;version="[4.0.0,5.0.0)", com._1c.g5.v8.dt.metadata.mdclass;version="[8.0.0,9.0.0)", com._1c.g5.v8.dt.platform.version;version="[2.14.0,3.0.0)", diff --git a/bundles/com.e1c.v8codestyle.form/markdown/data-composition-conditional-appearance-use.md b/bundles/com.e1c.v8codestyle.form/markdown/data-composition-conditional-appearance-use.md new file mode 100644 index 00000000..919ba381 --- /dev/null +++ b/bundles/com.e1c.v8codestyle.form/markdown/data-composition-conditional-appearance-use.md @@ -0,0 +1,7 @@ +# Conditional appearance in forms + +It is recommended to configure the conditional appearance of forms and dynamic lists in the form code. + +## See + +- [Conditional appearance in forms](https://kb.1ci.com/1C_Enterprise_Platform/Guides/Developer_Guides/1C_Enterprise_Development_Standards/Designing_user_interfaces/Implementation_of_form/Conditional_appearance_in_forms/) \ No newline at end of file diff --git a/bundles/com.e1c.v8codestyle.form/markdown/ru/data-composition-conditional-appearance-use.md b/bundles/com.e1c.v8codestyle.form/markdown/ru/data-composition-conditional-appearance-use.md new file mode 100644 index 00000000..8d3b9a79 --- /dev/null +++ b/bundles/com.e1c.v8codestyle.form/markdown/ru/data-composition-conditional-appearance-use.md @@ -0,0 +1,7 @@ +# Условное оформление в формах + +Настройку условного оформления рекомендуется делать в коде формы (а не в свойствах формы). + +## См. + +- [Условное оформление в формах](https://its.1c.ru/db/v8std#content:710:hdoc:2.1) \ No newline at end of file diff --git a/bundles/com.e1c.v8codestyle.form/plugin.xml b/bundles/com.e1c.v8codestyle.form/plugin.xml index 2c159798..2511a138 100644 --- a/bundles/com.e1c.v8codestyle.form/plugin.xml +++ b/bundles/com.e1c.v8codestyle.form/plugin.xml @@ -50,6 +50,10 @@ category="com.e1c.v8codestyle.form" class="com.e1c.v8codestyle.internal.form.ExecutableExtensionFactory:com.e1c.v8codestyle.form.check.FormCommandsSingleEventHandlerCheck"> + + diff --git a/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/DataCompositionConditionalAppearanceUseCheck.java b/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/DataCompositionConditionalAppearanceUseCheck.java new file mode 100644 index 00000000..b7d4e51a --- /dev/null +++ b/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/DataCompositionConditionalAppearanceUseCheck.java @@ -0,0 +1,139 @@ +/******************************************************************************* + * Copyright (C) 2023, 1C-Soft LLC and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * 1C-Soft LLC - initial API and implementation + * Vadim Goncharov - issue #262 + *******************************************************************************/ + +package com.e1c.v8codestyle.form.check; + +import static com._1c.g5.v8.dt.dcs.model.settings.DcsPackage.Literals.DATA_COMPOSITION_CONDITIONAL_APPEARANCE; +import static com._1c.g5.v8.dt.dcs.model.settings.DcsPackage.Literals.DATA_COMPOSITION_CONDITIONAL_APPEARANCE__ITEMS; +import static com._1c.g5.v8.dt.dcs.model.settings.DcsPackage.Literals.DATA_COMPOSITION_SETTINGS; + +import java.text.MessageFormat; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.xtext.EcoreUtil2; + +import com._1c.g5.v8.dt.core.platform.IBmModelManager; +import com._1c.g5.v8.dt.dcs.model.settings.DataCompositionConditionalAppearance; +import com._1c.g5.v8.dt.form.model.DynamicListExtInfo; +import com._1c.g5.v8.dt.form.model.Form; +import com._1c.g5.v8.dt.form.model.FormAttribute; +import com._1c.g5.v8.dt.metadata.ExternalPropertyManagerProvider; +import com._1c.g5.v8.dt.metadata.IExternalPropertyManager; +import com.e1c.g5.v8.dt.check.CheckComplexity; +import com.e1c.g5.v8.dt.check.ICheckParameters; +import com.e1c.g5.v8.dt.check.components.BasicCheck; +import com.e1c.g5.v8.dt.check.settings.IssueSeverity; +import com.e1c.g5.v8.dt.check.settings.IssueType; +import com.e1c.v8codestyle.check.StandardCheckExtension; +import com.e1c.v8codestyle.internal.form.CorePlugin; +import com.google.inject.Inject; + +/** + * The check find form or form attributes, that use conditional appearance. + * @author Vadim Goncharov + */ +public class DataCompositionConditionalAppearanceUseCheck + extends BasicCheck +{ + + private static final String CHECK_ID = "data-composition-conditional-appearance-use"; //$NON-NLS-1$ + + private final IBmModelManager bmModelManager; + + /** + * Instantiates a new dynamic list conditional appearance use check. + * + * @param bmModelManager the BmModelManager + */ + @Inject + public DataCompositionConditionalAppearanceUseCheck(IBmModelManager bmModelManager) + { + super(); + this.bmModelManager = bmModelManager; + } + + @Override + public String getCheckId() + { + return CHECK_ID; + } + + @Override + protected void configureCheck(CheckConfigurer builder) + { + builder.title(Messages.DataCompositionConditionalAppearanceUseCheck_title) + .description(Messages.DataCompositionConditionalAppearanceUseCheck_description) + .complexity(CheckComplexity.NORMAL) + .severity(IssueSeverity.MINOR) + .issueType(IssueType.UI_STYLE) + .extension(new StandardCheckExtension(710, getCheckId(), CorePlugin.PLUGIN_ID)) + .topObject(DATA_COMPOSITION_SETTINGS) + .containment(DATA_COMPOSITION_CONDITIONAL_APPEARANCE) + .features(DATA_COMPOSITION_CONDITIONAL_APPEARANCE__ITEMS); + } + + @Override + protected void check(Object object, ResultAcceptor resultAcceptor, ICheckParameters parameters, + IProgressMonitor monitor) + { + + DataCompositionConditionalAppearance dcca = (DataCompositionConditionalAppearance)object; + if (monitor.isCanceled() || dcca.getItems() == null || dcca.getItems().isEmpty()) + { + return; + } + + IExternalPropertyManager manager = + ExternalPropertyManagerProvider.INSTANCE.getExternalPropertyManager(bmModelManager.getModel(dcca)); + if (manager == null) + { + CorePlugin.logError(new IllegalStateException("ExternalPropertyManagerProvider not initialized")); //$NON-NLS-1$ + return; + } + + EObject eObject = dcca; + + DynamicListExtInfo dl = manager.getOwner(eObject, DynamicListExtInfo.class); + if (dl != null) + { + FormAttribute formAttribute = EcoreUtil2.getContainerOfType(dl, FormAttribute.class); + if (monitor.isCanceled() || formAttribute == null) + { + return; + } + + resultAcceptor.addIssue( + MessageFormat.format( + Messages.DataCompositionConditionalAppearanceUseCheck_Form_attribute, formAttribute.getName()), + dcca, DATA_COMPOSITION_CONDITIONAL_APPEARANCE__ITEMS); + + } + else + { + Form form = manager.getOwner(eObject, Form.class); + if (monitor.isCanceled() || form == null) + { + return; + } + + resultAcceptor.addIssue( + MessageFormat.format( + Messages.DataCompositionConditionalAppearanceUseCheck_Form, form.getMdForm().getName()), + dcca, DATA_COMPOSITION_CONDITIONAL_APPEARANCE__ITEMS); + + } + + } +} diff --git a/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/Messages.java b/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/Messages.java index 9086afe5..b43ba6f1 100644 --- a/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/Messages.java +++ b/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/Messages.java @@ -23,6 +23,10 @@ final class Messages extends NLS { private static final String BUNDLE_NAME = "com.e1c.v8codestyle.form.check.messages"; //$NON-NLS-1$ + public static String DataCompositionConditionalAppearanceUseCheck_description; + public static String DataCompositionConditionalAppearanceUseCheck_Form; + public static String DataCompositionConditionalAppearanceUseCheck_Form_attribute; + public static String DataCompositionConditionalAppearanceUseCheck_title; public static String DynamicListItemTitleCheck_Description; public static String DynamicListItemTitleCheck_message; public static String DynamicListItemTitleCheck_title; diff --git a/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/messages.properties b/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/messages.properties index eeebac4b..8b4c78e5 100644 --- a/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/messages.properties +++ b/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/messages.properties @@ -1,4 +1,3 @@ - #Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/) ############################################################################### # Copyright (C) 2021-2022, 1C-Soft LLC and others. @@ -13,6 +12,15 @@ # 1C-Soft LLC - initial API and implementation # Manaev Konstantin - issue #855 ############################################################################### + +DataCompositionConditionalAppearanceUseCheck_description = Use data composition conditional appearance + +DataCompositionConditionalAppearanceUseCheck_Form = Form "{0}" use conditional appearance + +DataCompositionConditionalAppearanceUseCheck_Form_attribute = Form attribute "{0}" use conditional appearance + +DataCompositionConditionalAppearanceUseCheck_title = Use data composition conditional appearance + DynamicListItemTitleCheck_Description = Dynamic list field title is empty DynamicListItemTitleCheck_message = Title of field of dynamic list is not filled diff --git a/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/messages_ru.properties b/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/messages_ru.properties index b44e16dd..195abf04 100644 --- a/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/messages_ru.properties +++ b/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/messages_ru.properties @@ -13,6 +13,14 @@ # Manaev Konstantin - issue #855 ############################################################################### +DataCompositionConditionalAppearanceUseCheck_description = Используется условное оформление компоновки данных + +DataCompositionConditionalAppearanceUseCheck_Form = Форма "{0}" использует условное оформление + +DataCompositionConditionalAppearanceUseCheck_Form_attribute = Реквизит формы "{0}" использует условное оформление + +DataCompositionConditionalAppearanceUseCheck_title = Используется условное оформление компоновки данных + DynamicListItemTitleCheck_Description = Заголовок поля динамического списка пустой DynamicListItemTitleCheck_message = Не заполнен заголовок поля динамического списка diff --git a/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/internal/form/ExternalDependenciesModule.java b/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/internal/form/ExternalDependenciesModule.java index 2c7398ec..e02fc595 100644 --- a/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/internal/form/ExternalDependenciesModule.java +++ b/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/internal/form/ExternalDependenciesModule.java @@ -17,6 +17,7 @@ import org.eclipse.core.runtime.Plugin; import org.eclipse.emf.common.util.URI; import org.eclipse.xtext.resource.IResourceServiceProvider; +import com._1c.g5.v8.dt.core.platform.IBmModelManager; import com._1c.g5.v8.dt.core.platform.IV8ProjectManager; import com._1c.g5.v8.dt.form.service.FormItemInformationService; import com._1c.g5.v8.dt.form.service.datasourceinfo.IDataSourceInfoAssociationService; @@ -48,8 +49,10 @@ public class ExternalDependenciesModule URI uri = URI.createURI("*.form"); //$NON-NLS-1$ final IResourceServiceProvider rsp = IResourceServiceProvider.Registry.INSTANCE.getResourceServiceProvider(uri); bind(FormItemInformationService.class).toProvider(() -> rsp.get(FormItemInformationService.class)); + bind(IV8ProjectManager.class).toService(); bind(IDataSourceInfoAssociationService.class).toService(); + bind(IBmModelManager.class).toService(); URI qlUri = URI.createURI("*.qldcs"); //$NON-NLS-1$ final IResourceServiceProvider qlRsp = diff --git a/tests/com.e1c.v8codestyle.form.itests/src/com/e1c/v8codestyle/form/check/itests/DataCompositionConditionalAppearanceUseCheckTest.java b/tests/com.e1c.v8codestyle.form.itests/src/com/e1c/v8codestyle/form/check/itests/DataCompositionConditionalAppearanceUseCheckTest.java new file mode 100644 index 00000000..682d5bfc --- /dev/null +++ b/tests/com.e1c.v8codestyle.form.itests/src/com/e1c/v8codestyle/form/check/itests/DataCompositionConditionalAppearanceUseCheckTest.java @@ -0,0 +1,103 @@ +package com.e1c.v8codestyle.form.check.itests; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +import com._1c.g5.v8.bm.core.IBmObject; +import com._1c.g5.v8.dt.core.platform.IDtProject; +import com._1c.g5.v8.dt.dcs.model.settings.DataCompositionConditionalAppearance; +import com._1c.g5.v8.dt.dcs.model.settings.DataCompositionSettings; +import com._1c.g5.v8.dt.validation.marker.Marker; +import com.e1c.g5.v8.dt.testing.check.CheckTestBase; +import com.e1c.v8codestyle.form.check.DataCompositionConditionalAppearanceUseCheck; + +/** + * Tests for {@link DataCompositionConditionalAppearanceUseCheck} check. + * + * @author Vadim Goncharov + */ +public class DataCompositionConditionalAppearanceUseCheckTest + extends CheckTestBase +{ + private static final String CHECK_ID = "data-composition-conditional-appearance-use"; + private static final String PROJECT_NAME = "DataCompositionConditionalAppearanceUse"; + private static final String FQN_DL1 = + "Catalog.TestCatalog1.Form.ListForm.Form.Attributes.List.ExtInfo.ListSettings"; + private static final String FQN_DL2 = + "Catalog.TestCatalog2.Form.ListForm.Form.Attributes.List.ExtInfo.ListSettings"; + private static final String FQN_FORM1 = "Catalog.TestCatalog3.Form.ItemForm.Form.ConditionalAppearance"; + private static final String FQN_FORM2 = "Catalog.TestCatalog4.Form.ItemForm.Form.ConditionalAppearance"; + + /** + * Test the Dynamic List use the conditional appearance. + * + * @throws Exception the exception + */ + @Test + public void testDynamicListUseConditionalAppearance() throws Exception + { + IDtProject dtProject = openProjectAndWaitForValidationFinish(PROJECT_NAME); + assertNotNull(dtProject); + + IBmObject object = getTopObjectByFqn(FQN_DL1, dtProject); + assertTrue(object instanceof DataCompositionSettings); + + Marker marker = getFirstNestedMarker(CHECK_ID, object.bmGetId(), dtProject); + assertNotNull(marker); + } + + /** + * Test the Dynamic List do not use the conditional appearance. + * + * @throws Exception the exception + */ + @Test + public void testDynamicListDoNotUseConditionalAppearance() throws Exception + { + IDtProject dtProject = openProjectAndWaitForValidationFinish(PROJECT_NAME); + assertNotNull(dtProject); + + IBmObject object = getTopObjectByFqn(FQN_DL2, dtProject); + assertTrue(object instanceof DataCompositionSettings); + + Marker marker = getFirstNestedMarker(CHECK_ID, object.bmGetId(), dtProject); + assertNull(marker); + } + + /** + * Test the form use the conditional appearance. + * + * @throws Exception the exception + */ + @Test + public void testFormUseConditionalAppearance() throws Exception + { + IDtProject dtProject = openProjectAndWaitForValidationFinish(PROJECT_NAME); + assertNotNull(dtProject); + + IBmObject object = getTopObjectByFqn(FQN_FORM1, dtProject); + assertTrue(object instanceof DataCompositionConditionalAppearance); + + Marker marker = getFirstNestedMarker(CHECK_ID, object.bmGetId(), dtProject); + assertNotNull(marker); + } + + /** + * Test the form don't use the conditional appearance. + * + * @throws Exception the exception + */ + @Test + public void testFormDontUseConditionalAppearance() throws Exception + { + IDtProject dtProject = openProjectAndWaitForValidationFinish(PROJECT_NAME); + assertNotNull(dtProject); + + IBmObject object = getTopObjectByFqn(FQN_FORM2, dtProject); + assertNull(object); + } + +} diff --git a/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/.project b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/.project new file mode 100644 index 00000000..46796cc1 --- /dev/null +++ b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/.project @@ -0,0 +1,18 @@ + + + DataCompositionConditionalAppearanceUse + + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + + org.eclipse.xtext.ui.shared.xtextNature + com._1c.g5.v8.dt.core.V8ConfigurationNature + + diff --git a/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/.settings/org.eclipse.core.resources.prefs b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000..99f26c02 --- /dev/null +++ b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/DT-INF/PROJECT.PMF b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/DT-INF/PROJECT.PMF new file mode 100644 index 00000000..6835f1cd --- /dev/null +++ b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/DT-INF/PROJECT.PMF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 +Runtime-Version: 8.3.19 diff --git a/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog1/Forms/ListForm/Attributes/List/ExtInfo/ListSettings.dcss b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog1/Forms/ListForm/Attributes/List/ExtInfo/ListSettings.dcss new file mode 100644 index 00000000..824ece8a --- /dev/null +++ b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog1/Forms/ListForm/Attributes/List/ExtInfo/ListSettings.dcss @@ -0,0 +1,37 @@ + + + + Normal + 0ba244f8-347c-4879-8818-804f99e1b947 + + + Normal + b2180f1e-00e6-4ddd-b884-17f325769653 + + + + + + Code + + + + + + Visible + false + + + + Normal + 2182c1c8-8657-4646-bf81-230ed595bf58 + + + en + Code visibility + + + + Normal + c4db2142-65c3-43e4-8bbc-c011c9e3103f + diff --git a/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog1/Forms/ListForm/Form.form b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog1/Forms/ListForm/Form.form new file mode 100644 index 00000000..1459778f --- /dev/null +++ b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog1/Forms/ListForm/Form.form @@ -0,0 +1,380 @@ + + + + ListSettingsComposerUserSettings + 1 + true + true + + true + + + <key>en</key> + <value>User settings group</value> + + false + + ListSettingsComposerUserSettingsExtendedTooltip + 2 + true + true + + true + + Label + true + true + + Left + + + UsualGroup + + Vertical + WeakSeparation + true + true + Auto + Auto + + + + List + 3 + true + true + + true + + + List + + true + None + + Code + 16 + true + true + + true + + + List.Code + + true + + CodeExtendedTooltip + 18 + true + true + + true + + Label + true + true + + Left + + + + CodeContextMenu + 17 + true + true + + true + + true + + LabelField + Enter + true + Left + true + + true + true + + + + Description + 19 + true + true + + true + + + List.Description + + + DescriptionExtendedTooltip + 21 + true + true + + true + + Label + true + true + + Left + + + + DescriptionContextMenu + 20 + true + true + + true + + true + + LabelField + Enter + true + Left + true + + true + true + + + None + + ListCommandBar + 5 + true + true + + true + + Left + + + true + true + + true + + ListSearchString + 7 + + ListSearchStringExtendedTooltip + 9 + true + true + + true + + Label + true + true + + Left + + + + ListSearchStringContextMenu + 8 + true + true + + true + + true + + ListSearchString + + true + + + + true + true + + true + + ListViewStatus + 10 + + ListViewStatusExtendedTooltip + 12 + true + true + + true + + Label + true + true + + Left + + + + ListViewStatusContextMenu + 11 + true + true + + true + + true + + ViewStatusAddition + ListViewStatus + + true + + + + true + true + + true + + ListSearchControl + 13 + + ListSearchControlExtendedTooltip + 15 + true + true + + true + + Label + true + true + + Left + + + + ListSearchControlContextMenu + 14 + true + true + + true + + true + + SearchControlAddition + ListSearchControl + + true + + + + ListExtendedTooltip + 6 + true + true + + true + + Label + true + true + + Left + + + + ListContextMenu + 4 + true + true + + true + + true + + true + true + true + true + true + MultiRow +
true
+ 1 + 1 + AutoUse + AutoUse + true + true + true + Auto + Auto + ExpandTopLevel + true + true + true + true + AsFileRef + + List.DefaultPicture + + + 60 + + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + + + true + ListSettingsComposerUserSettings + +
+ + FormCommandBar + -1 + true + true + + true + + Left + true + + true + true + Vertical + true + true + true + true + true + + List + 1 + + DynamicList + + + true + + + true + +
true
+ + Catalog.TestCatalog1 + true + true + true + true + +
+ + + + + +
diff --git a/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog1/TestCatalog1.mdo b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog1/TestCatalog1.mdo new file mode 100644 index 00000000..dd098a3a --- /dev/null +++ b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog1/TestCatalog1.mdo @@ -0,0 +1,43 @@ + + + + + + + + + + TestCatalog1 + + en + Test catalog1 + + true + Catalog.TestCatalog1.StandardAttribute.Code + Catalog.TestCatalog1.StandardAttribute.Description + DontUse + Use + Managed + Use + 2 + true + 9 + 25 + String + Variable + true + true + AsDescription + InDialog + BothWays + Catalog.TestCatalog1.Form.ListForm + + ListForm + + en + List form + + PersonalComputer + MobileDevice + + diff --git a/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog2/Forms/ListForm/Attributes/List/ExtInfo/ListSettings.dcss b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog2/Forms/ListForm/Attributes/List/ExtInfo/ListSettings.dcss new file mode 100644 index 00000000..ee4c392c --- /dev/null +++ b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog2/Forms/ListForm/Attributes/List/ExtInfo/ListSettings.dcss @@ -0,0 +1,17 @@ + + + + Normal + 29852e17-a948-4760-ad5b-96f652ae6385 + + + Normal + 5a49d25f-e3a1-4d9b-b77c-8ca7e4993f4d + + + Normal + 99b3d6c7-3b0a-4747-8f19-e6dfde297050 + + Normal + 8ec81508-4f51-4983-b1ef-98f3864d4768 + diff --git a/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog2/Forms/ListForm/Form.form b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog2/Forms/ListForm/Form.form new file mode 100644 index 00000000..a4e66911 --- /dev/null +++ b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog2/Forms/ListForm/Form.form @@ -0,0 +1,380 @@ + + + + ListSettingsComposerUserSettings + 1 + true + true + + true + + + <key>en</key> + <value>User settings group</value> + + false + + ListSettingsComposerUserSettingsExtendedTooltip + 2 + true + true + + true + + Label + true + true + + Left + + + UsualGroup + + Vertical + WeakSeparation + true + true + Auto + Auto + + + + List + 3 + true + true + + true + + + List + + true + None + + Code + 16 + true + true + + true + + + List.Code + + true + + CodeExtendedTooltip + 18 + true + true + + true + + Label + true + true + + Left + + + + CodeContextMenu + 17 + true + true + + true + + true + + LabelField + Enter + true + Left + true + + true + true + + + + Description + 19 + true + true + + true + + + List.Description + + + DescriptionExtendedTooltip + 21 + true + true + + true + + Label + true + true + + Left + + + + DescriptionContextMenu + 20 + true + true + + true + + true + + LabelField + Enter + true + Left + true + + true + true + + + None + + ListCommandBar + 5 + true + true + + true + + Left + + + true + true + + true + + ListSearchString + 7 + + ListSearchStringExtendedTooltip + 9 + true + true + + true + + Label + true + true + + Left + + + + ListSearchStringContextMenu + 8 + true + true + + true + + true + + ListSearchString + + true + + + + true + true + + true + + ListViewStatus + 10 + + ListViewStatusExtendedTooltip + 12 + true + true + + true + + Label + true + true + + Left + + + + ListViewStatusContextMenu + 11 + true + true + + true + + true + + ViewStatusAddition + ListViewStatus + + true + + + + true + true + + true + + ListSearchControl + 13 + + ListSearchControlExtendedTooltip + 15 + true + true + + true + + Label + true + true + + Left + + + + ListSearchControlContextMenu + 14 + true + true + + true + + true + + SearchControlAddition + ListSearchControl + + true + + + + ListExtendedTooltip + 6 + true + true + + true + + Label + true + true + + Left + + + + ListContextMenu + 4 + true + true + + true + + true + + true + true + true + true + true + MultiRow +
true
+ 1 + 1 + AutoUse + AutoUse + true + true + true + Auto + Auto + ExpandTopLevel + true + true + true + true + AsFileRef + + List.DefaultPicture + + + 60 + + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + + + true + ListSettingsComposerUserSettings + +
+ + FormCommandBar + -1 + true + true + + true + + Left + true + + true + true + Vertical + true + true + true + true + true + + List + 1 + + DynamicList + + + true + + + true + +
true
+ + Catalog.TestCatalog2 + true + true + true + true + +
+ + + + + +
diff --git a/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog2/TestCatalog2.mdo b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog2/TestCatalog2.mdo new file mode 100644 index 00000000..5d787916 --- /dev/null +++ b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog2/TestCatalog2.mdo @@ -0,0 +1,43 @@ + + + + + + + + + + TestCatalog2 + + en + Test catalog2 + + true + Catalog.TestCatalog2.StandardAttribute.Code + Catalog.TestCatalog2.StandardAttribute.Description + DontUse + Use + Managed + Use + 2 + true + 9 + 25 + String + Variable + true + true + AsDescription + InDialog + BothWays + Catalog.TestCatalog2.Form.ListForm + + ListForm + + en + List form + + PersonalComputer + MobileDevice + + diff --git a/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog3/Forms/ItemForm/ConditionalAppearance.dcssca b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog3/Forms/ItemForm/ConditionalAppearance.dcssca new file mode 100644 index 00000000..fc4dff39 --- /dev/null +++ b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog3/Forms/ItemForm/ConditionalAppearance.dcssca @@ -0,0 +1,13 @@ + + + + + + + + TextColor + #000000 + + + + diff --git a/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog3/Forms/ItemForm/Form.form b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog3/Forms/ItemForm/Form.form new file mode 100644 index 00000000..0480e526 --- /dev/null +++ b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog3/Forms/ItemForm/Form.form @@ -0,0 +1,143 @@ + + + + Code + 1 + true + true + + true + + + Object.Code + + + CodeExtendedTooltip + 3 + true + true + + true + + Label + true + true + + Left + + + + CodeContextMenu + 2 + true + true + + true + + true + + InputField + EnterOnInput + true + Left + true + + true + true + true + true + true + true + + + + Description + 4 + true + true + + true + + + Object.Description + + + DescriptionExtendedTooltip + 6 + true + true + + true + + Label + true + true + + Left + + + + DescriptionContextMenu + 5 + true + true + + true + + true + + InputField + EnterOnInput + true + Left + true + + true + true + true + true + true + true + + + + FormCommandBar + -1 + true + true + + true + + Left + true + + LockOwnerWindow + true + true + Vertical + true + true + true + true + true + + Object + 1 + + CatalogObject.TestCatalog3 + + + true + + + true + +
true
+ true +
+ + + + + +
diff --git a/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog3/TestCatalog3.mdo b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog3/TestCatalog3.mdo new file mode 100644 index 00000000..bf99dd7d --- /dev/null +++ b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog3/TestCatalog3.mdo @@ -0,0 +1,43 @@ + + + + + + + + + + TestCatalog3 + + en + Test catalog3 + + true + Catalog.TestCatalog3.StandardAttribute.Code + Catalog.TestCatalog3.StandardAttribute.Description + DontUse + Use + Managed + Use + 2 + true + 9 + 25 + String + Variable + true + true + AsDescription + InDialog + BothWays + Catalog.TestCatalog3.Form.ItemForm + + ItemForm + + en + Item form + + PersonalComputer + MobileDevice + + diff --git a/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog4/Forms/ItemForm/Form.form b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog4/Forms/ItemForm/Form.form new file mode 100644 index 00000000..2ff28dbd --- /dev/null +++ b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog4/Forms/ItemForm/Form.form @@ -0,0 +1,143 @@ + + + + Code + 1 + true + true + + true + + + Object.Code + + + CodeExtendedTooltip + 3 + true + true + + true + + Label + true + true + + Left + + + + CodeContextMenu + 2 + true + true + + true + + true + + InputField + EnterOnInput + true + Left + true + + true + true + true + true + true + true + + + + Description + 4 + true + true + + true + + + Object.Description + + + DescriptionExtendedTooltip + 6 + true + true + + true + + Label + true + true + + Left + + + + DescriptionContextMenu + 5 + true + true + + true + + true + + InputField + EnterOnInput + true + Left + true + + true + true + true + true + true + true + + + + FormCommandBar + -1 + true + true + + true + + Left + true + + LockOwnerWindow + true + true + Vertical + true + true + true + true + true + + Object + 1 + + CatalogObject.TestCatalog4 + + + true + + + true + +
true
+ true +
+ + + + + +
diff --git a/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog4/TestCatalog4.mdo b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog4/TestCatalog4.mdo new file mode 100644 index 00000000..b01dbee9 --- /dev/null +++ b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Catalogs/TestCatalog4/TestCatalog4.mdo @@ -0,0 +1,43 @@ + + + + + + + + + + TestCatalog4 + + en + Test catalog4 + + true + Catalog.TestCatalog4.StandardAttribute.Code + Catalog.TestCatalog4.StandardAttribute.Description + DontUse + Use + Managed + Use + 2 + true + 9 + 25 + String + Variable + true + true + AsDescription + InDialog + BothWays + Catalog.TestCatalog4.Form.ItemForm + + ItemForm + + en + Item form + + PersonalComputer + MobileDevice + + diff --git a/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Configuration/CommandInterface.cmi b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Configuration/CommandInterface.cmi new file mode 100644 index 00000000..0cf6de8a --- /dev/null +++ b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Configuration/CommandInterface.cmi @@ -0,0 +1,2 @@ + + diff --git a/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Configuration/Configuration.mdo b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Configuration/Configuration.mdo new file mode 100644 index 00000000..610df9f2 --- /dev/null +++ b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Configuration/Configuration.mdo @@ -0,0 +1,45 @@ + + + DataCompositionConditionalAppearanceUse + + en + DataCompositionConditionalAppearanceUse + + + + + + + + + 8.3.19 + ManagedApplication + PersonalComputer + + + true + + + OSBackup + true + + + Language.English + Managed + NotAutoFree + DontUse + DontUse + 8.3.19 + + English + + en + English + + en + + Catalog.TestCatalog1 + Catalog.TestCatalog2 + Catalog.TestCatalog3 + Catalog.TestCatalog4 + diff --git a/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Configuration/MainSectionCommandInterface.cmi b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Configuration/MainSectionCommandInterface.cmi new file mode 100644 index 00000000..0cf6de8a --- /dev/null +++ b/tests/com.e1c.v8codestyle.form.itests/workspace/DataCompositionConditionalAppearanceUse/src/Configuration/MainSectionCommandInterface.cmi @@ -0,0 +1,2 @@ + +