diff --git a/commonbase/build.gradle b/commonbase/build.gradle index 51c7d0d5c244b834ab6e77af7c17e451d12363ad..76d18cfebcd671eaba91eae62fd775249cdcea58 100644 --- a/commonbase/build.gradle +++ b/commonbase/build.gradle @@ -8,10 +8,10 @@ dependencies { 'sis:sis-base:18.09.0', 'rinn:restrictions:1.0.2', // Removed libraries from JDK 11 used by many projects - 'javax.activation:activation:1.1.1', // TODO: Add to ivy repository and remove mavenCentral() from repository.gradle + 'javax.activation:activation:1.1.1', 'javax.annotation:javax.annotation-api:1.3.2', 'javax.xml.bind:jaxb-api:2.3.0', - 'org.glassfish.jaxb:jaxb-runtime:2.3.0', // TODO: Add to ivy repository and remove mavenCentral() from repository.gradle + 'org.glassfish.jaxb:jaxb-runtime:2.3.0', 'org.glassfish.main.javaee-api:javax.jws:3.1.2.2' testCompile 'fjelmer:classycle:1.4.2', diff --git a/datastore_server/dist/datastore_server.sh b/datastore_server/dist/datastore_server.sh index 8909ae4cecddc3d486352e27c430ebf8011a8091..bf6416edec9d899253541806599fcbee3c1ca8a3 100755 --- a/datastore_server/dist/datastore_server.sh +++ b/datastore_server/dist/datastore_server.sh @@ -160,7 +160,13 @@ CP=`echo $LIB_FOLDER/slf4j-log4j12-1.6.2.jar $LIB_FOLDER/datastore_server.jar $L | sed 's/ /:/g'` CMD="${JAVA_BIN}" -COMMON_OPTIONS="${JAVA_OPTS} ${JAVA_MEM_OPTS} -Dnative.libpath=$LIB_FOLDER/native -classpath $CP ch.systemsx.cisd.openbis.dss.generic.DataStoreServer" +version=$("${CMD}" -version 2>&1 | awk -F '"' '/version/ {print $2}'| cut -c1-3) +JAVA_VERSION_OPTS="" +if [[ "$version" != "1.8" ]]; then + JAVA_VERSION_OPTS="--add-exports java.xml/jdk.xml.internal=ALL-UNNAMED" +fi +COMMON_OPTIONS="${JAVA_OPTS} ${JAVA_MEM_OPTS} $JAVA_VERSION_OPTS -Dnative.libpath=$LIB_FOLDER/native -classpath $CP ch.systemsx.cisd.openbis.dss.generic.DataStoreServer" + # ensure that we ignore a possible prefix "--" for any command command="${command#--*}" diff --git a/gradle/build.gradle b/gradle/build.gradle index 0e4ce2edeecaf1767e69dd072898d187fd604d08..352c83b352d3fe97e690d645125a815801aa6111 100644 --- a/gradle/build.gradle +++ b/gradle/build.gradle @@ -6,7 +6,6 @@ evaluationDependsOn(':authentication') evaluationDependsOn(':dbmigration') evaluationDependsOn(':openbis') evaluationDependsOn(':datastore_server') -evaluationDependsOn(':rtd_phosphonetx') evaluationDependsOn(':screening') evaluationDependsOn(':rtd_yeastx') evaluationDependsOn(':deep_sequencing_unit') diff --git a/gradle/repository.gradle b/gradle/repository.gradle index b9449009572b50f26fdac334e34a1b62b5225dc3..ca7ada3c059ee0c8311659f1ba8911ffac513f34 100644 --- a/gradle/repository.gradle +++ b/gradle/repository.gradle @@ -7,5 +7,4 @@ ext.repositoryConfig = { ivyPattern "http://svnsis.ethz.ch/repos/cisd/ivy-repository/trunk/[organisation]/[module]/[revision]/ivy.xml" artifactPattern "http://svnsis.ethz.ch/repos/cisd/ivy-repository/trunk/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]" } - mavenCentral() // TODO: remove after adding dependencies to Ivy repository } diff --git a/gradle/settings.gradle b/gradle/settings.gradle index 66310dbb5c5af7153a686e4c6335ba304c6d2099..ff6f7a72a0135f8344b0935430f999d1ad0cfe6f 100644 --- a/gradle/settings.gradle +++ b/gradle/settings.gradle @@ -1,4 +1,4 @@ includeFlat 'commonbase', 'common', 'openbis_api', 'openbis-common', 'authentication', 'dbmigration', 'openbis', - 'datastore_server', 'screening', 'rtd_phosphonetx', 'deep_sequencing_unit', 'rtd_yeastx', + 'datastore_server', 'screening', 'deep_sequencing_unit', 'rtd_yeastx', 'openbis_standard_technologies', 'installation', 'image_readers', 'ui-test', 'js-test', 'datamover', 'plasmid', 'rtd_cina', 'openbis_oai_pmh', 'big_data_link_server', 'openbis_ng_ui' diff --git a/installation/build.gradle b/installation/build.gradle index 2fb2f13b9c2feaf9a0c3857b7bd77ed39ca31195..de772827ddbfae861c2ba9ee6f6e4fba76a24b9f 100644 --- a/installation/build.gradle +++ b/installation/build.gradle @@ -6,7 +6,6 @@ evaluationDependsOn(':authentication') evaluationDependsOn(':dbmigration') evaluationDependsOn(':openbis') evaluationDependsOn(':datastore_server') -evaluationDependsOn(':rtd_phosphonetx') evaluationDependsOn(':screening') evaluationDependsOn(':rtd_yeastx') evaluationDependsOn(':deep_sequencing_unit') @@ -167,9 +166,6 @@ task createInstallerJar(type: Jar, dependsOn: [compileInstaller, jar]) { for (f in configurations.archives.files) { from zipTree(f) } - manifest { - attributes('Main-Class' : 'com.izforge.izpack.installer.bootstrap.Installer') - } } task createInstallerZip(type: Tar, dependsOn: createInstallerJar) { diff --git a/installation/resource/tarball/run-console.sh b/installation/resource/tarball/run-console.sh index 3593973e0dbe5dfb5e3ccfe4fdcccbe2eb7b6781..8dd8b38d386547ea6c91bb42b43808ea63d53112 100755 --- a/installation/resource/tarball/run-console.sh +++ b/installation/resource/tarball/run-console.sh @@ -84,4 +84,4 @@ else readAdminPassword fi -java -Djava.util.logging.config.file=$BASE/jul.config -DADMIN_PASSWORD=$ADMIN_PASSWORD -DCONSOLE=true -Dmerge.props.to.installation.vars=true -jar $BASE/openBIS-installer.jar -options-auto $BASE/console.properties +java -Djava.util.logging.config.file=$BASE/jul.config -DADMIN_PASSWORD=$ADMIN_PASSWORD -DCONSOLE=true -Dmerge.props.to.installation.vars=true -cp $BASE/openBIS-installer.jar com.izforge.izpack.installer.bootstrap.Installer -options-auto $BASE/console.properties diff --git a/installation/resource/tarball/run-ui.sh b/installation/resource/tarball/run-ui.sh deleted file mode 100755 index c6faf8bb4c7ff0253ebeeef86a4526943663199a..0000000000000000000000000000000000000000 --- a/installation/resource/tarball/run-ui.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -#Detect Java version - -if type -p java; then - _java=java -else - echo "Java not available" - exit -1 -fi - -if [[ "$_java" ]]; then - version=$("$_java" -version 2>&1 | awk -F '"' '/version/ {print $2}'| cut -c1-3) - if [[ "$version" == "1.8" || "$version" == "11." ]]; then - echo Java version $version found. - else - echo Java version $version found is neither 1.8 or 11. - exit -1 - fi -fi - -#Continue installation - -BASE=`dirname "$0"` -if [ ${BASE#/} == ${BASE} ]; then - BASE="`pwd`/${BASE}" -fi - -java -Djava.util.logging.config.file=$BASE/jul.config -jar $BASE/openBIS-installer.jar \ No newline at end of file diff --git a/installation/settings.gradle b/installation/settings.gradle index 3f3662d1ec0119b599baabe637f170dfdfa0bab0..50c7d614b24c5ecf1e16be23114aa0bb44214dd6 100644 --- a/installation/settings.gradle +++ b/installation/settings.gradle @@ -1,4 +1,4 @@ includeFlat 'commonbase', 'common', 'openbis_api', 'openbis-common', 'authentication', 'dbmigration', 'openbis', - 'datastore_server', 'screening', 'rtd_yeastx', 'rtd_phosphonetx', 'deep_sequencing_unit', 'plasmid', + 'datastore_server', 'screening', 'rtd_yeastx', 'deep_sequencing_unit', 'plasmid', 'openbis_standard_technologies', 'big_data_link_server', 'openbis_ng_ui' diff --git a/integration-tests/settings.py b/integration-tests/settings.py index 04ab833f45fa65f4f9e022e860f98fd399cd77eb..25faa19237f1d685c31d1860ce4a5661e70b58db 100644 --- a/integration-tests/settings.py +++ b/integration-tests/settings.py @@ -5,8 +5,8 @@ import sys import os.path import time -# Base URL of the CI server which hosts the artifacts. -CI_BASE_URL = 'http://bs-ci01.ethz.ch:8090' +# Default base URL of the CI server which hosts the artifacts. +ci_base_url = 'http://bs-ci01.ethz.ch:8090' reuseRepository = False devMode = False @@ -20,9 +20,12 @@ if len(sys.argv) > 1: devMode = True elif firstArgument == '-d': devMode = True + elif firstArgument == '-s': + ci_base_url = sys.argv[2] elif firstArgument == '-h': - print("Usage: %s [-h|-r|-d|-rd]\n-h: prints this help\n-r: reuses artifact repository\n" - + "-d: developing mode\n-rd: both options" % os.path.basename(cmd)) + print(("Usage: %s [-h|-r|-d|-rd|-s <ci server>]\n-h: prints this help\n-r: reuses artifact repository\n" + + "-d: developing mode\n-rd: both options\n" + + "-s <ci server>: option for CI server host name") % os.path.basename(cmd)) exit(1) else: print("Unknown option: %s. Use option '-h' to see usage." % firstArgument) @@ -34,6 +37,6 @@ sys.path.append("%s/sourceTest" % dirname) from systemtest.artifactrepository import JenkinsArtifactRepository -REPOSITORY = JenkinsArtifactRepository(CI_BASE_URL, "%s/targets/artifact-repository" % dirname) +REPOSITORY = JenkinsArtifactRepository(ci_base_url, "%s/targets/artifact-repository" % dirname) if not reuseRepository: REPOSITORY.clear() diff --git a/js-test/build.gradle b/js-test/build.gradle index 2fd32348cf7106bdd3924b2b8e9e4831d1e86fae..70a547facd9fc59c6f379552c13ba7df56de567f 100644 --- a/js-test/build.gradle +++ b/js-test/build.gradle @@ -8,7 +8,6 @@ evaluationDependsOn(':openbis') evaluationDependsOn(':datastore_server') evaluationDependsOn(':ui-test') evaluationDependsOn(':screening') -evaluationDependsOn(':rtd_phosphonetx') apply from: '../gradle/javaproject.gradle' @@ -43,13 +42,11 @@ dependencies { testCompile project(path: ':ui-test', configuration: 'tests') - testRuntime project(':screening'), project(':rtd_phosphonetx') - testRuntimeFirst 'javax:servlet-api:3.1.0', 'reflections:reflections:0.9.10', 'apache:commons-lang3:3.7' testRuntimeSecond 'google:gwt-user:2.4' - externalDss project(':screening'), project(':rtd_phosphonetx') + externalDss project(':screening') } sourceSets.test.runtimeClasspath = configurations.testRuntimeFirst + configurations.testRuntimeSecond + sourceSets.test.runtimeClasspath @@ -62,7 +59,7 @@ task copyWar(type: Copy, dependsOn: project(':openbis_standard_technologies').wa test { useTestNG() - options.suites('source/java/tests.xml') + options.suites('source/java/tests-dev.xml') jvmArgs '-Xmx2048m', '-XX:MaxPermSize=256m', '-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StrErrLog', '-Duser.timezone=Europe/Zurich', '-Xdebug', '-Xrunjdwp:transport=dt_socket,address=20010,server=y,suspend=n' diff --git a/js-test/settings.gradle b/js-test/settings.gradle index 45ce33136841ca5eae5b4c592b1ddc7c3ead612a..d6c54fa1f7181bca897f37a58740b5a3de3b6124 100644 --- a/js-test/settings.gradle +++ b/js-test/settings.gradle @@ -1,3 +1,3 @@ includeFlat 'commonbase', 'common', 'openbis_api', 'openbis-common', 'authentication', 'dbmigration', 'openbis', - 'datastore_server', 'screening', 'rtd_yeastx', 'rtd_phosphonetx', 'deep_sequencing_unit', 'plasmid', 'openbis_standard_technologies', - 'ui-test','screening', 'rtd_phosphonetx' + 'datastore_server', 'screening', 'rtd_yeastx', 'deep_sequencing_unit', 'plasmid', 'openbis_standard_technologies', + 'ui-test','screening' diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/dao/PostgresSearchDAO.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/dao/PostgresSearchDAO.java index 246e5ed5fde339c7d96fae206c3ece32258329d2..347721411530e106da8a1719bd9e7a38b76308b2 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/dao/PostgresSearchDAO.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/dao/PostgresSearchDAO.java @@ -89,26 +89,35 @@ public class PostgresSearchDAO implements ISQLSearchDAO private void assertPropertyTypesConsistent(final TranslationContext translationContext) { - final String pt = "pt"; - final String dt = "dt"; - final String propertyTypeAlias = "propertytype"; - final String dataTypeAlias = "datatype"; - final String sql = SELECT + SP + pt + PERIOD + CODE_COLUMN + SP + propertyTypeAlias + COMMA - + SP + dt + PERIOD + CODE_COLUMN + SP + dataTypeAlias + NL - + FROM + SP + PROPERTY_TYPES_TABLE + SP + pt + NL - + INNER_JOIN + SP + DATA_TYPES_TABLE + SP + dt + SP - + ON + SP + pt + PERIOD + DATA_TYPE_COLUMN + SP + EQ + SP + dt + PERIOD + ID_COLUMN; - - final List<Map<String, Object>> queryResultList = sqlExecutor.execute(sql, Collections.emptyList()); - final Map<String, String> dataTypesOfPropertyTypes = queryResultList.stream().collect(Collectors.toMap( - (valueByColumnName) -> (String) valueByColumnName.get(propertyTypeAlias), - (valueByColumnName) -> (String) valueByColumnName.get(dataTypeAlias))); + final Map<String, String> dataTypeByPropertyCode; + + if(translationContext.getDataTypeByPropertyCode() == null) { + final String pt = "pt"; + final String dt = "dt"; + final String propertyTypeAlias = "propertytype"; + final String dataTypeAlias = "datatype"; + final String isManagedInternallyAlias = "ismanagedinternally"; + final String sql = SELECT + SP + pt + PERIOD + CODE_COLUMN + SP + propertyTypeAlias + COMMA + + SP + pt + PERIOD + IS_MANAGED_INTERNALLY + SP + isManagedInternallyAlias + COMMA + + SP + dt + PERIOD + CODE_COLUMN + SP + dataTypeAlias + NL + + FROM + SP + PROPERTY_TYPES_TABLE + SP + pt + NL + + INNER_JOIN + SP + DATA_TYPES_TABLE + SP + dt + SP + + ON + SP + pt + PERIOD + DATA_TYPE_COLUMN + SP + EQ + SP + dt + PERIOD + ID_COLUMN; + + final List<Map<String, Object>> queryResultList = sqlExecutor.execute(sql, Collections.emptyList()); + dataTypeByPropertyCode = queryResultList.stream().collect(Collectors.toMap( + (valueByColumnName) -> ((((Boolean) valueByColumnName.get(isManagedInternallyAlias)) ? "$" : "") + ((String) valueByColumnName.get(propertyTypeAlias))), + (valueByColumnName) -> (String) valueByColumnName.get(dataTypeAlias))); + translationContext.setDataTypeByPropertyCode(dataTypeByPropertyCode); + } else { + dataTypeByPropertyCode = translationContext.getDataTypeByPropertyCode(); + } translationContext.getCriteria().forEach(criterion -> { if (criterion instanceof NumberPropertySearchCriteria) { - final String dataType = dataTypesOfPropertyTypes.get(((NumberPropertySearchCriteria) criterion) + final String dataType = dataTypeByPropertyCode.get(((NumberPropertySearchCriteria) criterion) .getFieldName()); if (!dataType.equals(DataTypeCode.INTEGER.toString()) && !dataType.equals(DataTypeCode.REAL.toString())) @@ -117,7 +126,7 @@ public class PostgresSearchDAO implements ISQLSearchDAO } } else if (criterion instanceof DatePropertySearchCriteria) { - final String dataType = dataTypesOfPropertyTypes.get(((DatePropertySearchCriteria) criterion) + final String dataType = dataTypeByPropertyCode.get(((DatePropertySearchCriteria) criterion) .getFieldName()); if (!dataType.equals(DataTypeCode.TIMESTAMP.toString()) && !dataType.equals(DataTypeCode.DATE.toString())) diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/planner/AbstractCompositeEntitySearchManager.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/planner/AbstractCompositeEntitySearchManager.java index 2420b060c763143c689986b371516e807c786505..733f5d39cd5bfa77fed15aff81aa9a3061a02e2d 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/planner/AbstractCompositeEntitySearchManager.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/planner/AbstractCompositeEntitySearchManager.java @@ -75,10 +75,16 @@ public abstract class AbstractCompositeEntitySearchManager<CRITERIA extends Abst authorisationInformation); } - protected Set<Long> doSearchForIDs(final Long userId, final Collection<ISearchCriteria> parentsCriteria, - final Collection<ISearchCriteria> childrenCriteria, final Collection<ISearchCriteria> mainCriteria, - final SearchOperator finalSearchOperator, final String idsColumnName, final TableMapper tableMapper, final AuthorisationInformation authorisationInformation) + protected Set<Long> doSearchForIDs(final Long userId, + final Collection<ISearchCriteria> upstreamRelationshipsCriteria, + final Collection<ISearchCriteria> downstreamRelationshipsCriteria, + final Collection<ISearchCriteria> mainCriteria, + final SearchOperator finalSearchOperator, final String idsColumnName, final TableMapper tableMapper, + final AuthorisationInformation authorisationInformation) { + // upstreamRelationshipsCriteria & downstreamRelationshipsCriteria are relationships from the relationships + // table, for datasets it is both the parent-child relationships and containers but for samples it is only the + // parent-child ones. final Set<Long> mainCriteriaIntermediateResults; if (!mainCriteria.isEmpty()) { @@ -92,45 +98,61 @@ public abstract class AbstractCompositeEntitySearchManager<CRITERIA extends Abst } final Set<Long> parentCriteriaIntermediateResults; - if (!parentsCriteria.isEmpty()) + final Set<Long> containerCriteriaIntermediateResults; + if (!upstreamRelationshipsCriteria.isEmpty()) { - parentCriteriaIntermediateResults = Arrays.stream(IGetRelationshipIdExecutor.RelationshipType.values()) - .flatMap(relationshipType -> - { - final Collection<ISearchCriteria> filteredParentsCriteria = - getCriteriaByRelationshipType(parentsCriteria, relationshipType); - - // The parents criteria can be or not recursive, they are resolved by a recursive call - final Set<Long> finalParentIds = findFinalRelationshipIds(userId, authorisationInformation, - finalSearchOperator, filteredParentsCriteria, tableMapper); - final Set<Long> finalParentIdsFiltered = filterIDsByUserRights(userId, authorisationInformation, - finalParentIds); - return getChildrenIdsOf(finalParentIdsFiltered, tableMapper, - relationshipType).stream(); - - }).collect(Collectors.toSet()); + final Collection<ISearchCriteria> filteredParentsCriteria = + getCriteriaByRelationshipType(upstreamRelationshipsCriteria, + IGetRelationshipIdExecutor.RelationshipType.PARENT_CHILD); + + if (!filteredParentsCriteria.isEmpty()) + { + final Set<Long> finalParentIds = findFinalRelationshipIds(userId, authorisationInformation, + finalSearchOperator, filteredParentsCriteria, tableMapper); + final Set<Long> finalParentIdsFiltered = filterIDsByUserRights(userId, authorisationInformation, + finalParentIds); + parentCriteriaIntermediateResults = getChildrenIdsOf(finalParentIdsFiltered, tableMapper, + IGetRelationshipIdExecutor.RelationshipType.PARENT_CHILD); + } else + { + parentCriteriaIntermediateResults = null; + } + + final Collection<ISearchCriteria> filteredContainersCriteria = + getCriteriaByRelationshipType(upstreamRelationshipsCriteria, + IGetRelationshipIdExecutor.RelationshipType.CONTAINER_COMPONENT); + + if (!filteredContainersCriteria.isEmpty()) + { + final Set<Long> finalContainerIds = findFinalRelationshipIds(userId, authorisationInformation, + finalSearchOperator, filteredContainersCriteria, tableMapper); + final Set<Long> finalContainerIdsFiltered = filterIDsByUserRights(userId, authorisationInformation, + finalContainerIds); + containerCriteriaIntermediateResults = getChildrenIdsOf(finalContainerIdsFiltered, tableMapper, + IGetRelationshipIdExecutor.RelationshipType.CONTAINER_COMPONENT); + } else + { + containerCriteriaIntermediateResults = null; + } } else { parentCriteriaIntermediateResults = null; + containerCriteriaIntermediateResults = null; } final Set<Long> childrenCriteriaIntermediateResults; - if (!childrenCriteria.isEmpty()) + if (!downstreamRelationshipsCriteria.isEmpty()) { - childrenCriteriaIntermediateResults = Arrays.stream(IGetRelationshipIdExecutor.RelationshipType.values()) - .flatMap(relationshipType -> - { - final Collection<ISearchCriteria> filteredChildrenCriteria = - getCriteriaByRelationshipType(childrenCriteria, relationshipType); - - // The children criteria can be or not recursive, they are resolved by a recursive call - final Set<Long> finalChildrenIds = findFinalRelationshipIds(userId, authorisationInformation, - finalSearchOperator, filteredChildrenCriteria, tableMapper); - final Set<Long> finalChildrenIdsFiltered = filterIDsByUserRights(userId, - authorisationInformation, finalChildrenIds); - return getParentsIdsOf(finalChildrenIdsFiltered, tableMapper, - relationshipType).stream(); - }).collect(Collectors.toSet()); + final Collection<ISearchCriteria> filteredChildrenCriteria = + getCriteriaByRelationshipType(downstreamRelationshipsCriteria, + IGetRelationshipIdExecutor.RelationshipType.PARENT_CHILD); + + final Set<Long> finalChildrenIds = findFinalRelationshipIds(userId, authorisationInformation, + finalSearchOperator, filteredChildrenCriteria, tableMapper); + final Set<Long> finalChildrenIdsFiltered = filterIDsByUserRights(userId, + authorisationInformation, finalChildrenIds); + childrenCriteriaIntermediateResults = getParentsIdsOf(finalChildrenIdsFiltered, tableMapper, + IGetRelationshipIdExecutor.RelationshipType.PARENT_CHILD); } else { childrenCriteriaIntermediateResults = null; @@ -138,15 +160,21 @@ public abstract class AbstractCompositeEntitySearchManager<CRITERIA extends Abst // Reaching this point we have the intermediate results of all recursive queries final Set<Long> results; - if (containsValues(mainCriteriaIntermediateResults) || containsValues(parentCriteriaIntermediateResults) || - containsValues(childrenCriteriaIntermediateResults)) + if (containsValues(mainCriteriaIntermediateResults) || containsValues(parentCriteriaIntermediateResults) + || containsValues(containerCriteriaIntermediateResults) + || containsValues(childrenCriteriaIntermediateResults)) { // If we have results, we merge them results = mergeResults(finalSearchOperator, - mainCriteriaIntermediateResults != null ? Collections.singleton(mainCriteriaIntermediateResults) : Collections.emptySet(), - childrenCriteriaIntermediateResults != null ? Collections.singleton(childrenCriteriaIntermediateResults) : Collections.emptySet(), - parentCriteriaIntermediateResults != null ? Collections.singleton(parentCriteriaIntermediateResults) : Collections.emptySet()); - } else if (mainCriteria.isEmpty() && parentsCriteria.isEmpty() && childrenCriteria.isEmpty()) + mainCriteriaIntermediateResults != null + ? Collections.singleton(mainCriteriaIntermediateResults) : Collections.emptySet(), + childrenCriteriaIntermediateResults != null + ? Collections.singleton(childrenCriteriaIntermediateResults) : Collections.emptySet(), + parentCriteriaIntermediateResults != null + ? Collections.singleton(parentCriteriaIntermediateResults) : Collections.emptySet(), + containerCriteriaIntermediateResults != null + ? Collections.singleton(containerCriteriaIntermediateResults) : Collections.emptySet()); + } else if (mainCriteria.isEmpty() && upstreamRelationshipsCriteria.isEmpty() && downstreamRelationshipsCriteria.isEmpty()) { // If we don't have results and criteria are empty, return all. results = getAllIds(userId, authorisationInformation, idsColumnName, tableMapper); diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/planner/SampleContainerSearchManager.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/planner/SampleContainerSearchManager.java index f67306d7bd083536360b87154a89d5889947c92b..d36607c74882456fb965124392233951b2860edd 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/planner/SampleContainerSearchManager.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/planner/SampleContainerSearchManager.java @@ -37,26 +37,22 @@ import java.util.Set; * * @author Viktor Kovtun */ -public class SampleContainerSearchManager extends AbstractCompositeEntitySearchManager<SampleContainerSearchCriteria, Sample, Long> +public class SampleContainerSearchManager extends AbstractLocalSearchManager<SampleContainerSearchCriteria, Sample, + Long> { - public SampleContainerSearchManager(final ISQLSearchDAO searchDAO, final ISQLAuthorisationInformationProviderDAO authProvider, + public SampleContainerSearchManager(final ISQLSearchDAO searchDAO, + final ISQLAuthorisationInformationProviderDAO authProvider, final IID2PEMapper<Long, Long> idsMapper) { super(searchDAO, authProvider, idsMapper); } - @Override - protected Class<? extends AbstractCompositeSearchCriteria> getParentsSearchCriteriaClass() - { - return SampleParentsSearchCriteria.class; - } - public Set<Long> searchForIDs(final Long userId, final AuthorisationInformation authorisationInformation, final SampleContainerSearchCriteria criteria, final AbstractCompositeSearchCriteria parentCriteria, final String idsColumnName) { - return doSearchForIDs(userId, authorisationInformation, criteria, null, idsColumnName, TableMapper.SAMPLE); + return super.searchForIDs(userId, authorisationInformation, criteria, idsColumnName, TableMapper.SAMPLE); } @Override @@ -64,30 +60,10 @@ public class SampleContainerSearchManager extends AbstractCompositeEntitySearchM return doSortIDs(ids, sortOptions, TableMapper.SAMPLE); } - @Override - protected Class<? extends AbstractCompositeSearchCriteria> getChildrenSearchCriteriaClass() - { - return SampleChildrenSearchCriteria.class; - } - - @Override - protected SampleContainerSearchCriteria createEmptyCriteria() - { - throw new UnsupportedOperationException("This method is not supposed to be called."); - } - @Override protected Set<Long> doFilterIDsByUserRights(final Set<Long> ids, final AuthorisationInformation authorisationInformation) { return getAuthProvider().getAuthorisedSamples(ids, authorisationInformation); } - @Override - protected Set<Long> getAllIds(final Long userId, final AuthorisationInformation authorisationInformation, final String idsColumnName, - final TableMapper tableMapper) - { - return getSearchDAO().queryDBWithNonRecursiveCriteria(userId, new DummyCompositeSearchCriterion(), tableMapper, - idsColumnName, authorisationInformation); - } - } diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/translator/TranslationContext.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/translator/TranslationContext.java index cfe04038ed14a68c20ab28396e505b6ff9f879e7..8dbc969383b5f96f5c3c1090b1a8ca0e3920b4ca 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/translator/TranslationContext.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/translator/TranslationContext.java @@ -50,6 +50,8 @@ public class TranslationContext private Map<String, String> dataTypeByPropertyName; + private Map<String, String> dataTypeByPropertyCode; + private Collection<Long> ids; private SortOptions<?> sortOptions; @@ -143,6 +145,14 @@ public class TranslationContext this.dataTypeByPropertyName = dataTypeByPropertyName; } + public Map<String, String> getDataTypeByPropertyCode() { + return dataTypeByPropertyCode; + } + + public void setDataTypeByPropertyCode(Map<String, String> dataTypeByPropertyCode) { + this.dataTypeByPropertyCode = dataTypeByPropertyCode; + } + public Collection<Long> getIds() { return ids; diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/translator/condition/StringFieldSearchConditionTranslator.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/translator/condition/StringFieldSearchConditionTranslator.java index c41908272975f98b1a80140460df502fdad83f0f..df26d912233e74d262e8619c68207a7e29032469 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/translator/condition/StringFieldSearchConditionTranslator.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/translator/condition/StringFieldSearchConditionTranslator.java @@ -33,8 +33,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataTypeCode; import static ch.ethz.sis.openbis.generic.server.asapi.v3.search.PSQLTypes.VARCHAR; import static ch.ethz.sis.openbis.generic.server.asapi.v3.search.translator.SQLLexemes.*; import static ch.systemsx.cisd.openbis.generic.shared.dto.ColumnNames.*; -import static ch.systemsx.cisd.openbis.generic.shared.dto.TableNames.CONTROLLED_VOCABULARY_TERM_TABLE; -import static ch.systemsx.cisd.openbis.generic.shared.dto.TableNames.MATERIALS_TABLE; +import static ch.systemsx.cisd.openbis.generic.shared.dto.TableNames.*; public class StringFieldSearchConditionTranslator implements IConditionTranslator<StringFieldSearchCriteria> { @@ -164,7 +163,42 @@ public class StringFieldSearchConditionTranslator implements IConditionTranslato if (value.getClass() != AnyStringValue.class) { - sqlBuilder.append(SP).append(THEN).append(SP); + sqlBuilder.append(SP).append(THEN).append(NL); + + sqlBuilder.append(CASE).append(NL).append(WHEN).append(SP) + .append(aliases.get(DATA_TYPES_TABLE).getSubTableAlias()).append(PERIOD).append(CODE_COLUMN) + .append(SP).append(EQ).append(SP).append(SQ).append(DataTypeCode.CONTROLLEDVOCABULARY) + .append(SQ).append(SP).append(THEN).append(SP); + TranslatorUtils.translateStringComparison( + aliases.get(CONTROLLED_VOCABULARY_TERM_TABLE).getSubTableAlias(), + CODE_COLUMN, value, null, sqlBuilder, args); + + final String materialsTableAlias = aliases.get(MATERIALS_TABLE).getSubTableAlias(); + sqlBuilder.append(NL).append(WHEN).append(SP).append(materialsTableAlias).append(PERIOD) + .append(CODE_COLUMN).append(SP).append(IS_NOT_NULL).append(SP).append(THEN).append(SP); + TranslatorUtils.translateStringComparison(materialsTableAlias, CODE_COLUMN, value, null, sqlBuilder, + args); + + final JoinInformation samplesPropertyTable = aliases.get(SAMPLE_PROP_COLUMN); + if (samplesPropertyTable != null) + { + sqlBuilder.append(NL).append(WHEN).append(SP).append(samplesPropertyTable.getSubTableAlias()) + .append(PERIOD).append(CODE_COLUMN).append(SP).append(IS_NOT_NULL).append(SP) + .append(THEN).append(SP); + + TranslatorUtils.translateStringComparison(samplesPropertyTable.getSubTableAlias(), + CODE_COLUMN, value, null, sqlBuilder, args); + + sqlBuilder.append(SP).append(OR).append(SP); + TranslatorUtils.translateStringComparison(samplesPropertyTable.getSubTableAlias(), + PERM_ID_COLUMN, value, null, sqlBuilder, args); + + sqlBuilder.append(SP).append(OR).append(SP); + TranslatorUtils.translateStringComparison(samplesPropertyTable.getSubTableAlias(), + SAMPLE_IDENTIFIER_COLUMN, value, null, sqlBuilder, args); + } + + sqlBuilder.append(NL).append(ELSE).append(SP); if (casting != null) { @@ -173,7 +207,8 @@ public class StringFieldSearchConditionTranslator implements IConditionTranslato { sqlBuilder.append(LOWER).append(LP); } - sqlBuilder.append(aliases.get(tableMapper.getValuesTable()).getSubTableAlias()).append(PERIOD).append(VALUE_COLUMN); + sqlBuilder.append(aliases.get(tableMapper.getValuesTable()).getSubTableAlias()).append(PERIOD) + .append(VALUE_COLUMN); if (equalsToComparison) { sqlBuilder.append(RP); @@ -188,31 +223,9 @@ public class StringFieldSearchConditionTranslator implements IConditionTranslato TranslatorUtils.translateStringComparison(aliases.get(tableMapper.getValuesTable()).getSubTableAlias(), VALUE_COLUMN, value, null, sqlBuilder, args); } - sqlBuilder.append(SP).append(OR).append(SP); - TranslatorUtils.translateStringComparison(aliases.get(CONTROLLED_VOCABULARY_TERM_TABLE).getSubTableAlias(), - CODE_COLUMN, value, null, sqlBuilder, args); - - sqlBuilder.append(SP).append(OR).append(SP); - TranslatorUtils.translateStringComparison(aliases.get(MATERIALS_TABLE).getSubTableAlias(), - CODE_COLUMN, value, null, sqlBuilder, args); - - final JoinInformation samplesPropertyTable = aliases.get(SAMPLE_PROP_COLUMN); - if (samplesPropertyTable != null) - { - sqlBuilder.append(SP).append(OR).append(SP); - TranslatorUtils.translateStringComparison(samplesPropertyTable.getSubTableAlias(), - CODE_COLUMN, value, null, sqlBuilder, args); - - sqlBuilder.append(SP).append(OR).append(SP); - TranslatorUtils.translateStringComparison(samplesPropertyTable.getSubTableAlias(), - PERM_ID_COLUMN, value, null, sqlBuilder, args); - - sqlBuilder.append(SP).append(OR).append(SP); - TranslatorUtils.translateStringComparison(samplesPropertyTable.getSubTableAlias(), - SAMPLE_IDENTIFIER_COLUMN, value, null, sqlBuilder, args); - } - sqlBuilder.append(SP).append(END); + sqlBuilder.append(NL).append(END); + sqlBuilder.append(NL).append(END); } sqlBuilder.append(RP); break; diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/translator/condition/utils/TranslatorUtils.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/translator/condition/utils/TranslatorUtils.java index 2516bf7d43877aac1ecda87cceed0f9c1b019b68..6d9882120f7028ff55cf2cd2653200e25863655c 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/translator/condition/utils/TranslatorUtils.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/search/translator/condition/utils/TranslatorUtils.java @@ -64,16 +64,7 @@ public class TranslatorUtils final AbstractStringValue value, final PSQLTypes casting, final StringBuilder sqlBuilder, final List<Object> args) { - final boolean equalsToComparison = (value.getClass() == StringEqualToValue.class); - if (equalsToComparison) - { - sqlBuilder.append(LOWER).append(LP); - } - sqlBuilder.append(tableAlias).append(PERIOD).append(columnName); - if (equalsToComparison) - { - sqlBuilder.append(RP); - } + sqlBuilder.append(LOWER).append(LP).append(tableAlias).append(PERIOD).append(columnName).append(RP); if (casting != null) { sqlBuilder.append(DOUBLE_COLON).append(casting); @@ -83,13 +74,14 @@ public class TranslatorUtils appendStringComparatorOp(value.getClass(), strippedValue, sqlBuilder, args); } - public static void appendStringComparatorOp(final AbstractStringValue value, final StringBuilder sqlBuilder, final List<Object> args) + public static void appendStringComparatorOp(final AbstractStringValue value, final StringBuilder sqlBuilder, + final List<Object> args) { appendStringComparatorOp(value.getClass(), value.getValue(), sqlBuilder, args); } - public static void appendStringComparatorOp(final Class<?> valueClass, final String finalValue, final StringBuilder sqlBuilder, - final List<Object> args) + public static void appendStringComparatorOp(final Class<?> valueClass, final String finalValue, + final StringBuilder sqlBuilder, final List<Object> args) { sqlBuilder.append(SP); if (valueClass == StringEqualToValue.class) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractPluginViewContext.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractPluginViewContext.java index 4e14b31f051f7b3a1b9bc46388e1fce1510fb972..fb3f037b0ba5538a50a51156cfc40f5d11f50efe 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractPluginViewContext.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractPluginViewContext.java @@ -29,6 +29,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.plugin.ICl import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.log.IProfilingTable; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ApplicationInfo; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.WebClientConfiguration; /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/Client.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/Client.java index 8cb2ba454cbae71b8a16ae8eafb4590ffd60ca23..11d5419cea1dd275d3beb55c5fed439a22d813e7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/Client.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/Client.java @@ -64,6 +64,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUt import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.WindowUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ApplicationInfo; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SessionContext; import ch.systemsx.cisd.openbis.generic.shared.basic.BasicConstant; import ch.systemsx.cisd.openbis.generic.shared.basic.ViewMode; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/MatchingEntitiesPanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/MatchingEntitiesPanel.java index ccada2916863264b0b529721edcb30635667e631..b0825422e85a40a587a5190bd2c6cfa1da4da6c9 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/MatchingEntitiesPanel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/MatchingEntitiesPanel.java @@ -55,11 +55,11 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget. import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.MultilineHTML; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.MatchingEntitiesPanelColumnIDs; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SearchableEntity; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; -import ch.systemsx.cisd.openbis.generic.client.web.server.resultset.MatchingEntitiesProvider; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithPermId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.BasicEntityType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; @@ -216,8 +216,8 @@ public final class MatchingEntitiesPanel extends TypedTableGrid<MatchingEntity> { html += code + ": "; } - html += match.getValue().replace(MatchingEntitiesProvider.START_HIGHLIGHT, "<span style=\"background-color:#cce9fc\">") - .replace(MatchingEntitiesProvider.END_HIGHLIGHT, "</span>") + html += match.getValue().replace(MatchingEntitiesPanelColumnIDs.START_HIGHLIGHT, "<span style=\"background-color:#cce9fc\">") + .replace(MatchingEntitiesPanelColumnIDs.END_HIGHLIGHT, "</span>") + "\n"; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ProjectPropertiesPanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ProjectPropertiesPanel.java index 4910a20d7b2492dc1a44aa743bfa292309de323e..a4e2bd259cd6b3959655e237df6f863b60159648 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ProjectPropertiesPanel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ProjectPropertiesPanel.java @@ -41,6 +41,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.Propert import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.property.PropertyGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.MultilineHTML; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Person; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Project; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ProjectViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ProjectViewer.java index 7182a392a7fae2d12710b57af44195e3b7dfcce1..1de57d624dba6d26591045daf4390e3ff4a57035 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ProjectViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ProjectViewer.java @@ -32,6 +32,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.BorderL import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.project.ProjectGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.project.ProjectListDeletionConfirmationDialog; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SearchWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SearchWidget.java index 1ad57b47f5d3b00df359ddd94046f688689ffd2d..46458d17e9e888c42b970ba48930635504b31660 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SearchWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/SearchWidget.java @@ -31,13 +31,14 @@ import ch.systemsx.cisd.common.shared.basic.string.StringUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AppEvents; import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.GlobalSearchLocatorResolver; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.ViewLocator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.SearchableEntityModel; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.EnterKeyListener; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.ButtonWithLoadingMask; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SearchableEntity; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Type; +import ch.systemsx.cisd.openbis.generic.shared.basic.BasicConstant; import ch.systemsx.cisd.openbis.generic.shared.basic.URLMethodWithParameters; /** @@ -225,7 +226,7 @@ public final class SearchWidget extends LayoutContainer { // forward to a new url URLMethodWithParameters url = new URLMethodWithParameters(""); - url.addParameter(ViewLocator.ACTION_PARAMETER, + url.addParameter(BasicConstant.LOCATOR_ACTION_PARAMETER, GlobalSearchLocatorResolver.GLOBAL_SEARCH_ACTION); if (searchableEntity != null) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/TabContent.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/TabContent.java index 53a92c44c141f50e1cd70df52e90ee8b5fb1c982..8a3cbd2fa05130779c3165473b1731e059fe361b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/TabContent.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/TabContent.java @@ -22,6 +22,7 @@ import com.extjs.gxt.ui.client.widget.layout.FitLayout; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.IDisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.SectionsPanel; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder; /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/UrlParamsHelper.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/UrlParamsHelper.java index 01dc2c517f9ea67b6d9ee2cad62c9625287d420d..e554cd1611445d42e82c2f7fc51635cb4ca7d72e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/UrlParamsHelper.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/UrlParamsHelper.java @@ -21,6 +21,7 @@ import com.google.gwt.user.client.History; import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.OpenViewAction; import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.ViewLocator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.ViewLocatorResolverRegistry; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.URLMethodWithParameters; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.BatchOperationKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DummyComponent.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DummyComponent.java index 2e1db819fa60e45bd547e3b1d43ff2e441acaf95..b6172cb885cd8752efb4c5e631dbac919040cc13 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DummyComponent.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/DummyComponent.java @@ -19,7 +19,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.framework import com.extjs.gxt.ui.client.widget.LayoutContainer; import com.extjs.gxt.ui.client.widget.layout.CenterLayout; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; /** * Component of the gui displayed when some functionality has not been implemented yet. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/MainPagePanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/MainPagePanel.java index e9302e20fb7ef0e1097a2ce3eed01444eb8b02ba..b397a47fff3464a34f2730fef93f31de7d405c53 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/MainPagePanel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/MainPagePanel.java @@ -24,10 +24,10 @@ import com.google.gwt.user.client.ui.Widget; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.UrlParamsHelper; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; /** * Main panel - where the pages will open. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/MainTabPanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/MainTabPanel.java index ada52d5db9ac1cad845e0da642a34dca84ffe5aa..d69f4e255ccb6a9e5782df321bf77c9aecc5a870 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/MainTabPanel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/framework/MainTabPanel.java @@ -39,13 +39,13 @@ import com.google.gwt.user.client.ui.Widget; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.help.HelpPageIdentifier; import ch.systemsx.cisd.openbis.generic.client.web.client.application.renderer.LinkRenderer; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.ConfirmationDialog; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.WindowUtils; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.URLMethodWithParameters; /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/AbstractViewLocatorResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/AbstractViewLocatorResolver.java index 62e9fb24026d491d8032ee03358a90aa55e851e6..d4a97c001f517561cc9a1c575a76959ed9ae14e6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/AbstractViewLocatorResolver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/AbstractViewLocatorResolver.java @@ -3,6 +3,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.locator; import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; +import ch.systemsx.cisd.openbis.generic.shared.basic.PermlinkUtilities; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; /** @@ -102,7 +103,7 @@ public abstract class AbstractViewLocatorResolver implements IViewLocatorResolve protected static final EntityKind getEntityKind(ViewLocator locator) { String entityKindValueOrNull = locator.tryGetEntity(); - checkRequiredParameter(entityKindValueOrNull, ViewLocator.ENTITY_PARAMETER); + checkRequiredParameter(entityKindValueOrNull, PermlinkUtilities.ENTITY_KIND_PARAMETER_KEY); return getEntityKind(entityKindValueOrNull); } @@ -113,7 +114,7 @@ public abstract class AbstractViewLocatorResolver implements IViewLocatorResolve return EntityKind.valueOf(entityKindValueOrNull); } catch (IllegalArgumentException exception) { - throw new UserFailureException("Invalid '" + ViewLocator.ENTITY_PARAMETER + throw new UserFailureException("Invalid '" + PermlinkUtilities.ENTITY_KIND_PARAMETER_KEY + "' URL parameter value."); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/AttachmentDownloadLocatorResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/AttachmentDownloadLocatorResolver.java index fc58c882b36e1fd2cfad99ac844d66c3215d643b..371242c189ef27b4a6d21680ad52e4202a86bf0e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/AttachmentDownloadLocatorResolver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/AttachmentDownloadLocatorResolver.java @@ -34,7 +34,7 @@ public class AttachmentDownloadLocatorResolver extends AbstractViewLocatorResolv public void resolve(ViewLocator locator) throws UserFailureException { String entityKindValueOrNull = locator.tryGetEntity(); - checkRequiredParameter(entityKindValueOrNull, ViewLocator.ENTITY_PARAMETER); + checkRequiredParameter(entityKindValueOrNull, PermlinkUtilities.ENTITY_KIND_PARAMETER_KEY); AttachmentHolderKind attachmentHolderKind = getAttachmentHolderKind(entityKindValueOrNull); String fileNameOrNull = locator.getParameters().get(PermlinkUtilities.FILE_NAME_KEY); @@ -96,7 +96,7 @@ public class AttachmentDownloadLocatorResolver extends AbstractViewLocatorResolv return AttachmentHolderKind.valueOf(entityKind); } catch (IllegalArgumentException exception) { - throw new UserFailureException("Invalid '" + ViewLocator.ENTITY_PARAMETER + throw new UserFailureException("Invalid '" + PermlinkUtilities.ENTITY_KIND_PARAMETER_KEY + "' URL parameter value."); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/BrowserLocatorResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/BrowserLocatorResolver.java index 8716ba1adbe8855ecc3aee7153f3e40b74097156..7bc56bf08ebacd755782d6cc6938daa6d6fad566 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/BrowserLocatorResolver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/BrowserLocatorResolver.java @@ -6,6 +6,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework. import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DispatcherHelper; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.EntityTypeUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; +import ch.systemsx.cisd.openbis.generic.shared.basic.PermlinkUtilities; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; /** @@ -17,17 +18,9 @@ public class BrowserLocatorResolver extends AbstractViewLocatorResolver { private final IViewContext<ICommonClientServiceAsync> viewContext; - public final static String BROWSE_ACTION = "BROWSE"; - - public final static String TYPE_PARAMETER_KEY = "type"; - - public final static String SPACE_PARAMETER_KEY = "space"; - - public final static String PROJECT_PARAMETER_KEY = "project"; - public BrowserLocatorResolver(IViewContext<ICommonClientServiceAsync> viewContext) { - super(BROWSE_ACTION); + super(PermlinkUtilities.BROWSE_ACTION); this.viewContext = viewContext; } @@ -35,9 +28,9 @@ public class BrowserLocatorResolver extends AbstractViewLocatorResolver public void resolve(ViewLocator locator) throws UserFailureException { EntityKind entityKind = getEntityKind(locator); - final String entityTypeOrNull = locator.getParameters().get(TYPE_PARAMETER_KEY); - final String spaceOrNull = locator.getParameters().get(SPACE_PARAMETER_KEY); - final String projectOrNull = locator.getParameters().get(PROJECT_PARAMETER_KEY); + final String entityTypeOrNull = locator.getParameters().get(PermlinkUtilities.TYPE_PARAMETER_KEY); + final String spaceOrNull = locator.getParameters().get(PermlinkUtilities.SPACE_PARAMETER_KEY); + final String projectOrNull = locator.getParameters().get("project"); switch (entityKind) { case EXPERIMENT: diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/HomeLocatorResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/HomeLocatorResolver.java index 2d03e98742be4fa1385f71933117ade79c573082..a9272bc580aaf225f69925f53113b1a4c3c0bdd8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/HomeLocatorResolver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/HomeLocatorResolver.java @@ -2,7 +2,6 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.locator; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AbstractTabItemFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DefaultTabItem; @@ -11,6 +10,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework. import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.MainPagePanel; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.WelcomePanelHelper; import ch.systemsx.cisd.openbis.generic.client.web.client.application.help.HelpPageIdentifier; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/MaterialLocatorResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/MaterialLocatorResolver.java index d35b980fa050ac56e1dc603433a13ad9c10cbfd9..e970fb30761bdeaf72e5812f7056be1fb4115815 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/MaterialLocatorResolver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/MaterialLocatorResolver.java @@ -7,6 +7,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewConte import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.listener.OpenEntityDetailsTabHelper; import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithPermId; +import ch.systemsx.cisd.openbis.generic.shared.basic.PermlinkUtilities; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialIdentifier; @@ -20,13 +21,9 @@ public class MaterialLocatorResolver extends AbstractViewLocatorResolver { private final IViewContext<ICommonClientServiceAsync> viewContext; - public final static String CODE_PARAMETER_KEY = "code"; - - public final static String TYPE_PARAMETER_KEY = "type"; - public MaterialLocatorResolver(IViewContext<ICommonClientServiceAsync> viewContext) { - super(ViewLocator.PERMLINK_ACTION); + super(PermlinkUtilities.PERMLINK_ACTION); this.viewContext = viewContext; } @@ -64,10 +61,10 @@ public class MaterialLocatorResolver extends AbstractViewLocatorResolver protected MaterialIdentifier extractMaterialIdentifier(ViewLocator locator) { - String codeValueOrNull = locator.getParameters().get(CODE_PARAMETER_KEY); - String materialTypeValueOrNull = locator.getParameters().get(TYPE_PARAMETER_KEY); - checkRequiredParameter(codeValueOrNull, CODE_PARAMETER_KEY); - checkRequiredParameter(materialTypeValueOrNull, TYPE_PARAMETER_KEY); + String codeValueOrNull = locator.getParameters().get(PermlinkUtilities.CODE_PARAMETER_KEY); + String materialTypeValueOrNull = locator.getParameters().get(PermlinkUtilities.TYPE_PARAMETER_KEY); + checkRequiredParameter(codeValueOrNull, PermlinkUtilities.CODE_PARAMETER_KEY); + checkRequiredParameter(materialTypeValueOrNull, PermlinkUtilities.TYPE_PARAMETER_KEY); String decodedMaterialCode = MaterialCodeUtils.decode(codeValueOrNull); return new MaterialIdentifier(decodedMaterialCode, materialTypeValueOrNull); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/MetaprojectBrowserLocatorResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/MetaprojectBrowserLocatorResolver.java index 42fbad7baaa48945c22a6e04332c75d3d643feec..c3ed1a2bc8668c400c4df7a466b09952b07475e2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/MetaprojectBrowserLocatorResolver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/MetaprojectBrowserLocatorResolver.java @@ -5,6 +5,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewConte import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ComponentProvider; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DispatcherHelper; import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; +import ch.systemsx.cisd.openbis.generic.shared.basic.PermlinkUtilities; /** * {@link IViewLocatorResolver} for metaproject browser. @@ -15,13 +16,9 @@ public class MetaprojectBrowserLocatorResolver extends AbstractViewLocatorResolv { private final IViewContext<ICommonClientServiceAsync> viewContext; - public final static String BROWSE_ACTION = "BROWSE"; - - public final static String METAPROJECT = "METAPROJECT"; - public MetaprojectBrowserLocatorResolver(IViewContext<ICommonClientServiceAsync> viewContext) { - super(BROWSE_ACTION); + super(PermlinkUtilities.BROWSE_ACTION); this.viewContext = viewContext; } @@ -29,7 +26,7 @@ public class MetaprojectBrowserLocatorResolver extends AbstractViewLocatorResolv public boolean canHandleLocator(ViewLocator locator) { String entityKindValueOrNull = locator.tryGetEntity(); - return super.canHandleLocator(locator) && METAPROJECT.equals(entityKindValueOrNull); + return super.canHandleLocator(locator) && PermlinkUtilities.METAPROJECT.equals(entityKindValueOrNull); } @Override diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/MetaprojectLocatorResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/MetaprojectLocatorResolver.java index 51e5e6559b432dcdbb92872710d56c94484c4a50..8ab05158eb1263a2291e25aab5ca1347dd1c7cd6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/MetaprojectLocatorResolver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/MetaprojectLocatorResolver.java @@ -7,6 +7,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAs import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.listener.OpenEntityDetailsTabHelper; import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; +import ch.systemsx.cisd.openbis.generic.shared.basic.PermlinkUtilities; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Metaproject; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MetaprojectIdentifier; @@ -19,15 +20,9 @@ public class MetaprojectLocatorResolver extends AbstractViewLocatorResolver { private final IViewContext<ICommonClientServiceAsync> viewContext; - public final static String VIEW_ACTION = ViewLocator.PERMLINK_ACTION; - - public final static String METAPROJECT = "METAPROJECT"; - - public final static String NAME_PARAMETER_KEY = "name"; - public MetaprojectLocatorResolver(IViewContext<ICommonClientServiceAsync> viewContext) { - super(VIEW_ACTION); + super(PermlinkUtilities.PERMLINK_ACTION); this.viewContext = viewContext; } @@ -35,7 +30,7 @@ public class MetaprojectLocatorResolver extends AbstractViewLocatorResolver public boolean canHandleLocator(ViewLocator locator) { String entityKindValueOrNull = locator.tryGetEntity(); - return super.canHandleLocator(locator) && METAPROJECT.equals(entityKindValueOrNull); + return super.canHandleLocator(locator) && PermlinkUtilities.METAPROJECT.equals(entityKindValueOrNull); } @Override @@ -63,7 +58,7 @@ public class MetaprojectLocatorResolver extends AbstractViewLocatorResolver private MetaprojectIdentifier extractMetaprojectIdentifier(ViewLocator locator) { String owner = viewContext.getModel().getLoggedInPerson().getUserId(); - String name = getMandatoryParameter(locator, NAME_PARAMETER_KEY); + String name = getMandatoryParameter(locator, PermlinkUtilities.NAME_PARAMETER_KEY); return new MetaprojectIdentifier(owner, name); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/PermlinkLocatorResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/PermlinkLocatorResolver.java index 392229f7dba8de77c08d801877edb5cecefcd740..22271049cc3c790f28aa5baf051a7e14035a21d6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/PermlinkLocatorResolver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/PermlinkLocatorResolver.java @@ -24,7 +24,7 @@ public class PermlinkLocatorResolver extends AbstractViewLocatorResolver public PermlinkLocatorResolver(IViewContext<ICommonClientServiceAsync> viewContext) { - this(ViewLocator.PERMLINK_ACTION, viewContext); + this(PermlinkUtilities.PERMLINK_ACTION, viewContext); } protected PermlinkLocatorResolver(String action, IViewContext<ICommonClientServiceAsync> viewContext) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/ProjectLocatorResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/ProjectLocatorResolver.java index 5eacddb3dab9ae0d9aa7306a725cead0da703999..d4a03b853002247f149bf692ea71a4cdc3a445ea 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/ProjectLocatorResolver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/ProjectLocatorResolver.java @@ -8,6 +8,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewConte import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.framework.LinkExtractor; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.listener.OpenEntityDetailsTabHelper; import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; +import ch.systemsx.cisd.openbis.generic.shared.basic.PermlinkUtilities; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.BasicProjectIdentifier; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Project; @@ -21,15 +22,9 @@ public class ProjectLocatorResolver extends AbstractViewLocatorResolver { private final IViewContext<ICommonClientServiceAsync> viewContext; - public final static String PROJECT = "PROJECT"; - - public final static String CODE_PARAMETER_KEY = "code"; - - public final static String SPACE_PARAMETER_KEY = "space"; - public ProjectLocatorResolver(IViewContext<ICommonClientServiceAsync> viewContext) { - super(ViewLocator.PERMLINK_ACTION); + super(PermlinkUtilities.PERMLINK_ACTION); this.viewContext = viewContext; } @@ -37,7 +32,7 @@ public class ProjectLocatorResolver extends AbstractViewLocatorResolver public boolean canHandleLocator(ViewLocator locator) { String entityKindValueOrNull = locator.tryGetEntity(); - return super.canHandleLocator(locator) && PROJECT.equals(entityKindValueOrNull); + return super.canHandleLocator(locator) && PermlinkUtilities.PROJECT.equals(entityKindValueOrNull); } @Override @@ -57,17 +52,17 @@ public class ProjectLocatorResolver extends AbstractViewLocatorResolver @Override public void resolve(ViewLocator locator) throws UserFailureException { - assert (PROJECT.equals(locator.tryGetEntity())); + assert (PermlinkUtilities.PROJECT.equals(locator.tryGetEntity())); openInitialProjectViewer(extractProjectIdentifier(locator)); } static BasicProjectIdentifier extractProjectIdentifier(ViewLocator locator) { - String codeValueOrNull = locator.getParameters().get(CODE_PARAMETER_KEY); - String spaceValueOrNull = locator.getParameters().get(SPACE_PARAMETER_KEY); - checkRequiredParameter(codeValueOrNull, CODE_PARAMETER_KEY); - checkRequiredParameter(spaceValueOrNull, SPACE_PARAMETER_KEY); + String codeValueOrNull = locator.getParameters().get(PermlinkUtilities.CODE_PARAMETER_KEY); + String spaceValueOrNull = locator.getParameters().get(PermlinkUtilities.SPACE_PARAMETER_KEY); + checkRequiredParameter(codeValueOrNull, PermlinkUtilities.CODE_PARAMETER_KEY); + checkRequiredParameter(spaceValueOrNull, PermlinkUtilities.SPACE_PARAMETER_KEY); return new BasicProjectIdentifier(spaceValueOrNull, codeValueOrNull); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/SearchLocatorResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/SearchLocatorResolver.java index cc55c956daffa4e3edafe74190e31e9c09cf382e..e3fde5ce220cc8e3517a30a50c65f788a8009e45 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/SearchLocatorResolver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/SearchLocatorResolver.java @@ -23,8 +23,6 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SearchCriteriaConnectio */ public class SearchLocatorResolver extends AbstractViewLocatorResolver { - public static final String SEARCH_ACTION = SearchlinkUtilities.SEARCH_ACTION; - protected static final String DEFAULT_SEARCH_STRING = "*"; private final IViewContext<ICommonClientServiceAsync> viewContext; @@ -42,7 +40,7 @@ public class SearchLocatorResolver extends AbstractViewLocatorResolver public SearchLocatorResolver(IViewContext<ICommonClientServiceAsync> viewContext) { - super(SEARCH_ACTION); + super(SearchlinkUtilities.SEARCH_ACTION); this.viewContext = viewContext; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/ViewLocator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/ViewLocator.java index 5b756bc9368317c01dea9e479730f9541a3de956..163f8d683013c1ddeaf94da644a71a7213f5672e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/ViewLocator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/locator/ViewLocator.java @@ -42,16 +42,6 @@ public class ViewLocator private static final String PARAMETER_SEPARATOR = "&"; - public static final String SESSION_ID_PARAMETER = GenericSharedConstants.SESSION_ID_PARAMETER; - - public static final String ACTION_PARAMETER = BasicConstant.LOCATOR_ACTION_PARAMETER; - - public static final String ENTITY_PARAMETER = PermlinkUtilities.ENTITY_KIND_PARAMETER_KEY; - - public static final String PERM_ID_PARAMETER = PermlinkUtilities.PERM_ID_PARAMETER_KEY; - - public static final String PERMLINK_ACTION = "VIEW"; - private static final String GWT_PARAMETER = "gwt.codesvr"; // Instance Variables @@ -160,21 +150,21 @@ public class ViewLocator if (GWT_PARAMETER.equals(paramName)) { // skip GWT parameters -- only relevant during testing - } else if (SESSION_ID_PARAMETER.equalsIgnoreCase(paramName)) + } else if (GenericSharedConstants.SESSION_ID_PARAMETER.equalsIgnoreCase(paramName)) { sessionIdOrNull = paramValue; - } else if (ACTION_PARAMETER.equalsIgnoreCase(paramName)) + } else if (BasicConstant.LOCATOR_ACTION_PARAMETER.equalsIgnoreCase(paramName)) { actionOrNull = paramValue; - } else if (ENTITY_PARAMETER.equalsIgnoreCase(paramName)) + } else if (PermlinkUtilities.ENTITY_KIND_PARAMETER_KEY.equalsIgnoreCase(paramName)) { entityOrNull = paramValue; - } else if (PERM_ID_PARAMETER.equalsIgnoreCase(paramName)) + } else if (PermlinkUtilities.PERM_ID_PARAMETER_KEY.equalsIgnoreCase(paramName)) { // Permlink URLs have an implied action if (actionOrNull == null) { - actionOrNull = PERMLINK_ACTION; + actionOrNull = PermlinkUtilities.PERMLINK_ACTION; } parameters.put(paramName, paramValue); } else @@ -186,7 +176,7 @@ public class ViewLocator // If the entity is specified, but no action, default the action to Permlink if (entityOrNull != null && actionOrNull == null) { - actionOrNull = PERMLINK_ACTION; + actionOrNull = PermlinkUtilities.PERMLINK_ACTION; } } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/TopMenu.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/TopMenu.java index 32ff768e372f15ea422cb2991b2e816f9817a59a..ae43bb0b4bb5b353bb355e2a5b075d59b2e221e8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/TopMenu.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/menu/TopMenu.java @@ -25,7 +25,6 @@ import com.extjs.gxt.ui.client.widget.toolbar.ToolBar; import com.google.gwt.user.client.Element; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.SearchWidget; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ComponentProvider; @@ -36,6 +35,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.top.I import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.top.NewMenu; import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.user.LoggedUserMenu; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; /** * Implements functionality of the top menu. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AbstractBatchRegistrationForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AbstractBatchRegistrationForm.java index 9bf42f1af465b4089e03c6e5c69aabd87684fc38..cf85ff033bfc6be8171ce40d0b8362577281647f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AbstractBatchRegistrationForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AbstractBatchRegistrationForm.java @@ -26,13 +26,13 @@ import com.google.gwt.user.client.ui.AbstractImagePrototype; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; import ch.systemsx.cisd.openbis.generic.client.web.client.application.FormPanelListener; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.renderer.LinkRenderer; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.file.BasicFileFieldManager; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.FieldUtil; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.HtmlMessageElement; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.WindowUtils; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.BatchRegistrationResult; public abstract class AbstractBatchRegistrationForm extends AbstractRegistrationForm diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AbstractRegistrationForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AbstractRegistrationForm.java index 737ab8a91131026310b698e0e0bf3afe204e8fb8..493913d0cc2e3d86fb052731205cf02919f9756e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AbstractRegistrationForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AbstractRegistrationForm.java @@ -41,7 +41,6 @@ import com.google.gwt.event.dom.client.ClickHandler; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ICallbackListener; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.InfoBoxCallbackListener; @@ -56,6 +55,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget. import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.InfoBox; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.WidgetUtils; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdAndCodeHolder; /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AuthorizationGroupGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AuthorizationGroupGrid.java index 5a00e5d397a6b2a235b992729cce6078ec493125..07354bb26ec8bb0198bb570bae80e5095e97c193 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AuthorizationGroupGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AuthorizationGroupGrid.java @@ -30,7 +30,6 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AbstractTabItemFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DefaultTabItem; @@ -52,6 +51,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget. import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.AuthorizationGroupGridColumnIDs; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/CustomImportComponent.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/CustomImportComponent.java index 7620ae3c7ab7fe1c1ad315a9a9f6ab2600add48e..ab47129b19aa879b0232e3beb4eab03a10bf35d3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/CustomImportComponent.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/CustomImportComponent.java @@ -25,10 +25,10 @@ import com.extjs.gxt.ui.client.widget.toolbar.ToolBar; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.ModelDataPropertyNames; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.CustomImportTypeSelectionWidget.CustomImportModelData; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.CustomImport; /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/GeneralImportComponent.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/GeneralImportComponent.java index 049601d06847f56a1b50646c6bdac18bdca27e94..65abb549703a626e8ee3e19c275ea3d37a69875a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/GeneralImportComponent.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/GeneralImportComponent.java @@ -4,9 +4,9 @@ import com.google.gwt.user.client.ui.Widget; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.TabContent; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleType; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/LoginPanelAutofill.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/LoginPanelAutofill.java index 79ec6bc8edbc57918354bf8103ade6bfc2c62fae..6c2326c9cb354f268ed5d5c144c9090a31988763 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/LoginPanelAutofill.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/LoginPanelAutofill.java @@ -27,9 +27,9 @@ import com.google.gwt.user.client.ui.FormPanel.SubmitHandler; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; /** * This class uses a variant of a trick described in the GWT discussion forum to support autofill. Browsers do not support autofill on input fields diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/LoginWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/LoginWidget.java index e6711a2edc8b7259412f980cffea0ed76d962d15..ebbbb2e4a534be4cdb0641144372b415aa0fd09e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/LoginWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/LoginWidget.java @@ -28,9 +28,9 @@ import com.extjs.gxt.ui.client.widget.form.TextField; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; /** * The login widget. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/PersonGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/PersonGrid.java index 06c8f56fbe4ab7a1f8f0a8bb880c363693f90cbc..eba0fd71e9230cf31da6cd85a977ff5fed583f9e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/PersonGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/PersonGrid.java @@ -28,7 +28,6 @@ import com.extjs.gxt.ui.client.widget.button.Button; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.renderer.PersonRenderer; @@ -39,6 +38,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IB import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.AbstractRegistrationDialog; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ListPersonsCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.PersonGridColumnIDs; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/RoleAssignmentGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/RoleAssignmentGrid.java index c569893bf5ffd0ebb60b3a5f3710ba8db99765ca..778624159908cb9a9b4a6c6295eba2e739b6bb8e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/RoleAssignmentGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/RoleAssignmentGrid.java @@ -27,7 +27,6 @@ import ch.systemsx.cisd.common.shared.basic.string.StringUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.BaseEntityModel; @@ -35,6 +34,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.amc.Add import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.ConfirmationDialog; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.RoleAssignmentGridColumnIDs; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SimpleModeHeader.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SimpleModeHeader.java index 819e043570fbe2c6e910ae3c59d0a67eadfa8532..57ce22495a4cc1409d143f073aeca5780892dee6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SimpleModeHeader.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SimpleModeHeader.java @@ -30,13 +30,13 @@ import com.google.gwt.user.client.History; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.SearchWidget; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ComponentProvider; import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.HomeLocatorResolver; import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.user.action.LoginAction; import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.user.action.LogoutAction; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.BasicConstant; import ch.systemsx.cisd.openbis.generic.shared.basic.URLMethodWithParameters; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SpaceGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SpaceGrid.java index 9b882f894d3c8e50da34eda79aaa69a2ccae4f32..52dac726a7ffa99079798ce53f305c0a1c80c26b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SpaceGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/SpaceGrid.java @@ -29,7 +29,6 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.BaseEntityModel; @@ -44,6 +43,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget. import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.FieldUtil; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SpaceGridColumnIDs; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/TypedTableGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/TypedTableGrid.java index a5f7a4ec336ccfdbf1b107069a74873d68d84c68..34f249ba6752b1803bde8c4b07028eae4a3bcf15 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/TypedTableGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/TypedTableGrid.java @@ -83,7 +83,6 @@ import ch.systemsx.cisd.common.shared.basic.string.StringUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IGenericImageBundle; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ShowRelatedDatasetsDialog; @@ -141,6 +140,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.Windo import ch.systemsx.cisd.openbis.generic.client.web.client.dto.CommonGridColumnIDs; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Constants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GridCustomColumnInfo; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GridFilters; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GridRowModels; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/aggregation/AggregationServiceLocatorResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/aggregation/AggregationServiceLocatorResolver.java index 8f7e5c1299814b51c1b3bbdfec68b42c66767671..121cd07ec7a12974094cfdfa34594642c8eaed5d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/aggregation/AggregationServiceLocatorResolver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/aggregation/AggregationServiceLocatorResolver.java @@ -1,7 +1,6 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.aggregation; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AbstractTabItemFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DefaultTabItem; @@ -12,6 +11,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.help.HelpP import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.AbstractViewLocatorResolver; import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.IViewLocatorResolver; import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.ViewLocator; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/AddPersonToAuthorizationGroupDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/AddPersonToAuthorizationGroupDialog.java index 829a97b69daac100bdde64077907ff2090b0bbf0..3e83810dbd1c1cc3b9a89fe1e39473c280c82b05 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/AddPersonToAuthorizationGroupDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/AddPersonToAuthorizationGroupDialog.java @@ -32,13 +32,13 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.common.shared.basic.string.StringUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.PersonSelectionWidget; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.AbstractRegistrationDialog; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.FieldUtil; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AuthorizationGroup; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/AddPropertyTypeDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/AddPropertyTypeDialog.java index 066458f33ff53501412e9b09505262af03d37148..22677fb8895d7e27bfbca4e9391496393bf3d775 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/AddPropertyTypeDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/AddPropertyTypeDialog.java @@ -37,7 +37,6 @@ import com.google.gwt.user.client.ui.AbstractImagePrototype; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DatabaseModificationAwareField; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.SampleTypeDisplayID; @@ -71,6 +70,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget. import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.FieldUtil; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataTypeCode; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/AddRoleAssignmentDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/AddRoleAssignmentDialog.java index 935654254b0fbf913de94455e83378071bddf0a1..5a562d7113bb97877a3bb1763e99da20e7a91e84 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/AddRoleAssignmentDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/amc/AddRoleAssignmentDialog.java @@ -26,7 +26,6 @@ import com.extjs.gxt.ui.client.widget.form.RadioGroup; import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.help.HelpPageIdentifier; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.AuthorizationGroupSelectionWidget; @@ -38,6 +37,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget. import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.DialogWithOnlineHelpUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Grantee; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Project; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.RoleWithHierarchy; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/attachment/AttachmentBrowser.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/attachment/AttachmentBrowser.java index f395943ffe05e7b86a87459e93b54eed7ba5e0a3..ddd7e22244aef04d7352afc27730bc2bc966c31b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/attachment/AttachmentBrowser.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/attachment/AttachmentBrowser.java @@ -47,7 +47,6 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAs import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; import ch.systemsx.cisd.openbis.generic.client.web.client.application.FormPanelListener; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AbstractTabItemFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DefaultTabItem; @@ -79,6 +78,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMess import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.lang.StringEscapeUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.AttachmentGridColumnIDs; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.GridRowModel; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/attachment/AttachmentDownloadHelper.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/attachment/AttachmentDownloadHelper.java index 16a9779b0c0bdfee74786c16dedded1c1b5e6fcb..e654056e3319600960bc4e1b03d7de3e62b72550 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/attachment/AttachmentDownloadHelper.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/attachment/AttachmentDownloadHelper.java @@ -16,8 +16,8 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.attachment; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.WindowUtils; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.AttachmentDownloadConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.IAttachmentHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.URLMethodWithParameters; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/columns/framework/LinkExtractor.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/columns/framework/LinkExtractor.java index fae4d76938f9f7b46559797fa06a24a653adbae7..fa1b62835c9a625640d14829740c25d303e4e6bf 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/columns/framework/LinkExtractor.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/columns/framework/LinkExtractor.java @@ -16,16 +16,11 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.framework; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.BrowserLocatorResolver; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.MaterialLocatorResolver; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.MetaprojectBrowserLocatorResolver; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.MetaprojectLocatorResolver; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.ProjectLocatorResolver; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.SearchLocatorResolver; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.ViewLocator; +import ch.systemsx.cisd.openbis.generic.shared.basic.BasicConstant; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithPermId; import ch.systemsx.cisd.openbis.generic.shared.basic.PermlinkUtilities; +import ch.systemsx.cisd.openbis.generic.shared.basic.SearchlinkUtilities; import ch.systemsx.cisd.openbis.generic.shared.basic.URLMethodWithParameters; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialIdentifier; @@ -44,15 +39,15 @@ public class LinkExtractor public static final String createSampleBrowserLink(String spaceOrNull, String sampleTypeOrNull) { URLMethodWithParameters url = new URLMethodWithParameters(""); - url.addParameter(ViewLocator.ACTION_PARAMETER, BrowserLocatorResolver.BROWSE_ACTION); - url.addParameter(ViewLocator.ENTITY_PARAMETER, EntityKind.SAMPLE.name()); + url.addParameter(BasicConstant.LOCATOR_ACTION_PARAMETER, PermlinkUtilities.BROWSE_ACTION); + url.addParameter(PermlinkUtilities.ENTITY_KIND_PARAMETER_KEY, EntityKind.SAMPLE.name()); if (spaceOrNull != null) { - url.addParameter(BrowserLocatorResolver.SPACE_PARAMETER_KEY, spaceOrNull); + url.addParameter(PermlinkUtilities.SPACE_PARAMETER_KEY, spaceOrNull); } if (sampleTypeOrNull != null) { - url.addParameter(BrowserLocatorResolver.TYPE_PARAMETER_KEY, sampleTypeOrNull); + url.addParameter(PermlinkUtilities.TYPE_PARAMETER_KEY, sampleTypeOrNull); } return tryPrint(url); } @@ -60,11 +55,11 @@ public class LinkExtractor public static final String createMaterialBrowserLink(String materialTypeOrNull) { URLMethodWithParameters url = new URLMethodWithParameters(""); - url.addParameter(ViewLocator.ACTION_PARAMETER, BrowserLocatorResolver.BROWSE_ACTION); - url.addParameter(ViewLocator.ENTITY_PARAMETER, EntityKind.MATERIAL.name()); + url.addParameter(BasicConstant.LOCATOR_ACTION_PARAMETER, PermlinkUtilities.BROWSE_ACTION); + url.addParameter(PermlinkUtilities.ENTITY_KIND_PARAMETER_KEY, EntityKind.MATERIAL.name()); if (materialTypeOrNull != null) { - url.addParameter(BrowserLocatorResolver.TYPE_PARAMETER_KEY, materialTypeOrNull); + url.addParameter(PermlinkUtilities.TYPE_PARAMETER_KEY, materialTypeOrNull); } return tryPrint(url); } @@ -73,19 +68,19 @@ public class LinkExtractor String projectOrNull, String experimentTypeOrNull) { URLMethodWithParameters url = new URLMethodWithParameters(""); - url.addParameter(ViewLocator.ACTION_PARAMETER, BrowserLocatorResolver.BROWSE_ACTION); - url.addParameter(ViewLocator.ENTITY_PARAMETER, EntityKind.EXPERIMENT.name()); + url.addParameter(BasicConstant.LOCATOR_ACTION_PARAMETER, PermlinkUtilities.BROWSE_ACTION); + url.addParameter(PermlinkUtilities.ENTITY_KIND_PARAMETER_KEY, EntityKind.EXPERIMENT.name()); if (spaceOrNull != null) { - url.addParameter(BrowserLocatorResolver.SPACE_PARAMETER_KEY, spaceOrNull); + url.addParameter(PermlinkUtilities.SPACE_PARAMETER_KEY, spaceOrNull); } if (projectOrNull != null) { - url.addParameter(BrowserLocatorResolver.PROJECT_PARAMETER_KEY, projectOrNull); + url.addParameter("project", projectOrNull); } if (experimentTypeOrNull != null) { - url.addParameter(BrowserLocatorResolver.TYPE_PARAMETER_KEY, experimentTypeOrNull); + url.addParameter(PermlinkUtilities.TYPE_PARAMETER_KEY, experimentTypeOrNull); } return tryPrint(url); } @@ -93,27 +88,27 @@ public class LinkExtractor public static final String createMetaprojectLink(String metaprojectName) { URLMethodWithParameters url = new URLMethodWithParameters(""); - url.addParameter(ViewLocator.ACTION_PARAMETER, MetaprojectLocatorResolver.VIEW_ACTION); - url.addParameter(ViewLocator.ENTITY_PARAMETER, MetaprojectLocatorResolver.METAPROJECT); - url.addParameter(MetaprojectLocatorResolver.NAME_PARAMETER_KEY, metaprojectName); + url.addParameter(BasicConstant.LOCATOR_ACTION_PARAMETER, PermlinkUtilities.PERMLINK_ACTION); + url.addParameter(PermlinkUtilities.ENTITY_KIND_PARAMETER_KEY, PermlinkUtilities.METAPROJECT); + url.addParameter(PermlinkUtilities.NAME_PARAMETER_KEY, metaprojectName); return tryPrint(url); } public static final String createMetaprojectBrowserLink() { URLMethodWithParameters url = new URLMethodWithParameters(""); - url.addParameter(ViewLocator.ACTION_PARAMETER, - MetaprojectBrowserLocatorResolver.BROWSE_ACTION); - url.addParameter(ViewLocator.ENTITY_PARAMETER, - MetaprojectBrowserLocatorResolver.METAPROJECT); + url.addParameter(BasicConstant.LOCATOR_ACTION_PARAMETER, + PermlinkUtilities.BROWSE_ACTION); + url.addParameter(PermlinkUtilities.ENTITY_KIND_PARAMETER_KEY, + PermlinkUtilities.METAPROJECT); return tryPrint(url); } public static final String createSearchLink(EntityKind entityKind) { URLMethodWithParameters url = new URLMethodWithParameters(""); - url.addParameter(ViewLocator.ACTION_PARAMETER, SearchLocatorResolver.SEARCH_ACTION); - url.addParameter(ViewLocator.ENTITY_PARAMETER, entityKind.name()); + url.addParameter(BasicConstant.LOCATOR_ACTION_PARAMETER, SearchlinkUtilities.SEARCH_ACTION); + url.addParameter(PermlinkUtilities.ENTITY_KIND_PARAMETER_KEY, entityKind.name()); return tryPrint(url); } @@ -152,9 +147,9 @@ public class LinkExtractor } URLMethodWithParameters url = new URLMethodWithParameters(""); url.addParameter(PermlinkUtilities.ENTITY_KIND_PARAMETER_KEY, - ProjectLocatorResolver.PROJECT); - url.addParameter(ProjectLocatorResolver.CODE_PARAMETER_KEY, p.getCode()); - url.addParameter(ProjectLocatorResolver.SPACE_PARAMETER_KEY, p.getSpace().getCode()); + PermlinkUtilities.PROJECT); + url.addParameter(PermlinkUtilities.CODE_PARAMETER_KEY, p.getCode()); + url.addParameter(PermlinkUtilities.SPACE_PARAMETER_KEY, p.getSpace().getCode()); return tryPrint(url); } @@ -186,8 +181,8 @@ public class LinkExtractor } URLMethodWithParameters url = new URLMethodWithParameters(""); url.addParameter(PermlinkUtilities.ENTITY_KIND_PARAMETER_KEY, EntityKind.MATERIAL.name()); - url.addParameter(MaterialLocatorResolver.CODE_PARAMETER_KEY, materialCode); - url.addParameter(MaterialLocatorResolver.TYPE_PARAMETER_KEY, materialTypeCode); + url.addParameter(PermlinkUtilities.CODE_PARAMETER_KEY, materialCode); + url.addParameter(PermlinkUtilities.TYPE_PARAMETER_KEY, materialTypeCode); return url; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetBatchUpdatePanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetBatchUpdatePanel.java index 93ac5a2857ab03f4a9eda9e4d1d81079b1920c44..56a87b870014e4e5989ad4a9a534f2515a108ba3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetBatchUpdatePanel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetBatchUpdatePanel.java @@ -26,11 +26,11 @@ import com.google.gwt.user.client.ui.Widget; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DatabaseModificationAwareComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.DataSetTypeModel; import ch.systemsx.cisd.openbis.generic.client.web.client.application.plugin.IClientPlugin; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithPermId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetSearchHitGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetSearchHitGrid.java index b1af5d2d4962e46acd978dc5ccce24ab4b5bbb9c..8242bceb6ffcc144c75935866d55a187e9ba8ba6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetSearchHitGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetSearchHitGrid.java @@ -30,7 +30,6 @@ import com.google.gwt.user.client.ui.Widget; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ShowResultSetCutInfo; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; @@ -44,6 +43,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.search. import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.search.DetailedSearchWindow; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.search.IDetailedSearchHitGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DetailedSearchCriteria; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetTypeGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetTypeGrid.java index 7e53c7344e0d621a197306781553cd6c3e0cb3bf..26a264e49ef23263f3c1c4d2c98234cb92f833e8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetTypeGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetTypeGrid.java @@ -21,7 +21,6 @@ import static ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModifica import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ComponentProvider; import ch.systemsx.cisd.openbis.generic.client.web.client.application.help.HelpPageIdentifier; @@ -38,6 +37,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.Dialo import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.EntityTypeUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetType; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetUploadForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetUploadForm.java index e546cd052db749bd6513465501995f3d2247cd7b..d5c10175e357dad3fc8a1b77612bea35d39ad835 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetUploadForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetUploadForm.java @@ -24,7 +24,6 @@ import com.google.gwt.http.client.URL; import ch.systemsx.cisd.common.shared.basic.string.StringUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.CompositeDatabaseModificationObserver; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DatabaseModificationAwareComponent; @@ -40,6 +39,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget. import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.WindowUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ExperimentIdentifier; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.BasicConstant; import ch.systemsx.cisd.openbis.generic.shared.basic.DataSetUploadInfo; import ch.systemsx.cisd.openbis.generic.shared.basic.DataSetUploadInfo.DataSetUploadInfoHelper; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/FileFormatTypeGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/FileFormatTypeGrid.java index 79e067d9b94d8d4794f80593836575d012036dec..5be79a1eabb733d90cdb458d9576c555add84155 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/FileFormatTypeGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/FileFormatTypeGrid.java @@ -28,7 +28,6 @@ import ch.systemsx.cisd.common.shared.basic.string.StringUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.BaseEntityModel; @@ -44,6 +43,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDele import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.TextToolItem; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.FileFormatTypeGridColumnIDs; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.FileFormatType; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/MatchCriteriaRadio.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/MatchCriteriaRadio.java index 2d7404924e44ba5ffaecdc4f751759c429fdc60e..9ac84392168e533761eaaf1f3e93af032a2c809a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/MatchCriteriaRadio.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/MatchCriteriaRadio.java @@ -23,7 +23,7 @@ import com.extjs.gxt.ui.client.widget.form.Radio; import com.extjs.gxt.ui.client.widget.form.RadioGroup; import com.extjs.gxt.ui.client.widget.layout.TableData; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SearchCriteriaConnection; /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/RelatedDataSetGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/RelatedDataSetGrid.java index b9cd9d7781df210146e273940b3edfc3ccbfb7f1..e244949b15760cae4131bd003db9dd4ed29dbeec 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/RelatedDataSetGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/RelatedDataSetGrid.java @@ -19,11 +19,11 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.RelatedDataSetCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolder; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/deletion/DeletionGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/deletion/DeletionGrid.java index e6b639c44e2322c9b4f06d1fd0054b4685339a6c..0b354db8e730cce08ba6b41228d1b6418caf131a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/deletion/DeletionGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/deletion/DeletionGrid.java @@ -26,7 +26,6 @@ import com.extjs.gxt.ui.client.widget.button.Button; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.renderer.PersonRenderer; @@ -37,6 +36,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IB import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DeletionGridColumnIDs; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/entity_type/AbstractEditEntityTypeDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/entity_type/AbstractEditEntityTypeDialog.java index b86282d04c85f3058956977b67afeb968dbcd6e4..291c6213a8768814b591bda0bd2f63921d3799bc 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/entity_type/AbstractEditEntityTypeDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/entity_type/AbstractEditEntityTypeDialog.java @@ -20,13 +20,13 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.DescriptionField; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.ScriptChooserField; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.AbstractRegistrationDialog; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.FieldUtil; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Script; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/entity_type/AddTypeDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/entity_type/AddTypeDialog.java index 3f2f6889237577346ee89929c684f2bc24d3e503..e720c3e10258b770dbceefea9c078b151bf992ee 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/entity_type/AddTypeDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/entity_type/AddTypeDialog.java @@ -20,11 +20,11 @@ import com.extjs.gxt.ui.client.widget.form.TextField; import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.DescriptionField; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.AbstractRegistrationDialog; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AbstractType; /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/entity_type/NewEntityTypeForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/entity_type/NewEntityTypeForm.java index f0aa883466842eee7559f9392a4800cb9f293442..1c36e0bbccc22d255240923a3957db7829aff197 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/entity_type/NewEntityTypeForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/entity_type/NewEntityTypeForm.java @@ -23,7 +23,6 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ComponentProvider; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.CompositeDatabaseModificationObserver; @@ -44,6 +43,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget. import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.FormPanelWithSavePoint; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.FormPanelWithSavePoint.DirtyChangeEvent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetTypePropertyType; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentBatchRegistrationPanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentBatchRegistrationPanel.java index 81c12f1683f66998985fb380e05b3ea6c8534681..d3c8c5aa46b301a5adba1305b53b5b0f0c1c13a4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentBatchRegistrationPanel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentBatchRegistrationPanel.java @@ -26,12 +26,12 @@ import com.google.gwt.user.client.ui.Widget; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DatabaseModificationAwareComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.ExperimentTypeModel; import ch.systemsx.cisd.openbis.generic.client.web.client.application.plugin.IClientPlugin; import ch.systemsx.cisd.openbis.generic.client.web.client.application.plugin.IClientPluginFactory; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdAndCodeHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityType; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentBrowserGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentBrowserGrid.java index 3d2e1d33fafcdd76d4e7985aaccbe63116cdb389..4ca1181a46c9aface43f3c2b4c74305f96892a94 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentBrowserGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentBrowserGrid.java @@ -31,7 +31,6 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAs import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ActionContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ComponentProvider; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DispatcherHelper; @@ -58,6 +57,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.TextT import ch.systemsx.cisd.openbis.generic.client.web.client.dto.CommonGridColumnIDs; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ExperimentBrowserGridColumnIDs; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ListExperimentsCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentBrowserToolbar.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentBrowserToolbar.java index b1db2c7804d74f672dcbc80a7c682990cad04826..cd817838d19e9f9bd8e871ac532e662c9f4abad9 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentBrowserToolbar.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentBrowserToolbar.java @@ -31,13 +31,13 @@ import com.google.gwt.user.client.Element; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.ExperimentTypeModel; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.ICriteriaProvider; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.IDataRefreshCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ListExperimentsCriteria; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.ObjectKind; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentTypeGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentTypeGrid.java index 40ff9ef4c127fdb57306adf5400a40be61492fba..698994cc394b1a12ddeed67309e08918fe679d1a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentTypeGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentTypeGrid.java @@ -21,7 +21,6 @@ import static ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModifica import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ComponentProvider; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.TypedTableGrid; @@ -29,6 +28,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.entity_ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.entity_type.AddEntityTypeDialog; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ProjectSelectionTreeGridContainer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ProjectSelectionTreeGridContainer.java index cabd094eca9b5f9fca7efe6ec2efcc1a295b66df..5c2e5fbef08e89485c49a2d99488087dba4a5f62 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ProjectSelectionTreeGridContainer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ProjectSelectionTreeGridContainer.java @@ -26,7 +26,6 @@ import java.util.TreeSet; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.VoidAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.ModelDataPropertyNames; @@ -38,6 +37,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.listene import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.WidgetUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.lang.StringEscapeUtils; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.ICodeHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.ObjectKind; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/DescriptionField.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/DescriptionField.java index 076f25b6236dfd30c06641a88fafa2572fa4986f..2b29c25a119fe407bfbfe9f9005446ad089659aa 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/DescriptionField.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/DescriptionField.java @@ -17,8 +17,8 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; /** * Text field allowing to specify description. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/MultilineItemsField.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/MultilineItemsField.java index 568dedd8b0c65a1f81bef221b4750201a587027c..c8521e30124e16edda03d7741f2e1e5f7ef2c2d7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/MultilineItemsField.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/MultilineItemsField.java @@ -31,7 +31,7 @@ import com.google.gwt.user.client.Element; import com.google.gwt.user.client.Timer; import ch.systemsx.cisd.common.shared.basic.string.StringUtils; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; /** * A {@link MultilineVarcharField} extension with support of handling list of items (Strings). diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/ReasonField.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/ReasonField.java index b8d31c9b4a8a2e223023a91874dc5758648dc805..a874659d634f01c0d8bb7bb32db0f3dadb0d64f2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/ReasonField.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/ReasonField.java @@ -17,8 +17,8 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; /** * Text field allowing to specify reason. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/VocabularyTermSelectionWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/VocabularyTermSelectionWidget.java index 0c56035c2a42cc6111853afef8ef95784dd2d093..51a0e255f8d3c115e586148549415367cd7512d9 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/VocabularyTermSelectionWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/field/VocabularyTermSelectionWidget.java @@ -32,7 +32,6 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.common.shared.basic.string.StringUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DatabaseModificationAwareField; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.ModelDataPropertyNames; @@ -42,6 +41,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget. import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.FieldUtil; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.CodeNormalizer; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/BrowserGridPagingToolBar.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/BrowserGridPagingToolBar.java index 60a61dbfbf67e1756f246798a2eaf6c74af2dfe7..52041ca67daf770233ef7981fcacbf975f986dbd 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/BrowserGridPagingToolBar.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/BrowserGridPagingToolBar.java @@ -42,10 +42,10 @@ import com.extjs.gxt.ui.client.widget.toolbar.PagingToolBar; import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; /** * {@link PagingToolBar} extension with overwritten behavior of the <i>Refresh</i> button and additional <i>Export</i> button. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ColumnSettingsDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ColumnSettingsDialog.java index a6f78d88c75c3e3e83fa0edef036f709dd11d339..3a59e18ff5256fc3cd1158d4a3cc7d576481ea01 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ColumnSettingsDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/ColumnSettingsDialog.java @@ -14,13 +14,13 @@ import com.extjs.gxt.ui.client.widget.layout.FitLayout; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.help.HelpPageIdentifier; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.expressions.column.GridCustomColumnGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.expressions.filter.GridCustomFilterGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.DialogWithOnlineHelpUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; /** * {@link Dialog} displaying {@link ColumnSettingsChooser}. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/column/GridCustomColumnGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/column/GridCustomColumnGrid.java index b0820d218a355bee33ec46cb315c7af77bbae926..c90fa61eeaddeca2614ab283d4635cb74d48f881 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/column/GridCustomColumnGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/column/GridCustomColumnGrid.java @@ -30,7 +30,6 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.help.HelpPageIdentifier; @@ -45,6 +44,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget. import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.CustomGridColumnGridColumnIDs; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GridRowModels; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.IResultSetConfig; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/common/AbstractGridCustomExpressionEditOrRegisterDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/common/AbstractGridCustomExpressionEditOrRegisterDialog.java index e37baa6815846c27ac080c355a28a967aa3e4fed..f6ba2c41836625ccfb4fc7b673409d7c0573fa31 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/common/AbstractGridCustomExpressionEditOrRegisterDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/common/AbstractGridCustomExpressionEditOrRegisterDialog.java @@ -26,7 +26,6 @@ import com.google.gwt.user.client.Event; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.help.HelpPageIdentifier; import ch.systemsx.cisd.openbis.generic.client.web.client.application.renderer.LinkRenderer; @@ -38,6 +37,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget. import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.FieldUtil; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.DialogWithOnlineHelpUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AbstractExpression; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewColumnOrFilter; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/filter/FilterToolbar.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/filter/FilterToolbar.java index a7e5f82c13d898e2c55da46c497a70425b6e6f15..2d5d5ad9ac0ec6455e5a86fe4ab418a8c013c149 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/filter/FilterToolbar.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/filter/FilterToolbar.java @@ -20,7 +20,6 @@ import com.google.gwt.user.client.ui.Widget; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.IDatabaseModificationObserver; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.IParameterField; @@ -34,6 +33,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMess import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.TextToolItem; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ColumnDistinctValues; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.CustomFilterInfo; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GridColumnFilterInfo; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GridFilters; import ch.systemsx.cisd.openbis.generic.shared.basic.IColumnDefinition; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/filter/GridCustomFilterGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/filter/GridCustomFilterGrid.java index b33421be51c1db24678ec72cc0f93eea70129207..fc98140ee1cb01c4e567dca79dcc1bf4f9e4a85e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/filter/GridCustomFilterGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/expressions/filter/GridCustomFilterGrid.java @@ -29,7 +29,6 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.help.HelpPageIdentifier; @@ -44,6 +43,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget. import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.CustomGridColumnGridColumnIDs; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyGrid.java index 914c9498c299756351b6f01f50ba96be5bafcd1c..9f662faf86e3b022fe63dc6e0451747b3a656638 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/managed_property/ManagedPropertyGrid.java @@ -25,7 +25,6 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.TypedTableGrid; @@ -34,6 +33,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.ID import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.TableExportType; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ResultSetFetchConfig; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableModelReference; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialBatchRegistrationUpdatePanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialBatchRegistrationUpdatePanel.java index d30828d596eb9c380ed21a2f95bc4ed8265f4049..efaca0586c3a172937d228a2a479071c0f58891c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialBatchRegistrationUpdatePanel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialBatchRegistrationUpdatePanel.java @@ -26,12 +26,12 @@ import com.google.gwt.user.client.ui.Widget; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DatabaseModificationAwareComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.MaterialTypeModel; import ch.systemsx.cisd.openbis.generic.client.web.client.application.plugin.IClientPlugin; import ch.systemsx.cisd.openbis.generic.client.web.client.application.plugin.IClientPluginFactory; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdAndCodeHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityType; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialBrowserGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialBrowserGrid.java index 57c124a965b481560a25eb981a7f3a1e8520bfe4..9e0e9a92047716b505f358bdba45177cdabe1405 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialBrowserGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialBrowserGrid.java @@ -27,7 +27,6 @@ import com.extjs.gxt.ui.client.widget.button.Button; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.renderer.PersonRenderer; @@ -43,6 +42,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDele import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedActionWithResult; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ColumnDistinctValues; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GridCustomColumnInfo; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GridRowModels; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ListMaterialDisplayCriteria; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialBrowserToolbar.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialBrowserToolbar.java index 0f77c50b12cd5133bd8fedb96f535309a1e8aa0f..0964084d93bbef2cba89ad03d721130974529575 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialBrowserToolbar.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialBrowserToolbar.java @@ -30,13 +30,13 @@ import com.google.gwt.user.client.Element; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.MaterialTypeModel; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.ICriteriaProvider; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.IDataRefreshCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ListMaterialDisplayCriteria; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialType; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialTypeGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialTypeGrid.java index 07b95842148d2d59e97156753ee275c155754777..28741fb1bd8497667b0475e363c34fb798f6d360 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialTypeGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialTypeGrid.java @@ -20,7 +20,6 @@ import static ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModifica import static ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.edit; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ComponentProvider; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.TypedTableGrid; @@ -28,6 +27,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.entity_ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.entity_type.AddEntityTypeDialog; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/browser/MetaprojectBrowser.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/browser/MetaprojectBrowser.java index 07e95f1c56b3ea3586c5133463d3700669353773..6ca581239b4b84d96d02296a6cbfed8f11523d81 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/browser/MetaprojectBrowser.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/browser/MetaprojectBrowser.java @@ -27,7 +27,6 @@ import com.extjs.gxt.ui.client.widget.ContentPanel; import com.extjs.gxt.ui.client.widget.layout.BorderLayout; import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.DisposableComposite; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; @@ -39,6 +38,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.metapro import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.metaproject.tree.model.MetaprojectTreeMetaprojectItemData; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.BorderLayoutHelper; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/browser/MetaprojectBrowserEntitiesPanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/browser/MetaprojectBrowserEntitiesPanel.java index 09f0c645db3ba4f5e9e2a8dfeb8ffdc341724cfd..e2effe09143ee307e3e8e54805c3200ca2cb681d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/browser/MetaprojectBrowserEntitiesPanel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/browser/MetaprojectBrowserEntitiesPanel.java @@ -20,9 +20,9 @@ import com.extjs.gxt.ui.client.widget.ContentPanel; import com.extjs.gxt.ui.client.widget.layout.FitLayout; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.metaproject.entity.MetaprojectEntities; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; /** * @author pkupczyk diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/browser/MetaprojectBrowserTreePanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/browser/MetaprojectBrowserTreePanel.java index 8b5d06b3d5ba8de53be9cf9fed922c3119d6f5d1..20cc78e0d7f0c94d311d20f087357931edeed8a5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/browser/MetaprojectBrowserTreePanel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/browser/MetaprojectBrowserTreePanel.java @@ -20,9 +20,9 @@ import com.extjs.gxt.ui.client.widget.ContentPanel; import com.extjs.gxt.ui.client.widget.layout.FitLayout; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.metaproject.tree.MetaprojectTree; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; /** * @author pkupczyk diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/entity/MetaprojectDataSetsGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/entity/MetaprojectDataSetsGrid.java index 2973aa53efe968085ee03a55561d58de4f62588c..6aa8141cce339872a99e78dbbe89a86a1326dbcd 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/entity/MetaprojectDataSetsGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/entity/MetaprojectDataSetsGrid.java @@ -17,11 +17,11 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.metaproject.entity; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data.AbstractExternalDataGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AbstractExternalData; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/entity/MetaprojectEntitySection.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/entity/MetaprojectEntitySection.java index 0a4866fa480433a7b618bf98bea3ca346310c092..d66bada279bee00f82d772cc2b48955176375168 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/entity/MetaprojectEntitySection.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/entity/MetaprojectEntitySection.java @@ -21,10 +21,10 @@ import com.extjs.gxt.ui.client.event.EventType; import com.extjs.gxt.ui.client.event.Listener; import ch.systemsx.cisd.openbis.generic.client.web.client.application.DisposableTabContent; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.AbstractEntityGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/form/AbstractMetaprojectEditRegisterForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/form/AbstractMetaprojectEditRegisterForm.java index 1eca216dc8bdfb31542eb48a934b80c7bbb27c17..8f11e69da9efd9a359cf9b230bf84d95db32e6a2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/form/AbstractMetaprojectEditRegisterForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/form/AbstractMetaprojectEditRegisterForm.java @@ -20,12 +20,12 @@ import com.extjs.gxt.ui.client.widget.LayoutContainer; import com.google.gwt.user.client.Element; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.AbstractRegistrationForm; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.DescriptionField; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.MultilineVarcharField; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.metaproject.field.MetaprojectNameField; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; /** * A {@link LayoutContainer} extension for registering and editing metaprojects. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/grid/MetaprojectGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/grid/MetaprojectGrid.java index ff03899a80c70989bf9e7d18d42f4151e5ff36d8..ffdb9a09264b186f07cae9480ae42d4ae92153b6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/grid/MetaprojectGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/grid/MetaprojectGrid.java @@ -21,7 +21,6 @@ import java.util.HashSet; import java.util.List; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.TypedTableGrid; @@ -29,6 +28,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.I import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.ColumnDefsAndConfigs; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.DisposableEntityChooser; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ListMetaprojectsCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.MetaprojectGridColumnIDs; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/viewer/MetaprojectPropertiesPanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/viewer/MetaprojectPropertiesPanel.java index 44e509c8c03f5b1e0cc5f39983159564ab25d387..bd11c87d4bcac4892aa3fdfdae02cfe4fb56bdf4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/viewer/MetaprojectPropertiesPanel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/viewer/MetaprojectPropertiesPanel.java @@ -30,10 +30,10 @@ import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.property.PropertyGrid; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.ObjectKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Metaproject; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/viewer/MetaprojectViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/viewer/MetaprojectViewer.java index 3012cdc6965c2fb0f3fcfa649973e8c3239f7d09..3e08dd5ed77aadc96718c37338dacd0a44fa7da7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/viewer/MetaprojectViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/metaproject/viewer/MetaprojectViewer.java @@ -29,7 +29,6 @@ import com.google.gwt.user.client.ui.Widget; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AbstractTabItemFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DatabaseModificationAwareComponent; @@ -47,6 +46,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.metapro import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.metaproject.form.MetaprojectEditForm; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.ObjectKind; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/AbstractProjectEditRegisterForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/AbstractProjectEditRegisterForm.java index 83348681be6d098f8d3e1b308fd8e1ad302546cb..033db7989d6195d4643f558c3645823ac588d983 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/AbstractProjectEditRegisterForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/AbstractProjectEditRegisterForm.java @@ -27,7 +27,6 @@ import com.google.gwt.user.client.Element; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; import ch.systemsx.cisd.openbis.generic.client.web.client.application.FormPanelListener; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.AbstractRegistrationForm; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.SpaceSelectionWidget; @@ -36,6 +35,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.D import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.MultilineVarcharField; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.file.AttachmentsFileFieldManager; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.FieldUtil; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewAttachment; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/ProjectEditForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/ProjectEditForm.java index a85bb8d7d13a15768ce4ff96cdef26ce791cb546..5ca09dfecc23632ecb3de128c9e5dd8f356311f4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/ProjectEditForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/ProjectEditForm.java @@ -21,12 +21,12 @@ import java.util.List; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DatabaseModificationAwareComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.AbstractRegistrationForm; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.FieldUtil; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.HtmlMessageElement; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Project; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ProjectUpdates; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/ProjectGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/ProjectGrid.java index 46a183c8f0917a5f294cc4ac1d33e2d18e624820..ab5f959cfe53d7ce43ff69aeb6de288fb8da59d7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/ProjectGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/ProjectGrid.java @@ -28,7 +28,6 @@ import com.extjs.gxt.ui.client.widget.button.Button; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ProjectViewer; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AbstractTabItemFactory; @@ -52,6 +51,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IB import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.CommonGridColumnIDs; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ProjectGridColumnIDs; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/ProjectRegistrationForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/ProjectRegistrationForm.java index 1983ae53ccd2970b33f2e647229c074b59ae4856..effaa55f2c6c8b7e3db387c6cb11ce7c6e1131ad 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/ProjectRegistrationForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/project/ProjectRegistrationForm.java @@ -20,11 +20,11 @@ import java.util.Arrays; import java.util.List; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DatabaseModificationAwareComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.AbstractRegistrationForm; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.HtmlMessageElement; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Project; /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property/EntityHistoryGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property/EntityHistoryGrid.java index 8661a3b46105b32a17135b8e38a4145b8197f7e9..bc46d917f7d9398421ff16641dd21bfeb62ba579 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property/EntityHistoryGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property/EntityHistoryGrid.java @@ -21,12 +21,12 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAs import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; import ch.systemsx.cisd.openbis.generic.client.web.client.application.DisposableTabContent; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.TypedTableGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ListEntityHistoryCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeAssignmentForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeAssignmentForm.java index bd9b2dced29e2dc0b92dc39a693b28ea0430bb51..1ac53cc6539398ade50c56287b2faa051993db96 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeAssignmentForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeAssignmentForm.java @@ -23,7 +23,6 @@ import java.util.Set; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.InfoBoxCallbackListener; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.CompositeDatabaseModificationObserver; @@ -45,6 +44,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget. import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.InfoBox; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityType; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeAssignmentGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeAssignmentGrid.java index f8a60b15824ada69746bd3674f98fbbbe837bb6a..c7c10afa9acb27943923ede17dc80105a43e1267 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeAssignmentGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeAssignmentGrid.java @@ -39,7 +39,6 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAs import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AsyncCallbackWithProgressBar; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.help.HelpPageIdentifier; @@ -63,6 +62,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUt import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.WindowUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.PropertyTypeAssignmentGridColumnIDs; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeGrid.java index 82b066f04fb22216779a53b97a166b0e5bd77915..30adbe0d46bc1969d3b630ecf0c2eec858561ac0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeGrid.java @@ -34,7 +34,6 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ComponentProvider; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DispatcherHelper; @@ -52,6 +51,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget. import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.PropertyTypeGridColumnIDs; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeRegistrationForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeRegistrationForm.java index 4f4214ba256a925ff9c63f2a21664dd4d40df405..4681bd291243bf64c030c62980c31e4aa027ede7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeRegistrationForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeRegistrationForm.java @@ -27,7 +27,6 @@ import com.google.gwt.user.client.ui.AbstractImagePrototype; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.CompositeDatabaseModificationObserver; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DatabaseModificationAwareComponent; @@ -46,6 +45,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.vocabul import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.FieldUtil; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.HtmlMessageElement; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataTypeCode; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialType; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/report/ReportGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/report/ReportGrid.java index bc4b7cfbe0c4d50010eef6ef680fc470a465f2f8..122fdce2ca2d2fb1b94b75c155149e622c78620c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/report/ReportGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/report/ReportGrid.java @@ -21,12 +21,12 @@ import java.util.Set; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.TypedTableGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ResultSetFetchConfig; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableModelReference; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBatchRegisterUpdatePanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBatchRegisterUpdatePanel.java index 20a5748088bfc61b4311b8724545f9f62fd878cd..bc87c5f93199e9ad1da8da69956cf145dc485e3c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBatchRegisterUpdatePanel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBatchRegisterUpdatePanel.java @@ -26,12 +26,12 @@ import com.google.gwt.user.client.ui.Widget; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DatabaseModificationAwareComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.SampleTypeDisplayID; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.SampleTypeModel; import ch.systemsx.cisd.openbis.generic.client.web.client.application.plugin.IClientPlugin; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdAndCodeHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityType; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBrowserGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBrowserGrid.java index 47e5dbd91503d57ef7a6f5c29dfc0edbe16949af..c5a7c89f90cdf2c13a6e62470932046c7286e70a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBrowserGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBrowserGrid.java @@ -35,7 +35,6 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAs import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ActionContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ComponentProvider; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DispatcherHelper; @@ -62,6 +61,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDele import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDirectlyConnectedController; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.CommonGridColumnIDs; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ListEntityDisplayCriteriaKind; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ListSampleDisplayCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ListSampleDisplayCriteria2; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBrowserToolbar.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBrowserToolbar.java index 5b6284a018febcd43b1833caefce678b07b6f8bd..5e2383f71955b9c159e396f2be048dcb395e54d8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBrowserToolbar.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleBrowserToolbar.java @@ -30,7 +30,6 @@ import com.extjs.gxt.ui.client.widget.toolbar.ToolBar; import com.google.gwt.user.client.Element; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.SampleTypeDisplayID; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.SampleTypeModel; @@ -39,6 +38,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.SpaceSe import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.IDataRefreshCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ListSampleDisplayCriteria; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.ObjectKind; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleSearchHitGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleSearchHitGrid.java index 5c6cf05a6255bb7323c5062e47cb43dbe663c0f6..613b0e0efca55c5a528f080dfe76f350ac6a36c1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleSearchHitGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleSearchHitGrid.java @@ -26,7 +26,6 @@ import com.extjs.gxt.ui.client.widget.button.Button; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ShowResultSetCutInfo; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; @@ -37,6 +36,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.search. import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.search.IDetailedSearchHitGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedActionWithResult; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ListSampleDisplayCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DetailedSearchCriteria; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleTypeGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleTypeGrid.java index 2a079e258655065f73f0e5248b72f932a62998d3..987b038e459ce898351c6d58076298188e37ded3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleTypeGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleTypeGrid.java @@ -26,7 +26,6 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ComponentProvider; import ch.systemsx.cisd.openbis.generic.client.web.client.application.help.HelpPageIdentifier; @@ -43,6 +42,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget. import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.DialogWithOnlineHelpUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.EntityTypeUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/AbstractScriptEditRegisterForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/AbstractScriptEditRegisterForm.java index 29416e22095f34d07258eadb2e35dce6aac5e2cc..5d6c9bd028da313b0a9d17445aff90134eb15610 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/AbstractScriptEditRegisterForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/AbstractScriptEditRegisterForm.java @@ -37,7 +37,6 @@ import com.google.gwt.user.client.Element; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.AbstractRegistrationForm; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.DescriptionField; @@ -48,6 +47,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.propert import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.AbstractRegistrationDialog; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.FieldUtil; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.LabeledItem; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.PluginType; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/EntityKindSelectionWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/EntityKindSelectionWidget.java index 45210ee6e9b9be66fe6343f4330f232002c057cf..5bfc5b97b141576ca738678c05bd5b3e61eb88e1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/EntityKindSelectionWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/EntityKindSelectionWidget.java @@ -20,12 +20,12 @@ import com.extjs.gxt.ui.client.widget.form.SimpleComboBox; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.FieldUtil; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.LabeledItem; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.EntityTypeUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/ScriptEditForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/ScriptEditForm.java index 7068b86895083b090176bc222e74837114d21f4e..9bcb93ba085e0d9f3f05379c877ead730db23aa1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/ScriptEditForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/ScriptEditForm.java @@ -23,12 +23,12 @@ import com.extjs.gxt.ui.client.widget.Component; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.AbstractRegistrationForm; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.FieldUtil; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.HtmlMessageElement; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.LabeledItem; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.PluginType; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/ScriptGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/ScriptGrid.java index 3f86cbb5f9913dbebcde4999cdbdb8dfcd3edb7d..aa4a532009a6aca2bf244372d179c1f1cd42d1d7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/ScriptGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/ScriptGrid.java @@ -22,7 +22,6 @@ import java.util.List; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AbstractTabItemFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ComponentProvider; @@ -40,6 +39,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.Di import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IBrowserGridActionInvoker; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.AbstractDataListPermanentDeletionConfirmationDialog; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ListScriptsCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ScriptGridColumnIDs; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchCriterionWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchCriterionWidget.java index 20e8d17abafc3e55542e752545fdc5444176f341..0129e92a80fd9169accda6deb12a57bcc3d1fda3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchCriterionWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchCriterionWidget.java @@ -32,9 +32,9 @@ import com.google.gwt.event.dom.client.KeyCodes; import ch.systemsx.cisd.common.shared.basic.string.StringUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.DetailedSearchFieldComboModel; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.AttributeSearchFieldKindProvider; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DetailedSearchCriterion; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DetailedSearchField; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchWindow.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchWindow.java index 2f6b3ee727fb727fc4d55224a8128cba967bf5c0..2719a74c6acaae49233a220d83a82a00a5bc4ad8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchWindow.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/DetailedSearchWindow.java @@ -28,12 +28,12 @@ import com.google.gwt.event.dom.client.KeyCodes; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.help.HelpPageIdentifier; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data.DataSetSearchHitGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.DialogWithOnlineHelpUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.EntityTypeUtils; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AssociatedEntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DetailedSearchCriteria; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DetailedSearchCriterion; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/MatchCriteriaRadio.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/MatchCriteriaRadio.java index 97f37e49c47769c5f626571581117204c0d10913..69b1be989d9386b6772ffc78a5d409b593cbda97 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/MatchCriteriaRadio.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/MatchCriteriaRadio.java @@ -23,7 +23,7 @@ import com.extjs.gxt.ui.client.widget.form.Radio; import com.extjs.gxt.ui.client.widget.form.RadioGroup; import com.extjs.gxt.ui.client.widget.layout.TableData; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SearchCriteriaConnection; /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/user/ChangeUserSettingsDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/user/ChangeUserSettingsDialog.java index 41d8ae5eea477c6f106efdf74328fd0a0ed31d9b..91a9e46fc2264f772fe1b6bd3974ec72dcf385ae 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/user/ChangeUserSettingsDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/user/ChangeUserSettingsDialog.java @@ -35,7 +35,6 @@ import com.google.gwt.user.client.ui.AbstractImagePrototype; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplaySettingsManager; import ch.systemsx.cisd.openbis.generic.client.web.client.application.help.HelpPageIdentifier; @@ -50,6 +49,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget. import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.DialogWithOnlineHelpUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SessionContext; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DisplaySettings; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyGrid.java index 5679878f5f4d8e64f35386f7d67d13e07834bbb6..d5a3a7df1d159146af6fa05354a88fdd7c9cf4f5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyGrid.java @@ -31,7 +31,6 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AbstractTabItemFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ComponentProvider; @@ -56,6 +55,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUt import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.lang.StringEscapeUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.VocabularyGridColumnIDs; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyRegistrationForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyRegistrationForm.java index 08bc836e6f4828a4cd469948e133b335044f7503..c99455e3b7c01643bc1f0c85f4fd159b961e01bc 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyRegistrationForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyRegistrationForm.java @@ -26,12 +26,12 @@ import com.extjs.gxt.ui.client.widget.button.Button; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.FormPanelListener; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ICallbackListener; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.AbstractRegistrationForm; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.vocabulary.AddVocabularyDialog.VocabularyPopUpCallbackListener; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.HtmlMessageElement; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewVocabulary; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Vocabulary; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyTermGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyTermGrid.java index f615dcc1afc5b22f9f43892097cf7db60a5a014d..8af2494c66532a6eded167d8dfe6646afb3662ee 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyTermGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyTermGrid.java @@ -46,7 +46,6 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAs import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; import ch.systemsx.cisd.openbis.generic.client.web.client.application.FormPanelListener; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.help.HelpPageIdentifier; @@ -69,6 +68,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.Dialo import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/webapp/WebAppComponent.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/webapp/WebAppComponent.java index 9d7df130f823d07a0711a2d1e7df76530306dd87..3b836a130e743acc920e1828b2d29ed87c274ae1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/webapp/WebAppComponent.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/webapp/WebAppComponent.java @@ -19,7 +19,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.webapp import com.extjs.gxt.ui.client.widget.WidgetComponent; import com.google.gwt.user.client.ui.Frame; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; /** * Component that displays a web application in an IFRAME. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractRegistrationDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractRegistrationDialog.java index 51a73f4b790e2a111d215d8703d72d306eb0d737..fdb09b00f5bcf5398a686d1c123bd656c72a6a0f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractRegistrationDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractRegistrationDialog.java @@ -21,7 +21,6 @@ import com.extjs.gxt.ui.client.widget.form.TextField; import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.CodeField; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.DescriptionField; @@ -29,6 +28,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.V import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.CodeField.CodeFieldKind; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; /** * Abstract {@link Window} with Save and Cancel buttons, useful when simple registration operation is needed. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractSaveDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractSaveDialog.java index 78f9f0e0f36d279a64f472a036375493ce097616..60d6160e7760343913401b8b4de4bf28618bb0ee 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractSaveDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/AbstractSaveDialog.java @@ -31,9 +31,9 @@ import com.google.gwt.user.client.ui.Widget; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; /** * Abstract {@link Window} with Save and Cancel buttons, useful when save operation is needed. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/DropDownList.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/DropDownList.java index 995cbaa67ce3e37aea851f36fcdefb45fde2df3e..2957b534ef56057fa09e0c6740c1d78a8353310f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/DropDownList.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/DropDownList.java @@ -39,12 +39,12 @@ import com.google.gwt.user.client.Event; import ch.systemsx.cisd.common.shared.basic.string.StringUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.VoidAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DatabaseModificationAwareField; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/EntityRegistrationPanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/EntityRegistrationPanel.java index aa5ebb8601a4f8569868dd2322590fe69628d4c1..c07920f91ef04bf2b97477ef8e06600b0e6664d9 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/EntityRegistrationPanel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/EntityRegistrationPanel.java @@ -34,7 +34,6 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAs import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ActionContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.ComponentWithCloseConfirmationUtil; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.CompositeDatabaseModificationObserver; @@ -43,6 +42,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework. import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.IDatabaseModificationObserver; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.ModelDataPropertyNames; import ch.systemsx.cisd.openbis.generic.client.web.client.application.plugin.IClientPlugin; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdAndCodeHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/SimpleDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/SimpleDialog.java index 3f19ec2ef59884c72332b395b4cd95eca868621e..edd57960a355ede810e43955c221f032cc1b82a9 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/SimpleDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/widget/SimpleDialog.java @@ -27,9 +27,9 @@ import com.extjs.gxt.ui.client.widget.layout.FitLayout; import com.google.gwt.user.client.ui.Widget; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; /** * A simple dialog with cancel and accept (e.g. Save or Ok) buttons. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/DialogWithOnlineHelpUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/DialogWithOnlineHelpUtils.java index 198ad7a4c6e020fada362be6aeba30caa17f2594..69de01531424fde45daa116d40ff9535bea24894 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/DialogWithOnlineHelpUtils.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/DialogWithOnlineHelpUtils.java @@ -24,9 +24,9 @@ import com.extjs.gxt.ui.client.widget.button.ToolButton; import com.google.gwt.http.client.URL; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.help.HelpPageIdentifier; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.URLMethodWithParameters; /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/WindowUtils.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/WindowUtils.java index 2607f5e917a949bb1365051e4515ae1369bbac40..3781c7a9fb93e62c1c11671b49aa769df7b2b0c7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/WindowUtils.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/WindowUtils.java @@ -23,8 +23,8 @@ import com.extjs.gxt.ui.client.widget.MessageBox; import com.extjs.gxt.ui.client.widget.Window; import com.google.gwt.user.client.Element; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AppEvents.OpenUrlEvent; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DispatcherHelper; /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/log/LoggingConsole.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/log/LoggingConsole.java index 761d2366be1168f37a85f1a4d8bdfe87b485bf0d..2393519d4a5d44677789c6c23b93794ea07e4a95 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/log/LoggingConsole.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/util/log/LoggingConsole.java @@ -28,7 +28,7 @@ import com.extjs.gxt.ui.client.widget.VerticalPanel; import com.extjs.gxt.ui.client.widget.button.Button; import com.google.gwt.user.client.ui.Widget; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; /** * @author Tomasz Pylak diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/GenericConstants.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/GenericConstants.java similarity index 95% rename from openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/GenericConstants.java rename to openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/GenericConstants.java index 52a016ba3337c8f74f5aed0c066f7b69501e87b1..13078b319eb3c09323a74421d44027bd5f9e767c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/GenericConstants.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/GenericConstants.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.generic.client.web.client.application; +package ch.systemsx.cisd.openbis.generic.client.web.client.dto; import com.google.gwt.core.client.GWT; import com.google.gwt.i18n.client.Dictionary; @@ -41,9 +41,9 @@ public final class GenericConstants */ public static final String ID_PREFIX = "openbis_"; - private static final String DEPLOYED_APPLICATION_NAME = Dictionary.getDictionary("common").get(Dict.DEPLOYED_APPLICATION_NAME); + private static final String DEPLOYED_APPLICATION_NAME = Dictionary.getDictionary("common").get("deployedAppName"); - private static final String SPRING_APPLICATION_NAME = Dictionary.getDictionary("common").get(Dict.SPRING_APPLICATION_NAME); + private static final String SPRING_APPLICATION_NAME = Dictionary.getDictionary("common").get("springApplicationName"); public static final String COMMON_SERVER_NAME = createServicePath("common"); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/MatchingEntitiesPanelColumnIDs.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/MatchingEntitiesPanelColumnIDs.java index dfbb2c5765124d4843e43f461f03cd2a509afac8..deb5ba918cd6450498c9c90859b7495356fff42b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/MatchingEntitiesPanelColumnIDs.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/MatchingEntitiesPanelColumnIDs.java @@ -39,4 +39,8 @@ public class MatchingEntitiesPanelColumnIDs public static final String RANK = "RANK"; + public static final String START_HIGHLIGHT = "|||startHighlight|||"; + + public static final String END_HIGHLIGHT = "|||endHighlight|||"; + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractClientService.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractClientService.java index 0976d7a0f467a11a7718dcacdf30e4fb5776250d..993bd4abc1d11a0d6cb25428a17207f091c0681f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractClientService.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractClientService.java @@ -75,12 +75,12 @@ import ch.systemsx.cisd.openbis.generic.client.web.server.translator.UserFailure import ch.systemsx.cisd.openbis.generic.client.web.server.util.TableModelUtils; import ch.systemsx.cisd.openbis.generic.client.web.server.util.XMLPropertyTransformer; import ch.systemsx.cisd.openbis.generic.server.ComponentNames; -import ch.systemsx.cisd.openbis.generic.server.SessionConstants; import ch.systemsx.cisd.openbis.generic.shared.Constants; import ch.systemsx.cisd.openbis.generic.shared.IOpenBisSessionManager; import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.WebClientConfigurationProvider; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolder; +import ch.systemsx.cisd.openbis.generic.shared.basic.SessionConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.WebAppsProperties; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.BasicEntityType; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractServlet.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractServlet.java index bebb2cdeb35781f4a1dd4ab79db2718088e954a1..50e5e2b38a54e149235827f3cc72c383cc7167dc 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractServlet.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractServlet.java @@ -28,8 +28,8 @@ import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.AbstractController; import ch.systemsx.cisd.common.exceptions.UserFailureException; -import ch.systemsx.cisd.openbis.generic.server.SessionConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.GenericSharedConstants; +import ch.systemsx.cisd.openbis.generic.shared.basic.SessionConstants; /** * @author Franz-Josef Elmer diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/FileExportServiceServlet.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/FileExportServiceServlet.java index 4b3e468cea1f6e532a0992c06927bfeccc7d6aac..0bd331c5ee89c38c78581f4d79f41dbae7788732 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/FileExportServiceServlet.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/FileExportServiceServlet.java @@ -28,7 +28,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import ch.systemsx.cisd.common.string.UnicodeUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientService; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.server.util.HttpUtils; import ch.systemsx.cisd.openbis.generic.client.web.server.util.OSKind; import ch.systemsx.cisd.openbis.generic.shared.ResourceNames; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/FileTemplateServiceServlet.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/FileTemplateServiceServlet.java index f530bf2200cd897e7ac978a45941f9ac0b3b90fc..fca0885b81c2408e838976e79693b90c1e798cfc 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/FileTemplateServiceServlet.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/FileTemplateServiceServlet.java @@ -29,11 +29,11 @@ import org.springframework.web.HttpSessionRequiredException; import org.springframework.web.bind.annotation.RequestMapping; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientService; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.server.ComponentNames; -import ch.systemsx.cisd.openbis.generic.server.SessionConstants; import ch.systemsx.cisd.openbis.generic.shared.IOpenBisSessionManager; import ch.systemsx.cisd.openbis.generic.shared.ResourceNames; +import ch.systemsx.cisd.openbis.generic.shared.basic.SessionConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.BatchOperationKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.dto.Session; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/HelpRedirectServlet.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/HelpRedirectServlet.java index 50a43a52e5b0da1ae5eb66a356b05c3ec3da7fb9..39885a1dba6199c6b5db3135affdf5261c457f7f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/HelpRedirectServlet.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/HelpRedirectServlet.java @@ -27,7 +27,7 @@ import org.springframework.web.servlet.mvc.AbstractController; import ch.systemsx.cisd.common.string.Template; import ch.systemsx.cisd.openbis.generic.client.web.client.IOnlineHelpResourceLocatorService; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.ResourceNames; /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/UploadServiceServlet.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/UploadServiceServlet.java index 134c1e09663a77b4286bcf4694b1cc22b6ae7aa0..d53a5ab3c5d11a68467ba8e0396b39ed07cb91e6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/UploadServiceServlet.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/UploadServiceServlet.java @@ -44,9 +44,9 @@ import ch.systemsx.cisd.common.exceptions.UserFailureException; import ch.systemsx.cisd.common.logging.LogCategory; import ch.systemsx.cisd.common.logging.LogFactory; import ch.systemsx.cisd.openbis.generic.server.ComponentNames; -import ch.systemsx.cisd.openbis.generic.server.SessionConstants; import ch.systemsx.cisd.openbis.generic.shared.IOpenBisSessionManager; import ch.systemsx.cisd.openbis.generic.shared.ISessionWorkspaceProvider; +import ch.systemsx.cisd.openbis.generic.shared.basic.SessionConstants; import ch.systemsx.cisd.openbis.generic.shared.dto.Session; /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/MatchingEntitiesProvider.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/MatchingEntitiesProvider.java index 8817320d041c984ba78ef0d72124ef65d15a692c..a740596810c60be10c5135631b1a6cd864e8962d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/MatchingEntitiesProvider.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/MatchingEntitiesProvider.java @@ -31,6 +31,7 @@ import java.util.HashMap; import java.util.List; import ch.systemsx.cisd.common.collection.SimpleComparator; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.MatchingEntitiesPanelColumnIDs; import ch.systemsx.cisd.openbis.generic.client.web.server.translator.SearchableEntityTranslator; import ch.systemsx.cisd.openbis.generic.shared.ICommonServer; import ch.systemsx.cisd.openbis.generic.shared.WebClientConfigurationProvider; @@ -51,10 +52,6 @@ import ch.systemsx.cisd.openbis.generic.shared.util.WebClientConfigUtils; */ public class MatchingEntitiesProvider implements ITableModelProvider<MatchingEntity> { - public static final String START_HIGHLIGHT = "|||startHighlight|||"; - - public static final String END_HIGHLIGHT = "|||endHighlight|||"; - private final ICommonServer commonServer; private final String sessionToken; @@ -189,14 +186,14 @@ public class MatchingEntitiesProvider implements ITableModelProvider<MatchingEnt if (block.isHighlighted()) { - highlighted += START_HIGHLIGHT; + highlighted += MatchingEntitiesPanelColumnIDs.START_HIGHLIGHT; } highlighted += rawValue.substring(0, Math.min(block.getLength(), rawValue.length())); if (block.isHighlighted()) { - highlighted += END_HIGHLIGHT; + highlighted += MatchingEntitiesPanelColumnIDs.END_HIGHLIGHT; } rawValue = rawValue.substring(Math.min(block.getLength(), rawValue.length())); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/GenericHttpSessionListener.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/GenericHttpSessionListener.java index 7368370cd78d03bc37d8e00dc1e93b6847dfa4bd..183f6954e39d05bde57fe0e02e4ef571df35e8d3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/GenericHttpSessionListener.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/GenericHttpSessionListener.java @@ -29,6 +29,7 @@ import org.apache.log4j.Logger; import ch.systemsx.cisd.common.logging.LogCategory; import ch.systemsx.cisd.common.logging.LogFactory; import ch.systemsx.cisd.openbis.generic.shared.IServer; +import ch.systemsx.cisd.openbis.generic.shared.basic.SessionConstants; import ch.systemsx.cisd.openbis.generic.shared.dto.Session; /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/WebInformationService.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/WebInformationService.java index 45d8a3e4fb57fb6c74af30de3535dddf4a589336..f30a7ea2a7383cbf616d6f4621d7812e9d5dc6ce 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/WebInformationService.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/api/v1/WebInformationService.java @@ -23,8 +23,8 @@ import org.springframework.stereotype.Component; import ch.rinn.restrictions.Private; import ch.systemsx.cisd.common.servlet.IRequestContextProvider; -import ch.systemsx.cisd.openbis.generic.server.SessionConstants; import ch.systemsx.cisd.openbis.generic.shared.api.v1.IWebInformationService; +import ch.systemsx.cisd.openbis.generic.shared.basic.SessionConstants; /** * @author Piotr Kupczyk diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/VocabularyBO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/VocabularyBO.java index abed35dcfe7825116f37b2be59ea2ab84f2063bf..d33cf2a6873b2fc093a761f7f1fac919929a8086 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/VocabularyBO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/VocabularyBO.java @@ -252,11 +252,6 @@ public class VocabularyBO extends AbstractBusinessObject implements IVocabularyB { remainingTerms.remove(termToBeReplaced.getTerm().getCode()); } - if (remainingTerms.isEmpty()) - { - throw new IllegalArgumentException("Deletion of all " + terms.size() - + " terms are not allowed."); - } for (VocabularyTermReplacement termToBeReplaced : termsToBeReplaced) { String code = termToBeReplaced.getTerm().getCode(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/HibernateSearchDAOV3Adaptor.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/HibernateSearchDAOV3Adaptor.java index 943602a76bfedbaf7a78eb974b161e2bbe92797a..32d69987b180b5801929f1d12e0c4ec8a870573b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/HibernateSearchDAOV3Adaptor.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/HibernateSearchDAOV3Adaptor.java @@ -1,6 +1,29 @@ package ch.systemsx.cisd.openbis.generic.server.dataaccess.db; -import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.*; +import static ch.ethz.sis.openbis.generic.server.asapi.v3.search.translator.GlobalSearchCriteriaTranslator.IDENTIFIER_ALIAS; +import static ch.systemsx.cisd.openbis.generic.shared.dto.ColumnNames.PERSON_REGISTERER_COLUMN; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; + +import org.apache.commons.lang3.StringUtils; +import org.apache.log4j.Logger; +import org.hibernate.Session; +import org.hibernate.query.NativeQuery; +import org.springframework.dao.DataAccessException; + +import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.AbstractEntitySearchCriteria; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.BooleanFieldSearchCriteria; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.DateFieldSearchCriteria; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.ISearchCriteria; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.NumberFieldSearchCriteria; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.NumberPropertySearchCriteria; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.search.StringFieldSearchCriteria; import ch.ethz.sis.openbis.generic.asapi.v3.dto.dataset.ArchivingStatus; import ch.ethz.sis.openbis.generic.asapi.v3.dto.dataset.Complete; import ch.ethz.sis.openbis.generic.asapi.v3.dto.dataset.search.AbstractDataSetSearchCriteria; @@ -17,27 +40,32 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.sample.search.AbstractSampleSear import ch.ethz.sis.openbis.generic.asapi.v3.dto.sample.search.SampleSearchCriteria; import ch.ethz.sis.openbis.generic.server.asapi.v3.search.auth.AuthorisationInformation; import ch.ethz.sis.openbis.generic.server.asapi.v3.search.mapper.TableMapper; -import ch.ethz.sis.openbis.generic.server.asapi.v3.search.planner.*; +import ch.ethz.sis.openbis.generic.server.asapi.v3.search.planner.DataSetSearchManager; +import ch.ethz.sis.openbis.generic.server.asapi.v3.search.planner.ExperimentSearchManager; +import ch.ethz.sis.openbis.generic.server.asapi.v3.search.planner.GlobalSearchManager; +import ch.ethz.sis.openbis.generic.server.asapi.v3.search.planner.IGlobalSearchManager; +import ch.ethz.sis.openbis.generic.server.asapi.v3.search.planner.ILocalSearchManager; +import ch.ethz.sis.openbis.generic.server.asapi.v3.search.planner.MaterialSearchManager; +import ch.ethz.sis.openbis.generic.server.asapi.v3.search.planner.SampleSearchManager; import ch.systemsx.cisd.common.logging.LogCategory; import ch.systemsx.cisd.common.logging.LogFactory; import ch.systemsx.cisd.openbis.generic.server.CommonServiceProvider; -import ch.systemsx.cisd.openbis.generic.server.ComponentNames; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IHibernateSearchDAO; import ch.systemsx.cisd.openbis.generic.shared.authorization.AuthorizationConfig; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.*; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.CompareType; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetAttributeSearchFieldKind; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DetailedSearchCriteria; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DetailedSearchCriterion; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DetailedSearchSubCriteria; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExperimentAttributeSearchFieldKind; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IAssociationCriteria; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MatchingEntity; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialAttributeSearchFieldKind; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Person; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleAttributeSearchFieldKind; import ch.systemsx.cisd.openbis.generic.shared.dto.PersonPE; import ch.systemsx.cisd.openbis.generic.shared.dto.SearchableEntity; import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind; -import org.apache.commons.lang3.StringUtils; -import org.apache.log4j.Logger; -import org.hibernate.Session; -import org.hibernate.query.NativeQuery; -import org.springframework.dao.DataAccessException; - -import java.util.*; - -import static ch.ethz.sis.openbis.generic.server.asapi.v3.search.translator.GlobalSearchCriteriaTranslator.IDENTIFIER_ALIAS; -import static ch.systemsx.cisd.openbis.generic.shared.dto.ColumnNames.PERSON_REGISTERER_COLUMN; /* * The goal of this class is to replace HibernateSearchDAO @@ -45,6 +73,7 @@ import static ch.systemsx.cisd.openbis.generic.shared.dto.ColumnNames.PERSON_REG */ public class HibernateSearchDAOV3Adaptor implements IHibernateSearchDAO { + private static final String DAO_FACTORY = "dao-factory"; private final static Logger operationLog = LogFactory.getLogger(LogCategory.OPERATION, HibernateSearchDAOV3Adaptor.class); @@ -80,7 +109,7 @@ public class HibernateSearchDAOV3Adaptor implements IHibernateSearchDAO { // alreadyFoundEntities is an ignored parameter // Obtain PersonPE - DAOFactory daoFactory = (DAOFactory) CommonServiceProvider.getApplicationContext().getBean(ComponentNames.DAO_FACTORY); + DAOFactory daoFactory = (DAOFactory) CommonServiceProvider.getApplicationContext().getBean(DAO_FACTORY); PersonPE personPE = daoFactory.getPersonDAO().tryFindPersonByUserId(userId); if(personPE == null) { @@ -213,7 +242,7 @@ public class HibernateSearchDAOV3Adaptor implements IHibernateSearchDAO { operationLog.info("TO ADAPT [QUERY] : " + entityKind + " [" + mainV1Criteria + "] " + v1Associations); // Obtain PersonPE - DAOFactory daoFactory = (DAOFactory) CommonServiceProvider.getApplicationContext().getBean(ComponentNames.DAO_FACTORY); + DAOFactory daoFactory = (DAOFactory) CommonServiceProvider.getApplicationContext().getBean(DAO_FACTORY); PersonPE personPE = daoFactory.getPersonDAO().tryFindPersonByUserId(userId); if(personPE == null) { @@ -1130,7 +1159,7 @@ public class HibernateSearchDAOV3Adaptor implements IHibernateSearchDAO { private static String IS_NUMBER = "SELECT COUNT(*) > 0 FROM property_types WHERE code = :code AND (daty_id = (SELECT id FROM data_types WHERE code = 'INTEGER') OR daty_id = (SELECT id FROM data_types WHERE code = 'REAL'))"; private boolean isNumberProperty(String propertyCode) { - DAOFactory daoFactory = (DAOFactory) CommonServiceProvider.getApplicationContext().getBean(ComponentNames.DAO_FACTORY); + DAOFactory daoFactory = (DAOFactory) CommonServiceProvider.getApplicationContext().getBean(DAO_FACTORY); Session currentSession = daoFactory.getSessionFactory().getCurrentSession(); NativeQuery nativeQuery = currentSession.createNativeQuery(IS_NUMBER); nativeQuery.setParameter("code", propertyCode); @@ -1141,7 +1170,7 @@ public class HibernateSearchDAOV3Adaptor implements IHibernateSearchDAO { private static String IS_DATE = "SELECT COUNT(*) > 0 FROM property_types WHERE code = :code AND (daty_id = (SELECT id FROM data_types WHERE code = 'TIMESTAMP'))"; private boolean isDateProperty(String propertyCode) { - DAOFactory daoFactory = (DAOFactory) CommonServiceProvider.getApplicationContext().getBean(ComponentNames.DAO_FACTORY); + DAOFactory daoFactory = (DAOFactory) CommonServiceProvider.getApplicationContext().getBean(DAO_FACTORY); Session currentSession = daoFactory.getSessionFactory().getCurrentSession(); NativeQuery nativeQuery = currentSession.createNativeQuery(IS_DATE); nativeQuery.setParameter("code", propertyCode); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/PermlinkUtilities.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/PermlinkUtilities.java index e15a64f85b3d1ab2c3865b24ffa588056a173262..95879c134954039799317c9e4caa6a4d25708439 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/PermlinkUtilities.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/PermlinkUtilities.java @@ -16,7 +16,6 @@ package ch.systemsx.cisd.openbis.generic.shared.basic; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.ProjectLocatorResolver; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AttachmentHolderKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; @@ -88,8 +87,8 @@ public class PermlinkUtilities URLMethodWithParameters ulrWithParameters = createAttachmentParameters(baseIndexURL, fileName, version); ulrWithParameters.addParameter(ENTITY_KIND_PARAMETER_KEY, AttachmentHolderKind.PROJECT); - ulrWithParameters.addParameter(ProjectLocatorResolver.CODE_PARAMETER_KEY, projectCode); - ulrWithParameters.addParameter(ProjectLocatorResolver.SPACE_PARAMETER_KEY, space); + ulrWithParameters.addParameter(PermlinkUtilities.CODE_PARAMETER_KEY, projectCode); + ulrWithParameters.addParameter(PermlinkUtilities.SPACE_PARAMETER_KEY, space); return ulrWithParameters.toString(); } @@ -99,10 +98,26 @@ public class PermlinkUtilities URLMethodWithParameters ulrWithParameters = new URLMethodWithParameters(baseIndexURL); ulrWithParameters.addParameter(BasicConstant.VIEW_MODE_KEY, ViewMode.SIMPLE.name()); ulrWithParameters.startHistoryToken(); - ulrWithParameters.addParameter(ENTITY_KIND_PARAMETER_KEY, ProjectLocatorResolver.PROJECT); - ulrWithParameters.addParameter(ProjectLocatorResolver.CODE_PARAMETER_KEY, projectCode); - ulrWithParameters.addParameter(ProjectLocatorResolver.SPACE_PARAMETER_KEY, spaceCode); + ulrWithParameters.addParameter(ENTITY_KIND_PARAMETER_KEY, PermlinkUtilities.PROJECT); + ulrWithParameters.addParameter(PermlinkUtilities.CODE_PARAMETER_KEY, projectCode); + ulrWithParameters.addParameter(PermlinkUtilities.SPACE_PARAMETER_KEY, spaceCode); return ulrWithParameters.toString(); } + public final static String PROJECT = "PROJECT"; + + public final static String CODE_PARAMETER_KEY = "code"; + + public final static String SPACE_PARAMETER_KEY = "space"; + + public final static String TYPE_PARAMETER_KEY = "type"; + + public static final String PERMLINK_ACTION = "VIEW"; + + public final static String METAPROJECT = "METAPROJECT"; + + public final static String NAME_PARAMETER_KEY = "name"; + + public final static String BROWSE_ACTION = "BROWSE"; + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/SessionConstants.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/SessionConstants.java similarity index 95% rename from openbis/source/java/ch/systemsx/cisd/openbis/generic/server/SessionConstants.java rename to openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/SessionConstants.java index eb4932496db0eb510e095fff3747ee17ec988d76..be6ea858b4daf809e87fcb88915587218e87f063 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/SessionConstants.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/SessionConstants.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.generic.server; +package ch.systemsx.cisd.openbis.generic.shared.basic; /** * Some session constants. diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AbstractExpressionPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AbstractExpressionPE.java index c86e2cdb89751572e10075321a05fb565b064bde..20d199d9114196ccd96f1a7227a5056c384c6cee 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AbstractExpressionPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AbstractExpressionPE.java @@ -26,7 +26,7 @@ import javax.validation.constraints.NotNull; import org.hibernate.validator.constraints.Length; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ServiceVersionHolder; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AbstractTypePE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AbstractTypePE.java index c8f961425a4b5945531b3b5d7554124ffc6292c5..7a92c24c944fb0b8884a8bf98401ff2e00abd10f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AbstractTypePE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AbstractTypePE.java @@ -25,7 +25,7 @@ import javax.validation.constraints.Pattern; import org.apache.commons.lang3.builder.ToStringBuilder; import org.hibernate.validator.constraints.Length; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdentityHolder; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AttachmentPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AttachmentPE.java index d2e50be65699d347954baba4ab6dc509b29bdef5..346762674acd0b26a3bab8290801beecbe01a098 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AttachmentPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AttachmentPE.java @@ -40,7 +40,7 @@ import org.hibernate.validator.constraints.Length; import ch.rinn.restrictions.Private; import ch.systemsx.cisd.common.reflection.ModifiedShortPrefixToStringStyle; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder; import ch.systemsx.cisd.openbis.generic.shared.util.EqualsHashUtils; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AuthorizationGroupPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AuthorizationGroupPE.java index a9ed7cea4216e99ace37aaa4d9873c086c932136..4bdfbaf6111539911737ab6de8d78218b4b19a62 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AuthorizationGroupPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/AuthorizationGroupPE.java @@ -44,7 +44,7 @@ import org.hibernate.validator.constraints.Length; import ch.rinn.restrictions.Friend; import ch.systemsx.cisd.common.collection.UnmodifiableSetDecorator; import ch.systemsx.cisd.common.reflection.ModifiedShortPrefixToStringStyle; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdentityHolder; import ch.systemsx.cisd.openbis.generic.shared.dto.hibernate.SearchFieldConstants; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSetTypePE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSetTypePE.java index 5248ea466fa30c337dce745518a72519b53f0295..75072b6cbc7eff950f6530fea57fbc7fcae190f2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSetTypePE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataSetTypePE.java @@ -35,7 +35,7 @@ import javax.persistence.UniqueConstraint; import org.hibernate.validator.constraints.Length; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataTypePE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataTypePE.java index 8daf24eca051ca6349e36cdcbd4e7afbdfe828fe..e331ac58ae5fbcdfdb3af814dbc80869bcb52ee0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataTypePE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataTypePE.java @@ -37,7 +37,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder; import org.hibernate.validator.constraints.Length; import ch.systemsx.cisd.common.reflection.ModifiedShortPrefixToStringStyle; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataTypeCode; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DeletionPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DeletionPE.java index 654f7a2f793f881e94a435b4f0570d6f8f60cf57..1e94a7678d34e30623ce236c9e7e7a35912c65bf 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DeletionPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DeletionPE.java @@ -31,7 +31,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder; import org.hibernate.validator.constraints.Length; import ch.systemsx.cisd.common.reflection.ModifiedShortPrefixToStringStyle; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EntityTypePropertyTypePE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EntityTypePropertyTypePE.java index 79947301fd387b26bec12c018ccafdb76a860607..ef1f52336c8013663204111a20946bd18a4e5e82 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EntityTypePropertyTypePE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EntityTypePropertyTypePE.java @@ -35,7 +35,7 @@ import org.hibernate.validator.constraints.Length; import ch.systemsx.cisd.common.reflection.ClassUtils; import ch.systemsx.cisd.common.reflection.ModifiedShortPrefixToStringStyle; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EventPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EventPE.java index c07143506069216e44343e9e3271781f60ce1845..759df144dd6e5831be2bc97ba81f730051c5ad2b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EventPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EventPE.java @@ -45,7 +45,7 @@ import ch.rinn.restrictions.Friend; import ch.systemsx.cisd.common.collection.CollectionStyle; import ch.systemsx.cisd.common.collection.CollectionUtils; import ch.systemsx.cisd.common.reflection.ModifiedShortPrefixToStringStyle; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdHolder; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/GridCustomColumnPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/GridCustomColumnPE.java index 010679189c5bf931af5f947e664797e3df5823a7..c5c5c2d36921fdb57b2990bd91bc1dad53f68c82 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/GridCustomColumnPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/GridCustomColumnPE.java @@ -29,7 +29,7 @@ import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.hibernate.validator.constraints.Length; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ServiceVersionHolder; /** diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ProjectPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ProjectPE.java index 9e85e73909a51cee7bbd8238e8c8da2cce265b27..3f78c40c784627da0d04b1280a3e42e5b0fa80be 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ProjectPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ProjectPE.java @@ -54,7 +54,7 @@ import ch.rinn.restrictions.Friend; import ch.rinn.restrictions.Private; import ch.systemsx.cisd.common.collection.UnmodifiableListDecorator; import ch.systemsx.cisd.common.reflection.ModifiedShortPrefixToStringStyle; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdentityHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AttachmentHolderKind; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/PropertyTypePE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/PropertyTypePE.java index e0208fa78fba63a3110eab98f016ee468648cc76..11b3688c30344e83e6fc45146920fa72ddc81b36 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/PropertyTypePE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/PropertyTypePE.java @@ -46,7 +46,7 @@ import org.hibernate.annotations.TypeDefs; import org.hibernate.validator.constraints.Length; import ch.systemsx.cisd.common.collection.UnmodifiableSetDecorator; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.basic.CodeConverter; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdentityHolder; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/RelationshipTypePE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/RelationshipTypePE.java index 4b822d22152813a91d8905083d5a7fe0dbab4dee..fa80cb527e3d6770e87fe3b68a1168add3410f6b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/RelationshipTypePE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/RelationshipTypePE.java @@ -32,7 +32,7 @@ import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.hibernate.validator.constraints.Length; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.basic.CodeConverter; import ch.systemsx.cisd.openbis.generic.shared.dto.hibernate.ManagedInternally; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ScriptPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ScriptPE.java index 217f136dc0e0d2a07171dc333e53e6fba110673c..6556a2e8a401d145f7fd973b8904a6b34a771353 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ScriptPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ScriptPE.java @@ -42,7 +42,7 @@ import org.hibernate.validator.constraints.Length; import ch.rinn.restrictions.Private; import ch.systemsx.cisd.common.collection.UnmodifiableListDecorator; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdentityHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.PluginType; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SpacePE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SpacePE.java index dcf2d1b9e8e0bb2d9c5ed1cb2f6a2172e2d93851..2e1c83c0aab5adcd357be87bd52cd779219f3b23 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SpacePE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SpacePE.java @@ -42,7 +42,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder; import org.hibernate.validator.constraints.Length; import ch.systemsx.cisd.common.reflection.ModifiedShortPrefixToStringStyle; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdentityHolder; import ch.systemsx.cisd.openbis.generic.shared.dto.hibernate.SearchFieldConstants; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/VocabularyPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/VocabularyPE.java index 8680e89a0efa5f0b92ff4b23b7cf6759da618481..1861a17017e2000416e9f243905523717026d1da 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/VocabularyPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/VocabularyPE.java @@ -47,7 +47,7 @@ import org.hibernate.validator.constraints.Length; import ch.rinn.restrictions.Private; import ch.systemsx.cisd.common.collection.UnmodifiableSetDecorator; import ch.systemsx.cisd.common.reflection.ModifiedShortPrefixToStringStyle; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.basic.CodeConverter; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdentityHolder; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/VocabularyTermPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/VocabularyTermPE.java index 183a71770ca8d47e52144abf72efc27d89441423..73f22943ea8015b06adcdbf0c18f0fba3fd3e7f8 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/VocabularyTermPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/VocabularyTermPE.java @@ -41,7 +41,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder; import org.hibernate.validator.constraints.Length; import ch.systemsx.cisd.common.reflection.ModifiedShortPrefixToStringStyle; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.IServer; import ch.systemsx.cisd.openbis.generic.shared.basic.BasicConstant; import ch.systemsx.cisd.openbis.generic.shared.basic.CodeConverter; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/DemoSampleViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/DemoSampleViewer.java index f41f6cc6fbf28f8b2d7a9c40629080ef0057f2c3..c5ccb2bce07177b475144fb0030f925e509dbf7f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/DemoSampleViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/DemoSampleViewer.java @@ -20,9 +20,9 @@ import com.google.gwt.user.client.ui.Widget; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.AbstractViewer; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleParentWithDerived; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/module/StatisticsWidget.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/module/StatisticsWidget.java index 2480265dcba784b3d78ef3cdd12d860cafad768b..1d68fb79aee8f79a6697d74528c5d859cc6621d9 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/module/StatisticsWidget.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/module/StatisticsWidget.java @@ -23,10 +23,10 @@ import com.extjs.gxt.ui.client.widget.Html; import com.google.gwt.user.client.Element; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DatabaseModificationAwareComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.IDatabaseModificationObserver; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.ObjectKind; import ch.systemsx.cisd.openbis.plugin.demo.client.web.client.IDemoClientServiceAsync; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/module/TopMenuItemDemoModuleMenu.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/module/TopMenuItemDemoModuleMenu.java index a7fc11851cad8b03a26c138461fc9ba7705041f8..906526a8489ce6bf4649457679fd76b27052becf 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/module/TopMenuItemDemoModuleMenu.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/demo/client/web/client/application/module/TopMenuItemDemoModuleMenu.java @@ -19,7 +19,6 @@ package ch.systemsx.cisd.openbis.plugin.demo.client.web.client.application.modul import com.extjs.gxt.ui.client.widget.menu.Menu; import com.extjs.gxt.ui.client.widget.menu.MenuItem; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AbstractTabItemFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DefaultTabItem; @@ -28,6 +27,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.help.HelpP import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.ActionMenu; import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.IActionMenuItem; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.plugin.demo.client.web.client.IDemoClientServiceAsync; import ch.systemsx.cisd.openbis.plugin.demo.client.web.client.application.Dict; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/AbstractGenericEntityRegistrationForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/AbstractGenericEntityRegistrationForm.java index fdbb303499b0b609fbfb9a138eea86c1aab91589..909960e837aa13a2a0cc8e8e4a8920e4ed6c1800 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/AbstractGenericEntityRegistrationForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/AbstractGenericEntityRegistrationForm.java @@ -32,7 +32,6 @@ import com.google.gwt.user.client.Element; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.CompositeDatabaseModificationObserver; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DatabaseModificationAwareField; @@ -46,6 +45,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.M import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.ButtonWithConfirmations; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.ButtonWithConfirmations.IConfirmation; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.ButtonWithConfirmations.IConfirmationChain; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.ConfirmationDialog; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdAndCodeHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/DataSetPropertiesPanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/DataSetPropertiesPanel.java index 7b5d039144b1cfdeeabd8be1417258b6ddf0434f..a51f675cec0d3f9d2862fa5e45637af0cccd5793 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/DataSetPropertiesPanel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/DataSetPropertiesPanel.java @@ -23,12 +23,12 @@ import java.util.Map; import com.extjs.gxt.ui.client.widget.ContentPanel; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.PropertyValueRenderers; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.property.PropertyGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.ExternalHyperlink; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AbstractExternalData; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ContainerDataSet; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetType; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/DataSetRelationshipBrowser.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/DataSetRelationshipBrowser.java index 1e25cd40b6fa3154b6d7999d3627fb9c0da09785..466071a6dd2d38c223112ecdbbe95c16e8754b57 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/DataSetRelationshipBrowser.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/DataSetRelationshipBrowser.java @@ -18,12 +18,12 @@ package ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.da import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data.AbstractExternalDataGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetRelationshipRole; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetBatchUpdateForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetBatchUpdateForm.java index dc73727da2fb1f8af27ee7c8ddcddac0aca02b84..64fe795639c3132c14c1364323abbb96afc92552 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetBatchUpdateForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetBatchUpdateForm.java @@ -16,10 +16,10 @@ package ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.dataset; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.UrlParamsHelper; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.AbstractBatchRegistrationForm; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.BatchOperationKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewer.java index 49b00399bee31f280850541ea68179de1e75f439..392817b4bc79f0569ff1dab837cbfe21293441af 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewer.java @@ -36,7 +36,6 @@ import com.google.gwt.user.client.ui.Widget; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.TabContent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DatabaseModificationAwareComponent; @@ -56,6 +55,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDele import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedActionWithResult; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DisplayedOrSelectedDatasetCriteria; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdAndCodeHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AbstractExternalData; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/AbstractExperimentBatchRegistrationForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/AbstractExperimentBatchRegistrationForm.java index 29a5cebf7554a785688277bece6f9cca6c28e99a..03ab1deaa8c9b033124dd2d8700902796b220366 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/AbstractExperimentBatchRegistrationForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/AbstractExperimentBatchRegistrationForm.java @@ -16,10 +16,10 @@ package ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.experiment; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.UrlParamsHelper; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.AbstractBatchRegistrationForm; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.BatchOperationKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExperimentType; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ExperimentDataSetBrowser.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ExperimentDataSetBrowser.java index 13f42e726847b34856c6d45866823472947ac95d..5c3d05a7909cdbb262ae5a27d325fe8d1e208088 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ExperimentDataSetBrowser.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ExperimentDataSetBrowser.java @@ -18,7 +18,6 @@ package ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.ex import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data.AbstractExternalDataGrid; @@ -26,6 +25,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.ID import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDirectlyConnectedController; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.BasicEntityType; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ExperimentPropertiesPanel.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ExperimentPropertiesPanel.java index e082dfe2738998751716cefb669479e6c843e1ee..901801f6963d4ab043adabf32f3b7d6174a69ed9 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ExperimentPropertiesPanel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ExperimentPropertiesPanel.java @@ -29,7 +29,6 @@ import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AbstractDatabaseModificationObserverWithCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.IDatabaseModificationObserverWithCallback; @@ -37,6 +36,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.Propert import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.property.PropertyGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.ExternalHyperlink; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.ObjectKind; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ExperimentSamplesSection.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ExperimentSamplesSection.java index ac3b2f3766a5500fabced4ec660ee5ee18063d7b..da8d001bc47fbddc2bf2beedbd170c889bf84b4c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ExperimentSamplesSection.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/ExperimentSamplesSection.java @@ -20,12 +20,12 @@ import com.extjs.gxt.ui.client.widget.form.CheckBox; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; import ch.systemsx.cisd.openbis.generic.client.web.client.application.DisposableTabContent; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.TabContent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample.SampleBrowserGrid; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdAndCodeHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.BasicEntityType; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentRegistrationForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentRegistrationForm.java index fba2c0356e50614a1b76d6ee4d10420efcd44018..f578b53acd4f30a61f2e1dc898395eab59fbac9c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentRegistrationForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentRegistrationForm.java @@ -38,7 +38,6 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewExperiment; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Project; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.api.IManagedInputWidgetDescription; import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.IGenericClientServiceAsync; -import ch.systemsx.cisd.openbis.plugin.query.client.web.client.application.Dict; /** * The <i>generic</i> experiment registration form. @@ -95,7 +94,7 @@ public final class GenericExperimentRegistrationForm extends protected List<IMessageElement> createSuccessfullRegistrationInfo(Experiment experiment) { List<IMessageElement> message = new ArrayList<IMessageElement>(); - message.add(new HtmlMessageElement(viewContext.getMessage(Dict.EXPERIMENT))); + message.add(new HtmlMessageElement(viewContext.getMessage("experiment"))); message.add(new EntityLinkMessageElement(viewContext, createExperimentIdentifier(), EntityKind.EXPERIMENT, experiment.getPermId())); message.add(new HtmlMessageElement("successfully registered")); return message; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewer.java index 1643cf50fe71fdcb2aeb7e932d5e74f12c329ae2..cffdae78d19164ce9f81916a99c93f8b26b1934f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentViewer.java @@ -31,7 +31,6 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAs import ch.systemsx.cisd.openbis.generic.client.web.client.application.AttachmentVersionsSection; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; import ch.systemsx.cisd.openbis.generic.client.web.client.application.DisposableTabContent; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.CompositeDatabaseModificationObserver; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.CompositeDatabaseModificationObserverWithMainObserver; @@ -48,6 +47,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget. import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDirectlyConnectedController; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.IAttachmentHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdAndCodeHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/material/AbstractMaterialBatchRegistrationForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/material/AbstractMaterialBatchRegistrationForm.java index 36c66ab4816f0dee587753c24182a20c48d1b23f..38339e80a0a6439c3377716ef7a980718104301b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/material/AbstractMaterialBatchRegistrationForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/material/AbstractMaterialBatchRegistrationForm.java @@ -16,10 +16,10 @@ package ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.material; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.UrlParamsHelper; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.AbstractBatchRegistrationForm; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.BatchOperationKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialType; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/material/GenericMaterialViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/material/GenericMaterialViewer.java index 6872e36e1f52c47d42f60f1096bbf743f9448c88..5b336e6bf4251e965f5e41c1faddb57796ea72c2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/material/GenericMaterialViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/material/GenericMaterialViewer.java @@ -30,7 +30,6 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.TabContent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AbstractDatabaseModificationObserverWithCallback; @@ -43,6 +42,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.Propert import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.property.EntityHistoryGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.property.PropertyGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.SectionsPanel; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.ObjectKind; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/AbstractSampleBatchRegistrationForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/AbstractSampleBatchRegistrationForm.java index a7c072c4c0e1e21d2ade57445a24b9588b6f7dee..420b42d06fb7fe83a7dd61644261d50977562a91 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/AbstractSampleBatchRegistrationForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/AbstractSampleBatchRegistrationForm.java @@ -16,9 +16,9 @@ package ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.sample; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.AbstractBatchRegistrationForm; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleType; import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.IGenericClientServiceAsync; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/ContainerSamplesSection.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/ContainerSamplesSection.java index d73d8f032ef56459a75d93d3fa61ba47fdca18af..5ac66e5bb8b502c8fd5d7ace4bc7bf48d58a73df 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/ContainerSamplesSection.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/ContainerSamplesSection.java @@ -18,12 +18,12 @@ package ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.sa import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; import ch.systemsx.cisd.openbis.generic.client.web.client.application.DisposableTabContent; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.TabContent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample.SampleBrowserGrid; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/DerivedSamplesSection.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/DerivedSamplesSection.java index 78d61ed098ae2c74aa14650533aa779b39d99738..256591175b0c80ab8059b15e3f427c1d36a93485 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/DerivedSamplesSection.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/DerivedSamplesSection.java @@ -18,12 +18,12 @@ package ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.sa import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; import ch.systemsx.cisd.openbis.generic.client.web.client.application.DisposableTabContent; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.TabContent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample.SampleBrowserGrid; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java index 6da0442ff606bbdf4724e9ea9077cc62b1d3ebbb..685a9c1d900a03f91f481c2daa517d2a7acbb788 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewer.java @@ -35,7 +35,6 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAs import ch.systemsx.cisd.openbis.generic.client.web.client.application.AttachmentVersionsSection; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; import ch.systemsx.cisd.openbis.generic.client.web.client.application.DisposableTabContent; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.TabContent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AbstractDatabaseModificationObserverWithCallback; @@ -56,6 +55,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget. import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.EntityDeletionConfirmationUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GridRowModels; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ListSampleDisplayCriteria2; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.SampleChildrenInfo; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/ParentSamplesSection.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/ParentSamplesSection.java index f78f6233896cc77473e001ef3349814a1ec929cc..6034cd19b790855058e8fc2ca1ebc93d93f3fc04 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/ParentSamplesSection.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/ParentSamplesSection.java @@ -18,12 +18,12 @@ package ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.sa import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; import ch.systemsx.cisd.openbis.generic.client.web.client.application.DisposableTabContent; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.TabContent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample.SampleBrowserGrid; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/SampleDataSetBrowser.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/SampleDataSetBrowser.java index 8d20969d4a5ad780abd3d01b31c7ad13855f9473..8d6069229009320e432cb11757cfb2e17148c579 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/SampleDataSetBrowser.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/SampleDataSetBrowser.java @@ -18,7 +18,6 @@ package ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.sa import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data.AbstractExternalDataGrid; @@ -26,6 +25,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.ID import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDirectlyConnectedController; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.BasicEntityType; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/Constants.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/Constants.java index 1d59198551d0f3c5af340aacba5b70f650c19d98..a163c6370b987e4c92a9d198a85b80fe57c2924f 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/Constants.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/Constants.java @@ -16,7 +16,7 @@ package ch.systemsx.cisd.openbis.plugin.query.client.web.client.application; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; /** * @author Franz-Josef Elmer diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/QueryModule.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/QueryModule.java index 92e010cfed99577527216d031bf321342c5e0f0d..3fb2ec5a067bb83e362fc56bd7a7bd65a48466a4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/QueryModule.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/QueryModule.java @@ -26,9 +26,9 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.DisposableTabContent; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.plugin.IModule; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithIdentifier; import ch.systemsx.cisd.openbis.plugin.query.client.web.client.IQueryClientServiceAsync; import ch.systemsx.cisd.openbis.plugin.query.client.web.client.application.module.QueryModuleDatabaseMenuItem; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/locator/QueryLocatorResolver.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/locator/QueryLocatorResolver.java index 1638eef7ef1f8cb7a1226b496a776cd5219bc59b..7936efe67b2cace1cda0048fef07059fee2a5414 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/locator/QueryLocatorResolver.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/locator/QueryLocatorResolver.java @@ -15,6 +15,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.IV import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.ViewLocator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.ITabActionMenuItemDefinition; import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; +import ch.systemsx.cisd.openbis.generic.shared.basic.BasicConstant; import ch.systemsx.cisd.openbis.generic.shared.basic.URLMethodWithParameters; import ch.systemsx.cisd.openbis.plugin.query.client.web.client.IQueryClientServiceAsync; import ch.systemsx.cisd.openbis.plugin.query.client.web.client.application.QueryParameterValue; @@ -101,7 +102,7 @@ public class QueryLocatorResolver extends AbstractViewLocatorResolver public static String createQueryBrowserLink() { URLMethodWithParameters url = new URLMethodWithParameters(""); - url.addParameter(ViewLocator.ACTION_PARAMETER, QUERY_ACTION); + url.addParameter(BasicConstant.LOCATOR_ACTION_PARAMETER, QUERY_ACTION); return url.toString().substring(1); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/module/QueryEditor.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/module/QueryEditor.java index c48fc2c81d7431dec5865b082bf4210c73990950..0e39a00be66f04fa0792b4ce03664a96e43fb18c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/module/QueryEditor.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/module/QueryEditor.java @@ -43,7 +43,6 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.ICommonClientServiceAsync; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.SampleTypeDisplayID; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data.DataSetTypeSelectionWidget; @@ -62,6 +61,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget. import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.FieldUtil; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.ExpressionUtil; import ch.systemsx.cisd.openbis.generic.shared.basic.IReportInformationProvider; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/module/QueryModuleDatabaseMenuItem.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/module/QueryModuleDatabaseMenuItem.java index 455d915f6524043783b1dfaead57e112124e1eb9..930eb4a23431e90700508d63fe4776ab396d1933 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/module/QueryModuleDatabaseMenuItem.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/module/QueryModuleDatabaseMenuItem.java @@ -21,11 +21,11 @@ import java.util.HashMap; import com.extjs.gxt.ui.client.widget.menu.Menu; import com.extjs.gxt.ui.client.widget.menu.MenuItem; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DatabaseModificationAwareComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.ITabActionMenuItemDefinition; import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.TabActionMenuItemFactory; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.plugin.query.client.web.client.IQueryClientServiceAsync; import ch.systemsx.cisd.openbis.plugin.query.client.web.client.application.Dict; import ch.systemsx.cisd.openbis.plugin.query.client.web.client.application.QueryModule; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/module/RunCustomQueryToolbar.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/module/RunCustomQueryToolbar.java index 2b836724b10121624667541b568a81d5cc7538b2..6e45f484c8ed6993dd7db9616516852d1b182236 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/module/RunCustomQueryToolbar.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/module/RunCustomQueryToolbar.java @@ -22,8 +22,8 @@ import com.extjs.gxt.ui.client.Style.HorizontalAlignment; import com.extjs.gxt.ui.client.widget.form.TextArea; import com.extjs.gxt.ui.client.widget.toolbar.LabelToolItem; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; import ch.systemsx.cisd.openbis.plugin.query.client.web.client.IQueryClientServiceAsync; import ch.systemsx.cisd.openbis.plugin.query.client.web.client.application.Dict; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/common/search/DateFieldSearchCriteria.js b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/common/search/DateFieldSearchCriteria.js index 4219295500f7e82657f951fbcccf87f0fd6a4722..87d9e0dbdc8a620c9eafff1368e78766e10847c1 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/common/search/DateFieldSearchCriteria.js +++ b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/common/search/DateFieldSearchCriteria.js @@ -1,7 +1,10 @@ define([ "require", "stjs", "util/Exceptions", "as/dto/common/search/AbstractFieldSearchCriteria", "as/dto/common/search/ServerTimeZone", "as/dto/common/search/ShortDateFormat", "as/dto/common/search/NormalDateFormat", "as/dto/common/search/LongDateFormat", "as/dto/common/search/DateEqualToValue", "as/dto/common/search/DateObjectEqualToValue", - "as/dto/common/search/DateLaterThanOrEqualToValue", "as/dto/common/search/DateObjectLaterThanOrEqualToValue", "as/dto/common/search/DateEarlierThanOrEqualToValue", - "as/dto/common/search/DateObjectEarlierThanOrEqualToValue", "as/dto/common/search/TimeZone", "as/dto/common/search/AbstractDateValue", "util/DateFormat" ], function(require, stjs, exceptions, + "as/dto/common/search/DateLaterThanValue", "as/dto/common/search/DateLaterThanOrEqualToValue", + "as/dto/common/search/DateObjectLaterThanValue", "as/dto/common/search/DateObjectLaterThanOrEqualToValue", + "as/dto/common/search/DateEarlierThanValue", "as/dto/common/search/DateEarlierThanOrEqualToValue", + "as/dto/common/search/DateObjectEarlierThanValue", "as/dto/common/search/DateObjectEarlierThanOrEqualToValue", + "as/dto/common/search/TimeZone", "as/dto/common/search/AbstractDateValue", "util/DateFormat" ], function(require, stjs, exceptions, AbstractFieldSearchCriteria, ServerTimeZone) { var DateFieldSearchCriteria = function(fieldName, fieldType) { AbstractFieldSearchCriteria.call(this, fieldName, fieldType); diff --git a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/DeleteVocabularyTermTest.java b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/DeleteVocabularyTermTest.java index 27275f6fd0f4eca2c7ba0996baea987009bfda92..07a1d7cb5127bf87398170c760c6ffc70db6925e 100644 --- a/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/DeleteVocabularyTermTest.java +++ b/openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/DeleteVocabularyTermTest.java @@ -23,6 +23,7 @@ import static org.testng.Assert.fail; import java.util.Arrays; import java.util.List; import java.util.UUID; +import java.util.stream.Collectors; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -34,10 +35,12 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.material.id.MaterialPermId; import ch.ethz.sis.openbis.generic.asapi.v3.dto.sample.Sample; import ch.ethz.sis.openbis.generic.asapi.v3.dto.sample.fetchoptions.SampleFetchOptions; import ch.ethz.sis.openbis.generic.asapi.v3.dto.sample.id.SamplePermId; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.Vocabulary; import ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.VocabularyTerm; import ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.create.VocabularyCreation; import ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.create.VocabularyTermCreation; import ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.delete.VocabularyTermDeletionOptions; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.fetchoptions.VocabularyFetchOptions; import ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.fetchoptions.VocabularyTermFetchOptions; import ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.id.IVocabularyTermId; import ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.id.VocabularyPermId; @@ -115,6 +118,39 @@ public class DeleteVocabularyTermTest extends AbstractVocabularyTermTest assertVocabularyTermPermIds(terms, termIdA, termIdB); } + @Test + public void testDeleteAllTerms() + { + String sessionToken = v3api.login(TEST_USER, PASSWORD); + + VocabularyTermCreation term1Creation = new VocabularyTermCreation(); + term1Creation.setCode("TERM_TO_DELETE_1"); + + VocabularyTermCreation term2Creation = new VocabularyTermCreation(); + term2Creation.setCode("TERM_TO_DELETE_2"); + + VocabularyCreation vocabularyCreation = new VocabularyCreation(); + vocabularyCreation.setCode("VOCABULARY_WITH_ALL_TERMS_TO_DELETE"); + vocabularyCreation.setTerms(Arrays.asList(term1Creation, term2Creation)); + + VocabularyPermId vocabularyId = v3api.createVocabularies(sessionToken, Arrays.asList(vocabularyCreation)).get(0); + + VocabularyFetchOptions fo = new VocabularyFetchOptions(); + fo.withTerms(); + + Vocabulary vocabularyBefore = v3api.getVocabularies(sessionToken, Arrays.asList(vocabularyId), fo).get(vocabularyId); + assertEquals(vocabularyBefore.getTerms().size(), 2); + + VocabularyTermDeletionOptions deletionOptions = new VocabularyTermDeletionOptions(); + deletionOptions.setReason("deleting all terms"); + + v3api.deleteVocabularyTerms(sessionToken, vocabularyBefore.getTerms().stream().map(term -> term.getPermId()).collect(Collectors.toList()), + deletionOptions); + + Vocabulary vocabularyAfter = v3api.getVocabularies(sessionToken, Arrays.asList(vocabularyId), fo).get(vocabularyId); + assertEquals(vocabularyAfter.getTerms().size(), 0); + } + @DataProvider public Object[][] providerTestDeleteTermFromInternallyManagedVocabulary() { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/GWTTestUtil.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/GWTTestUtil.java index 3fc5260c96ca964b4985bd537bd97e39c26b5a19..1ada8dcda617823910237eb89fdb98d88f3c2787 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/GWTTestUtil.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/GWTTestUtil.java @@ -51,13 +51,13 @@ import com.google.gwt.user.client.ui.ListBox; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.Widget; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.ActionMenu; import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.IActionMenuItem; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.ModelDataPropertyNames; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.BrowserGridPagingToolBar; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.TextToolItem; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.PropertyField; /** diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractClientServiceTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractClientServiceTest.java index d29d4f15bc63f6fdebcc1bc305e5e2cd96277bd4..f4e44ccef7944af5777ef3569de0f9245175061e 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractClientServiceTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/AbstractClientServiceTest.java @@ -28,7 +28,7 @@ import org.testng.annotations.BeforeMethod; import ch.systemsx.cisd.common.servlet.IRequestContextProvider; import ch.systemsx.cisd.openbis.generic.client.web.client.IClientService; import ch.systemsx.cisd.openbis.generic.client.web.server.resultset.IResultSetManager; -import ch.systemsx.cisd.openbis.generic.server.SessionConstants; +import ch.systemsx.cisd.openbis.generic.shared.basic.SessionConstants; /** * An <i>abstract</i> test class for all {@link IClientService} implementations. diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientServiceTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientServiceTest.java index ea55ce95833e1ad2c31f7303b2307820fecde108..da0cbae1fe03e339e4423b5681775d39617697e7 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientServiceTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/CommonClientServiceTest.java @@ -49,11 +49,11 @@ import ch.systemsx.cisd.openbis.generic.client.web.server.resultset.IOriginalDat import ch.systemsx.cisd.openbis.generic.client.web.server.resultset.IResultSet; import ch.systemsx.cisd.openbis.generic.client.web.server.resultset.IResultSetKeyGenerator; import ch.systemsx.cisd.openbis.generic.client.web.server.resultset.TableDataCache; -import ch.systemsx.cisd.openbis.generic.server.SessionConstants; import ch.systemsx.cisd.openbis.generic.server.business.ManagerTestTool; import ch.systemsx.cisd.openbis.generic.shared.CommonTestUtils; import ch.systemsx.cisd.openbis.generic.shared.ICommonServer; import ch.systemsx.cisd.openbis.generic.shared.WebClientConfigurationProvider; +import ch.systemsx.cisd.openbis.generic.shared.basic.SessionConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AbstractExternalData; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ColumnSetting; diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/HelpRedirectServletTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/HelpRedirectServletTest.java index 53898cdcc80df7e71307eecae9b29c46f51209ca..7b445c4878f61f98bd9998a83922575a1cbcb705 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/HelpRedirectServletTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/server/HelpRedirectServletTest.java @@ -28,7 +28,7 @@ import org.testng.annotations.Test; import ch.rinn.restrictions.Friend; import ch.systemsx.cisd.openbis.generic.client.web.client.IOnlineHelpResourceLocatorService; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; /** * @author Chandrasekhar Ramakrishnan diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/VocabularyBOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/VocabularyBOTest.java index a058bbf9c436d698733bd46f0ba00b4d64302299..d424f97ffea479292b6e06399ecf372998b51d34 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/VocabularyBOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/VocabularyBOTest.java @@ -369,16 +369,11 @@ public final class VocabularyBOTest extends AbstractBOTest VocabularyBO vocabularyBO = createVocabularyBO(); vocabularyBO.load("voc-code"); - try - { - vocabularyBO.delete(Arrays.asList(term1), - Collections.<VocabularyTermReplacement> emptyList()); - } catch (IllegalArgumentException e) - { - assertEquals("Deletion of all 1 terms are not allowed.", e.getMessage()); - } - assertEquals(1, vocabulary.getTerms().size()); + vocabularyBO.delete(Arrays.asList(term1), + Collections.<VocabularyTermReplacement> emptyList()); + + assertEquals(0, vocabulary.getTerms().size()); context.assertIsSatisfied(); } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/FillExperimentRegistrationForm.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/FillExperimentRegistrationForm.java index a1ebcfc93d4414cc5c0eae82f42d053e108bbe9a..6ec26a51c9570249abe771137df14491ee7a5506 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/FillExperimentRegistrationForm.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/FillExperimentRegistrationForm.java @@ -21,12 +21,12 @@ import java.util.List; import com.extjs.gxt.ui.client.widget.form.TextArea; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.ModelDataPropertyNames; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.AbstractRegistrationForm; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experiment.ProjectSelectionWidget; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.DropDownList; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.AbstractDefaultTestCommand; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestUtil; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/AttachmentDownloadServletTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/AttachmentDownloadServletTest.java index f1a69de288eec3ee77886149655003b999d2f63b..a6c5a2807bed89ffd7a17ef3e732267a3c279df0 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/AttachmentDownloadServletTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/AttachmentDownloadServletTest.java @@ -28,10 +28,10 @@ import org.testng.annotations.Test; import ch.rinn.restrictions.Friend; import ch.systemsx.cisd.openbis.generic.client.web.server.AbstractFileDownloadServlet.FileContent; -import ch.systemsx.cisd.openbis.generic.server.SessionConstants; import ch.systemsx.cisd.openbis.generic.shared.CommonTestUtils; import ch.systemsx.cisd.openbis.generic.shared.basic.AttachmentDownloadConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.GenericSharedConstants; +import ch.systemsx.cisd.openbis.generic.shared.basic.SessionConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AttachmentHolderKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AttachmentWithContent; import ch.systemsx.cisd.openbis.generic.shared.dto.AttachmentPE; diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/v1/GeneralInformationServiceTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/v1/GeneralInformationServiceTest.java index 400b1cc37a68f2b3c65994ce8b57aaf55982eefc..a61ad40a56b521c48ba101c5c631c03b73a1c051 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/v1/GeneralInformationServiceTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/api/v1/GeneralInformationServiceTest.java @@ -2805,19 +2805,23 @@ public class GeneralInformationServiceTest extends SystemTestCase MatchClauseTimeAttribute.MODIFICATION_DATE, CompareMode.LESS_THAN_OR_EQUAL, "2009-03-19", "+1")); - List<Material> materials = - generalInformationService.searchForMaterials(sessionToken, searchCriteria) - .stream().filter(m -> m.getMaterialTypeIdentifier().getMaterialTypeCode().equals("BACTERIUM") == false) - .collect(Collectors.toList()); - assertEquals(3728, materials.size()); + List<Material> materials = filter(generalInformationService.searchForMaterials(sessionToken, searchCriteria)); + assertEquals(2774, materials.size()); searchCriteria = new SearchCriteria(); searchCriteria.addMatchClause(MatchClause.createTimeAttributeMatch( MatchClauseTimeAttribute.MODIFICATION_DATE, CompareMode.GREATER_THAN_OR_EQUAL, "2009-03-19", "+1")); - materials = generalInformationService.searchForMaterials(sessionToken, searchCriteria); - assertEquals(2, materials.size()); + materials = filter(generalInformationService.searchForMaterials(sessionToken, searchCriteria)); + assertEquals(0, materials.size()); + } + + private List<Material> filter(List<Material> materials) + { + return materials + .stream().filter(m -> m.getMaterialTypeIdentifier().getMaterialTypeCode().equals("SIRNA")) + .collect(Collectors.toList()); } @Test diff --git a/openbis_knime/build.gradle b/openbis_knime/build.gradle index be6583504a7adef77f1b82aac723506b227e5925..8b7f7f884d87c645eecafaa1ccf6af2f17eabc5b 100644 --- a/openbis_knime/build.gradle +++ b/openbis_knime/build.gradle @@ -7,7 +7,7 @@ dependencies { 'openbis:dss:+', 'openbis:query:+', 'rinn:restrictions:+', - 'javax.activation:activation:1.1.1' // TODO: Add to ivy repository and remove mavenCentral() from repository.gradle + 'javax.activation:activation:1.1.1' testCompile 'testng:testng:+', 'hamcrest:hamcrest-integration:+', diff --git a/openbis_ng_ui/src/js/components/types/form/TypeFormControllerChange.js b/openbis_ng_ui/src/js/components/types/form/TypeFormControllerChange.js index 50a67b10e920f020fc126b2042b5b89ddd3ea5f6..1c1bbe8550298970bbb14602e42e3f63edf178e2 100644 --- a/openbis_ng_ui/src/js/components/types/form/TypeFormControllerChange.js +++ b/openbis_ng_ui/src/js/components/types/form/TypeFormControllerChange.js @@ -209,15 +209,15 @@ export default class TypeFormControllerChange extends PageControllerChange { }, vocabulary: { ...newProperty.vocabulary, - enabled: !systemInternalPropertyType + enabled: !systemInternalPropertyType && !isGlobal }, materialType: { ...newProperty.materialType, - enabled: !systemInternalPropertyType + enabled: !systemInternalPropertyType && !isGlobal }, sampleType: { ...newProperty.sampleType, - enabled: !systemInternalPropertyType + enabled: !systemInternalPropertyType && !isGlobal }, plugin: { ...newProperty.plugin, diff --git a/openbis_ng_ui/srcTest/js/common/fixture.js b/openbis_ng_ui/srcTest/js/common/fixture.js index 6f13cefad4c51d684b9d8446e2c2eb3ba6feec25..6cd9060e2f6e803a2401125315bc11eb82bba7cf 100644 --- a/openbis_ng_ui/srcTest/js/common/fixture.js +++ b/openbis_ng_ui/srcTest/js/common/fixture.js @@ -32,6 +32,9 @@ ANOTHER_USER_GROUP_DTO.setUsers([ANOTHER_USER_DTO]) const TEST_PLUGIN_DTO = new openbis.Plugin() TEST_PLUGIN_DTO.setName('TEST_PLUGIN') +const ANOTHER_PLUGIN_DTO = new openbis.Plugin() +ANOTHER_PLUGIN_DTO.setName('ANOTHER_PLUGIN') + const TEST_PROPERTY_TYPE_1_DTO = new openbis.PropertyType() TEST_PROPERTY_TYPE_1_DTO.setCode('TEST_PROPERTY_TYPE_1') TEST_PROPERTY_TYPE_1_DTO.setPermId( @@ -158,6 +161,7 @@ export default { TEST_USER_GROUP_DTO, ANOTHER_USER_GROUP_DTO, TEST_PLUGIN_DTO, + ANOTHER_PLUGIN_DTO, TEST_PROPERTY_TYPE_1_DTO, TEST_PROPERTY_TYPE_2_DTO, TEST_PROPERTY_TYPE_3_DTO, diff --git a/openbis_ng_ui/srcTest/js/components/AppComponentLogin.test.js b/openbis_ng_ui/srcTest/js/components/AppComponentLogin.test.js new file mode 100644 index 0000000000000000000000000000000000000000..0d10d5cb63298a7c5d891d9c6e83ebc95a7dcc0c --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/AppComponentLogin.test.js @@ -0,0 +1,67 @@ +import AppComponentTest from '@srcTest/js/components/AppComponentTest.js' + +let common = null + +beforeEach(() => { + common = new AppComponentTest() + common.beforeEach() +}) + +describe(AppComponentTest.SUITE, () => { + test('login', testLogin) +}) + +async function testLogin() { + const app = await common.mount() + + app.expectJSON({ + login: { + user: { + value: null, + enabled: true + }, + password: { + value: null, + enabled: true + }, + button: { + enabled: true + } + }, + menu: null, + types: null, + users: null + }) + + await common.login(app) + + app.expectJSON({ + login: null, + menu: { + tabs: [ + { + label: 'Types', + selected: true + } + ] + }, + types: { + browser: { + filter: { + value: null + }, + nodes: [ + { level: 0, text: 'Object Types' }, + { level: 0, text: 'Collection Types' }, + { level: 0, text: 'Data Set Types' }, + { level: 0, text: 'Material Types' }, + { level: 0, text: 'Vocabulary Types' } + ] + }, + content: { + tabs: [] + } + }, + users: null + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/AppComponent.test.js b/openbis_ng_ui/srcTest/js/components/AppComponentOpenCloseTypes.test.js similarity index 58% rename from openbis_ng_ui/srcTest/js/components/AppComponent.test.js rename to openbis_ng_ui/srcTest/js/components/AppComponentOpenCloseTypes.test.js index 91d7772cafd252c4937b8533009e189dcebc2597..91ad207e4ade20a1485cfc2d9349f71a03ab048a 100644 --- a/openbis_ng_ui/srcTest/js/components/AppComponent.test.js +++ b/openbis_ng_ui/srcTest/js/components/AppComponentOpenCloseTypes.test.js @@ -1,89 +1,18 @@ -import React from 'react' -import ComponentTest from '@srcTest/js/components/common/ComponentTest.js' -import AppWrapper from '@srcTest/js/components/wrapper/AppWrapper.js' -import App from '@src/js/components/App.jsx' +import AppComponentTest from '@srcTest/js/components/AppComponentTest.js' import openbis from '@srcTest/js/services/openbis.js' import fixture from '@srcTest/js/common/fixture.js' let common = null beforeEach(() => { - common = new ComponentTest( - () => <App />, - wrapper => new AppWrapper(wrapper) - ) + common = new AppComponentTest() common.beforeEach() - - openbis.login.mockReturnValue(Promise.resolve('testSession')) - openbis.mockSearchSampleTypes([]) - openbis.mockSearchExperimentTypes([]) - openbis.mockSearchDataSetTypes([]) - openbis.mockSearchMaterialTypes([]) - openbis.mockSearchVocabularies([]) - openbis.mockSearchPersons([]) - openbis.mockSearchGroups([]) }) -describe('app', () => { - test('login', testLogin) +describe(AppComponentTest.SUITE, () => { test('open/close types', testOpenCloseTypes) }) -async function testLogin() { - const app = await common.mount() - - app.expectJSON({ - login: { - user: { - value: null, - enabled: true - }, - password: { - value: null, - enabled: true - }, - button: { - enabled: true - } - }, - menu: null, - types: null, - users: null - }) - - await login(app) - - app.expectJSON({ - login: null, - menu: { - tabs: [ - { - label: 'Types', - selected: true - } - ] - }, - types: { - browser: { - filter: { - value: null - }, - nodes: [ - { level: 0, text: 'Object Types' }, - { level: 0, text: 'Collection Types' }, - { level: 0, text: 'Data Set Types' }, - { level: 0, text: 'Material Types' }, - { level: 0, text: 'Vocabulary Types' } - ] - }, - content: { - tabs: [] - } - }, - users: null - }) -} - async function testOpenCloseTypes() { openbis.mockSearchSampleTypes([ fixture.TEST_SAMPLE_TYPE_DTO, @@ -92,7 +21,7 @@ async function testOpenCloseTypes() { const app = await common.mount() - await login(app) + await common.login(app) app.getTypes().getBrowser().getNodes()[0].getIcon().click() await app.update() @@ -172,10 +101,3 @@ async function testOpenCloseTypes() { } }) } - -async function login(app) { - app.getLogin().getUser().change('testUser') - app.getLogin().getPassword().change('testPassword') - app.getLogin().getButton().click() - await app.update() -} diff --git a/openbis_ng_ui/srcTest/js/components/AppComponentTest.js b/openbis_ng_ui/srcTest/js/components/AppComponentTest.js new file mode 100644 index 0000000000000000000000000000000000000000..ea692cf30a149542938cfa9e57ceeb82d2b99536 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/AppComponentTest.js @@ -0,0 +1,36 @@ +import React from 'react' +import ComponentTest from '@srcTest/js/components/common/ComponentTest.js' +import AppWrapper from '@srcTest/js/components/wrapper/AppWrapper.js' +import App from '@src/js/components/App.jsx' +import openbis from '@srcTest/js/services/openbis.js' + +export default class AppComponentTest extends ComponentTest { + static SUITE = 'AppComponent' + + constructor() { + super( + () => <App />, + wrapper => new AppWrapper(wrapper) + ) + } + + async beforeEach() { + super.beforeEach() + + openbis.login.mockReturnValue(Promise.resolve('testSession')) + openbis.mockSearchSampleTypes([]) + openbis.mockSearchExperimentTypes([]) + openbis.mockSearchDataSetTypes([]) + openbis.mockSearchMaterialTypes([]) + openbis.mockSearchVocabularies([]) + openbis.mockSearchPersons([]) + openbis.mockSearchGroups([]) + } + + async login(app) { + app.getLogin().getUser().change('testUser') + app.getLogin().getPassword().change('testPassword') + app.getLogin().getButton().click() + await app.update() + } +} diff --git a/openbis_ng_ui/srcTest/js/components/common/form/wrapper/AutocompleterFieldWrapper.js b/openbis_ng_ui/srcTest/js/components/common/form/wrapper/AutocompleterFieldWrapper.js index 0c723599cdd502c1982d3a7846a321ae64e64b65..8e654ff2d33197fb8c9572772fb7c5c25ed46db0 100644 --- a/openbis_ng_ui/srcTest/js/components/common/form/wrapper/AutocompleterFieldWrapper.js +++ b/openbis_ng_ui/srcTest/js/components/common/form/wrapper/AutocompleterFieldWrapper.js @@ -8,4 +8,18 @@ export default class AutocompleterFieldWrapper extends FieldWrapper { return false } } + getOptions() { + return this.wrapper.prop('options') + } + + toJSON() { + if (this.wrapper.exists()) { + return { + ...super.toJSON(), + options: this.getOptions() + } + } else { + return null + } + } } diff --git a/openbis_ng_ui/srcTest/js/components/login/LoginComponent.test.js b/openbis_ng_ui/srcTest/js/components/login/LoginComponent.test.js deleted file mode 100644 index 4fd904e0fe8e6542d6ec2d3eaa2dab395d560461..0000000000000000000000000000000000000000 --- a/openbis_ng_ui/srcTest/js/components/login/LoginComponent.test.js +++ /dev/null @@ -1,95 +0,0 @@ -import React from 'react' -import ComponentTest from '@srcTest/js/components/common/ComponentTest.js' -import Login from '@src/js/components/login/Login.jsx' -import LoginWrapper from '@srcTest/js/components/login/wrapper/LoginWrapper.js' - -let common = null - -beforeEach(() => { - common = new ComponentTest( - () => <Login />, - wrapper => new LoginWrapper(wrapper) - ) - common.beforeEach() -}) - -describe('login', () => { - test('test', async () => { - const login = await common.mount() - - login.expectJSON({ - user: { - value: null, - focused: true, - error: null - }, - password: { - value: null, - focused: false, - error: null - }, - button: { - enabled: true - } - }) - - login.getButton().click() - await login.update() - - login.expectJSON({ - user: { - value: null, - focused: true, - error: 'User cannot be empty' - }, - password: { - value: null, - focused: false, - error: 'Password cannot be empty' - }, - button: { - enabled: true - } - }) - - login.getUser().change('testUser') - login.getButton().click() - await login.update() - - login.expectJSON({ - user: { - value: 'testUser', - focused: false, - error: null - }, - password: { - value: null, - focused: true, - error: 'Password cannot be empty' - }, - button: { - enabled: true - } - }) - - login.getPassword().change('testPassword') - login.getButton().click() - await login.update() - - login.expectJSON({ - user: { - value: 'testUser', - focused: false, - error: null - }, - password: { - value: 'testPassword', - focused: true, - error: null - }, - button: { - enabled: true - } - }) - }) -}) diff --git a/openbis_ng_ui/srcTest/js/components/login/LoginComponentLogin.test.js b/openbis_ng_ui/srcTest/js/components/login/LoginComponentLogin.test.js new file mode 100644 index 0000000000000000000000000000000000000000..900bdee2ab153222ba8b54f712fc857f36b037bb --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/login/LoginComponentLogin.test.js @@ -0,0 +1,91 @@ +import LoginComponentTest from '@srcTest/js/components/login/LoginComponentTest.js' + +let common = null + +beforeEach(() => { + common = new LoginComponentTest() + common.beforeEach() +}) + +describe(LoginComponentTest.SUITE, () => { + test('login', testLogin) +}) + +async function testLogin() { + const login = await common.mount() + + login.expectJSON({ + user: { + value: null, + focused: true, + error: null + }, + password: { + value: null, + focused: false, + error: null + }, + button: { + enabled: true + } + }) + + login.getButton().click() + await login.update() + + login.expectJSON({ + user: { + value: null, + focused: true, + error: 'User cannot be empty' + }, + password: { + value: null, + focused: false, + error: 'Password cannot be empty' + }, + button: { + enabled: true + } + }) + + login.getUser().change('testUser') + login.getButton().click() + await login.update() + + login.expectJSON({ + user: { + value: 'testUser', + focused: false, + error: null + }, + password: { + value: null, + focused: true, + error: 'Password cannot be empty' + }, + button: { + enabled: true + } + }) + + login.getPassword().change('testPassword') + login.getButton().click() + await login.update() + + login.expectJSON({ + user: { + value: 'testUser', + focused: false, + error: null + }, + password: { + value: 'testPassword', + focused: true, + error: null + }, + button: { + enabled: true + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/login/LoginComponentTest.js b/openbis_ng_ui/srcTest/js/components/login/LoginComponentTest.js new file mode 100644 index 0000000000000000000000000000000000000000..930ffef13a5fceacd3e4f66c0be39633499630ea --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/login/LoginComponentTest.js @@ -0,0 +1,15 @@ +import React from 'react' +import ComponentTest from '@srcTest/js/components/common/ComponentTest.js' +import Login from '@src/js/components/login/Login.jsx' +import LoginWrapper from '@srcTest/js/components/login/wrapper/LoginWrapper.js' + +export default class LoginComponentTest extends ComponentTest { + static SUITE = 'LoginComponent' + + constructor() { + super( + () => <Login />, + wrapper => new LoginWrapper(wrapper) + ) + } +} diff --git a/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserComponent.test.js b/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserComponent.test.js deleted file mode 100644 index ab13b2a73d81b17292ec1c3077d1f719ed49fffb..0000000000000000000000000000000000000000 --- a/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserComponent.test.js +++ /dev/null @@ -1,235 +0,0 @@ -import React from 'react' -import ComponentTest from '@srcTest/js/components/common/ComponentTest.js' -import BrowserWrapper from '@srcTest/js/components/common/browser/wrapper/BrowserWrapper.js' -import TypeBrowser from '@src/js/components/types/browser/TypeBrowser.jsx' -import openbis from '@srcTest/js/services/openbis.js' -import fixture from '@srcTest/js/common/fixture.js' - -let common = null - -beforeEach(() => { - common = new ComponentTest( - () => <TypeBrowser />, - wrapper => new BrowserWrapper(wrapper) - ) - common.beforeEach() - - openbis.mockSearchSampleTypes([ - fixture.TEST_SAMPLE_TYPE_DTO, - fixture.ANOTHER_SAMPLE_TYPE_DTO - ]) - - openbis.mockSearchExperimentTypes([fixture.TEST_EXPERIMENT_TYPE_DTO]) - openbis.mockSearchDataSetTypes([fixture.TEST_DATA_SET_TYPE_DTO]) - - openbis.mockSearchMaterialTypes([ - fixture.TEST_MATERIAL_TYPE_DTO, - fixture.ANOTHER_MATERIAL_TYPE_DTO - ]) - - openbis.mockSearchVocabularies([ - fixture.TEST_VOCABULARY_DTO, - fixture.ANOTHER_VOCABULARY_DTO - ]) -}) - -describe('type browser', () => { - test('load', testLoad) - test('open/close', testOpenClose) - test('filter', testFilter) - test('select entity kind', testSelectEntityKind) - test('select entity type', testSelectEntityType) -}) - -async function testLoad() { - const browser = await common.mount() - - browser.expectJSON({ - filter: { - value: null - }, - nodes: [ - { level: 0, text: 'Object Types' }, - { level: 0, text: 'Collection Types' }, - { level: 0, text: 'Data Set Types' }, - { level: 0, text: 'Material Types' }, - { level: 0, text: 'Vocabulary Types' } - ] - }) -} - -async function testOpenClose() { - const browser = await common.mount() - - browser.getNodes()[0].getIcon().click() - await browser.update() - - browser.expectJSON({ - filter: { - value: null - }, - nodes: [ - { level: 0, text: 'Object Types' }, - { level: 1, text: fixture.ANOTHER_SAMPLE_TYPE_DTO.code }, - { level: 1, text: fixture.TEST_SAMPLE_TYPE_DTO.code }, - { level: 0, text: 'Collection Types' }, - { level: 0, text: 'Data Set Types' }, - { level: 0, text: 'Material Types' }, - { level: 0, text: 'Vocabulary Types' } - ] - }) - - browser.getNodes()[0].getIcon().click() - await browser.update() - - browser.expectJSON({ - filter: { - value: null - }, - nodes: [ - { level: 0, text: 'Object Types' }, - { level: 0, text: 'Collection Types' }, - { level: 0, text: 'Data Set Types' }, - { level: 0, text: 'Material Types' }, - { level: 0, text: 'Vocabulary Types' } - ] - }) -} - -async function testFilter() { - const browser = await common.mount() - - browser.getFilter().change('ANOTHER') - await browser.update() - - browser.expectJSON({ - filter: { - value: 'ANOTHER' - }, - nodes: [ - { level: 0, text: 'Object Types' }, - { level: 1, text: fixture.ANOTHER_SAMPLE_TYPE_DTO.code }, - { level: 0, text: 'Material Types' }, - { level: 1, text: fixture.ANOTHER_MATERIAL_TYPE_DTO.code }, - { level: 0, text: 'Vocabulary Types' }, - { level: 1, text: fixture.ANOTHER_VOCABULARY_DTO.code } - ] - }) - - browser.getFilter().getClearIcon().click() - await browser.update() - - browser.expectJSON({ - filter: { - value: null - }, - nodes: [ - { level: 0, text: 'Object Types' }, - { level: 1, text: fixture.ANOTHER_SAMPLE_TYPE_DTO.code }, - { level: 1, text: fixture.TEST_SAMPLE_TYPE_DTO.code }, - { level: 0, text: 'Collection Types' }, - { level: 1, text: fixture.TEST_EXPERIMENT_TYPE_DTO.code }, - { level: 0, text: 'Data Set Types' }, - { level: 1, text: fixture.TEST_DATA_SET_TYPE_DTO.code }, - { level: 0, text: 'Material Types' }, - { level: 1, text: fixture.ANOTHER_MATERIAL_TYPE_DTO.code }, - { level: 1, text: fixture.TEST_MATERIAL_TYPE_DTO.code }, - { level: 0, text: 'Vocabulary Types' }, - { level: 1, text: fixture.ANOTHER_VOCABULARY_DTO.code }, - { level: 1, text: fixture.TEST_VOCABULARY_DTO.code } - ] - }) -} - -async function testSelectEntityKind() { - const browser = await common.mount() - - browser.expectJSON({ - nodes: [ - { level: 0, text: 'Object Types', selected: false }, - { level: 0, text: 'Collection Types', selected: false }, - { level: 0, text: 'Data Set Types', selected: false }, - { level: 0, text: 'Material Types', selected: false }, - { level: 0, text: 'Vocabulary Types', selected: false } - ], - buttons: { - add: { - enabled: false - }, - remove: { - enabled: false - } - } - }) - - browser.getNodes()[0].click() - await browser.update() - - browser.expectJSON({ - nodes: [ - { level: 0, text: 'Object Types', selected: true }, - { level: 0, text: 'Collection Types', selected: false }, - { level: 0, text: 'Data Set Types', selected: false }, - { level: 0, text: 'Material Types', selected: false }, - { level: 0, text: 'Vocabulary Types', selected: false } - ], - buttons: { - add: { - enabled: true - }, - remove: { - enabled: false - } - } - }) -} - -async function testSelectEntityType() { - const browser = await common.mount() - - browser.getNodes()[0].getIcon().click() - await browser.update() - - browser.expectJSON({ - nodes: [ - { level: 0, text: 'Object Types', selected: false }, - { level: 1, text: fixture.ANOTHER_SAMPLE_TYPE_DTO.code, selected: false }, - { level: 1, text: fixture.TEST_SAMPLE_TYPE_DTO.code, selected: false }, - { level: 0, text: 'Collection Types', selected: false }, - { level: 0, text: 'Data Set Types', selected: false }, - { level: 0, text: 'Material Types', selected: false }, - { level: 0, text: 'Vocabulary Types', selected: false } - ], - buttons: { - add: { - enabled: false - }, - remove: { - enabled: false - } - } - }) - - browser.getNodes()[1].click() - await browser.update() - - browser.expectJSON({ - nodes: [ - { level: 0, text: 'Object Types', selected: false }, - { level: 1, text: fixture.ANOTHER_SAMPLE_TYPE_DTO.code, selected: true }, - { level: 1, text: fixture.TEST_SAMPLE_TYPE_DTO.code, selected: false }, - { level: 0, text: 'Collection Types', selected: false }, - { level: 0, text: 'Data Set Types', selected: false }, - { level: 0, text: 'Material Types', selected: false }, - { level: 0, text: 'Vocabulary Types', selected: false } - ], - buttons: { - add: { - enabled: false - }, - remove: { - enabled: true - } - } - }) -} diff --git a/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserComponentFilter.test.js b/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserComponentFilter.test.js new file mode 100644 index 0000000000000000000000000000000000000000..d492b88bc3b51f5f654bc4665ccb748b44d273bc --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserComponentFilter.test.js @@ -0,0 +1,58 @@ +import TypeBrowserComponentTest from '@srcTest/js/components/types/browser/TypeBrowserComponentTest.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new TypeBrowserComponentTest() + common.beforeEach() +}) + +describe(TypeBrowserComponentTest.SUITE, () => { + test('filter', testFilter) +}) + +async function testFilter() { + const browser = await common.mount() + + browser.getFilter().change('ANOTHER') + await browser.update() + + browser.expectJSON({ + filter: { + value: 'ANOTHER' + }, + nodes: [ + { level: 0, text: 'Object Types' }, + { level: 1, text: fixture.ANOTHER_SAMPLE_TYPE_DTO.code }, + { level: 0, text: 'Material Types' }, + { level: 1, text: fixture.ANOTHER_MATERIAL_TYPE_DTO.code }, + { level: 0, text: 'Vocabulary Types' }, + { level: 1, text: fixture.ANOTHER_VOCABULARY_DTO.code } + ] + }) + + browser.getFilter().getClearIcon().click() + await browser.update() + + browser.expectJSON({ + filter: { + value: null + }, + nodes: [ + { level: 0, text: 'Object Types' }, + { level: 1, text: fixture.ANOTHER_SAMPLE_TYPE_DTO.code }, + { level: 1, text: fixture.TEST_SAMPLE_TYPE_DTO.code }, + { level: 0, text: 'Collection Types' }, + { level: 1, text: fixture.TEST_EXPERIMENT_TYPE_DTO.code }, + { level: 0, text: 'Data Set Types' }, + { level: 1, text: fixture.TEST_DATA_SET_TYPE_DTO.code }, + { level: 0, text: 'Material Types' }, + { level: 1, text: fixture.ANOTHER_MATERIAL_TYPE_DTO.code }, + { level: 1, text: fixture.TEST_MATERIAL_TYPE_DTO.code }, + { level: 0, text: 'Vocabulary Types' }, + { level: 1, text: fixture.ANOTHER_VOCABULARY_DTO.code }, + { level: 1, text: fixture.TEST_VOCABULARY_DTO.code } + ] + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserComponentLoad.test.js b/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserComponentLoad.test.js new file mode 100644 index 0000000000000000000000000000000000000000..6516511132d2148d54a38d9fc6ccd3d849f201d6 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserComponentLoad.test.js @@ -0,0 +1,29 @@ +import TypeBrowserComponentTest from '@srcTest/js/components/types/browser/TypeBrowserComponentTest.js' + +let common = null + +beforeEach(() => { + common = new TypeBrowserComponentTest() + common.beforeEach() +}) + +describe(TypeBrowserComponentTest.SUITE, () => { + test('load', testLoad) +}) + +async function testLoad() { + const browser = await common.mount() + + browser.expectJSON({ + filter: { + value: null + }, + nodes: [ + { level: 0, text: 'Object Types' }, + { level: 0, text: 'Collection Types' }, + { level: 0, text: 'Data Set Types' }, + { level: 0, text: 'Material Types' }, + { level: 0, text: 'Vocabulary Types' } + ] + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserComponentOpenClose.test.js b/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserComponentOpenClose.test.js new file mode 100644 index 0000000000000000000000000000000000000000..d389cd3e8c3f3611902c868a8419dd766afc4349 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserComponentOpenClose.test.js @@ -0,0 +1,51 @@ +import TypeBrowserComponentTest from '@srcTest/js/components/types/browser/TypeBrowserComponentTest.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new TypeBrowserComponentTest() + common.beforeEach() +}) + +describe(TypeBrowserComponentTest.SUITE, () => { + test('open/close', testOpenClose) +}) + +async function testOpenClose() { + const browser = await common.mount() + + browser.getNodes()[0].getIcon().click() + await browser.update() + + browser.expectJSON({ + filter: { + value: null + }, + nodes: [ + { level: 0, text: 'Object Types' }, + { level: 1, text: fixture.ANOTHER_SAMPLE_TYPE_DTO.code }, + { level: 1, text: fixture.TEST_SAMPLE_TYPE_DTO.code }, + { level: 0, text: 'Collection Types' }, + { level: 0, text: 'Data Set Types' }, + { level: 0, text: 'Material Types' }, + { level: 0, text: 'Vocabulary Types' } + ] + }) + + browser.getNodes()[0].getIcon().click() + await browser.update() + + browser.expectJSON({ + filter: { + value: null + }, + nodes: [ + { level: 0, text: 'Object Types' }, + { level: 0, text: 'Collection Types' }, + { level: 0, text: 'Data Set Types' }, + { level: 0, text: 'Material Types' }, + { level: 0, text: 'Vocabulary Types' } + ] + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserComponentSelect.test.js b/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserComponentSelect.test.js new file mode 100644 index 0000000000000000000000000000000000000000..1e05a49bea1237e227dcdcac83fac4d421cd1e36 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserComponentSelect.test.js @@ -0,0 +1,107 @@ +import TypeBrowserComponentTest from '@srcTest/js/components/types/browser/TypeBrowserComponentTest.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new TypeBrowserComponentTest() + common.beforeEach() +}) + +describe(TypeBrowserComponentTest.SUITE, () => { + test('select entity kind', testSelectEntityKind) + test('select entity type', testSelectEntityType) +}) + +async function testSelectEntityKind() { + const browser = await common.mount() + + browser.expectJSON({ + nodes: [ + { level: 0, text: 'Object Types', selected: false }, + { level: 0, text: 'Collection Types', selected: false }, + { level: 0, text: 'Data Set Types', selected: false }, + { level: 0, text: 'Material Types', selected: false }, + { level: 0, text: 'Vocabulary Types', selected: false } + ], + buttons: { + add: { + enabled: false + }, + remove: { + enabled: false + } + } + }) + + browser.getNodes()[0].click() + await browser.update() + + browser.expectJSON({ + nodes: [ + { level: 0, text: 'Object Types', selected: true }, + { level: 0, text: 'Collection Types', selected: false }, + { level: 0, text: 'Data Set Types', selected: false }, + { level: 0, text: 'Material Types', selected: false }, + { level: 0, text: 'Vocabulary Types', selected: false } + ], + buttons: { + add: { + enabled: true + }, + remove: { + enabled: false + } + } + }) +} + +async function testSelectEntityType() { + const browser = await common.mount() + + browser.getNodes()[0].getIcon().click() + await browser.update() + + browser.expectJSON({ + nodes: [ + { level: 0, text: 'Object Types', selected: false }, + { level: 1, text: fixture.ANOTHER_SAMPLE_TYPE_DTO.code, selected: false }, + { level: 1, text: fixture.TEST_SAMPLE_TYPE_DTO.code, selected: false }, + { level: 0, text: 'Collection Types', selected: false }, + { level: 0, text: 'Data Set Types', selected: false }, + { level: 0, text: 'Material Types', selected: false }, + { level: 0, text: 'Vocabulary Types', selected: false } + ], + buttons: { + add: { + enabled: false + }, + remove: { + enabled: false + } + } + }) + + browser.getNodes()[1].click() + await browser.update() + + browser.expectJSON({ + nodes: [ + { level: 0, text: 'Object Types', selected: false }, + { level: 1, text: fixture.ANOTHER_SAMPLE_TYPE_DTO.code, selected: true }, + { level: 1, text: fixture.TEST_SAMPLE_TYPE_DTO.code, selected: false }, + { level: 0, text: 'Collection Types', selected: false }, + { level: 0, text: 'Data Set Types', selected: false }, + { level: 0, text: 'Material Types', selected: false }, + { level: 0, text: 'Vocabulary Types', selected: false } + ], + buttons: { + add: { + enabled: false + }, + remove: { + enabled: true + } + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserComponentTest.js b/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserComponentTest.js new file mode 100644 index 0000000000000000000000000000000000000000..eb943ad8621690cd2b97e034935f39c648e297bb --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserComponentTest.js @@ -0,0 +1,39 @@ +import React from 'react' +import ComponentTest from '@srcTest/js/components/common/ComponentTest.js' +import BrowserWrapper from '@srcTest/js/components/common/browser/wrapper/BrowserWrapper.js' +import TypeBrowser from '@src/js/components/types/browser/TypeBrowser.jsx' +import openbis from '@srcTest/js/services/openbis.js' +import fixture from '@srcTest/js/common/fixture.js' + +export default class TypeBrowserComponentTest extends ComponentTest { + static SUITE = 'TypeBrowserComponent' + + constructor() { + super( + () => <TypeBrowser />, + wrapper => new BrowserWrapper(wrapper) + ) + } + + async beforeEach() { + super.beforeEach() + + openbis.mockSearchSampleTypes([ + fixture.TEST_SAMPLE_TYPE_DTO, + fixture.ANOTHER_SAMPLE_TYPE_DTO + ]) + + openbis.mockSearchExperimentTypes([fixture.TEST_EXPERIMENT_TYPE_DTO]) + openbis.mockSearchDataSetTypes([fixture.TEST_DATA_SET_TYPE_DTO]) + + openbis.mockSearchMaterialTypes([ + fixture.TEST_MATERIAL_TYPE_DTO, + fixture.ANOTHER_MATERIAL_TYPE_DTO + ]) + + openbis.mockSearchVocabularies([ + fixture.TEST_VOCABULARY_DTO, + fixture.ANOTHER_VOCABULARY_DTO + ]) + } +} diff --git a/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserController.test.js b/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserController.test.js deleted file mode 100644 index 964a707d722dbd2ce49fd7a158d18cb5c28cf77f..0000000000000000000000000000000000000000 --- a/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserController.test.js +++ /dev/null @@ -1,186 +0,0 @@ -import TypeBrowserController from '@src/js/components/types/browser/TypeBrowserController.js' -import ComponentContext from '@srcTest/js/components/common/ComponentContext.js' -import openbis from '@srcTest/js/services/openbis.js' -import pages from '@src/js/common/consts/pages.js' -import objectType from '@src/js/common/consts/objectType.js' -import actions from '@src/js/store/actions/actions.js' -import fixture from '@srcTest/js/common/fixture.js' - -let context = null -let controller = null - -beforeEach(() => { - jest.resetAllMocks() - - context = new ComponentContext() - controller = new TypeBrowserController() - controller.init(context) - - openbis.mockSearchSampleTypes([ - fixture.TEST_SAMPLE_TYPE_DTO, - fixture.ANOTHER_SAMPLE_TYPE_DTO - ]) - - openbis.mockSearchExperimentTypes([fixture.TEST_EXPERIMENT_TYPE_DTO]) - openbis.mockSearchDataSetTypes([fixture.TEST_DATA_SET_TYPE_DTO]) - - openbis.mockSearchMaterialTypes([ - fixture.TEST_MATERIAL_TYPE_DTO, - fixture.ANOTHER_MATERIAL_TYPE_DTO - ]) - - openbis.mockSearchVocabularies([ - fixture.TEST_VOCABULARY_DTO, - fixture.ANOTHER_VOCABULARY_DTO - ]) -}) - -describe('browser', () => { - test('load', async () => { - await controller.load() - - expect(controller.getNodes()).toMatchObject([ - { - text: 'Object Types', - expanded: false, - selected: false - }, - { - text: 'Collection Types', - expanded: false, - selected: false - }, - { - text: 'Data Set Types', - expanded: false, - selected: false - }, - { - text: 'Material Types', - expanded: false, - selected: false - }, - { - text: 'Vocabulary Types', - expanded: false, - selected: false - } - ]) - - context.expectNoActions() - }) - - test('filter', async () => { - await controller.load() - - controller.filterChange('ANOTHER') - - expect(controller.getNodes()).toMatchObject([ - { - text: 'Object Types', - expanded: true, - selected: false, - children: [ - { - text: fixture.ANOTHER_SAMPLE_TYPE_DTO.code, - expanded: false, - selected: false - } - ] - }, - { - text: 'Material Types', - expanded: true, - selected: false, - children: [ - { - text: fixture.ANOTHER_MATERIAL_TYPE_DTO.code, - expanded: false, - selected: false - } - ] - }, - { - text: 'Vocabulary Types', - expanded: true, - selected: false, - children: [ - { - text: fixture.ANOTHER_VOCABULARY_DTO.code, - expanded: false, - selected: false - } - ] - } - ]) - - context.expectNoActions() - }) - - test('add node', async () => { - await controller.load() - - controller.nodeSelect('objectTypes') - controller.nodeAdd() - - expectNewTypeAction(objectType.NEW_OBJECT_TYPE) - }) - - test('remove node', async () => { - openbis.mockSearchPropertyTypes([fixture.TEST_PROPERTY_TYPE_1_DTO]) - openbis.deleteSampleTypes.mockReturnValue(Promise.resolve()) - - await controller.load() - - expect(controller.isRemoveNodeDialogOpen()).toBe(false) - expect(openbis.deleteSampleTypes).toHaveBeenCalledTimes(0) - - controller.nodeSelect('objectTypes/' + fixture.TEST_SAMPLE_TYPE_DTO.code) - controller.nodeRemove() - - expect(controller.isRemoveNodeDialogOpen()).toBe(true) - expect(openbis.deleteSampleTypes).toHaveBeenCalledTimes(0) - - await controller.nodeRemoveConfirm() - - expect(controller.isRemoveNodeDialogOpen()).toBe(false) - - const createDeleteTypeOperation = typeCode => { - const id = new openbis.EntityTypePermId(typeCode) - const options = new openbis.SampleTypeDeletionOptions() - options.setReason('deleted via ng_ui') - return new openbis.DeleteSampleTypesOperation([id], options) - } - - const createDeletePropertyTypeOperation = propertyTypeCode => { - const id = new openbis.PropertyTypePermId(propertyTypeCode) - const options = new openbis.PropertyTypeDeletionOptions() - options.setReason('deleted via ng_ui') - return new openbis.DeletePropertyTypesOperation([id], options) - } - - const options = new openbis.SynchronousOperationExecutionOptions() - options.setExecuteInOrder(true) - - expect(openbis.executeOperations).toHaveBeenCalledWith( - [ - createDeleteTypeOperation(fixture.TEST_SAMPLE_TYPE_DTO.code), - createDeletePropertyTypeOperation(fixture.TEST_PROPERTY_TYPE_1_DTO.code) - ], - options - ) - - expectDeleteTypeAction( - objectType.OBJECT_TYPE, - fixture.TEST_SAMPLE_TYPE_DTO.code - ) - }) -}) - -function expectNewTypeAction(type) { - context.expectAction(actions.objectNew(pages.TYPES, type)) -} - -function expectDeleteTypeAction(type, id) { - context.expectAction(actions.objectDelete(pages.TYPES, type, id)) -} diff --git a/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserControllerAddNode.test.js b/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserControllerAddNode.test.js new file mode 100644 index 0000000000000000000000000000000000000000..e6ac9bb3162fe327716ead33e26bca957beb7f16 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserControllerAddNode.test.js @@ -0,0 +1,22 @@ +import TypeBrowserControllerTest from '@srcTest/js/components/types/browser/TypeBrowserControllerTest.js' +import objectType from '@src/js/common/consts/objectType.js' + +let common = null + +beforeEach(() => { + common = new TypeBrowserControllerTest() + common.beforeEach() +}) + +describe(TypeBrowserControllerTest.SUITE, () => { + test('add node', testAddNode) +}) + +async function testAddNode() { + await common.controller.load() + + common.controller.nodeSelect('objectTypes') + common.controller.nodeAdd() + + common.expectNewTypeAction(objectType.NEW_OBJECT_TYPE) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserControllerFilter.test.js b/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserControllerFilter.test.js new file mode 100644 index 0000000000000000000000000000000000000000..3de48fb648ea6b1904fb22a2a71bd0f55e7107d3 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserControllerFilter.test.js @@ -0,0 +1,60 @@ +import TypeBrowserControllerTest from '@srcTest/js/components/types/browser/TypeBrowserControllerTest.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new TypeBrowserControllerTest() + common.beforeEach() +}) + +describe(TypeBrowserControllerTest.SUITE, () => { + test('filter', testFilter) +}) + +async function testFilter() { + await common.controller.load() + + common.controller.filterChange('ANOTHER') + + expect(common.controller.getNodes()).toMatchObject([ + { + text: 'Object Types', + expanded: true, + selected: false, + children: [ + { + text: fixture.ANOTHER_SAMPLE_TYPE_DTO.code, + expanded: false, + selected: false + } + ] + }, + { + text: 'Material Types', + expanded: true, + selected: false, + children: [ + { + text: fixture.ANOTHER_MATERIAL_TYPE_DTO.code, + expanded: false, + selected: false + } + ] + }, + { + text: 'Vocabulary Types', + expanded: true, + selected: false, + children: [ + { + text: fixture.ANOTHER_VOCABULARY_DTO.code, + expanded: false, + selected: false + } + ] + } + ]) + + common.context.expectNoActions() +} diff --git a/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserControllerLoad.test.js b/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserControllerLoad.test.js new file mode 100644 index 0000000000000000000000000000000000000000..85c4b3a9138ca1795bf51bff08deb7979569822c --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserControllerLoad.test.js @@ -0,0 +1,46 @@ +import TypeBrowserControllerTest from '@srcTest/js/components/types/browser/TypeBrowserControllerTest.js' + +let common = null + +beforeEach(() => { + common = new TypeBrowserControllerTest() + common.beforeEach() +}) + +describe(TypeBrowserControllerTest.SUITE, () => { + test('load', testLoad) +}) + +async function testLoad() { + await common.controller.load() + + expect(common.controller.getNodes()).toMatchObject([ + { + text: 'Object Types', + expanded: false, + selected: false + }, + { + text: 'Collection Types', + expanded: false, + selected: false + }, + { + text: 'Data Set Types', + expanded: false, + selected: false + }, + { + text: 'Material Types', + expanded: false, + selected: false + }, + { + text: 'Vocabulary Types', + expanded: false, + selected: false + } + ]) + + common.context.expectNoActions() +} diff --git a/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserControllerRemoveNode.test.js b/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserControllerRemoveNode.test.js new file mode 100644 index 0000000000000000000000000000000000000000..1efd40bd8951934d2f222d913fd1c23a3863bd30 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserControllerRemoveNode.test.js @@ -0,0 +1,67 @@ +import TypeBrowserControllerTest from '@srcTest/js/components/types/browser/TypeBrowserControllerTest.js' +import objectType from '@src/js/common/consts/objectType.js' +import openbis from '@srcTest/js/services/openbis.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new TypeBrowserControllerTest() + common.beforeEach() +}) + +describe(TypeBrowserControllerTest.SUITE, () => { + test('remove node', testRemoveNode) +}) + +async function testRemoveNode() { + openbis.mockSearchPropertyTypes([fixture.TEST_PROPERTY_TYPE_1_DTO]) + openbis.deleteSampleTypes.mockReturnValue(Promise.resolve()) + + await common.controller.load() + + expect(common.controller.isRemoveNodeDialogOpen()).toBe(false) + expect(openbis.deleteSampleTypes).toHaveBeenCalledTimes(0) + + common.controller.nodeSelect( + 'objectTypes/' + fixture.TEST_SAMPLE_TYPE_DTO.code + ) + common.controller.nodeRemove() + + expect(common.controller.isRemoveNodeDialogOpen()).toBe(true) + expect(openbis.deleteSampleTypes).toHaveBeenCalledTimes(0) + + await common.controller.nodeRemoveConfirm() + + expect(common.controller.isRemoveNodeDialogOpen()).toBe(false) + + const createDeleteTypeOperation = typeCode => { + const id = new openbis.EntityTypePermId(typeCode) + const options = new openbis.SampleTypeDeletionOptions() + options.setReason('deleted via ng_ui') + return new openbis.DeleteSampleTypesOperation([id], options) + } + + const createDeletePropertyTypeOperation = propertyTypeCode => { + const id = new openbis.PropertyTypePermId(propertyTypeCode) + const options = new openbis.PropertyTypeDeletionOptions() + options.setReason('deleted via ng_ui') + return new openbis.DeletePropertyTypesOperation([id], options) + } + + const options = new openbis.SynchronousOperationExecutionOptions() + options.setExecuteInOrder(true) + + expect(openbis.executeOperations).toHaveBeenCalledWith( + [ + createDeleteTypeOperation(fixture.TEST_SAMPLE_TYPE_DTO.code), + createDeletePropertyTypeOperation(fixture.TEST_PROPERTY_TYPE_1_DTO.code) + ], + options + ) + + common.expectDeleteTypeAction( + objectType.OBJECT_TYPE, + fixture.TEST_SAMPLE_TYPE_DTO.code + ) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserControllerTest.js b/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserControllerTest.js new file mode 100644 index 0000000000000000000000000000000000000000..d7fd9e3c177dda3433fb8351692b021ae7cb2948 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/browser/TypeBrowserControllerTest.js @@ -0,0 +1,44 @@ +import TypeBrowserController from '@src/js/components/types/browser/TypeBrowserController.js' +import ComponentContext from '@srcTest/js/components/common/ComponentContext.js' +import openbis from '@srcTest/js/services/openbis.js' +import pages from '@src/js/common/consts/pages.js' +import actions from '@src/js/store/actions/actions.js' +import fixture from '@srcTest/js/common/fixture.js' + +export default class TypeBrowserControllerTest { + static SUITE = 'TypeBrowserController' + + beforeEach() { + jest.resetAllMocks() + + this.context = new ComponentContext() + this.controller = new TypeBrowserController() + this.controller.init(this.context) + + openbis.mockSearchSampleTypes([ + fixture.TEST_SAMPLE_TYPE_DTO, + fixture.ANOTHER_SAMPLE_TYPE_DTO + ]) + + openbis.mockSearchExperimentTypes([fixture.TEST_EXPERIMENT_TYPE_DTO]) + openbis.mockSearchDataSetTypes([fixture.TEST_DATA_SET_TYPE_DTO]) + + openbis.mockSearchMaterialTypes([ + fixture.TEST_MATERIAL_TYPE_DTO, + fixture.ANOTHER_MATERIAL_TYPE_DTO + ]) + + openbis.mockSearchVocabularies([ + fixture.TEST_VOCABULARY_DTO, + fixture.ANOTHER_VOCABULARY_DTO + ]) + } + + expectNewTypeAction(type) { + this.context.expectAction(actions.objectNew(pages.TYPES, type)) + } + + expectDeleteTypeAction(type, id) { + this.context.expectAction(actions.objectDelete(pages.TYPES, type, id)) + } +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponent.test.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponent.test.js deleted file mode 100644 index c0f600a38386bd107de11857e1a2c328ffb4cc97..0000000000000000000000000000000000000000 --- a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponent.test.js +++ /dev/null @@ -1,1651 +0,0 @@ -import React from 'react' -import ComponentTest from '@srcTest/js/components/common/ComponentTest.js' -import TypeForm from '@src/js/components/types/form/TypeForm.jsx' -import TypeFormWrapper from '@srcTest/js/components/types/form/wrapper/TypeFormWrapper.js' -import TypeFormController from '@src/js/components/types/form/TypeFormController.js' -import TypeFormFacade from '@src/js/components/types/form/TypeFormFacade' -import objectTypes from '@src/js/common/consts/objectType.js' -import openbis from '@srcTest/js/services/openbis.js' -import fixture from '@srcTest/js/common/fixture.js' - -jest.mock('@src/js/components/types/form/TypeFormFacade') - -let common = null -let facade = null -let controller = null - -beforeEach(() => { - common = new ComponentTest( - object => <TypeForm object={object} controller={controller} />, - wrapper => new TypeFormWrapper(wrapper) - ) - common.beforeEach() - - facade = new TypeFormFacade() - controller = new TypeFormController(facade) - - facade.loadType.mockReturnValue(Promise.resolve({})) - facade.loadUsages.mockReturnValue(Promise.resolve({})) - facade.loadDynamicPlugins.mockReturnValue(Promise.resolve([])) - facade.loadValidationPlugins.mockReturnValue(Promise.resolve([])) - facade.loadMaterials.mockReturnValue(Promise.resolve([])) - facade.loadSamples.mockReturnValue(Promise.resolve([])) - facade.loadVocabularyTerms.mockReturnValue(Promise.resolve([])) - facade.loadGlobalPropertyTypes.mockReturnValue(Promise.resolve([])) -}) - -describe('TypeFormComponent', () => { - test('load new', testLoadNew) - test('load existing', testLoadExisting) - test('select property local unused', testSelectPropertyLocalUnused) - test('select property local used', testSelectPropertyLocalUsed) - test('select property global unused', testSelectPropertyGlobalUnused) - test('select property global used', testSelectPropertyGlobalUsed) - test('select section', testSelectSection) - test('add section', testAddSection) - test('add property', testAddProperty) - test('change type', testChangeType) - test('change property', testChangeProperty) - test('convert property', testConvertProperty) - test('change section', testChangeSection) - test('remove property', testRemoveProperty) - test('remove section', testRemoveSection) - test('validate type', testValidateType) - test('validate property', testValidateProperty) - test('validate type and property', testValidateTypeAndProperty) - test('internal', testInternal) -}) - -async function testLoadNew() { - const form = await mountNew() - - form.expectJSON({ - preview: { - sections: [] - }, - parameters: { - type: { - title: 'Type', - code: { - label: 'Code', - value: null, - enabled: true, - mode: 'edit' - }, - description: { - label: 'Description', - value: null, - enabled: true, - mode: 'edit' - }, - validationPlugin: { - label: 'Validation Plugin', - value: null, - enabled: true, - mode: 'edit' - } - } - }, - buttons: { - addSection: { - enabled: true - }, - addProperty: { - enabled: false - }, - remove: { - enabled: false - }, - save: { - enabled: true - }, - edit: null, - cancel: null, - message: null - } - }) -} - -async function testLoadExisting() { - const form = await mountExisting() - - form.expectJSON({ - preview: { - sections: [ - { - name: 'TEST_SECTION_1', - properties: [{ code: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() }] - }, - { - name: 'TEST_SECTION_2', - properties: [ - { code: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, - { code: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - ] - } - ] - }, - parameters: { - type: { - title: 'Type', - code: { - label: 'Code', - value: fixture.TEST_SAMPLE_TYPE_DTO.getCode(), - mode: 'view' - }, - description: { - label: 'Description', - value: fixture.TEST_SAMPLE_TYPE_DTO.getDescription(), - mode: 'view' - }, - validationPlugin: { - label: 'Validation Plugin', - value: fixture.TEST_SAMPLE_TYPE_DTO.validationPlugin.name, - mode: 'view' - } - } - }, - buttons: { - edit: { - enabled: true - }, - addSection: null, - addProperty: null, - remove: null, - save: null, - cancel: null, - message: null - } - }) - - form.getButtons().getEdit().click() - await form.update() - - form.expectJSON({ - preview: { - sections: [ - { - name: 'TEST_SECTION_1', - properties: [{ code: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() }] - }, - { - name: 'TEST_SECTION_2', - properties: [ - { code: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, - { code: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - ] - } - ] - }, - parameters: { - type: { - title: 'Type', - code: { - label: 'Code', - value: fixture.TEST_SAMPLE_TYPE_DTO.getCode(), - enabled: false, - mode: 'edit' - }, - description: { - label: 'Description', - value: fixture.TEST_SAMPLE_TYPE_DTO.getDescription(), - enabled: true, - mode: 'edit' - }, - validationPlugin: { - label: 'Validation Plugin', - value: fixture.TEST_SAMPLE_TYPE_DTO.validationPlugin.name, - enabled: true, - mode: 'edit' - } - } - }, - buttons: { - addSection: { - enabled: true - }, - addProperty: { - enabled: false - }, - remove: { - enabled: false - }, - save: { - enabled: true - }, - cancel: { - enabled: true - }, - edit: null, - message: null - } - }) -} - -async function testSelectPropertyLocalUnused() { - await doTestSelectProperty('local', false) -} - -async function testSelectPropertyLocalUsed() { - await doTestSelectProperty('local', true) -} - -async function testSelectPropertyGlobalUnused() { - await doTestSelectProperty('global', false) -} - -async function testSelectPropertyGlobalUsed() { - await doTestSelectProperty('global', true) -} - -async function doTestSelectProperty(scope, used) { - const plugin = new openbis.Plugin() - plugin.setName('TEST_PLUGIN') - - const propertyType = new openbis.PropertyType() - propertyType.setCode( - scope === 'global' ? 'GLOBAL_PROPERTY' : 'TEST_TYPE.LOCAL_PROPERTY' - ) - propertyType.setLabel('Test Label') - propertyType.setDescription('Test Description') - propertyType.setDataType(openbis.DataType.VARCHAR) - - const propertyAssignment = new openbis.PropertyAssignment() - propertyAssignment.setPropertyType(propertyType) - propertyAssignment.setPlugin(plugin) - - const type = new openbis.SampleType() - type.setCode('TEST_TYPE') - type.setPropertyAssignments([propertyAssignment]) - - facade.loadType.mockReturnValue(Promise.resolve(type)) - facade.loadDynamicPlugins.mockReturnValue(Promise.resolve([plugin])) - - const messages = [] - - if (scope === 'global') { - messages.push({ - text: - 'This property is global. Changes will also influence other types where this property is used.', - type: 'warning' - }) - } - - if (used) { - facade.loadAssignments.mockReturnValue( - Promise.resolve({ - [propertyType.getCode()]: 2 - }) - ) - messages.push({ - text: 'This property is already assigned to 2 types.', - type: 'info' - }) - - facade.loadUsages.mockReturnValue( - Promise.resolve({ - propertyLocal: { - [propertyType.getCode()]: 1 - }, - propertyGlobal: { - [propertyType.getCode()]: 3 - } - }) - ) - messages.push({ - text: - 'This property is already used by 3 entities (1 entity of this type and 2 entities of other types).', - type: 'info' - }) - } - - const form = await common.mount({ - id: type.getCode(), - type: objectTypes.OBJECT_TYPE - }) - - form.getPreview().getSections()[0].getProperties()[0].click() - await form.update() - - form.getButtons().getEdit().click() - await form.update() - - form.expectJSON({ - parameters: { - property: { - title: 'Property', - messages, - scope: { - label: 'Scope', - value: scope, - enabled: false, - mode: 'edit' - }, - code: { - label: 'Code', - value: propertyType.getCode(), - enabled: false, - mode: 'edit' - }, - dataType: { - label: 'Data Type', - value: propertyType.getDataType(), - enabled: true, - mode: 'edit', - options: [ - { - label: openbis.DataType.VARCHAR, - value: openbis.DataType.VARCHAR - }, - { - label: openbis.DataType.MULTILINE_VARCHAR + ' (converted)', - value: openbis.DataType.MULTILINE_VARCHAR - } - ] - }, - label: { - label: 'Label', - value: propertyType.getLabel(), - enabled: true, - mode: 'edit' - }, - description: { - label: 'Description', - value: propertyType.getDescription(), - enabled: true, - mode: 'edit' - }, - plugin: { - label: 'Dynamic Plugin', - value: plugin.getName(), - enabled: true, - mode: 'edit' - } - } - }, - buttons: { - message: null - } - }) -} - -async function testSelectSection() { - const form = await mountExisting() - - form.getPreview().getSections()[1].click() - await form.update() - - form.getButtons().getEdit().click() - await form.update() - - form.expectJSON({ - parameters: { - section: { - title: 'Section', - name: { - label: 'Name', - value: 'TEST_SECTION_2', - enabled: true, - mode: 'edit' - } - } - }, - buttons: { - message: null - } - }) -} - -async function testAddSection() { - const form = await mountExisting() - - form.expectJSON({ - preview: { - sections: [ - { - name: 'TEST_SECTION_1' - }, - { - name: 'TEST_SECTION_2' - } - ] - }, - buttons: { - edit: { - enabled: true - }, - addSection: null, - addProperty: null, - remove: null, - save: null, - cancel: null, - message: null - } - }) - - form.getButtons().getEdit().click() - await form.update() - - form.getPreview().getSections()[0].click() - form.getButtons().getAddSection().click() - await form.update() - - form.expectJSON({ - preview: { - sections: [ - { - name: 'TEST_SECTION_1' - }, - { - name: null - }, - { - name: 'TEST_SECTION_2' - } - ] - }, - parameters: { - section: { - title: 'Section', - name: { - label: 'Name', - value: null, - enabled: true, - mode: 'edit' - } - } - }, - buttons: { - edit: null, - addSection: { - enabled: true - }, - addProperty: { - enabled: true - }, - remove: { - enabled: true - }, - save: { - enabled: true - }, - cancel: { - enabled: true - }, - message: { - text: 'You have unsaved changes.', - type: 'warning' - } - } - }) -} - -async function testAddProperty() { - const form = await mountExisting() - - form.expectJSON({ - preview: { - sections: [ - { - name: 'TEST_SECTION_1', - properties: [{ code: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() }] - }, - { - name: 'TEST_SECTION_2', - properties: [ - { code: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, - { code: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - ] - } - ] - }, - buttons: { - edit: { - enabled: true - }, - addSection: null, - addProperty: null, - remove: null, - save: null, - cancel: null, - message: null - } - }) - - form.getButtons().getEdit().click() - await form.update() - - form.getPreview().getSections()[1].getProperties()[0].click() - form.getButtons().getAddProperty().click() - await form.update() - - form.expectJSON({ - preview: { - sections: [ - { - name: 'TEST_SECTION_1', - properties: [{ code: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() }] - }, - { - name: 'TEST_SECTION_2', - properties: [ - { code: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, - { - message: { - type: 'info', - text: 'Please select a data type to display the field preview.' - } - }, - { code: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - ] - } - ] - }, - parameters: { - property: { - title: 'Property', - scope: { - label: 'Scope', - value: 'local', - enabled: true, - mode: 'edit' - }, - code: { - label: 'Code', - value: null, - enabled: true, - mode: 'edit' - }, - dataType: { - label: 'Data Type', - value: null, - enabled: true, - mode: 'edit' - }, - label: { - label: 'Label', - value: null, - enabled: true, - mode: 'edit' - }, - description: { - label: 'Description', - value: null, - enabled: true, - mode: 'edit' - }, - plugin: { - label: 'Dynamic Plugin', - value: null, - enabled: true, - mode: 'edit' - } - } - }, - buttons: { - edit: null, - addSection: { - enabled: true - }, - addProperty: { - enabled: true - }, - remove: { - enabled: true - }, - save: { - enabled: true - }, - cancel: { - enabled: true - }, - message: { - text: 'You have unsaved changes.', - type: 'warning' - } - } - }) -} - -async function testChangeType() { - const form = await mountExisting() - - form.expectJSON({ - preview: { - header: { - code: { - label: 'Code', - value: null, - enabled: false, - mode: 'edit' - } - } - }, - parameters: { - type: { - title: 'Type', - autoGeneratedCode: { - label: 'Generate Codes', - value: false, - mode: 'view' - }, - generatedCodePrefix: { - label: 'Generated code prefix', - value: 'TEST_PREFIX_', - mode: 'view' - } - } - }, - buttons: { - message: null - } - }) - - form.getButtons().getEdit().click() - await form.update() - - form.expectJSON({ - preview: { - header: { - code: { - label: 'Code', - value: null, - enabled: true, - mode: 'edit' - } - } - } - }) - - form.getParameters().getType().getAutoGeneratedCode().change(true) - form.getParameters().getType().getGeneratedCodePrefix().change('NEW_PREFIX_') - await form.update() - - form.expectJSON({ - preview: { - header: { - code: { - label: 'Code', - value: 'NEW_PREFIX_', - enabled: false, - mode: 'edit' - } - } - }, - parameters: { - type: { - title: 'Type', - autoGeneratedCode: { - label: 'Generate Codes', - value: true, - enabled: true, - mode: 'edit' - }, - generatedCodePrefix: { - label: 'Generated code prefix', - value: 'NEW_PREFIX_', - enabled: true, - mode: 'edit' - } - } - }, - buttons: { - message: { - text: 'You have unsaved changes.', - type: 'warning' - } - } - }) -} - -async function testChangeProperty() { - const form = await mountNew() - - form.getButtons().getAddSection().click() - await form.update() - - form.getButtons().getAddProperty().click() - await form.update() - - form.getParameters().getProperty().getCode().change('TEST_CODE') - await form.update() - - form.getParameters().getProperty().getDataType().change('VARCHAR') - await form.update() - - form.expectJSON({ - preview: { - sections: [ - { - name: null, - properties: [{ code: 'TEST_CODE', dataType: 'VARCHAR' }] - } - ] - }, - parameters: { - property: { - title: 'Property', - code: { - label: 'Code', - value: 'TEST_CODE', - enabled: true, - mode: 'edit' - }, - dataType: { - label: 'Data Type', - value: 'VARCHAR', - enabled: true, - mode: 'edit' - }, - vocabulary: null, - materialType: null, - schema: null, - transformation: null - } - }, - buttons: { - message: { - text: 'You have unsaved changes.', - type: 'warning' - } - } - }) - - form - .getParameters() - .getProperty() - .getDataType() - .change('CONTROLLEDVOCABULARY') - await form.update() - - form.expectJSON({ - preview: { - sections: [ - { - name: null, - properties: [{ code: 'TEST_CODE', dataType: 'CONTROLLEDVOCABULARY' }] - } - ] - }, - parameters: { - property: { - title: 'Property', - code: { - label: 'Code', - value: 'TEST_CODE', - enabled: true, - mode: 'edit' - }, - dataType: { - label: 'Data Type', - value: 'CONTROLLEDVOCABULARY', - enabled: true, - mode: 'edit' - }, - vocabulary: { - label: 'Vocabulary', - value: null, - enabled: true, - mode: 'edit' - }, - materialType: null, - schema: null, - transformation: null - } - }, - buttons: { - message: { - text: 'You have unsaved changes.', - type: 'warning' - } - } - }) - - form.getParameters().getProperty().getDataType().change('MATERIAL') - await form.update() - - form.expectJSON({ - preview: { - sections: [ - { - name: null, - properties: [{ code: 'TEST_CODE', dataType: 'MATERIAL' }] - } - ] - }, - parameters: { - property: { - title: 'Property', - code: { - label: 'Code', - value: 'TEST_CODE', - enabled: true, - mode: 'edit' - }, - dataType: { - label: 'Data Type', - value: 'MATERIAL', - enabled: true, - mode: 'edit' - }, - vocabulary: null, - materialType: { - label: 'Material Type', - value: null, - enabled: true, - mode: 'edit' - }, - schema: null, - transformation: null - } - }, - buttons: { - message: { - text: 'You have unsaved changes.', - type: 'warning' - } - } - }) - - form.getParameters().getProperty().getDataType().change('XML') - await form.update() - - form.expectJSON({ - preview: { - sections: [ - { - name: null, - properties: [{ code: 'TEST_CODE', dataType: 'XML' }] - } - ] - }, - parameters: { - property: { - title: 'Property', - code: { - label: 'Code', - value: 'TEST_CODE', - enabled: true, - mode: 'edit' - }, - dataType: { - label: 'Data Type', - value: 'XML', - enabled: true, - mode: 'edit' - }, - vocabulary: null, - materialType: null, - schema: { - label: 'XML Schema', - value: null, - enabled: true, - mode: 'edit' - }, - transformation: { - label: 'XSLT Script', - value: null, - enabled: true, - mode: 'edit' - } - } - }, - buttons: { - message: { - text: 'You have unsaved changes.', - type: 'warning' - } - } - }) -} - -async function testConvertProperty() { - const properties = [ - openbis.DataType.INTEGER, - openbis.DataType.REAL, - openbis.DataType.VARCHAR, - openbis.DataType.MULTILINE_VARCHAR, - openbis.DataType.XML, - openbis.DataType.HYPERLINK, - openbis.DataType.TIMESTAMP, - openbis.DataType.DATE, - openbis.DataType.BOOLEAN, - openbis.DataType.CONTROLLEDVOCABULARY, - openbis.DataType.MATERIAL, - openbis.DataType.SAMPLE - ].map(dataType => { - const propertyType = new openbis.PropertyType() - propertyType.setCode(dataType) - propertyType.setDataType(dataType) - const property = new openbis.PropertyAssignment() - property.setPropertyType(propertyType) - return property - }) - - const type = new openbis.SampleType() - type.setCode('TEST_TYPE') - type.setPropertyAssignments(properties) - - facade.loadType.mockReturnValue(Promise.resolve(type)) - facade.loadUsages.mockReturnValue( - Promise.resolve({ - propertyGlobal: properties.reduce((map, property) => { - map[property.propertyType.code] = 1 - return map - }, {}) - }) - ) - - const suffix = ' (converted)' - let index = 0 - - const form = await common.mount({ - id: type.getCode(), - type: objectTypes.OBJECT_TYPE - }) - - form.getButtons().getEdit().click() - await form.update() - - form.getPreview().getSections()[0].getProperties()[index++].click() - await form.update() - - form.expectJSON({ - parameters: { - property: { - dataType: { - value: 'INTEGER', - enabled: true, - options: [ - { label: openbis.DataType.INTEGER }, - { label: openbis.DataType.VARCHAR + suffix }, - { label: openbis.DataType.MULTILINE_VARCHAR + suffix }, - { label: openbis.DataType.REAL + suffix } - ] - } - } - } - }) - - form.getPreview().getSections()[0].getProperties()[index++].click() - await form.update() - - form.expectJSON({ - parameters: { - property: { - dataType: { - value: 'REAL', - enabled: true, - options: [ - { label: openbis.DataType.REAL }, - { label: openbis.DataType.VARCHAR + suffix }, - { label: openbis.DataType.MULTILINE_VARCHAR + suffix } - ] - } - } - } - }) - - form.getPreview().getSections()[0].getProperties()[index++].click() - await form.update() - - form.expectJSON({ - parameters: { - property: { - dataType: { - value: 'VARCHAR', - enabled: true, - options: [ - { label: openbis.DataType.VARCHAR }, - { label: openbis.DataType.MULTILINE_VARCHAR + suffix } - ] - } - } - } - }) - - form.getPreview().getSections()[0].getProperties()[index++].click() - await form.update() - - form.expectJSON({ - parameters: { - property: { - dataType: { - value: 'MULTILINE_VARCHAR', - enabled: true, - options: [ - { label: openbis.DataType.MULTILINE_VARCHAR }, - { label: openbis.DataType.VARCHAR + suffix } - ] - } - } - } - }) - - form.getPreview().getSections()[0].getProperties()[index++].click() - await form.update() - - form.expectJSON({ - parameters: { - property: { - dataType: { - value: 'XML', - enabled: true, - options: [ - { label: openbis.DataType.XML }, - { label: openbis.DataType.VARCHAR + suffix }, - { label: openbis.DataType.MULTILINE_VARCHAR + suffix } - ] - } - } - } - }) - - form.getPreview().getSections()[0].getProperties()[index++].click() - await form.update() - - form.expectJSON({ - parameters: { - property: { - dataType: { - value: 'HYPERLINK', - enabled: true, - options: [ - { label: openbis.DataType.HYPERLINK }, - { label: openbis.DataType.VARCHAR + suffix }, - { label: openbis.DataType.MULTILINE_VARCHAR + suffix } - ] - } - } - } - }) - - form.getPreview().getSections()[0].getProperties()[index++].click() - await form.update() - - form.expectJSON({ - parameters: { - property: { - dataType: { - value: 'TIMESTAMP', - enabled: true, - options: [ - { label: openbis.DataType.TIMESTAMP }, - { label: openbis.DataType.VARCHAR + suffix }, - { label: openbis.DataType.MULTILINE_VARCHAR + suffix }, - { label: openbis.DataType.DATE + suffix } - ] - } - } - } - }) - - form.getPreview().getSections()[0].getProperties()[index++].click() - await form.update() - - form.expectJSON({ - parameters: { - property: { - dataType: { - value: 'DATE', - enabled: true, - options: [ - { label: openbis.DataType.DATE }, - { label: openbis.DataType.VARCHAR + suffix }, - { label: openbis.DataType.MULTILINE_VARCHAR + suffix } - ] - } - } - } - }) - - form.getPreview().getSections()[0].getProperties()[index++].click() - await form.update() - - form.expectJSON({ - parameters: { - property: { - dataType: { - value: 'BOOLEAN', - enabled: true, - options: [ - { label: openbis.DataType.BOOLEAN }, - { label: openbis.DataType.VARCHAR + suffix }, - { label: openbis.DataType.MULTILINE_VARCHAR + suffix } - ] - } - } - } - }) - - form.getPreview().getSections()[0].getProperties()[index++].click() - await form.update() - - form.expectJSON({ - parameters: { - property: { - dataType: { - value: 'CONTROLLEDVOCABULARY', - enabled: true, - options: [ - { label: openbis.DataType.CONTROLLEDVOCABULARY }, - { label: openbis.DataType.VARCHAR + suffix }, - { label: openbis.DataType.MULTILINE_VARCHAR + suffix } - ] - } - } - } - }) - - form.getPreview().getSections()[0].getProperties()[index++].click() - await form.update() - - form.expectJSON({ - parameters: { - property: { - dataType: { - value: 'MATERIAL', - enabled: true, - options: [ - { label: openbis.DataType.MATERIAL }, - { label: openbis.DataType.VARCHAR + suffix }, - { label: openbis.DataType.MULTILINE_VARCHAR + suffix } - ] - } - } - } - }) - - form.getPreview().getSections()[0].getProperties()[index++].click() - await form.update() - - form.expectJSON({ - parameters: { - property: { - dataType: { - value: 'SAMPLE', - enabled: true, - options: [ - { label: openbis.DataType.SAMPLE }, - { label: openbis.DataType.VARCHAR + suffix }, - { label: openbis.DataType.MULTILINE_VARCHAR + suffix } - ] - } - } - } - }) -} - -async function testChangeSection() { - const form = await mountExisting() - - form.getButtons().getEdit().click() - await form.update() - - form.getPreview().getSections()[1].click() - await form.update() - - form.expectJSON({ - preview: { - sections: [ - { - name: 'TEST_SECTION_1' - }, - { - name: 'TEST_SECTION_2' - } - ] - }, - parameters: { - section: { - title: 'Section', - name: { - label: 'Name', - value: 'TEST_SECTION_2', - enabled: true, - mode: 'edit' - } - } - }, - buttons: { - message: null - } - }) - - form.getParameters().getSection().getName().change('NEW_NAME') - await form.update() - - form.expectJSON({ - preview: { - sections: [ - { - name: 'TEST_SECTION_1' - }, - { - name: 'NEW_NAME' - } - ] - }, - parameters: { - section: { - title: 'Section', - name: { - label: 'Name', - value: 'NEW_NAME', - enabled: true, - mode: 'edit' - } - } - }, - buttons: { - message: { - text: 'You have unsaved changes.', - type: 'warning' - } - } - }) -} - -async function testRemoveProperty() { - const form = await mountExisting() - - form.getButtons().getEdit().click() - await form.update() - - form.getPreview().getSections()[1].getProperties()[0].click() - await form.update() - - form.expectJSON({ - preview: { - sections: [ - { - name: 'TEST_SECTION_1', - properties: [{ code: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() }] - }, - { - name: 'TEST_SECTION_2', - properties: [ - { code: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, - { code: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - ] - } - ] - }, - buttons: { - message: null - } - }) - - form.getButtons().getRemove().click() - await form.update() - - form.expectJSON({ - preview: { - sections: [ - { - name: 'TEST_SECTION_1', - properties: [{ code: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() }] - }, - { - name: 'TEST_SECTION_2', - properties: [{ code: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() }] - } - ] - }, - buttons: { - message: { - text: 'You have unsaved changes.', - type: 'warning' - } - } - }) -} - -async function testRemoveSection() { - const form = await mountExisting() - - form.getButtons().getEdit().click() - await form.update() - - form.getPreview().getSections()[0].click() - await form.update() - - form.expectJSON({ - preview: { - sections: [ - { - name: 'TEST_SECTION_1' - }, - { - name: 'TEST_SECTION_2' - } - ] - }, - buttons: { - message: null - } - }) - - form.getButtons().getRemove().click() - await form.update() - - form.expectJSON({ - preview: { - sections: [ - { - name: 'TEST_SECTION_2' - } - ] - }, - buttons: { - message: { - text: 'You have unsaved changes.', - type: 'warning' - } - } - }) -} - -async function testValidateType() { - const form = await mountNew() - - form.getButtons().getSave().click() - await form.update() - - form.expectJSON({ - parameters: { - type: { - title: 'Type', - code: { - error: 'Code cannot be empty', - focused: true - }, - description: { - error: null - }, - validationPlugin: { - error: null - }, - generatedCodePrefix: { - error: 'Generated code prefix cannot be empty' - } - } - }, - buttons: { - message: null - } - }) - - form.getParameters().getType().getCode().change('I am illegal') - await form.update() - - form.getButtons().getSave().click() - await form.update() - - form.expectJSON({ - parameters: { - type: { - code: { - value: 'I am illegal', - error: 'Code can only contain A-Z, a-z, 0-9 and _, -, .', - focused: true - } - } - }, - buttons: { - message: { - text: 'You have unsaved changes.', - type: 'warning' - } - } - }) -} - -async function testValidateProperty() { - const form = await mountNew() - - form.getParameters().getType().getCode().change('TEST_CODE') - form.getParameters().getType().getGeneratedCodePrefix().change('TEST_PREFIX_') - - form.getButtons().getAddSection().click() - form.getButtons().getAddProperty().click() - form.getButtons().getSave().click() - await form.update() - - form.expectJSON({ - parameters: { - property: { - title: 'Property', - scope: { - error: null - }, - code: { - error: 'Code cannot be empty', - focused: true - }, - dataType: { - error: 'Data Type cannot be empty' - }, - label: { - error: 'Label cannot be empty' - }, - description: { - error: 'Description cannot be empty' - }, - plugin: { - error: null - } - } - }, - buttons: { - message: { - text: 'You have unsaved changes.', - type: 'warning' - } - } - }) - - form.getParameters().getProperty().getCode().change('I am illegal') - await form.update() - - form.getButtons().getSave().click() - await form.update() - - form.expectJSON({ - parameters: { - property: { - code: { - value: 'I am illegal', - error: 'Code can only contain A-Z, a-z, 0-9 and _, -, .', - focused: true - } - } - } - }) -} - -async function testValidateTypeAndProperty() { - const form = await mountNew() - - form.getButtons().getAddSection().click() - form.getButtons().getAddProperty().click() - form.getButtons().getSave().click() - await form.update() - - form.expectJSON({ - parameters: { - type: { - title: 'Type', - code: { - error: 'Code cannot be empty' - }, - description: { - error: null - }, - validationPlugin: { - error: null - }, - generatedCodePrefix: { - error: 'Generated code prefix cannot be empty' - } - } - }, - buttons: { - message: { - text: 'You have unsaved changes.', - type: 'warning' - } - } - }) -} - -async function testInternal() { - await doTestInternal(true, fixture.SYSTEM_USER_DTO, fixture.SYSTEM_USER_DTO) - await doTestInternal(false, fixture.SYSTEM_USER_DTO, fixture.SYSTEM_USER_DTO) - await doTestInternal(true, fixture.SYSTEM_USER_DTO, fixture.TEST_USER_DTO) - await doTestInternal(false, fixture.SYSTEM_USER_DTO, fixture.TEST_USER_DTO) - await doTestInternal(true, fixture.TEST_USER_DTO, fixture.TEST_USER_DTO) - await doTestInternal(false, fixture.TEST_USER_DTO, fixture.TEST_USER_DTO) - await doTestInternal(true, fixture.TEST_USER_DTO, fixture.SYSTEM_USER_DTO) - await doTestInternal(false, fixture.TEST_USER_DTO, fixture.SYSTEM_USER_DTO) -} - -async function doTestInternal( - propertyTypeInternal, - propertyTypeRegistrator, - propertyAssignmentRegistrator -) { - const isSystemInternalPropertyType = - propertyTypeInternal && - propertyTypeRegistrator.userId === fixture.SYSTEM_USER_DTO.userId - - const isSystemInternalPropertyAssignment = - propertyTypeInternal && - propertyAssignmentRegistrator.userId === fixture.SYSTEM_USER_DTO.userId - - const propertyType = new openbis.PropertyType() - propertyType.setCode('TEST_PROPERTY') - propertyType.setManagedInternally(propertyTypeInternal) - propertyType.setRegistrator(propertyTypeRegistrator) - propertyType.setDataType(openbis.DataType.VARCHAR) - - const propertyAssignment = new openbis.PropertyAssignment() - propertyAssignment.setPropertyType(propertyType) - propertyAssignment.setPlugin(fixture.TEST_PLUGIN_DTO) - propertyAssignment.setRegistrator(propertyAssignmentRegistrator) - - const type = new openbis.SampleType() - type.setCode('TEST_TYPE') - type.setPropertyAssignments([propertyAssignment]) - - facade.loadType.mockReturnValue(Promise.resolve(type)) - facade.loadDynamicPlugins.mockReturnValue( - Promise.resolve([propertyAssignment.plugin]) - ) - - const form = await common.mount({ - id: type.getCode(), - type: objectTypes.OBJECT_TYPE - }) - - form.getButtons().getEdit().click() - await form.update() - - form.expectJSON({ - parameters: { - type: { - title: 'Type', - code: { - value: type.getCode(), - enabled: false - }, - description: { - value: type.getDescription(), - enabled: true - } - } - } - }) - - form.getPreview().getSections()[0].getProperties()[0].click() - await form.update() - - form.expectJSON({ - parameters: { - property: { - title: 'Property', - code: { - value: propertyType.getCode(), - enabled: false - }, - dataType: { - value: propertyType.getDataType(), - enabled: !isSystemInternalPropertyType - }, - label: { - value: propertyType.getLabel(), - enabled: !isSystemInternalPropertyType - }, - description: { - value: propertyType.getDescription(), - enabled: !isSystemInternalPropertyType - }, - plugin: { - value: propertyAssignment.plugin.getName(), - enabled: !isSystemInternalPropertyAssignment - }, - mandatory: { - value: propertyAssignment.isMandatory(), - enabled: !isSystemInternalPropertyAssignment - }, - visible: { - value: propertyAssignment.isShowInEditView(), - enabled: !isSystemInternalPropertyAssignment - } - } - }, - buttons: { - remove: { - enabled: !isSystemInternalPropertyAssignment - } - } - }) - - form.getPreview().getSections()[0].click() - await form.update() - - form.expectJSON({ - parameters: { - section: { - title: 'Section', - name: { - value: propertyAssignment.getSection(), - enabled: true - } - } - }, - buttons: { - remove: { - enabled: !isSystemInternalPropertyAssignment - } - } - }) -} - -async function mountNew() { - return await common.mount({ - type: objectTypes.NEW_OBJECT_TYPE - }) -} - -async function mountExisting() { - facade.loadType.mockReturnValue(Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO)) - facade.loadValidationPlugins.mockReturnValue( - Promise.resolve([fixture.TEST_SAMPLE_TYPE_DTO.validationPlugin]) - ) - - return await common.mount({ - id: fixture.TEST_SAMPLE_TYPE_DTO.getCode(), - type: objectTypes.OBJECT_TYPE - }) -} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentAddProperty.test.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentAddProperty.test.js new file mode 100644 index 0000000000000000000000000000000000000000..30f7729caa72317050c2ab47292fbca3c9d5eb9e --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentAddProperty.test.js @@ -0,0 +1,611 @@ +import TypeFormComponentTest from '@srcTest/js/components/types/form/TypeFormComponentTest.js' +import TypeFormPropertyScope from '@src/js/components/types/form/TypeFormPropertyScope.js' +import openbis from '@srcTest/js/services/openbis.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new TypeFormComponentTest() + common.beforeEach() +}) + +describe(TypeFormComponentTest.SUITE, () => { + test('add local property', testAddLocalProperty) + test('add new global property', testAddNewGlobalProperty) + test('add existing global property', testAddExistingGlobalProperty) +}) + +async function testAddLocalProperty() { + common.facade.loadValidationPlugins.mockReturnValue( + Promise.resolve([fixture.TEST_SAMPLE_TYPE_DTO.validationPlugin]) + ) + + const form = await common.mountExisting(fixture.TEST_SAMPLE_TYPE_DTO) + + form.expectJSON({ + preview: { + sections: [ + { + name: 'TEST_SECTION_1', + properties: [{ code: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() }] + }, + { + name: 'TEST_SECTION_2', + properties: [ + { code: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, + { code: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + ] + } + ] + }, + buttons: { + edit: { + enabled: true + }, + addSection: null, + addProperty: null, + remove: null, + save: null, + cancel: null, + message: null + } + }) + + form.getButtons().getEdit().click() + await form.update() + + form.getPreview().getSections()[1].getProperties()[0].click() + form.getButtons().getAddProperty().click() + await form.update() + + form.expectJSON({ + preview: { + sections: [ + { + name: 'TEST_SECTION_1', + properties: [{ code: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() }] + }, + { + name: 'TEST_SECTION_2', + properties: [ + { code: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, + { + message: { + type: 'info', + text: 'Please select a data type to display the field preview.' + } + }, + { code: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + ] + } + ] + }, + parameters: { + property: { + title: 'Property', + scope: { + label: 'Scope', + value: TypeFormPropertyScope.LOCAL, + enabled: true, + mode: 'edit' + }, + code: { + label: 'Code', + value: null, + enabled: true, + mode: 'edit' + }, + dataType: { + label: 'Data Type', + value: null, + enabled: true, + mode: 'edit' + }, + label: { + label: 'Label', + value: null, + enabled: true, + mode: 'edit' + }, + description: { + label: 'Description', + value: null, + enabled: true, + mode: 'edit' + }, + plugin: { + label: 'Dynamic Plugin', + value: null, + enabled: true, + mode: 'edit' + }, + visible: { + label: 'Visible', + value: true, + enabled: true, + mode: 'edit' + }, + mandatory: { + label: 'Mandatory', + value: false, + enabled: true, + mode: 'edit' + } + } + }, + buttons: { + edit: null, + addSection: { + enabled: true + }, + addProperty: { + enabled: true + }, + remove: { + enabled: true + }, + save: { + enabled: true + }, + cancel: { + enabled: true + }, + message: { + text: 'You have unsaved changes.', + type: 'warning' + } + } + }) +} + +async function testAddNewGlobalProperty() { + const EXISTING_GLOBAL_PROPERTY = new openbis.PropertyType() + EXISTING_GLOBAL_PROPERTY.setCode('EXISTING_GLOBAL_PROPERTY') + + common.facade.loadGlobalPropertyTypes.mockReturnValue( + Promise.resolve([EXISTING_GLOBAL_PROPERTY]) + ) + common.facade.loadDynamicPlugins.mockReturnValue( + Promise.resolve([fixture.TEST_PLUGIN_DTO, fixture.ANOTHER_PLUGIN_DTO]) + ) + + const form = await common.mountNew() + + form.getButtons().getAddSection().click() + await form.update() + + form.getButtons().getAddProperty().click() + await form.update() + + form + .getParameters() + .getProperty() + .getScope() + .change(TypeFormPropertyScope.GLOBAL) + await form.update() + + form.getParameters().getProperty().getCode().change('NEW_GLOBAL_PROPERTY') + await form.update() + + form.expectJSON({ + preview: { + sections: [ + { + name: null, + properties: [ + { + message: { + type: 'info', + text: 'Please select a data type to display the field preview.' + } + } + ] + } + ] + }, + parameters: { + property: { + title: 'Property', + scope: { + label: 'Scope', + value: TypeFormPropertyScope.GLOBAL, + enabled: true, + mode: 'edit' + }, + code: { + label: 'Code', + value: 'NEW_GLOBAL_PROPERTY', + enabled: true, + mode: 'edit', + options: [EXISTING_GLOBAL_PROPERTY.getCode()] + }, + dataType: { + label: 'Data Type', + value: null, + enabled: true, + mode: 'edit' + }, + label: { + label: 'Label', + value: null, + enabled: true, + mode: 'edit' + }, + description: { + label: 'Description', + value: null, + enabled: true, + mode: 'edit' + }, + plugin: { + label: 'Dynamic Plugin', + value: null, + enabled: true, + mode: 'edit' + }, + visible: { + label: 'Visible', + value: true, + enabled: true, + mode: 'edit' + }, + mandatory: { + label: 'Mandatory', + value: false, + enabled: true, + mode: 'edit' + } + } + }, + buttons: { + addSection: { + enabled: true + }, + addProperty: { + enabled: true + }, + remove: { + enabled: true + }, + save: { + enabled: true + }, + message: { + text: 'You have unsaved changes.', + type: 'warning' + }, + edit: null, + cancel: null + } + }) + + form.getParameters().getProperty().getDataType().change('VARCHAR') + form.getParameters().getProperty().getLabel().change('New Label') + form.getParameters().getProperty().getDescription().change('New Description') + form + .getParameters() + .getProperty() + .getPlugin() + .change(fixture.ANOTHER_PLUGIN_DTO.getName()) + form.getParameters().getProperty().getVisible().change(false) + form.getParameters().getProperty().getMandatory().change(true) + await form.update() + + form.expectJSON({ + preview: { + sections: [ + { + name: null, + properties: [{ code: 'NEW_GLOBAL_PROPERTY' }] + } + ] + }, + parameters: { + property: { + title: 'Property', + scope: { + label: 'Scope', + value: TypeFormPropertyScope.GLOBAL, + enabled: true, + mode: 'edit' + }, + code: { + label: 'Code', + value: 'NEW_GLOBAL_PROPERTY', + enabled: true, + mode: 'edit', + options: [EXISTING_GLOBAL_PROPERTY.getCode()] + }, + dataType: { + label: 'Data Type', + value: 'VARCHAR', + enabled: true, + mode: 'edit' + }, + label: { + label: 'Label', + value: 'New Label', + enabled: true, + mode: 'edit' + }, + description: { + label: 'Description', + value: 'New Description', + enabled: true, + mode: 'edit' + }, + plugin: { + label: 'Dynamic Plugin', + value: fixture.ANOTHER_PLUGIN_DTO.getName(), + enabled: true, + mode: 'edit' + }, + visible: { + label: 'Visible', + value: false, + enabled: true, + mode: 'edit' + }, + mandatory: { + label: 'Mandatory', + value: true, + enabled: true, + mode: 'edit' + } + } + }, + buttons: { + addSection: { + enabled: true + }, + addProperty: { + enabled: true + }, + remove: { + enabled: true + }, + save: { + enabled: true + }, + message: { + text: 'You have unsaved changes.', + type: 'warning' + }, + edit: null, + cancel: null + } + }) +} + +async function testAddExistingGlobalProperty() { + const EXISTING_GLOBAL_PROPERTY = new openbis.PropertyType() + EXISTING_GLOBAL_PROPERTY.setCode('EXISTING_GLOBAL_PROPERTY') + EXISTING_GLOBAL_PROPERTY.setDataType('CONTROLLEDVOCABULARY') + EXISTING_GLOBAL_PROPERTY.setVocabulary(fixture.TEST_VOCABULARY_DTO) + EXISTING_GLOBAL_PROPERTY.setLabel('Existing Label') + EXISTING_GLOBAL_PROPERTY.setDescription('Existing Description') + + common.facade.loadGlobalPropertyTypes.mockReturnValue( + Promise.resolve([EXISTING_GLOBAL_PROPERTY]) + ) + common.facade.loadDynamicPlugins.mockReturnValue( + Promise.resolve([fixture.TEST_PLUGIN_DTO, fixture.ANOTHER_PLUGIN_DTO]) + ) + common.facade.loadVocabularies.mockReturnValue( + Promise.resolve([fixture.TEST_VOCABULARY_DTO]) + ) + + const form = await common.mountNew() + + form.getButtons().getAddSection().click() + await form.update() + + form.getButtons().getAddProperty().click() + await form.update() + + form + .getParameters() + .getProperty() + .getScope() + .change(TypeFormPropertyScope.GLOBAL) + await form.update() + + form + .getParameters() + .getProperty() + .getCode() + .change(EXISTING_GLOBAL_PROPERTY.getCode()) + await form.update() + + form.expectJSON({ + preview: { + sections: [ + { + name: null, + properties: [{ code: EXISTING_GLOBAL_PROPERTY.getCode() }] + } + ] + }, + parameters: { + property: { + title: 'Property', + scope: { + label: 'Scope', + value: TypeFormPropertyScope.GLOBAL, + enabled: true, + mode: 'edit' + }, + code: { + label: 'Code', + value: EXISTING_GLOBAL_PROPERTY.getCode(), + enabled: true, + mode: 'edit', + options: [EXISTING_GLOBAL_PROPERTY.getCode()] + }, + dataType: { + label: 'Data Type', + value: EXISTING_GLOBAL_PROPERTY.getDataType(), + enabled: true, + mode: 'edit' + }, + vocabulary: { + label: 'Vocabulary', + value: EXISTING_GLOBAL_PROPERTY.vocabulary.getCode(), + enabled: false, + mode: 'edit' + }, + label: { + label: 'Label', + value: EXISTING_GLOBAL_PROPERTY.getLabel(), + enabled: true, + mode: 'edit' + }, + description: { + label: 'Description', + value: EXISTING_GLOBAL_PROPERTY.getDescription(), + enabled: true, + mode: 'edit' + }, + plugin: { + label: 'Dynamic Plugin', + value: null, + enabled: true, + mode: 'edit' + }, + visible: { + label: 'Visible', + value: true, + enabled: true, + mode: 'edit' + }, + mandatory: { + label: 'Mandatory', + value: false, + enabled: true, + mode: 'edit' + } + } + }, + buttons: { + addSection: { + enabled: true + }, + addProperty: { + enabled: true + }, + remove: { + enabled: true + }, + save: { + enabled: true + }, + message: { + text: 'You have unsaved changes.', + type: 'warning' + }, + edit: null, + cancel: null + } + }) + + form + .getParameters() + .getProperty() + .getPlugin() + .change(fixture.ANOTHER_PLUGIN_DTO.getName()) + form.getParameters().getProperty().getVisible().change(false) + form.getParameters().getProperty().getMandatory().change(true) + await form.update() + + form.expectJSON({ + preview: { + sections: [ + { + name: null, + properties: [{ code: EXISTING_GLOBAL_PROPERTY.getCode() }] + } + ] + }, + parameters: { + property: { + title: 'Property', + scope: { + label: 'Scope', + value: TypeFormPropertyScope.GLOBAL, + enabled: true, + mode: 'edit' + }, + code: { + label: 'Code', + value: EXISTING_GLOBAL_PROPERTY.getCode(), + enabled: true, + mode: 'edit', + options: [EXISTING_GLOBAL_PROPERTY.getCode()] + }, + dataType: { + label: 'Data Type', + value: EXISTING_GLOBAL_PROPERTY.getDataType(), + enabled: true, + mode: 'edit' + }, + vocabulary: { + label: 'Vocabulary', + value: EXISTING_GLOBAL_PROPERTY.vocabulary.getCode(), + enabled: false, + mode: 'edit' + }, + label: { + label: 'Label', + value: EXISTING_GLOBAL_PROPERTY.getLabel(), + enabled: true, + mode: 'edit' + }, + description: { + label: 'Description', + value: EXISTING_GLOBAL_PROPERTY.getDescription(), + enabled: true, + mode: 'edit' + }, + plugin: { + label: 'Dynamic Plugin', + value: fixture.ANOTHER_PLUGIN_DTO.getName(), + enabled: true, + mode: 'edit' + }, + visible: { + label: 'Visible', + value: false, + enabled: true, + mode: 'edit' + }, + mandatory: { + label: 'Mandatory', + value: true, + enabled: true, + mode: 'edit' + } + } + }, + buttons: { + addSection: { + enabled: true + }, + addProperty: { + enabled: true + }, + remove: { + enabled: true + }, + save: { + enabled: true + }, + message: { + text: 'You have unsaved changes.', + type: 'warning' + }, + edit: null, + cancel: null + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentAddSection.test.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentAddSection.test.js new file mode 100644 index 0000000000000000000000000000000000000000..8bf337318cea1ae01a526863a4c4a87146288aa3 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentAddSection.test.js @@ -0,0 +1,101 @@ +import TypeFormComponentTest from '@srcTest/js/components/types/form/TypeFormComponentTest.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new TypeFormComponentTest() + common.beforeEach() +}) + +describe(TypeFormComponentTest.SUITE, () => { + test('add section', testAddSection) +}) + +async function testAddSection() { + common.facade.loadValidationPlugins.mockReturnValue( + Promise.resolve([fixture.TEST_SAMPLE_TYPE_DTO.validationPlugin]) + ) + + const form = await common.mountExisting(fixture.TEST_SAMPLE_TYPE_DTO) + + form.expectJSON({ + preview: { + sections: [ + { + name: 'TEST_SECTION_1' + }, + { + name: 'TEST_SECTION_2' + } + ] + }, + buttons: { + edit: { + enabled: true + }, + addSection: null, + addProperty: null, + remove: null, + save: null, + cancel: null, + message: null + } + }) + + form.getButtons().getEdit().click() + await form.update() + + form.getPreview().getSections()[0].click() + form.getButtons().getAddSection().click() + await form.update() + + form.expectJSON({ + preview: { + sections: [ + { + name: 'TEST_SECTION_1' + }, + { + name: null + }, + { + name: 'TEST_SECTION_2' + } + ] + }, + parameters: { + section: { + title: 'Section', + name: { + label: 'Name', + value: null, + enabled: true, + mode: 'edit' + } + } + }, + buttons: { + edit: null, + addSection: { + enabled: true + }, + addProperty: { + enabled: true + }, + remove: { + enabled: true + }, + save: { + enabled: true + }, + cancel: { + enabled: true + }, + message: { + text: 'You have unsaved changes.', + type: 'warning' + } + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentChangeProperty.test.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentChangeProperty.test.js new file mode 100644 index 0000000000000000000000000000000000000000..4675d2303fec59c06cb47b60923fbc49f05f0300 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentChangeProperty.test.js @@ -0,0 +1,493 @@ +import TypeFormComponentTest from '@srcTest/js/components/types/form/TypeFormComponentTest.js' +import objectTypes from '@src/js/common/consts/objectType.js' +import openbis from '@srcTest/js/services/openbis.js' + +let common = null + +beforeEach(() => { + common = new TypeFormComponentTest() + common.beforeEach() +}) + +describe(TypeFormComponentTest.SUITE, () => { + test('change property', testChangeProperty) + test('convert property', testConvertProperty) +}) + +async function testChangeProperty() { + const form = await common.mountNew() + + form.getButtons().getAddSection().click() + await form.update() + + form.getButtons().getAddProperty().click() + await form.update() + + form.getParameters().getProperty().getCode().change('TEST_CODE') + await form.update() + + form.getParameters().getProperty().getDataType().change('VARCHAR') + await form.update() + + form.expectJSON({ + preview: { + sections: [ + { + name: null, + properties: [{ code: 'TEST_CODE', dataType: 'VARCHAR' }] + } + ] + }, + parameters: { + property: { + title: 'Property', + code: { + label: 'Code', + value: 'TEST_CODE', + enabled: true, + mode: 'edit' + }, + dataType: { + label: 'Data Type', + value: 'VARCHAR', + enabled: true, + mode: 'edit' + }, + vocabulary: null, + materialType: null, + schema: null, + transformation: null + } + }, + buttons: { + message: { + text: 'You have unsaved changes.', + type: 'warning' + } + } + }) + + form + .getParameters() + .getProperty() + .getDataType() + .change('CONTROLLEDVOCABULARY') + await form.update() + + form.expectJSON({ + preview: { + sections: [ + { + name: null, + properties: [{ code: 'TEST_CODE', dataType: 'CONTROLLEDVOCABULARY' }] + } + ] + }, + parameters: { + property: { + title: 'Property', + code: { + label: 'Code', + value: 'TEST_CODE', + enabled: true, + mode: 'edit' + }, + dataType: { + label: 'Data Type', + value: 'CONTROLLEDVOCABULARY', + enabled: true, + mode: 'edit' + }, + vocabulary: { + label: 'Vocabulary', + value: null, + enabled: true, + mode: 'edit' + }, + materialType: null, + schema: null, + transformation: null + } + }, + buttons: { + message: { + text: 'You have unsaved changes.', + type: 'warning' + } + } + }) + + form.getParameters().getProperty().getDataType().change('MATERIAL') + await form.update() + + form.expectJSON({ + preview: { + sections: [ + { + name: null, + properties: [{ code: 'TEST_CODE', dataType: 'MATERIAL' }] + } + ] + }, + parameters: { + property: { + title: 'Property', + code: { + label: 'Code', + value: 'TEST_CODE', + enabled: true, + mode: 'edit' + }, + dataType: { + label: 'Data Type', + value: 'MATERIAL', + enabled: true, + mode: 'edit' + }, + vocabulary: null, + materialType: { + label: 'Material Type', + value: null, + enabled: true, + mode: 'edit' + }, + schema: null, + transformation: null + } + }, + buttons: { + message: { + text: 'You have unsaved changes.', + type: 'warning' + } + } + }) + + form.getParameters().getProperty().getDataType().change('XML') + await form.update() + + form.expectJSON({ + preview: { + sections: [ + { + name: null, + properties: [{ code: 'TEST_CODE', dataType: 'XML' }] + } + ] + }, + parameters: { + property: { + title: 'Property', + code: { + label: 'Code', + value: 'TEST_CODE', + enabled: true, + mode: 'edit' + }, + dataType: { + label: 'Data Type', + value: 'XML', + enabled: true, + mode: 'edit' + }, + vocabulary: null, + materialType: null, + schema: { + label: 'XML Schema', + value: null, + enabled: true, + mode: 'edit' + }, + transformation: { + label: 'XSLT Script', + value: null, + enabled: true, + mode: 'edit' + } + } + }, + buttons: { + message: { + text: 'You have unsaved changes.', + type: 'warning' + } + } + }) +} + +async function testConvertProperty() { + const properties = [ + openbis.DataType.INTEGER, + openbis.DataType.REAL, + openbis.DataType.VARCHAR, + openbis.DataType.MULTILINE_VARCHAR, + openbis.DataType.XML, + openbis.DataType.HYPERLINK, + openbis.DataType.TIMESTAMP, + openbis.DataType.DATE, + openbis.DataType.BOOLEAN, + openbis.DataType.CONTROLLEDVOCABULARY, + openbis.DataType.MATERIAL, + openbis.DataType.SAMPLE + ].map(dataType => { + const propertyType = new openbis.PropertyType() + propertyType.setCode(dataType) + propertyType.setDataType(dataType) + const property = new openbis.PropertyAssignment() + property.setPropertyType(propertyType) + return property + }) + + const type = new openbis.SampleType() + type.setCode('TEST_TYPE') + type.setPropertyAssignments(properties) + + common.facade.loadType.mockReturnValue(Promise.resolve(type)) + common.facade.loadUsages.mockReturnValue( + Promise.resolve({ + propertyGlobal: properties.reduce((map, property) => { + map[property.propertyType.code] = 1 + return map + }, {}) + }) + ) + + const suffix = ' (converted)' + let index = 0 + + const form = await common.mount({ + id: type.getCode(), + type: objectTypes.OBJECT_TYPE + }) + + form.getButtons().getEdit().click() + await form.update() + + form.getPreview().getSections()[0].getProperties()[index++].click() + await form.update() + + form.expectJSON({ + parameters: { + property: { + dataType: { + value: 'INTEGER', + enabled: true, + options: [ + { label: openbis.DataType.INTEGER }, + { label: openbis.DataType.VARCHAR + suffix }, + { label: openbis.DataType.MULTILINE_VARCHAR + suffix }, + { label: openbis.DataType.REAL + suffix } + ] + } + } + } + }) + + form.getPreview().getSections()[0].getProperties()[index++].click() + await form.update() + + form.expectJSON({ + parameters: { + property: { + dataType: { + value: 'REAL', + enabled: true, + options: [ + { label: openbis.DataType.REAL }, + { label: openbis.DataType.VARCHAR + suffix }, + { label: openbis.DataType.MULTILINE_VARCHAR + suffix } + ] + } + } + } + }) + + form.getPreview().getSections()[0].getProperties()[index++].click() + await form.update() + + form.expectJSON({ + parameters: { + property: { + dataType: { + value: 'VARCHAR', + enabled: true, + options: [ + { label: openbis.DataType.VARCHAR }, + { label: openbis.DataType.MULTILINE_VARCHAR + suffix } + ] + } + } + } + }) + + form.getPreview().getSections()[0].getProperties()[index++].click() + await form.update() + + form.expectJSON({ + parameters: { + property: { + dataType: { + value: 'MULTILINE_VARCHAR', + enabled: true, + options: [ + { label: openbis.DataType.MULTILINE_VARCHAR }, + { label: openbis.DataType.VARCHAR + suffix } + ] + } + } + } + }) + + form.getPreview().getSections()[0].getProperties()[index++].click() + await form.update() + + form.expectJSON({ + parameters: { + property: { + dataType: { + value: 'XML', + enabled: true, + options: [ + { label: openbis.DataType.XML }, + { label: openbis.DataType.VARCHAR + suffix }, + { label: openbis.DataType.MULTILINE_VARCHAR + suffix } + ] + } + } + } + }) + + form.getPreview().getSections()[0].getProperties()[index++].click() + await form.update() + + form.expectJSON({ + parameters: { + property: { + dataType: { + value: 'HYPERLINK', + enabled: true, + options: [ + { label: openbis.DataType.HYPERLINK }, + { label: openbis.DataType.VARCHAR + suffix }, + { label: openbis.DataType.MULTILINE_VARCHAR + suffix } + ] + } + } + } + }) + + form.getPreview().getSections()[0].getProperties()[index++].click() + await form.update() + + form.expectJSON({ + parameters: { + property: { + dataType: { + value: 'TIMESTAMP', + enabled: true, + options: [ + { label: openbis.DataType.TIMESTAMP }, + { label: openbis.DataType.VARCHAR + suffix }, + { label: openbis.DataType.MULTILINE_VARCHAR + suffix }, + { label: openbis.DataType.DATE + suffix } + ] + } + } + } + }) + + form.getPreview().getSections()[0].getProperties()[index++].click() + await form.update() + + form.expectJSON({ + parameters: { + property: { + dataType: { + value: 'DATE', + enabled: true, + options: [ + { label: openbis.DataType.DATE }, + { label: openbis.DataType.VARCHAR + suffix }, + { label: openbis.DataType.MULTILINE_VARCHAR + suffix } + ] + } + } + } + }) + + form.getPreview().getSections()[0].getProperties()[index++].click() + await form.update() + + form.expectJSON({ + parameters: { + property: { + dataType: { + value: 'BOOLEAN', + enabled: true, + options: [ + { label: openbis.DataType.BOOLEAN }, + { label: openbis.DataType.VARCHAR + suffix }, + { label: openbis.DataType.MULTILINE_VARCHAR + suffix } + ] + } + } + } + }) + + form.getPreview().getSections()[0].getProperties()[index++].click() + await form.update() + + form.expectJSON({ + parameters: { + property: { + dataType: { + value: 'CONTROLLEDVOCABULARY', + enabled: true, + options: [ + { label: openbis.DataType.CONTROLLEDVOCABULARY }, + { label: openbis.DataType.VARCHAR + suffix }, + { label: openbis.DataType.MULTILINE_VARCHAR + suffix } + ] + } + } + } + }) + + form.getPreview().getSections()[0].getProperties()[index++].click() + await form.update() + + form.expectJSON({ + parameters: { + property: { + dataType: { + value: 'MATERIAL', + enabled: true, + options: [ + { label: openbis.DataType.MATERIAL }, + { label: openbis.DataType.VARCHAR + suffix }, + { label: openbis.DataType.MULTILINE_VARCHAR + suffix } + ] + } + } + } + }) + + form.getPreview().getSections()[0].getProperties()[index++].click() + await form.update() + + form.expectJSON({ + parameters: { + property: { + dataType: { + value: 'SAMPLE', + enabled: true, + options: [ + { label: openbis.DataType.SAMPLE }, + { label: openbis.DataType.VARCHAR + suffix }, + { label: openbis.DataType.MULTILINE_VARCHAR + suffix } + ] + } + } + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentChangeSection.test.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentChangeSection.test.js new file mode 100644 index 0000000000000000000000000000000000000000..7531cddcf5d54915d05d8ed536e314e6de25bbb3 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentChangeSection.test.js @@ -0,0 +1,87 @@ +import TypeFormComponentTest from '@srcTest/js/components/types/form/TypeFormComponentTest.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new TypeFormComponentTest() + common.beforeEach() +}) + +describe(TypeFormComponentTest.SUITE, () => { + test('change section', testChangeSection) +}) + +async function testChangeSection() { + common.facade.loadValidationPlugins.mockReturnValue( + Promise.resolve([fixture.TEST_SAMPLE_TYPE_DTO.validationPlugin]) + ) + + const form = await common.mountExisting(fixture.TEST_SAMPLE_TYPE_DTO) + + form.getButtons().getEdit().click() + await form.update() + + form.getPreview().getSections()[1].click() + await form.update() + + form.expectJSON({ + preview: { + sections: [ + { + name: 'TEST_SECTION_1' + }, + { + name: 'TEST_SECTION_2' + } + ] + }, + parameters: { + section: { + title: 'Section', + name: { + label: 'Name', + value: 'TEST_SECTION_2', + enabled: true, + mode: 'edit' + } + } + }, + buttons: { + message: null + } + }) + + form.getParameters().getSection().getName().change('NEW_NAME') + await form.update() + + form.expectJSON({ + preview: { + sections: [ + { + name: 'TEST_SECTION_1' + }, + { + name: 'NEW_NAME' + } + ] + }, + parameters: { + section: { + title: 'Section', + name: { + label: 'Name', + value: 'NEW_NAME', + enabled: true, + mode: 'edit' + } + } + }, + buttons: { + message: { + text: 'You have unsaved changes.', + type: 'warning' + } + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentChangeType.test.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentChangeType.test.js new file mode 100644 index 0000000000000000000000000000000000000000..6b61509eb75efc7172fd9e7057b691e84103e54a --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentChangeType.test.js @@ -0,0 +1,108 @@ +import TypeFormComponentTest from '@srcTest/js/components/types/form/TypeFormComponentTest.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new TypeFormComponentTest() + common.beforeEach() +}) + +describe(TypeFormComponentTest.SUITE, () => { + test('change type', testChangeType) +}) + +async function testChangeType() { + common.facade.loadValidationPlugins.mockReturnValue( + Promise.resolve([fixture.TEST_SAMPLE_TYPE_DTO.validationPlugin]) + ) + + const form = await common.mountExisting(fixture.TEST_SAMPLE_TYPE_DTO) + + form.expectJSON({ + preview: { + header: { + code: { + label: 'Code', + value: null, + enabled: false, + mode: 'edit' + } + } + }, + parameters: { + type: { + title: 'Type', + autoGeneratedCode: { + label: 'Generate Codes', + value: false, + mode: 'view' + }, + generatedCodePrefix: { + label: 'Generated code prefix', + value: 'TEST_PREFIX_', + mode: 'view' + } + } + }, + buttons: { + message: null + } + }) + + form.getButtons().getEdit().click() + await form.update() + + form.expectJSON({ + preview: { + header: { + code: { + label: 'Code', + value: null, + enabled: true, + mode: 'edit' + } + } + } + }) + + form.getParameters().getType().getAutoGeneratedCode().change(true) + form.getParameters().getType().getGeneratedCodePrefix().change('NEW_PREFIX_') + await form.update() + + form.expectJSON({ + preview: { + header: { + code: { + label: 'Code', + value: 'NEW_PREFIX_', + enabled: false, + mode: 'edit' + } + } + }, + parameters: { + type: { + title: 'Type', + autoGeneratedCode: { + label: 'Generate Codes', + value: true, + enabled: true, + mode: 'edit' + }, + generatedCodePrefix: { + label: 'Generated code prefix', + value: 'NEW_PREFIX_', + enabled: true, + mode: 'edit' + } + } + }, + buttons: { + message: { + text: 'You have unsaved changes.', + type: 'warning' + } + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentInternal.test.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentInternal.test.js new file mode 100644 index 0000000000000000000000000000000000000000..ecf0117db81c1efe3566faaa1e90112499433302 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentInternal.test.js @@ -0,0 +1,148 @@ +import TypeFormComponentTest from '@srcTest/js/components/types/form/TypeFormComponentTest.js' +import objectTypes from '@src/js/common/consts/objectType.js' +import openbis from '@srcTest/js/services/openbis.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new TypeFormComponentTest() + common.beforeEach() +}) + +describe(TypeFormComponentTest.SUITE, () => { + test('internal', testInternal) +}) + +async function testInternal() { + await doTestInternal(true, fixture.SYSTEM_USER_DTO, fixture.SYSTEM_USER_DTO) + await doTestInternal(false, fixture.SYSTEM_USER_DTO, fixture.SYSTEM_USER_DTO) + await doTestInternal(true, fixture.SYSTEM_USER_DTO, fixture.TEST_USER_DTO) + await doTestInternal(false, fixture.SYSTEM_USER_DTO, fixture.TEST_USER_DTO) + await doTestInternal(true, fixture.TEST_USER_DTO, fixture.TEST_USER_DTO) + await doTestInternal(false, fixture.TEST_USER_DTO, fixture.TEST_USER_DTO) + await doTestInternal(true, fixture.TEST_USER_DTO, fixture.SYSTEM_USER_DTO) + await doTestInternal(false, fixture.TEST_USER_DTO, fixture.SYSTEM_USER_DTO) +} + +async function doTestInternal( + propertyTypeInternal, + propertyTypeRegistrator, + propertyAssignmentRegistrator +) { + const isSystemInternalPropertyType = + propertyTypeInternal && + propertyTypeRegistrator.userId === fixture.SYSTEM_USER_DTO.userId + + const isSystemInternalPropertyAssignment = + propertyTypeInternal && + propertyAssignmentRegistrator.userId === fixture.SYSTEM_USER_DTO.userId + + const propertyType = new openbis.PropertyType() + propertyType.setCode('TEST_PROPERTY') + propertyType.setManagedInternally(propertyTypeInternal) + propertyType.setRegistrator(propertyTypeRegistrator) + propertyType.setDataType(openbis.DataType.VARCHAR) + + const propertyAssignment = new openbis.PropertyAssignment() + propertyAssignment.setPropertyType(propertyType) + propertyAssignment.setPlugin(fixture.TEST_PLUGIN_DTO) + propertyAssignment.setRegistrator(propertyAssignmentRegistrator) + + const type = new openbis.SampleType() + type.setCode('TEST_TYPE') + type.setPropertyAssignments([propertyAssignment]) + + common.facade.loadType.mockReturnValue(Promise.resolve(type)) + common.facade.loadDynamicPlugins.mockReturnValue( + Promise.resolve([propertyAssignment.plugin]) + ) + + const form = await common.mount({ + id: type.getCode(), + type: objectTypes.OBJECT_TYPE + }) + + form.getButtons().getEdit().click() + await form.update() + + form.expectJSON({ + parameters: { + type: { + title: 'Type', + code: { + value: type.getCode(), + enabled: false + }, + description: { + value: type.getDescription(), + enabled: true + } + } + } + }) + + form.getPreview().getSections()[0].getProperties()[0].click() + await form.update() + + form.expectJSON({ + parameters: { + property: { + title: 'Property', + code: { + value: propertyType.getCode(), + enabled: false + }, + dataType: { + value: propertyType.getDataType(), + enabled: !isSystemInternalPropertyType + }, + label: { + value: propertyType.getLabel(), + enabled: !isSystemInternalPropertyType + }, + description: { + value: propertyType.getDescription(), + enabled: !isSystemInternalPropertyType + }, + plugin: { + value: propertyAssignment.plugin.getName(), + enabled: !isSystemInternalPropertyAssignment + }, + mandatory: { + value: propertyAssignment.isMandatory(), + enabled: !isSystemInternalPropertyAssignment + }, + visible: { + value: propertyAssignment.isShowInEditView(), + enabled: !isSystemInternalPropertyAssignment + } + } + }, + buttons: { + remove: { + enabled: !isSystemInternalPropertyAssignment + } + } + }) + + form.getPreview().getSections()[0].click() + await form.update() + + form.expectJSON({ + parameters: { + section: { + title: 'Section', + name: { + value: propertyAssignment.getSection(), + enabled: true + } + } + }, + buttons: { + remove: { + enabled: !isSystemInternalPropertyAssignment + } + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentLoad.test.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentLoad.test.js new file mode 100644 index 0000000000000000000000000000000000000000..d13c97bbcc84fa6fd21432094ff725f4e17032a7 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentLoad.test.js @@ -0,0 +1,184 @@ +import TypeFormComponentTest from '@srcTest/js/components/types/form/TypeFormComponentTest.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new TypeFormComponentTest() + common.beforeEach() +}) + +describe(TypeFormComponentTest.SUITE, () => { + test('load new', testLoadNew) + test('load existing', testLoadExisting) +}) + +async function testLoadNew() { + const form = await common.mountNew() + + form.expectJSON({ + preview: { + sections: [] + }, + parameters: { + type: { + title: 'Type', + code: { + label: 'Code', + value: null, + enabled: true, + mode: 'edit' + }, + description: { + label: 'Description', + value: null, + enabled: true, + mode: 'edit' + }, + validationPlugin: { + label: 'Validation Plugin', + value: null, + enabled: true, + mode: 'edit' + } + } + }, + buttons: { + addSection: { + enabled: true + }, + addProperty: { + enabled: false + }, + remove: { + enabled: false + }, + save: { + enabled: true + }, + edit: null, + cancel: null, + message: null + } + }) +} + +async function testLoadExisting() { + common.facade.loadValidationPlugins.mockReturnValue( + Promise.resolve([fixture.TEST_SAMPLE_TYPE_DTO.validationPlugin]) + ) + + const form = await common.mountExisting(fixture.TEST_SAMPLE_TYPE_DTO) + + form.expectJSON({ + preview: { + sections: [ + { + name: 'TEST_SECTION_1', + properties: [{ code: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() }] + }, + { + name: 'TEST_SECTION_2', + properties: [ + { code: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, + { code: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + ] + } + ] + }, + parameters: { + type: { + title: 'Type', + code: { + label: 'Code', + value: fixture.TEST_SAMPLE_TYPE_DTO.getCode(), + mode: 'view' + }, + description: { + label: 'Description', + value: fixture.TEST_SAMPLE_TYPE_DTO.getDescription(), + mode: 'view' + }, + validationPlugin: { + label: 'Validation Plugin', + value: fixture.TEST_SAMPLE_TYPE_DTO.validationPlugin.name, + mode: 'view' + } + } + }, + buttons: { + edit: { + enabled: true + }, + addSection: null, + addProperty: null, + remove: null, + save: null, + cancel: null, + message: null + } + }) + + form.getButtons().getEdit().click() + await form.update() + + form.expectJSON({ + preview: { + sections: [ + { + name: 'TEST_SECTION_1', + properties: [{ code: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() }] + }, + { + name: 'TEST_SECTION_2', + properties: [ + { code: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, + { code: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + ] + } + ] + }, + parameters: { + type: { + title: 'Type', + code: { + label: 'Code', + value: fixture.TEST_SAMPLE_TYPE_DTO.getCode(), + enabled: false, + mode: 'edit' + }, + description: { + label: 'Description', + value: fixture.TEST_SAMPLE_TYPE_DTO.getDescription(), + enabled: true, + mode: 'edit' + }, + validationPlugin: { + label: 'Validation Plugin', + value: fixture.TEST_SAMPLE_TYPE_DTO.validationPlugin.name, + enabled: true, + mode: 'edit' + } + } + }, + buttons: { + addSection: { + enabled: true + }, + addProperty: { + enabled: false + }, + remove: { + enabled: false + }, + save: { + enabled: true + }, + cancel: { + enabled: true + }, + edit: null, + message: null + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentRemoveProperty.test.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentRemoveProperty.test.js new file mode 100644 index 0000000000000000000000000000000000000000..269feb492fb51b1007382b371a7efb47a0dafa51 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentRemoveProperty.test.js @@ -0,0 +1,72 @@ +import TypeFormComponentTest from '@srcTest/js/components/types/form/TypeFormComponentTest.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new TypeFormComponentTest() + common.beforeEach() +}) + +describe(TypeFormComponentTest.SUITE, () => { + test('remove property', testRemoveProperty) +}) + +async function testRemoveProperty() { + common.facade.loadValidationPlugins.mockReturnValue( + Promise.resolve([fixture.TEST_SAMPLE_TYPE_DTO.validationPlugin]) + ) + + const form = await common.mountExisting(fixture.TEST_SAMPLE_TYPE_DTO) + + form.getButtons().getEdit().click() + await form.update() + + form.getPreview().getSections()[1].getProperties()[0].click() + await form.update() + + form.expectJSON({ + preview: { + sections: [ + { + name: 'TEST_SECTION_1', + properties: [{ code: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() }] + }, + { + name: 'TEST_SECTION_2', + properties: [ + { code: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, + { code: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + ] + } + ] + }, + buttons: { + message: null + } + }) + + form.getButtons().getRemove().click() + await form.update() + + form.expectJSON({ + preview: { + sections: [ + { + name: 'TEST_SECTION_1', + properties: [{ code: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() }] + }, + { + name: 'TEST_SECTION_2', + properties: [{ code: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() }] + } + ] + }, + buttons: { + message: { + text: 'You have unsaved changes.', + type: 'warning' + } + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentRemoveSection.test.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentRemoveSection.test.js new file mode 100644 index 0000000000000000000000000000000000000000..5d7da08e00f16dc7c11b86fa30a3021921efa304 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentRemoveSection.test.js @@ -0,0 +1,62 @@ +import TypeFormComponentTest from '@srcTest/js/components/types/form/TypeFormComponentTest.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new TypeFormComponentTest() + common.beforeEach() +}) + +describe(TypeFormComponentTest.SUITE, () => { + test('remove section', testRemoveSection) +}) + +async function testRemoveSection() { + common.facade.loadValidationPlugins.mockReturnValue( + Promise.resolve([fixture.TEST_SAMPLE_TYPE_DTO.validationPlugin]) + ) + + const form = await common.mountExisting(fixture.TEST_SAMPLE_TYPE_DTO) + + form.getButtons().getEdit().click() + await form.update() + + form.getPreview().getSections()[0].click() + await form.update() + + form.expectJSON({ + preview: { + sections: [ + { + name: 'TEST_SECTION_1' + }, + { + name: 'TEST_SECTION_2' + } + ] + }, + buttons: { + message: null + } + }) + + form.getButtons().getRemove().click() + await form.update() + + form.expectJSON({ + preview: { + sections: [ + { + name: 'TEST_SECTION_2' + } + ] + }, + buttons: { + message: { + text: 'You have unsaved changes.', + type: 'warning' + } + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentSelectProperty.test.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentSelectProperty.test.js new file mode 100644 index 0000000000000000000000000000000000000000..1e3d1ff021beb7bc5fc751996c099a7eddcb0cf8 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentSelectProperty.test.js @@ -0,0 +1,167 @@ +import TypeFormComponentTest from '@srcTest/js/components/types/form/TypeFormComponentTest.js' +import TypeFormPropertyScope from '@src/js/components/types/form/TypeFormPropertyScope.js' +import objectTypes from '@src/js/common/consts/objectType.js' +import openbis from '@srcTest/js/services/openbis.js' + +let common = null + +beforeEach(() => { + common = new TypeFormComponentTest() + common.beforeEach() +}) + +describe(TypeFormComponentTest.SUITE, () => { + test('select property local unused', testSelectPropertyLocalUnused) + test('select property local used', testSelectPropertyLocalUsed) + test('select property global unused', testSelectPropertyGlobalUnused) + test('select property global used', testSelectPropertyGlobalUsed) +}) + +async function testSelectPropertyLocalUnused() { + await doTestSelectProperty(TypeFormPropertyScope.LOCAL, false) +} + +async function testSelectPropertyLocalUsed() { + await doTestSelectProperty(TypeFormPropertyScope.LOCAL, true) +} + +async function testSelectPropertyGlobalUnused() { + await doTestSelectProperty(TypeFormPropertyScope.GLOBAL, false) +} + +async function testSelectPropertyGlobalUsed() { + await doTestSelectProperty(TypeFormPropertyScope.GLOBAL, true) +} + +async function doTestSelectProperty(scope, used) { + const plugin = new openbis.Plugin() + plugin.setName('TEST_PLUGIN') + + const propertyType = new openbis.PropertyType() + propertyType.setCode( + scope === TypeFormPropertyScope.GLOBAL + ? 'GLOBAL_PROPERTY' + : 'TEST_TYPE.LOCAL_PROPERTY' + ) + propertyType.setLabel('Test Label') + propertyType.setDescription('Test Description') + propertyType.setDataType(openbis.DataType.VARCHAR) + + const propertyAssignment = new openbis.PropertyAssignment() + propertyAssignment.setPropertyType(propertyType) + propertyAssignment.setPlugin(plugin) + + const type = new openbis.SampleType() + type.setCode('TEST_TYPE') + type.setPropertyAssignments([propertyAssignment]) + + common.facade.loadType.mockReturnValue(Promise.resolve(type)) + common.facade.loadDynamicPlugins.mockReturnValue(Promise.resolve([plugin])) + + const messages = [] + + if (scope === TypeFormPropertyScope.GLOBAL) { + messages.push({ + text: + 'This property is global. Changes will also influence other types where this property is used.', + type: 'warning' + }) + } + + if (used) { + common.facade.loadAssignments.mockReturnValue( + Promise.resolve({ + [propertyType.getCode()]: 2 + }) + ) + messages.push({ + text: 'This property is already assigned to 2 types.', + type: 'info' + }) + + common.facade.loadUsages.mockReturnValue( + Promise.resolve({ + propertyLocal: { + [propertyType.getCode()]: 1 + }, + propertyGlobal: { + [propertyType.getCode()]: 3 + } + }) + ) + messages.push({ + text: + 'This property is already used by 3 entities (1 entity of this type and 2 entities of other types).', + type: 'info' + }) + } + + const form = await common.mount({ + id: type.getCode(), + type: objectTypes.OBJECT_TYPE + }) + + form.getPreview().getSections()[0].getProperties()[0].click() + await form.update() + + form.getButtons().getEdit().click() + await form.update() + + form.expectJSON({ + parameters: { + property: { + title: 'Property', + messages, + scope: { + label: 'Scope', + value: scope, + enabled: false, + mode: 'edit' + }, + code: { + label: 'Code', + value: propertyType.getCode(), + enabled: false, + mode: 'edit' + }, + dataType: { + label: 'Data Type', + value: propertyType.getDataType(), + enabled: true, + mode: 'edit', + options: [ + { + label: openbis.DataType.VARCHAR, + value: openbis.DataType.VARCHAR + }, + { + label: openbis.DataType.MULTILINE_VARCHAR + ' (converted)', + value: openbis.DataType.MULTILINE_VARCHAR + } + ] + }, + label: { + label: 'Label', + value: propertyType.getLabel(), + enabled: true, + mode: 'edit' + }, + description: { + label: 'Description', + value: propertyType.getDescription(), + enabled: true, + mode: 'edit' + }, + plugin: { + label: 'Dynamic Plugin', + value: plugin.getName(), + enabled: true, + mode: 'edit' + } + } + }, + buttons: { + message: null + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentSelectSection.test.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentSelectSection.test.js new file mode 100644 index 0000000000000000000000000000000000000000..90e7b10167009e3688af816e7c943b480a1d71ac --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentSelectSection.test.js @@ -0,0 +1,40 @@ +import TypeFormComponentTest from '@srcTest/js/components/types/form/TypeFormComponentTest.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new TypeFormComponentTest() + common.beforeEach() +}) + +describe(TypeFormComponentTest.SUITE, () => { + test('select section', testSelectSection) +}) + +async function testSelectSection() { + const form = await common.mountExisting(fixture.TEST_SAMPLE_TYPE_DTO) + + form.getPreview().getSections()[1].click() + await form.update() + + form.getButtons().getEdit().click() + await form.update() + + form.expectJSON({ + parameters: { + section: { + title: 'Section', + name: { + label: 'Name', + value: 'TEST_SECTION_2', + enabled: true, + mode: 'edit' + } + } + }, + buttons: { + message: null + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentTest.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentTest.js new file mode 100644 index 0000000000000000000000000000000000000000..13931192b824a1b43703e2ef07ffe1a32270964e --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentTest.js @@ -0,0 +1,54 @@ +import React from 'react' +import ComponentTest from '@srcTest/js/components/common/ComponentTest.js' +import TypeForm from '@src/js/components/types/form/TypeForm.jsx' +import TypeFormWrapper from '@srcTest/js/components/types/form/wrapper/TypeFormWrapper.js' +import TypeFormController from '@src/js/components/types/form/TypeFormController.js' +import TypeFormFacade from '@src/js/components/types/form/TypeFormFacade' +import objectTypes from '@src/js/common/consts/objectType.js' + +jest.mock('@src/js/components/types/form/TypeFormFacade') + +export default class TypeFormComponentTest extends ComponentTest { + static SUITE = 'TypeFormComponent' + + constructor() { + super( + object => <TypeForm object={object} controller={this.controller} />, + wrapper => new TypeFormWrapper(wrapper) + ) + this.facade = null + this.controller = null + } + + async beforeEach() { + super.beforeEach() + + this.facade = new TypeFormFacade() + this.controller = new TypeFormController(this.facade) + + this.facade.loadType.mockReturnValue(Promise.resolve({})) + this.facade.loadUsages.mockReturnValue(Promise.resolve({})) + this.facade.loadDynamicPlugins.mockReturnValue(Promise.resolve([])) + this.facade.loadValidationPlugins.mockReturnValue(Promise.resolve([])) + this.facade.loadMaterials.mockReturnValue(Promise.resolve([])) + this.facade.loadSamples.mockReturnValue(Promise.resolve([])) + this.facade.loadVocabularies.mockReturnValue(Promise.resolve([])) + this.facade.loadVocabularyTerms.mockReturnValue(Promise.resolve([])) + this.facade.loadGlobalPropertyTypes.mockReturnValue(Promise.resolve([])) + } + + async mountNew() { + return await this.mount({ + type: objectTypes.NEW_OBJECT_TYPE + }) + } + + async mountExisting(type) { + this.facade.loadType.mockReturnValue(Promise.resolve(type)) + + return await this.mount({ + id: type.getCode(), + type: objectTypes.OBJECT_TYPE + }) + } +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentValidate.test.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentValidate.test.js new file mode 100644 index 0000000000000000000000000000000000000000..80548a6776632091e12e6dcd5db572e1a80eb23d --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormComponentValidate.test.js @@ -0,0 +1,167 @@ +import TypeFormComponentTest from '@srcTest/js/components/types/form/TypeFormComponentTest.js' + +let common = null + +beforeEach(() => { + common = new TypeFormComponentTest() + common.beforeEach() +}) + +describe(TypeFormComponentTest.SUITE, () => { + test('validate type', testValidateType) + test('validate property', testValidateProperty) + test('validate type and property', testValidateTypeAndProperty) +}) + +async function testValidateType() { + const form = await common.mountNew() + + form.getButtons().getSave().click() + await form.update() + + form.expectJSON({ + parameters: { + type: { + title: 'Type', + code: { + error: 'Code cannot be empty', + focused: true + }, + description: { + error: null + }, + validationPlugin: { + error: null + }, + generatedCodePrefix: { + error: 'Generated code prefix cannot be empty' + } + } + }, + buttons: { + message: null + } + }) + + form.getParameters().getType().getCode().change('I am illegal') + await form.update() + + form.getButtons().getSave().click() + await form.update() + + form.expectJSON({ + parameters: { + type: { + code: { + value: 'I am illegal', + error: 'Code can only contain A-Z, a-z, 0-9 and _, -, .', + focused: true + } + } + }, + buttons: { + message: { + text: 'You have unsaved changes.', + type: 'warning' + } + } + }) +} + +async function testValidateProperty() { + const form = await common.mountNew() + + form.getParameters().getType().getCode().change('TEST_CODE') + form.getParameters().getType().getGeneratedCodePrefix().change('TEST_PREFIX_') + + form.getButtons().getAddSection().click() + form.getButtons().getAddProperty().click() + form.getButtons().getSave().click() + await form.update() + + form.expectJSON({ + parameters: { + property: { + title: 'Property', + scope: { + error: null + }, + code: { + error: 'Code cannot be empty', + focused: true + }, + dataType: { + error: 'Data Type cannot be empty' + }, + label: { + error: 'Label cannot be empty' + }, + description: { + error: 'Description cannot be empty' + }, + plugin: { + error: null + } + } + }, + buttons: { + message: { + text: 'You have unsaved changes.', + type: 'warning' + } + } + }) + + form.getParameters().getProperty().getCode().change('I am illegal') + await form.update() + + form.getButtons().getSave().click() + await form.update() + + form.expectJSON({ + parameters: { + property: { + code: { + value: 'I am illegal', + error: 'Code can only contain A-Z, a-z, 0-9 and _, -, .', + focused: true + } + } + } + }) +} + +async function testValidateTypeAndProperty() { + const form = await common.mountNew() + + form.getButtons().getAddSection().click() + form.getButtons().getAddProperty().click() + form.getButtons().getSave().click() + await form.update() + + form.expectJSON({ + parameters: { + type: { + title: 'Type', + code: { + error: 'Code cannot be empty' + }, + description: { + error: null + }, + validationPlugin: { + error: null + }, + generatedCodePrefix: { + error: 'Generated code prefix cannot be empty' + } + } + }, + buttons: { + message: { + text: 'You have unsaved changes.', + type: 'warning' + } + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerAddProperty.test.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerAddProperty.test.js index a1884dc71e5e2a589a55ee6b7f79619de0da5f1c..f65e8d3341a234f7706f3447e52af558d95dde53 100644 --- a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerAddProperty.test.js +++ b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerAddProperty.test.js @@ -1,209 +1,200 @@ -import ComponentContext from '@srcTest/js/components/common/ComponentContext.js' -import TypeFormControler from '@src/js/components/types/form/TypeFormController.js' +import TypeFormControllerTest from '@srcTest/js/components/types/form/TypeFormControllerTest.js' import TypeFormSelectionType from '@src/js/components/types/form/TypeFormSelectionType.js' -import TypeFormFacade from '@src/js/components/types/form/TypeFormFacade' import objectTypes from '@src/js/common/consts/objectType.js' import fixture from '@srcTest/js/common/fixture.js' -jest.mock('@src/js/components/types/form/TypeFormFacade') - -let context = null -let facade = null -let controller = null +let common = null beforeEach(() => { - jest.resetAllMocks() - context = new ComponentContext() - context.setProps({ - object: { - id: 'TEST_OBJECT_ID', - type: objectTypes.OBJECT_TYPE - } + common = new TypeFormControllerTest() + common.beforeEach() + common.init({ + id: 'TEST_OBJECT_ID', + type: objectTypes.OBJECT_TYPE }) - facade = new TypeFormFacade() - controller = new TypeFormControler(facade) - controller.init(context) }) afterEach(() => { - expect(facade.loadType).toHaveBeenCalledWith(context.getProps().object) - expect(facade.loadUsages).toHaveBeenCalledWith(context.getProps().object) + common.afterEach() }) -describe('TypeFormController.handleAddProperty', () => { - test('add with a section selected', async () => { - facade.loadType.mockReturnValue( - Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) - ) - facade.loadUsages.mockReturnValue(Promise.resolve({})) +describe(TypeFormControllerTest.SUITE, () => { + test('add property with a section selected', testAddWithSectionSelected) + test('add property with a property selected', testAddWithPropertySelected) +}) - await controller.load() - controller.handleSelectionChange(TypeFormSelectionType.SECTION, { - id: 'section-1' - }) +async function testAddWithSectionSelected() { + common.facade.loadType.mockReturnValue( + Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) + ) + common.facade.loadUsages.mockReturnValue(Promise.resolve({})) - expect(context.getState()).toMatchObject({ - selection: { - type: TypeFormSelectionType.SECTION, - params: { - id: 'section-1' - } + await common.controller.load() + common.controller.handleSelectionChange(TypeFormSelectionType.SECTION, { + id: 'section-1' + }) + + expect(common.context.getState()).toMatchObject({ + selection: { + type: TypeFormSelectionType.SECTION, + params: { + id: 'section-1' + } + }, + properties: [ + { + id: 'property-0', + code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } + }, + { + id: 'property-1', + code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } }, - properties: [ - { - id: 'property-0', - code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } - }, - { - id: 'property-1', - code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } - }, - { - id: 'property-2', - code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - } - ], - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] - }) + { + id: 'property-2', + code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + } + ], + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] + }) - controller.handleAddProperty() + common.controller.handleAddProperty() - expect(context.getState()).toMatchObject({ - selection: { - type: TypeFormSelectionType.PROPERTY, - params: { - id: 'property-3' - } + expect(common.context.getState()).toMatchObject({ + selection: { + type: TypeFormSelectionType.PROPERTY, + params: { + id: 'property-3' + } + }, + properties: [ + { + id: 'property-0', + code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } + }, + { + id: 'property-1', + code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } + }, + { + id: 'property-2', + code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } }, - properties: [ - { - id: 'property-0', - code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } - }, - { - id: 'property-1', - code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } - }, - { - id: 'property-2', - code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - }, - { - id: 'property-3', - code: { value: null } - } - ], - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2', 'property-3'] - } - ] - }) + { + id: 'property-3', + code: { value: null } + } + ], + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2', 'property-3'] + } + ] }) +} - test('add with a property selected', async () => { - facade.loadType.mockReturnValue( - Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) - ) - facade.loadUsages.mockReturnValue(Promise.resolve({})) +async function testAddWithPropertySelected() { + common.facade.loadType.mockReturnValue( + Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) + ) + common.facade.loadUsages.mockReturnValue(Promise.resolve({})) - await controller.load() - controller.handleSelectionChange(TypeFormSelectionType.PROPERTY, { - id: 'property-1' - }) + await common.controller.load() + common.controller.handleSelectionChange(TypeFormSelectionType.PROPERTY, { + id: 'property-1' + }) - expect(context.getState()).toMatchObject({ - selection: { - type: TypeFormSelectionType.PROPERTY, - params: { - id: 'property-1' - } + expect(common.context.getState()).toMatchObject({ + selection: { + type: TypeFormSelectionType.PROPERTY, + params: { + id: 'property-1' + } + }, + properties: [ + { + id: 'property-0', + code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } + }, + { + id: 'property-1', + code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } }, - properties: [ - { - id: 'property-0', - code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } - }, - { - id: 'property-1', - code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } - }, - { - id: 'property-2', - code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - } - ], - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] - }) + { + id: 'property-2', + code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + } + ], + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] + }) - controller.handleAddProperty() + common.controller.handleAddProperty() - expect(context.getState()).toMatchObject({ - selection: { - type: TypeFormSelectionType.PROPERTY, - params: { - id: 'property-3' - } + expect(common.context.getState()).toMatchObject({ + selection: { + type: TypeFormSelectionType.PROPERTY, + params: { + id: 'property-3' + } + }, + properties: [ + { + id: 'property-0', + code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } }, - properties: [ - { - id: 'property-0', - code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } - }, - { - id: 'property-1', - code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } - }, - { - id: 'property-2', - code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - }, - { - id: 'property-3', - code: { value: null } - } - ], - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-3', 'property-2'] - } - ] - }) + { + id: 'property-1', + code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } + }, + { + id: 'property-2', + code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + }, + { + id: 'property-3', + code: { value: null } + } + ], + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-3', 'property-2'] + } + ] }) -}) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerAddSection.test.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerAddSection.test.js index dbbbcb0ecd16f76db8b9691c5145c4ddbb2f699b..368cefd8146a458d5c480f2303c953a560ca9a24 100644 --- a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerAddSection.test.js +++ b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerAddSection.test.js @@ -1,208 +1,200 @@ -import ComponentContext from '@srcTest/js/components/common/ComponentContext.js' -import TypeFormControler from '@src/js/components/types/form/TypeFormController.js' +import TypeFormControllerTest from '@srcTest/js/components/types/form/TypeFormControllerTest.js' import TypeFormSelectionType from '@src/js/components/types/form/TypeFormSelectionType.js' -import TypeFormFacade from '@src/js/components/types/form/TypeFormFacade' import objectTypes from '@src/js/common/consts/objectType.js' import fixture from '@srcTest/js/common/fixture.js' -jest.mock('@src/js/components/types/form/TypeFormFacade') - -let context = null -let facade = null -let controller = null +let common = null beforeEach(() => { - jest.resetAllMocks() - context = new ComponentContext() - context.setProps({ - object: { - id: 'TEST_OBJECT_ID', - type: objectTypes.OBJECT_TYPE - } + common = new TypeFormControllerTest() + common.beforeEach() + common.init({ + id: 'TEST_OBJECT_ID', + type: objectTypes.OBJECT_TYPE }) - facade = new TypeFormFacade() - controller = new TypeFormControler(facade) - controller.init(context) }) afterEach(() => { - expect(facade.loadType).toHaveBeenCalledWith(context.getProps().object) - expect(facade.loadUsages).toHaveBeenCalledWith(context.getProps().object) + common.afterEach() +}) + +describe(TypeFormControllerTest.SUITE, () => { + test('add section with nothing selected', testAddWithNothingSelected) + test('add section with a property selected', testAddWithPropertySelected) + test('add section with a section selected', testAddWithSectionSelected) }) -describe('TypeFormController.handleAddProperty', () => { - test('add with nothing selected', async () => { - facade.loadType.mockReturnValue( - Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) - ) - facade.loadUsages.mockReturnValue(Promise.resolve({})) - - await controller.load() - - expect(context.getState()).toMatchObject({ - selection: null, - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] - }) - - controller.handleAddSection() - - expect(context.getState()).toMatchObject({ - selection: { - type: TypeFormSelectionType.SECTION, - params: { - id: 'section-2' - } +async function testAddWithNothingSelected() { + common.facade.loadType.mockReturnValue( + Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) + ) + common.facade.loadUsages.mockReturnValue(Promise.resolve({})) + + await common.controller.load() + + expect(common.context.getState()).toMatchObject({ + selection: null, + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] }, - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - }, - { - id: 'section-2', - name: { value: null }, - properties: [] - } - ] - }) + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] }) - test('add with a property selected', async () => { - facade.loadType.mockReturnValue( - Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) - ) - facade.loadUsages.mockReturnValue(Promise.resolve({})) - - await controller.load() - controller.handleSelectionChange(TypeFormSelectionType.PROPERTY, { - id: 'property-0' - }) - - expect(context.getState()).toMatchObject({ - selection: { - type: TypeFormSelectionType.PROPERTY, - params: { - id: 'property-0' - } + common.controller.handleAddSection() + + expect(common.context.getState()).toMatchObject({ + selection: { + type: TypeFormSelectionType.SECTION, + params: { + id: 'section-2' + } + }, + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] }, - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] - }) - - controller.handleAddSection() - - expect(context.getState()).toMatchObject({ - selection: { - type: TypeFormSelectionType.SECTION, - params: { - id: 'section-2' - } + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + }, + { + id: 'section-2', + name: { value: null }, + properties: [] + } + ] + }) +} + +async function testAddWithPropertySelected() { + common.facade.loadType.mockReturnValue( + Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) + ) + common.facade.loadUsages.mockReturnValue(Promise.resolve({})) + + await common.controller.load() + common.controller.handleSelectionChange(TypeFormSelectionType.PROPERTY, { + id: 'property-0' + }) + + expect(common.context.getState()).toMatchObject({ + selection: { + type: TypeFormSelectionType.PROPERTY, + params: { + id: 'property-0' + } + }, + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] }, - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-2', - name: { value: null }, - properties: [] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] - }) + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] }) - test('add with a section selected', async () => { - facade.loadType.mockReturnValue( - Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) - ) - facade.loadUsages.mockReturnValue(Promise.resolve({})) - - await controller.load() - controller.handleSelectionChange(TypeFormSelectionType.SECTION, { - id: 'section-0' - }) - - expect(context.getState()).toMatchObject({ - selection: { - type: TypeFormSelectionType.SECTION, - params: { - id: 'section-0' - } + common.controller.handleAddSection() + + expect(common.context.getState()).toMatchObject({ + selection: { + type: TypeFormSelectionType.SECTION, + params: { + id: 'section-2' + } + }, + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] }, - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] - }) - - controller.handleAddSection() - - expect(context.getState()).toMatchObject({ - selection: { - type: TypeFormSelectionType.SECTION, - params: { - id: 'section-2' - } + { + id: 'section-2', + name: { value: null }, + properties: [] }, - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-2', - name: { value: null }, - properties: [] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] - }) + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] }) -}) +} + +async function testAddWithSectionSelected() { + common.facade.loadType.mockReturnValue( + Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) + ) + common.facade.loadUsages.mockReturnValue(Promise.resolve({})) + + await common.controller.load() + common.controller.handleSelectionChange(TypeFormSelectionType.SECTION, { + id: 'section-0' + }) + + expect(common.context.getState()).toMatchObject({ + selection: { + type: TypeFormSelectionType.SECTION, + params: { + id: 'section-0' + } + }, + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] + }) + + common.controller.handleAddSection() + + expect(common.context.getState()).toMatchObject({ + selection: { + type: TypeFormSelectionType.SECTION, + params: { + id: 'section-2' + } + }, + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-2', + name: { value: null }, + properties: [] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerChange.test.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerChange.test.js index 54d63ebcd39b971e77b04cc71a72826af9e8c7e4..e47eacf5d3e1a7e9e505023648703c6f70cdb5b4 100644 --- a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerChange.test.js +++ b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerChange.test.js @@ -1,155 +1,147 @@ -import ComponentContext from '@srcTest/js/components/common/ComponentContext.js' -import TypeFormControler from '@src/js/components/types/form/TypeFormController.js' +import TypeFormControllerTest from '@srcTest/js/components/types/form/TypeFormControllerTest.js' import TypeFormSelectionType from '@src/js/components/types/form/TypeFormSelectionType.js' -import TypeFormFacade from '@src/js/components/types/form/TypeFormFacade' import objectTypes from '@src/js/common/consts/objectType.js' import fixture from '@srcTest/js/common/fixture.js' -jest.mock('@src/js/components/types/form/TypeFormFacade') - -let context = null -let facade = null -let controller = null +let common = null beforeEach(() => { - jest.resetAllMocks() - context = new ComponentContext() - context.setProps({ - object: { - id: 'TEST_OBJECT_ID', - type: objectTypes.OBJECT_TYPE - } + common = new TypeFormControllerTest() + common.beforeEach() + common.init({ + id: 'TEST_OBJECT_ID', + type: objectTypes.OBJECT_TYPE }) - facade = new TypeFormFacade() - controller = new TypeFormControler(facade) - controller.init(context) }) afterEach(() => { - expect(facade.loadType).toHaveBeenCalledWith(context.getProps().object) - expect(facade.loadUsages).toHaveBeenCalledWith(context.getProps().object) + common.afterEach() }) -describe('TypeFormController.handleChange', () => { - test('type', async () => { - facade.loadType.mockReturnValue( - Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) - ) - facade.loadUsages.mockReturnValue(Promise.resolve({})) +describe(TypeFormControllerTest.SUITE, () => { + test('change type', testChangeType) + test('change section', testChangeSection) + test('change property', testChangeProperty) +}) - await controller.load() +async function testChangeType() { + common.facade.loadType.mockReturnValue( + Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) + ) + common.facade.loadUsages.mockReturnValue(Promise.resolve({})) - expect(context.getState()).toMatchObject({ - type: { - description: { value: 'TEST_DESCRIPTION' } + await common.controller.load() + + expect(common.context.getState()).toMatchObject({ + type: { + description: { value: 'TEST_DESCRIPTION' } + } + }) + + common.controller.handleChange(TypeFormSelectionType.TYPE, { + field: 'description', + value: 'NEW_DESCRIPTION' + }) + + expect(common.context.getState()).toMatchObject({ + type: { + description: { value: 'NEW_DESCRIPTION' } + } + }) +} + +async function testChangeSection() { + common.facade.loadType.mockReturnValue( + Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) + ) + common.facade.loadUsages.mockReturnValue(Promise.resolve({})) + + await common.controller.load() + + expect(common.context.getState()).toMatchObject({ + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] } - }) + ] + }) - controller.handleChange(TypeFormSelectionType.TYPE, { - field: 'description', - value: 'NEW_DESCRIPTION' - }) + common.controller.handleChange(TypeFormSelectionType.SECTION, { + id: 'section-1', + field: 'name', + value: 'TEST_NAME' + }) - expect(context.getState()).toMatchObject({ - type: { - description: { value: 'NEW_DESCRIPTION' } + expect(common.context.getState()).toMatchObject({ + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_NAME' }, + properties: ['property-1', 'property-2'] } - }) + ] + }) +} + +async function testChangeProperty() { + common.facade.loadType.mockReturnValue( + Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) + ) + common.facade.loadUsages.mockReturnValue(Promise.resolve({})) + + await common.controller.load() + + expect(common.context.getState()).toMatchObject({ + properties: [ + { + id: 'property-0', + code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } + }, + { + id: 'property-1', + code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, + description: { value: null } + }, + { + id: 'property-2', + code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + } + ] }) - test('section', async () => { - facade.loadType.mockReturnValue( - Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) - ) - facade.loadUsages.mockReturnValue(Promise.resolve({})) - - await controller.load() - - expect(context.getState()).toMatchObject({ - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] - }) - - controller.handleChange(TypeFormSelectionType.SECTION, { - id: 'section-1', - field: 'name', - value: 'TEST_NAME' - }) - - expect(context.getState()).toMatchObject({ - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_NAME' }, - properties: ['property-1', 'property-2'] - } - ] - }) + common.controller.handleChange(TypeFormSelectionType.PROPERTY, { + id: 'property-1', + field: 'description', + value: 'TEST_DESCRIPTION' }) - test('property', async () => { - facade.loadType.mockReturnValue( - Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) - ) - facade.loadUsages.mockReturnValue(Promise.resolve({})) - - await controller.load() - - expect(context.getState()).toMatchObject({ - properties: [ - { - id: 'property-0', - code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } - }, - { - id: 'property-1', - code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, - description: { value: null } - }, - { - id: 'property-2', - code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - } - ] - }) - - controller.handleChange(TypeFormSelectionType.PROPERTY, { - id: 'property-1', - field: 'description', - value: 'TEST_DESCRIPTION' - }) - - expect(context.getState()).toMatchObject({ - properties: [ - { - id: 'property-0', - code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } - }, - { - id: 'property-1', - code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, - description: { value: 'TEST_DESCRIPTION' } - }, - { - id: 'property-2', - code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - } - ] - }) + expect(common.context.getState()).toMatchObject({ + properties: [ + { + id: 'property-0', + code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } + }, + { + id: 'property-1', + code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, + description: { value: 'TEST_DESCRIPTION' } + }, + { + id: 'property-2', + code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + } + ] }) -}) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerLoad.test.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerLoad.test.js index 6e64884070f2800fe8597d2173c7d40fada87e1b..91bbd1df4adedcacc617d3ec8616fd57d2d7b72e 100644 --- a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerLoad.test.js +++ b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerLoad.test.js @@ -1,11 +1,287 @@ -import ComponentContext from '@srcTest/js/components/common/ComponentContext.js' -import TypeFormControler from '@src/js/components/types/form/TypeFormController.js' +import TypeFormControllerTest from '@srcTest/js/components/types/form/TypeFormControllerTest.js' import TypeFormSelectionType from '@src/js/components/types/form/TypeFormSelectionType.js' -import TypeFormFacade from '@src/js/components/types/form/TypeFormFacade' import objectTypes from '@src/js/common/consts/objectType.js' import openbis from '@srcTest/js/services/openbis.js' -jest.mock('@src/js/components/types/form/TypeFormFacade') +let common = null + +beforeEach(() => { + common = new TypeFormControllerTest() + common.beforeEach() +}) + +describe(TypeFormControllerTest.SUITE, () => { + test('load successful existing', testLoadSuccessfulExisting) + test('load successful new', testLoadSuccessfulNew) + test('load maintains section selection', testLoadMaintainsSectionSelection) + test('load maintains property selection', testLoadMaintainsPropertySelection) +}) + +async function testLoadSuccessfulExisting() { + common.init({ + id: 'TEST_OBJECT_ID', + type: objectTypes.OBJECT_TYPE + }) + + common.facade.loadType.mockReturnValue(Promise.resolve(TEST_SAMPLE_TYPE_DTO)) + common.facade.loadUsages.mockReturnValue( + Promise.resolve({ + type: 10, + propertyLocal: { + [TEST_PROPERTY_TYPE_1_DTO.getCode()]: 1, + [TEST_PROPERTY_TYPE_2_DTO.getCode()]: 2 + }, + propertyGlobal: { + [TEST_PROPERTY_TYPE_1_DTO.getCode()]: 10, + [TEST_PROPERTY_TYPE_2_DTO.getCode()]: 20 + } + }) + ) + + await common.controller.load() + + expect(common.context.getState()).toMatchObject({ + loading: false, + selection: null, + type: { + code: { value: 'TEST_TYPE' }, + description: { value: 'TEST_DESCRIPTION' }, + listable: { value: true }, + showContainer: { value: true }, + showParents: { value: true }, + showParentMetadata: { value: true }, + autoGeneratedCode: { value: true }, + generatedCodePrefix: { value: 'TEST_PREFIX' }, + subcodeUnique: { value: true }, + validationPlugin: { value: 'TEST_PLUGIN_2' }, + usages: 10 + }, + properties: [ + { + id: 'property-0', + code: { value: 'TEST_PROPERTY_TYPE_1' }, + label: { value: 'TEST_LABEL_1' }, + description: { value: 'TEST_DESCRIPTION_1' }, + dataType: { value: 'INTEGER' }, + plugin: { value: 'TEST_PLUGIN_1' }, + mandatory: { value: true }, + showInEditView: { value: true }, + showRawValueInForms: { value: true }, + usagesLocal: 1, + usagesGlobal: 10, + section: 'section-0' + }, + { + id: 'property-1', + code: { value: 'TEST_PROPERTY_TYPE_2' }, + label: { value: 'TEST_LABEL_2' }, + description: { value: 'TEST_DESCRIPTION_2' }, + dataType: { value: 'CONTROLLEDVOCABULARY' }, + vocabulary: { value: 'TEST_VOCABULARY' }, + mandatory: { value: true }, + showInEditView: { value: false }, + showRawValueInForms: { value: true }, + usagesLocal: 2, + usagesGlobal: 20, + section: 'section-1' + }, + { + id: 'property-2', + code: { value: 'TEST_PROPERTY_TYPE_3' }, + label: { value: 'TEST_LABEL_3' }, + description: { value: 'TEST_DESCRIPTION_3' }, + dataType: { value: 'MATERIAL' }, + materialType: { value: 'TEST_MATERIAL_TYPE' }, + mandatory: { value: false }, + showInEditView: { value: true }, + showRawValueInForms: { value: false }, + usagesLocal: 0, + usagesGlobal: 0, + section: 'section-1' + } + ], + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] + }) + + expect(common.facade.loadType).toHaveBeenCalledWith( + common.context.getProps().object + ) + expect(common.facade.loadUsages).toHaveBeenCalledWith( + common.context.getProps().object + ) +} + +async function testLoadSuccessfulNew() { + common.init({ + id: 'TEST_OBJECT_ID', + type: objectTypes.NEW_OBJECT_TYPE + }) + + await common.controller.load() + + expect(common.context.getState()).toMatchObject({ + loading: false, + selection: null, + type: { + code: { value: null }, + description: { value: null }, + listable: { value: true }, + showContainer: { value: false }, + showParents: { value: true }, + showParentMetadata: { value: false }, + autoGeneratedCode: { value: true }, + generatedCodePrefix: { value: null }, + subcodeUnique: { value: false }, + validationPlugin: { value: null }, + usages: 0 + }, + properties: [], + sections: [] + }) +} + +async function testLoadMaintainsSectionSelection() { + common.init({ + id: 'TEST_OBJECT_ID', + type: objectTypes.OBJECT_TYPE + }) + + common.facade.loadType.mockReturnValue( + Promise.resolve(new openbis.SampleType()) + ) + common.facade.loadUsages.mockReturnValue({}) + + await common.controller.load() + + common.controller.handleAddSection() + common.controller.handleAddProperty() + common.controller.handleAddProperty() + common.controller.handleAddSection() + common.controller.handleAddProperty() + common.controller.handleOrderChange(TypeFormSelectionType.SECTION, { + fromIndex: 0, + toIndex: 1 + }) + common.controller.handleSelectionChange(TypeFormSelectionType.SECTION, { + id: 'section-0' + }) + + expect(common.context.getState()).toMatchObject({ + selection: { + type: TypeFormSelectionType.SECTION, + params: { id: 'section-0' } + }, + sections: [ + { + id: 'section-1', + properties: ['property-2'] + }, + { + id: 'section-0', + properties: ['property-0', 'property-1'] + } + ] + }) + + common.facade.loadType.mockReturnValue(Promise.resolve(TEST_SAMPLE_TYPE_DTO)) + common.facade.loadUsages.mockReturnValue({}) + + await common.controller.load() + + expect(common.context.getState()).toMatchObject({ + selection: { + type: TypeFormSelectionType.SECTION, + params: { id: 'section-1' } + }, + sections: [ + { + id: 'section-0', + properties: ['property-0'] + }, + { + id: 'section-1', + properties: ['property-1', 'property-2'] + } + ] + }) +} + +async function testLoadMaintainsPropertySelection() { + common.init({ + id: 'TEST_OBJECT_ID', + type: objectTypes.OBJECT_TYPE + }) + + common.facade.loadType.mockReturnValue( + Promise.resolve(new openbis.SampleType()) + ) + common.facade.loadUsages.mockReturnValue({}) + + await common.controller.load() + + common.controller.handleAddSection() + common.controller.handleAddProperty() + common.controller.handleAddProperty() + common.controller.handleAddSection() + common.controller.handleAddProperty() + common.controller.handleOrderChange(TypeFormSelectionType.SECTION, { + fromIndex: 0, + toIndex: 1 + }) + common.controller.handleSelectionChange(TypeFormSelectionType.PROPERTY, { + id: 'property-1' + }) + + expect(common.context.getState()).toMatchObject({ + selection: { + type: TypeFormSelectionType.PROPERTY, + params: { id: 'property-1' } + }, + sections: [ + { + id: 'section-1', + properties: ['property-2'] + }, + { + id: 'section-0', + properties: ['property-0', 'property-1'] + } + ] + }) + + common.facade.loadType.mockReturnValue(Promise.resolve(TEST_SAMPLE_TYPE_DTO)) + common.facade.loadUsages.mockReturnValue({}) + + await common.controller.load() + + expect(common.context.getState()).toMatchObject({ + selection: { + type: TypeFormSelectionType.PROPERTY, + params: { id: 'property-2' } + }, + sections: [ + { + id: 'section-0', + properties: ['property-0'] + }, + { + id: 'section-1', + properties: ['property-1', 'property-2'] + } + ] + }) +} const TEST_PLUGIN_1 = new openbis.Plugin() TEST_PLUGIN_1.setName('TEST_PLUGIN_1') @@ -77,286 +353,3 @@ TEST_SAMPLE_TYPE_DTO.setPropertyAssignments([ TEST_PROPERTY_ASSIGNMENT_2, TEST_PROPERTY_ASSIGNMENT_3 ]) - -let context = null -let facade = null -let controller = null - -beforeEach(() => { - jest.resetAllMocks() - - context = new ComponentContext() - facade = new TypeFormFacade() - controller = new TypeFormControler(facade) -}) - -describe('TypeFormController.load', () => { - test('successful existing', async () => { - facade.loadType.mockReturnValue(Promise.resolve(TEST_SAMPLE_TYPE_DTO)) - facade.loadUsages.mockReturnValue( - Promise.resolve({ - type: 10, - propertyLocal: { - [TEST_PROPERTY_TYPE_1_DTO.getCode()]: 1, - [TEST_PROPERTY_TYPE_2_DTO.getCode()]: 2 - }, - propertyGlobal: { - [TEST_PROPERTY_TYPE_1_DTO.getCode()]: 10, - [TEST_PROPERTY_TYPE_2_DTO.getCode()]: 20 - } - }) - ) - - context.setProps({ - object: { - id: 'TEST_OBJECT_ID', - type: objectTypes.OBJECT_TYPE - } - }) - - controller.init(context) - await controller.load() - - expect(context.getState()).toMatchObject({ - loading: false, - selection: null, - type: { - code: { value: 'TEST_TYPE' }, - description: { value: 'TEST_DESCRIPTION' }, - listable: { value: true }, - showContainer: { value: true }, - showParents: { value: true }, - showParentMetadata: { value: true }, - autoGeneratedCode: { value: true }, - generatedCodePrefix: { value: 'TEST_PREFIX' }, - subcodeUnique: { value: true }, - validationPlugin: { value: 'TEST_PLUGIN_2' }, - usages: 10 - }, - properties: [ - { - id: 'property-0', - code: { value: 'TEST_PROPERTY_TYPE_1' }, - label: { value: 'TEST_LABEL_1' }, - description: { value: 'TEST_DESCRIPTION_1' }, - dataType: { value: 'INTEGER' }, - plugin: { value: 'TEST_PLUGIN_1' }, - mandatory: { value: true }, - showInEditView: { value: true }, - showRawValueInForms: { value: true }, - usagesLocal: 1, - usagesGlobal: 10, - section: 'section-0' - }, - { - id: 'property-1', - code: { value: 'TEST_PROPERTY_TYPE_2' }, - label: { value: 'TEST_LABEL_2' }, - description: { value: 'TEST_DESCRIPTION_2' }, - dataType: { value: 'CONTROLLEDVOCABULARY' }, - vocabulary: { value: 'TEST_VOCABULARY' }, - mandatory: { value: true }, - showInEditView: { value: false }, - showRawValueInForms: { value: true }, - usagesLocal: 2, - usagesGlobal: 20, - section: 'section-1' - }, - { - id: 'property-2', - code: { value: 'TEST_PROPERTY_TYPE_3' }, - label: { value: 'TEST_LABEL_3' }, - description: { value: 'TEST_DESCRIPTION_3' }, - dataType: { value: 'MATERIAL' }, - materialType: { value: 'TEST_MATERIAL_TYPE' }, - mandatory: { value: false }, - showInEditView: { value: true }, - showRawValueInForms: { value: false }, - usagesLocal: 0, - usagesGlobal: 0, - section: 'section-1' - } - ], - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] - }) - - expect(facade.loadType).toHaveBeenCalledWith(context.getProps().object) - expect(facade.loadUsages).toHaveBeenCalledWith(context.getProps().object) - }) - - test('successful new', async () => { - context.setProps({ - object: { - id: 'TEST_OBJECT_ID', - type: objectTypes.NEW_OBJECT_TYPE - } - }) - controller.init(context) - await controller.load() - - expect(context.getState()).toMatchObject({ - loading: false, - selection: null, - type: { - code: { value: null }, - description: { value: null }, - listable: { value: true }, - showContainer: { value: false }, - showParents: { value: true }, - showParentMetadata: { value: false }, - autoGeneratedCode: { value: true }, - generatedCodePrefix: { value: null }, - subcodeUnique: { value: false }, - validationPlugin: { value: null }, - usages: 0 - }, - properties: [], - sections: [] - }) - }) - - test('maintain section selection', async () => { - const emptyType = new openbis.SampleType() - - context.setProps({ - object: { - id: 'TEST_OBJECT_ID', - type: objectTypes.OBJECT_TYPE - } - }) - controller.init(context) - - facade.loadType.mockReturnValue(Promise.resolve(emptyType)) - facade.loadUsages.mockReturnValue({}) - await controller.load() - - controller.handleAddSection() - controller.handleAddProperty() - controller.handleAddProperty() - controller.handleAddSection() - controller.handleAddProperty() - controller.handleOrderChange(TypeFormSelectionType.SECTION, { - fromIndex: 0, - toIndex: 1 - }) - controller.handleSelectionChange(TypeFormSelectionType.SECTION, { - id: 'section-0' - }) - - expect(context.getState()).toMatchObject({ - selection: { - type: TypeFormSelectionType.SECTION, - params: { id: 'section-0' } - }, - sections: [ - { - id: 'section-1', - properties: ['property-2'] - }, - { - id: 'section-0', - properties: ['property-0', 'property-1'] - } - ] - }) - - facade.loadType.mockReturnValue(Promise.resolve(TEST_SAMPLE_TYPE_DTO)) - facade.loadUsages.mockReturnValue({}) - await controller.load() - - expect(context.getState()).toMatchObject({ - selection: { - type: TypeFormSelectionType.SECTION, - params: { id: 'section-1' } - }, - sections: [ - { - id: 'section-0', - properties: ['property-0'] - }, - { - id: 'section-1', - properties: ['property-1', 'property-2'] - } - ] - }) - }) - - test('maintain property selection', async () => { - const emptyType = new openbis.SampleType() - - context.setProps({ - object: { - id: 'TEST_OBJECT_ID', - type: objectTypes.OBJECT_TYPE - } - }) - controller.init(context) - - facade.loadType.mockReturnValue(Promise.resolve(emptyType)) - facade.loadUsages.mockReturnValue({}) - await controller.load() - - controller.handleAddSection() - controller.handleAddProperty() - controller.handleAddProperty() - controller.handleAddSection() - controller.handleAddProperty() - controller.handleOrderChange(TypeFormSelectionType.SECTION, { - fromIndex: 0, - toIndex: 1 - }) - controller.handleSelectionChange(TypeFormSelectionType.PROPERTY, { - id: 'property-1' - }) - - expect(context.getState()).toMatchObject({ - selection: { - type: TypeFormSelectionType.PROPERTY, - params: { id: 'property-1' } - }, - sections: [ - { - id: 'section-1', - properties: ['property-2'] - }, - { - id: 'section-0', - properties: ['property-0', 'property-1'] - } - ] - }) - - facade.loadType.mockReturnValue(Promise.resolve(TEST_SAMPLE_TYPE_DTO)) - facade.loadUsages.mockReturnValue({}) - await controller.load() - - expect(context.getState()).toMatchObject({ - selection: { - type: TypeFormSelectionType.PROPERTY, - params: { id: 'property-2' } - }, - sections: [ - { - id: 'section-0', - properties: ['property-0'] - }, - { - id: 'section-1', - properties: ['property-1', 'property-2'] - } - ] - }) - }) -}) diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerOrderChange.test.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerOrderChange.test.js index 92b87fef7af5d70539189bdc5cbc2efbcb835536..ac74ebc5c2849b1a19ffdacd8ebe3d1582920432 100644 --- a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerOrderChange.test.js +++ b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerOrderChange.test.js @@ -1,169 +1,161 @@ -import ComponentContext from '@srcTest/js/components/common/ComponentContext.js' -import TypeFormControler from '@src/js/components/types/form/TypeFormController.js' +import TypeFormControllerTest from '@srcTest/js/components/types/form/TypeFormControllerTest.js' import TypeFormSelectionType from '@src/js/components/types/form/TypeFormSelectionType.js' -import TypeFormFacade from '@src/js/components/types/form/TypeFormFacade' import objectTypes from '@src/js/common/consts/objectType.js' import fixture from '@srcTest/js/common/fixture.js' -jest.mock('@src/js/components/types/form/TypeFormFacade') - -let context = null -let facade = null -let controller = null +let common = null beforeEach(() => { - jest.resetAllMocks() - context = new ComponentContext() - context.setProps({ - object: { - id: 'TEST_OBJECT_ID', - type: objectTypes.OBJECT_TYPE - } + common = new TypeFormControllerTest() + common.beforeEach() + common.init({ + id: 'TEST_OBJECT_ID', + type: objectTypes.OBJECT_TYPE }) - facade = new TypeFormFacade() - controller = new TypeFormControler(facade) - controller.init(context) }) afterEach(() => { - expect(facade.loadType).toHaveBeenCalledWith(context.getProps().object) - expect(facade.loadUsages).toHaveBeenCalledWith(context.getProps().object) + common.afterEach() +}) + +describe(TypeFormControllerTest.SUITE, () => { + test('move section', testMoveSection) + test('move property within section', testMovePropertyWithinSection) + test('move property between sections', testMovePropertyBetweenSections) }) -describe('TypeFormController.handleOrderChange', () => { - test('section', async () => { - facade.loadType.mockReturnValue( - Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) - ) - facade.loadUsages.mockReturnValue(Promise.resolve({})) - - await controller.load() - - expect(context.getState()).toMatchObject({ - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] - }) - - controller.handleOrderChange(TypeFormSelectionType.SECTION, { - fromIndex: 0, - toIndex: 1 - }) - - expect(context.getState()).toMatchObject({ - sections: [ - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - }, - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - } - ] - }) +async function testMoveSection() { + common.facade.loadType.mockReturnValue( + Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) + ) + common.facade.loadUsages.mockReturnValue(Promise.resolve({})) + + await common.controller.load() + + expect(common.context.getState()).toMatchObject({ + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] }) - test('property within section', async () => { - facade.loadType.mockReturnValue( - Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) - ) - facade.loadUsages.mockReturnValue(Promise.resolve({})) - - await controller.load() - - expect(context.getState()).toMatchObject({ - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] - }) - - controller.handleOrderChange(TypeFormSelectionType.PROPERTY, { - fromSectionId: 'section-1', - toSectionId: 'section-1', - fromIndex: 0, - toIndex: 1 - }) - - expect(context.getState()).toMatchObject({ - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-2', 'property-1'] - } - ] - }) + common.controller.handleOrderChange(TypeFormSelectionType.SECTION, { + fromIndex: 0, + toIndex: 1 }) - test('property between sections', async () => { - facade.loadType.mockReturnValue( - Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) - ) - facade.loadUsages.mockReturnValue(Promise.resolve({})) - - await controller.load() - - expect(context.getState()).toMatchObject({ - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] - }) - - controller.handleOrderChange(TypeFormSelectionType.PROPERTY, { - fromSectionId: 'section-1', - toSectionId: 'section-0', - fromIndex: 1, - toIndex: 0 - }) - - expect(context.getState()).toMatchObject({ - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-2', 'property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1'] - } - ] - }) + expect(common.context.getState()).toMatchObject({ + sections: [ + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + }, + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + } + ] }) -}) +} + +async function testMovePropertyWithinSection() { + common.facade.loadType.mockReturnValue( + Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) + ) + common.facade.loadUsages.mockReturnValue(Promise.resolve({})) + + await common.controller.load() + + expect(common.context.getState()).toMatchObject({ + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] + }) + + common.controller.handleOrderChange(TypeFormSelectionType.PROPERTY, { + fromSectionId: 'section-1', + toSectionId: 'section-1', + fromIndex: 0, + toIndex: 1 + }) + + expect(common.context.getState()).toMatchObject({ + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-2', 'property-1'] + } + ] + }) +} + +async function testMovePropertyBetweenSections() { + common.facade.loadType.mockReturnValue( + Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) + ) + common.facade.loadUsages.mockReturnValue(Promise.resolve({})) + + await common.controller.load() + + expect(common.context.getState()).toMatchObject({ + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] + }) + + common.controller.handleOrderChange(TypeFormSelectionType.PROPERTY, { + fromSectionId: 'section-1', + toSectionId: 'section-0', + fromIndex: 1, + toIndex: 0 + }) + + expect(common.context.getState()).toMatchObject({ + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-2', 'property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1'] + } + ] + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerRemove.test.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerRemove.test.js index 14b925509d1138ced2ea757521e22cf29406f59e..ba9ed49bf1821d1949cc51a537e3be70b283988a 100644 --- a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerRemove.test.js +++ b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerRemove.test.js @@ -1,703 +1,698 @@ -import ComponentContext from '@srcTest/js/components/common/ComponentContext.js' -import TypeFormControler from '@src/js/components/types/form/TypeFormController.js' +import TypeFormControllerTest from '@srcTest/js/components/types/form/TypeFormControllerTest.js' import TypeFormSelectionType from '@src/js/components/types/form/TypeFormSelectionType.js' -import TypeFormFacade from '@src/js/components/types/form/TypeFormFacade' import objectTypes from '@src/js/common/consts/objectType.js' import fixture from '@srcTest/js/common/fixture.js' -jest.mock('@src/js/components/types/form/TypeFormFacade') - -let context = null -let facade = null -let controller = null +let common = null beforeEach(() => { - jest.resetAllMocks() - context = new ComponentContext() - context.setProps({ - object: { - id: 'TEST_OBJECT_ID', - type: objectTypes.OBJECT_TYPE - } + common = new TypeFormControllerTest() + common.beforeEach() + common.init({ + id: 'TEST_OBJECT_ID', + type: objectTypes.OBJECT_TYPE }) - facade = new TypeFormFacade() - controller = new TypeFormControler(facade) - controller.init(context) }) afterEach(() => { - expect(facade.loadType).toHaveBeenCalledWith(context.getProps().object) - expect(facade.loadUsages).toHaveBeenCalledWith(context.getProps().object) + common.afterEach() }) -describe('TypeFormController.handleRemove', () => { - test('section not used', async () => { - facade.loadType.mockReturnValue( - Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) - ) - facade.loadUsages.mockReturnValue(Promise.resolve({})) +describe(TypeFormControllerTest.SUITE, () => { + test('remove section not used', testRemoveSectionNotUsed) + test('remove section used and confirmed', testRemoveSectionUsedAndConfirmed) + test('remove section used and cancelled', testRemoveSectionUsedAndCancelled) + test('remove property not used', testRemovePropertyNotUsed) + test('remove property used and confirmed', testRemovePropertyUsedAndConfirmed) + test('remove property used and cancelled', testRemovePropertyUsedAndCancelled) +}) - await controller.load() - controller.handleSelectionChange(TypeFormSelectionType.SECTION, { - id: 'section-0' - }) +async function testRemoveSectionNotUsed() { + common.facade.loadType.mockReturnValue( + Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) + ) + common.facade.loadUsages.mockReturnValue(Promise.resolve({})) - expect(context.getState()).toMatchObject({ - selection: { - type: TypeFormSelectionType.SECTION, - params: { - id: 'section-0' - } - }, - properties: [ - { - id: 'property-0', - code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } - }, - { - id: 'property-1', - code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } - }, - { - id: 'property-2', - code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - } - ], - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] - }) + await common.controller.load() + common.controller.handleSelectionChange(TypeFormSelectionType.SECTION, { + id: 'section-0' + }) - controller.handleRemove() - - expect(context.getState()).toMatchObject({ - selection: null, - properties: [ - { - id: 'property-1', - code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } - }, - { - id: 'property-2', - code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - } - ], - sections: [ - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] - }) + expect(common.context.getState()).toMatchObject({ + selection: { + type: TypeFormSelectionType.SECTION, + params: { + id: 'section-0' + } + }, + properties: [ + { + id: 'property-0', + code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } + }, + { + id: 'property-1', + code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } + }, + { + id: 'property-2', + code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + } + ], + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] }) - test('section used and confirmed', async () => { - facade.loadType.mockReturnValue( - Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) - ) - facade.loadUsages.mockReturnValue( - Promise.resolve({ - propertyLocal: { - [fixture.TEST_PROPERTY_TYPE_1_DTO.getCode()]: 1 - }, - propertyGlobal: { - [fixture.TEST_PROPERTY_TYPE_1_DTO.getCode()]: 10 - } - }) - ) - - await controller.load() - controller.handleSelectionChange(TypeFormSelectionType.SECTION, { - id: 'section-0' - }) + common.controller.handleRemove() - expect(context.getState()).toMatchObject({ - selection: { - type: TypeFormSelectionType.SECTION, - params: { - id: 'section-0' - } - }, - properties: [ - { - id: 'property-0', - code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() }, - usagesLocal: 1, - usagesGlobal: 10 - }, - { - id: 'property-1', - code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } - }, - { - id: 'property-2', - code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - } - ], - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] + expect(common.context.getState()).toMatchObject({ + selection: null, + properties: [ + { + id: 'property-1', + code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } + }, + { + id: 'property-2', + code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + } + ], + sections: [ + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] + }) +} + +async function testRemoveSectionUsedAndConfirmed() { + common.facade.loadType.mockReturnValue( + Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) + ) + common.facade.loadUsages.mockReturnValue( + Promise.resolve({ + propertyLocal: { + [fixture.TEST_PROPERTY_TYPE_1_DTO.getCode()]: 1 + }, + propertyGlobal: { + [fixture.TEST_PROPERTY_TYPE_1_DTO.getCode()]: 10 + } }) + ) - controller.handleRemove() - - expect(context.getState()).toMatchObject({ - removeSectionDialogOpen: true, - selection: { - type: TypeFormSelectionType.SECTION, - params: { - id: 'section-0' - } - }, - properties: [ - { - id: 'property-0', - code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() }, - usagesLocal: 1, - usagesGlobal: 10 - }, - { - id: 'property-1', - code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } - }, - { - id: 'property-2', - code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - } - ], - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] - }) + await common.controller.load() + common.controller.handleSelectionChange(TypeFormSelectionType.SECTION, { + id: 'section-0' + }) - controller.handleRemoveConfirm() - - expect(context.getState()).toMatchObject({ - removeSectionDialogOpen: false, - selection: null, - properties: [ - { - id: 'property-1', - code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } - }, - { - id: 'property-2', - code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - } - ], - sections: [ - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] - }) + expect(common.context.getState()).toMatchObject({ + selection: { + type: TypeFormSelectionType.SECTION, + params: { + id: 'section-0' + } + }, + properties: [ + { + id: 'property-0', + code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() }, + usagesLocal: 1, + usagesGlobal: 10 + }, + { + id: 'property-1', + code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } + }, + { + id: 'property-2', + code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + } + ], + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] }) - test('section used and cancelled', async () => { - facade.loadType.mockReturnValue( - Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) - ) - facade.loadUsages.mockReturnValue( - Promise.resolve({ - propertyLocal: { - [fixture.TEST_PROPERTY_TYPE_1_DTO.getCode()]: 1 - }, - propertyGlobal: { - [fixture.TEST_PROPERTY_TYPE_1_DTO.getCode()]: 10 - } - }) - ) - - await controller.load() - controller.handleSelectionChange(TypeFormSelectionType.SECTION, { - id: 'section-0' - }) + common.controller.handleRemove() + + expect(common.context.getState()).toMatchObject({ + removeSectionDialogOpen: true, + selection: { + type: TypeFormSelectionType.SECTION, + params: { + id: 'section-0' + } + }, + properties: [ + { + id: 'property-0', + code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() }, + usagesLocal: 1, + usagesGlobal: 10 + }, + { + id: 'property-1', + code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } + }, + { + id: 'property-2', + code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + } + ], + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] + }) - expect(context.getState()).toMatchObject({ - selection: { - type: TypeFormSelectionType.SECTION, - params: { - id: 'section-0' - } - }, - properties: [ - { - id: 'property-0', - code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() }, - usagesLocal: 1, - usagesGlobal: 10 - }, - { - id: 'property-1', - code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } - }, - { - id: 'property-2', - code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - } - ], - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] - }) + common.controller.handleRemoveConfirm() - controller.handleRemove() - - expect(context.getState()).toMatchObject({ - removeSectionDialogOpen: true, - selection: { - type: TypeFormSelectionType.SECTION, - params: { - id: 'section-0' - } - }, - properties: [ - { - id: 'property-0', - code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() }, - usagesLocal: 1, - usagesGlobal: 10 - }, - { - id: 'property-1', - code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } - }, - { - id: 'property-2', - code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - } - ], - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] + expect(common.context.getState()).toMatchObject({ + removeSectionDialogOpen: false, + selection: null, + properties: [ + { + id: 'property-1', + code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } + }, + { + id: 'property-2', + code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + } + ], + sections: [ + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] + }) +} + +async function testRemoveSectionUsedAndCancelled() { + common.facade.loadType.mockReturnValue( + Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) + ) + common.facade.loadUsages.mockReturnValue( + Promise.resolve({ + propertyLocal: { + [fixture.TEST_PROPERTY_TYPE_1_DTO.getCode()]: 1 + }, + propertyGlobal: { + [fixture.TEST_PROPERTY_TYPE_1_DTO.getCode()]: 10 + } }) + ) - controller.handleRemoveCancel() - - expect(context.getState()).toMatchObject({ - removeSectionDialogOpen: false, - selection: { - type: TypeFormSelectionType.SECTION, - params: { - id: 'section-0' - } - }, - properties: [ - { - id: 'property-0', - code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() }, - usagesLocal: 1, - usagesGlobal: 10 - }, - { - id: 'property-1', - code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } - }, - { - id: 'property-2', - code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - } - ], - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] - }) + await common.controller.load() + common.controller.handleSelectionChange(TypeFormSelectionType.SECTION, { + id: 'section-0' }) - test('property not used', async () => { - facade.loadType.mockReturnValue( - Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) - ) - facade.loadUsages.mockReturnValue(Promise.resolve({})) + expect(common.context.getState()).toMatchObject({ + selection: { + type: TypeFormSelectionType.SECTION, + params: { + id: 'section-0' + } + }, + properties: [ + { + id: 'property-0', + code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() }, + usagesLocal: 1, + usagesGlobal: 10 + }, + { + id: 'property-1', + code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } + }, + { + id: 'property-2', + code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + } + ], + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] + }) - await controller.load() - controller.handleSelectionChange(TypeFormSelectionType.PROPERTY, { - id: 'property-1' - }) + common.controller.handleRemove() + + expect(common.context.getState()).toMatchObject({ + removeSectionDialogOpen: true, + selection: { + type: TypeFormSelectionType.SECTION, + params: { + id: 'section-0' + } + }, + properties: [ + { + id: 'property-0', + code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() }, + usagesLocal: 1, + usagesGlobal: 10 + }, + { + id: 'property-1', + code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } + }, + { + id: 'property-2', + code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + } + ], + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] + }) - expect(context.getState()).toMatchObject({ - selection: { - type: TypeFormSelectionType.PROPERTY, - params: { - id: 'property-1' - } - }, - properties: [ - { - id: 'property-0', - code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } - }, - { - id: 'property-1', - code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } - }, - { - id: 'property-2', - code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - } - ], - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] - }) + common.controller.handleRemoveCancel() + + expect(common.context.getState()).toMatchObject({ + removeSectionDialogOpen: false, + selection: { + type: TypeFormSelectionType.SECTION, + params: { + id: 'section-0' + } + }, + properties: [ + { + id: 'property-0', + code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() }, + usagesLocal: 1, + usagesGlobal: 10 + }, + { + id: 'property-1', + code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } + }, + { + id: 'property-2', + code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + } + ], + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] + }) +} - controller.handleRemove() - - expect(context.getState()).toMatchObject({ - selection: null, - properties: [ - { - id: 'property-0', - code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } - }, - { - id: 'property-2', - code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - } - ], - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-2'] - } - ] - }) +async function testRemovePropertyNotUsed() { + common.facade.loadType.mockReturnValue( + Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) + ) + common.facade.loadUsages.mockReturnValue(Promise.resolve({})) + + await common.controller.load() + common.controller.handleSelectionChange(TypeFormSelectionType.PROPERTY, { + id: 'property-1' }) - test('property used and confirmed', async () => { - facade.loadType.mockReturnValue( - Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) - ) - facade.loadUsages.mockReturnValue( - Promise.resolve({ - propertyLocal: { - [fixture.TEST_PROPERTY_TYPE_2_DTO.getCode()]: 1 - }, - propertyGlobal: { - [fixture.TEST_PROPERTY_TYPE_2_DTO.getCode()]: 10 - } - }) - ) - - await controller.load() - controller.handleSelectionChange(TypeFormSelectionType.PROPERTY, { - id: 'property-1' - }) + expect(common.context.getState()).toMatchObject({ + selection: { + type: TypeFormSelectionType.PROPERTY, + params: { + id: 'property-1' + } + }, + properties: [ + { + id: 'property-0', + code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } + }, + { + id: 'property-1', + code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() } + }, + { + id: 'property-2', + code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + } + ], + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] + }) - expect(context.getState()).toMatchObject({ - selection: { - type: TypeFormSelectionType.PROPERTY, - params: { - id: 'property-1' - } - }, - properties: [ - { - id: 'property-0', - code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } - }, - { - id: 'property-1', - code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, - usagesLocal: 1, - usagesGlobal: 10 - }, - { - id: 'property-2', - code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - } - ], - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] - }) + common.controller.handleRemove() - controller.handleRemove() - - expect(context.getState()).toMatchObject({ - removePropertyDialogOpen: true, - selection: { - type: TypeFormSelectionType.PROPERTY, - params: { - id: 'property-1' - } - }, - properties: [ - { - id: 'property-0', - code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } - }, - { - id: 'property-1', - code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, - usagesLocal: 1, - usagesGlobal: 10 - }, - { - id: 'property-2', - code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - } - ], - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] + expect(common.context.getState()).toMatchObject({ + selection: null, + properties: [ + { + id: 'property-0', + code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } + }, + { + id: 'property-2', + code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + } + ], + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-2'] + } + ] + }) +} + +async function testRemovePropertyUsedAndConfirmed() { + common.facade.loadType.mockReturnValue( + Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) + ) + common.facade.loadUsages.mockReturnValue( + Promise.resolve({ + propertyLocal: { + [fixture.TEST_PROPERTY_TYPE_2_DTO.getCode()]: 1 + }, + propertyGlobal: { + [fixture.TEST_PROPERTY_TYPE_2_DTO.getCode()]: 10 + } }) + ) - controller.handleRemoveConfirm() - - expect(context.getState()).toMatchObject({ - removePropertyDialogOpen: false, - selection: null, - properties: [ - { - id: 'property-0', - code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } - }, - { - id: 'property-2', - code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - } - ], - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-2'] - } - ] - }) + await common.controller.load() + common.controller.handleSelectionChange(TypeFormSelectionType.PROPERTY, { + id: 'property-1' }) - test('property used and cancelled', async () => { - facade.loadType.mockReturnValue( - Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) - ) - facade.loadUsages.mockReturnValue( - Promise.resolve({ - propertyLocal: { - [fixture.TEST_PROPERTY_TYPE_2_DTO.getCode()]: 1 - }, - propertyGlobal: { - [fixture.TEST_PROPERTY_TYPE_2_DTO.getCode()]: 10 - } - }) - ) - - await controller.load() - controller.handleSelectionChange(TypeFormSelectionType.PROPERTY, { - id: 'property-1' - }) + expect(common.context.getState()).toMatchObject({ + selection: { + type: TypeFormSelectionType.PROPERTY, + params: { + id: 'property-1' + } + }, + properties: [ + { + id: 'property-0', + code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } + }, + { + id: 'property-1', + code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, + usagesLocal: 1, + usagesGlobal: 10 + }, + { + id: 'property-2', + code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + } + ], + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] + }) - expect(context.getState()).toMatchObject({ - selection: { - type: TypeFormSelectionType.PROPERTY, - params: { - id: 'property-1' - } - }, - properties: [ - { - id: 'property-0', - code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } - }, - { - id: 'property-1', - code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, - usagesLocal: 1, - usagesGlobal: 10 - }, - { - id: 'property-2', - code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - } - ], - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] - }) + common.controller.handleRemove() + + expect(common.context.getState()).toMatchObject({ + removePropertyDialogOpen: true, + selection: { + type: TypeFormSelectionType.PROPERTY, + params: { + id: 'property-1' + } + }, + properties: [ + { + id: 'property-0', + code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } + }, + { + id: 'property-1', + code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, + usagesLocal: 1, + usagesGlobal: 10 + }, + { + id: 'property-2', + code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + } + ], + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] + }) - controller.handleRemove() - - expect(context.getState()).toMatchObject({ - removePropertyDialogOpen: true, - selection: { - type: TypeFormSelectionType.PROPERTY, - params: { - id: 'property-1' - } - }, - properties: [ - { - id: 'property-0', - code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } - }, - { - id: 'property-1', - code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, - usagesLocal: 1, - usagesGlobal: 10 - }, - { - id: 'property-2', - code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - } - ], - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] - }) + common.controller.handleRemoveConfirm() - controller.handleRemoveCancel() - - expect(context.getState()).toMatchObject({ - removePropertyDialogOpen: false, - selection: { - type: TypeFormSelectionType.PROPERTY, - params: { - id: 'property-1' - } - }, - properties: [ - { - id: 'property-0', - code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } - }, - { - id: 'property-1', - code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, - usagesLocal: 1, - usagesGlobal: 10 - }, - { - id: 'property-2', - code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } - } - ], - sections: [ - { - id: 'section-0', - name: { value: 'TEST_SECTION_1' }, - properties: ['property-0'] - }, - { - id: 'section-1', - name: { value: 'TEST_SECTION_2' }, - properties: ['property-1', 'property-2'] - } - ] + expect(common.context.getState()).toMatchObject({ + removePropertyDialogOpen: false, + selection: null, + properties: [ + { + id: 'property-0', + code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } + }, + { + id: 'property-2', + code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + } + ], + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-2'] + } + ] + }) +} + +async function testRemovePropertyUsedAndCancelled() { + common.facade.loadType.mockReturnValue( + Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) + ) + common.facade.loadUsages.mockReturnValue( + Promise.resolve({ + propertyLocal: { + [fixture.TEST_PROPERTY_TYPE_2_DTO.getCode()]: 1 + }, + propertyGlobal: { + [fixture.TEST_PROPERTY_TYPE_2_DTO.getCode()]: 10 + } }) + ) + + await common.controller.load() + common.controller.handleSelectionChange(TypeFormSelectionType.PROPERTY, { + id: 'property-1' }) -}) + + expect(common.context.getState()).toMatchObject({ + selection: { + type: TypeFormSelectionType.PROPERTY, + params: { + id: 'property-1' + } + }, + properties: [ + { + id: 'property-0', + code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } + }, + { + id: 'property-1', + code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, + usagesLocal: 1, + usagesGlobal: 10 + }, + { + id: 'property-2', + code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + } + ], + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] + }) + + common.controller.handleRemove() + + expect(common.context.getState()).toMatchObject({ + removePropertyDialogOpen: true, + selection: { + type: TypeFormSelectionType.PROPERTY, + params: { + id: 'property-1' + } + }, + properties: [ + { + id: 'property-0', + code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } + }, + { + id: 'property-1', + code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, + usagesLocal: 1, + usagesGlobal: 10 + }, + { + id: 'property-2', + code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + } + ], + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] + }) + + common.controller.handleRemoveCancel() + + expect(common.context.getState()).toMatchObject({ + removePropertyDialogOpen: false, + selection: { + type: TypeFormSelectionType.PROPERTY, + params: { + id: 'property-1' + } + }, + properties: [ + { + id: 'property-0', + code: { value: fixture.TEST_PROPERTY_TYPE_1_DTO.getCode() } + }, + { + id: 'property-1', + code: { value: fixture.TEST_PROPERTY_TYPE_2_DTO.getCode() }, + usagesLocal: 1, + usagesGlobal: 10 + }, + { + id: 'property-2', + code: { value: fixture.TEST_PROPERTY_TYPE_3_DTO.getCode() } + } + ], + sections: [ + { + id: 'section-0', + name: { value: 'TEST_SECTION_1' }, + properties: ['property-0'] + }, + { + id: 'section-1', + name: { value: 'TEST_SECTION_2' }, + properties: ['property-1', 'property-2'] + } + ] + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerSave.test.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerSave.test.js index 9b442c6b76ba5ebd9bd8a55219ec2cf3260ad806..602803bfdb5d3bdfab9a2d58175afda919eeac2e 100644 --- a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerSave.test.js +++ b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerSave.test.js @@ -1,440 +1,389 @@ -import ComponentContext from '@srcTest/js/components/common/ComponentContext.js' -import TypeFormControler from '@src/js/components/types/form/TypeFormController.js' +import TypeFormControllerTest from '@srcTest/js/components/types/form/TypeFormControllerTest.js' import TypeFormSelectionType from '@src/js/components/types/form/TypeFormSelectionType.js' -import TypeFormFacade from '@src/js/components/types/form/TypeFormFacade' import objectTypes from '@src/js/common/consts/objectType.js' import openbis from '@srcTest/js/services/openbis.js' -jest.mock('@src/js/components/types/form/TypeFormFacade') - -const LOCAL_PROPERTY_TYPE = new openbis.PropertyType() -LOCAL_PROPERTY_TYPE.setCode('TEST_TYPE.TEST_PROPERTY_TYPE') -LOCAL_PROPERTY_TYPE.setLabel('TEST_LABEL') -LOCAL_PROPERTY_TYPE.setDescription('TEST_DESCRIPTION') -LOCAL_PROPERTY_TYPE.setDataType(openbis.DataType.INTEGER) - -const LOCAL_PROPERTY_ASSIGNMENT = new openbis.PropertyAssignment() -LOCAL_PROPERTY_ASSIGNMENT.setPropertyType(LOCAL_PROPERTY_TYPE) - -const SAMPLE_TYPE_WITH_LOCAL_PROPERTY = new openbis.SampleType() -SAMPLE_TYPE_WITH_LOCAL_PROPERTY.setCode('TEST_TYPE') -SAMPLE_TYPE_WITH_LOCAL_PROPERTY.setGeneratedCodePrefix('TEST_PREFIX') -SAMPLE_TYPE_WITH_LOCAL_PROPERTY.setPropertyAssignments([ - LOCAL_PROPERTY_ASSIGNMENT -]) - -const GLOBAL_PROPERTY_TYPE = new openbis.PropertyType() -GLOBAL_PROPERTY_TYPE.setCode('TEST_PROPERTY_TYPE') -GLOBAL_PROPERTY_TYPE.setLabel('TEST_LABEL') -GLOBAL_PROPERTY_TYPE.setDescription('TEST_DESCRIPTION') -GLOBAL_PROPERTY_TYPE.setDataType(openbis.DataType.INTEGER) - -const GLOBAL_PROPERTY_ASSIGNMENT = new openbis.PropertyAssignment() -GLOBAL_PROPERTY_ASSIGNMENT.setPropertyType(GLOBAL_PROPERTY_TYPE) - -const SAMPLE_TYPE_WITH_GLOBAL_PROPERTY = new openbis.SampleType() -SAMPLE_TYPE_WITH_GLOBAL_PROPERTY.setCode('TEST_TYPE') -SAMPLE_TYPE_WITH_GLOBAL_PROPERTY.setGeneratedCodePrefix('TEST_PREFIX') -SAMPLE_TYPE_WITH_GLOBAL_PROPERTY.setPropertyAssignments([ - GLOBAL_PROPERTY_ASSIGNMENT -]) - -let context = null -let facade = null -let controller = null +let common = null beforeEach(() => { - jest.resetAllMocks() - context = new ComponentContext() - context.setProps({ - object: { - id: 'TEST_OBJECT_ID', - type: objectTypes.OBJECT_TYPE - } + common = new TypeFormControllerTest() + common.beforeEach() + common.init({ + id: 'TEST_OBJECT_ID', + type: objectTypes.OBJECT_TYPE }) - facade = new TypeFormFacade() - controller = new TypeFormControler(facade) - controller.init(context) }) afterEach(() => { - expect(facade.loadType).toHaveBeenCalledWith(context.getProps().object) - expect(facade.loadUsages).toHaveBeenCalledWith(context.getProps().object) + common.afterEach() }) -describe('TypeFormController.handleSave', () => { - test('validation', async () => { - const SAMPLE_TYPE = new openbis.SampleType() - - facade.loadType.mockReturnValue(Promise.resolve(SAMPLE_TYPE)) - facade.loadUsages.mockReturnValue(Promise.resolve({})) - - await controller.load() - controller.handleAddSection() - controller.handleAddProperty() - - expect(context.getState()).toMatchObject({ - selection: { - type: TypeFormSelectionType.PROPERTY, - params: { - id: 'property-0' - } - }, - type: { - errors: 0 - }, - properties: [ - { - id: 'property-0', - code: { value: null }, - dataType: { value: null }, - label: { value: null }, - description: { value: null }, - errors: 0 - } - ] - }) +describe(TypeFormControllerTest.SUITE, () => { + test('save add local property', testSaveAddLocalProperty) + test('save add global property', testSaveAddGlobalProperty) + test( + 'save update local property assignment', + testSaveUpdateLocalPropertyAssignment + ) + test( + 'save update global property assignment', + testSaveUpdateGlobalPropertyAssignment + ) + test( + 'save update local property type if possible', + testSaveUpdateLocalPropertyTypeIfPossible + ) + test( + 'save update global property type if possible', + testSaveUpdateGlobalPropertyTypeIfPossible + ) + test('save delete local property', testSaveDeleteLocalProperty) + test('save delete global property', testSaveDeleteGlobalProperty) + test( + 'save delete local property last assignment', + testSaveDeleteLocalPropertyLastAssignment + ) + test( + 'save delete global property last assignment', + testSaveDeleteGlobalPropertyLastAssignment + ) +}) - await controller.handleSave() - - expect(context.getState()).toMatchObject({ - selection: { - type: TypeFormSelectionType.TYPE, - params: { - part: 'code' - } - }, - type: { - code: { - error: 'Code cannot be empty' - }, - generatedCodePrefix: { - error: 'Generated code prefix cannot be empty' - }, - errors: 2 - }, - properties: [ - { - id: 'property-0', - code: { value: null, error: 'Code cannot be empty' }, - dataType: { value: null, error: 'Data Type cannot be empty' }, - label: { value: null, error: 'Label cannot be empty' }, - description: { value: null, error: 'Description cannot be empty' }, - errors: 4 - } - ] - }) +async function testSaveAddLocalProperty() { + await doTestAddProperty('local') +} + +async function testSaveAddGlobalProperty() { + await doTestAddProperty('global') +} + +async function testSaveUpdateLocalPropertyAssignment() { + await doTestUpdatePropertyAssignment( + SAMPLE_TYPE_WITH_LOCAL_PROPERTY, + LOCAL_PROPERTY_TYPE + ) +} + +async function testSaveUpdateGlobalPropertyAssignment() { + await doTestUpdatePropertyAssignment( + SAMPLE_TYPE_WITH_GLOBAL_PROPERTY, + GLOBAL_PROPERTY_TYPE + ) +} + +async function testSaveUpdateLocalPropertyTypeIfPossible() { + await doTestUpdatePropertyTypeIfPossible( + SAMPLE_TYPE_WITH_LOCAL_PROPERTY, + LOCAL_PROPERTY_TYPE, + LOCAL_PROPERTY_ASSIGNMENT + ) +} + +async function testSaveUpdateGlobalPropertyTypeIfPossible() { + await doTestUpdatePropertyTypeIfPossible( + SAMPLE_TYPE_WITH_GLOBAL_PROPERTY, + GLOBAL_PROPERTY_TYPE, + GLOBAL_PROPERTY_ASSIGNMENT + ) +} + +async function testSaveDeleteLocalProperty() { + await doTestDeleteProperty( + SAMPLE_TYPE_WITH_LOCAL_PROPERTY, + LOCAL_PROPERTY_TYPE + ) +} + +async function testSaveDeleteGlobalProperty() { + await doTestDeleteProperty( + SAMPLE_TYPE_WITH_GLOBAL_PROPERTY, + GLOBAL_PROPERTY_TYPE + ) +} + +async function testSaveDeleteLocalPropertyLastAssignment() { + await doTestDeletePropertyLastAssignment( + SAMPLE_TYPE_WITH_LOCAL_PROPERTY, + LOCAL_PROPERTY_TYPE + ) +} + +async function testSaveDeleteGlobalPropertyLastAssignment() { + await doTestDeletePropertyLastAssignment( + SAMPLE_TYPE_WITH_GLOBAL_PROPERTY, + GLOBAL_PROPERTY_TYPE + ) +} + +async function doTestAddProperty(scope) { + const SAMPLE_TYPE = new openbis.SampleType() + SAMPLE_TYPE.setCode('TEST_TYPE') + SAMPLE_TYPE.setGeneratedCodePrefix('TEST_PREFIX') + + common.facade.loadType.mockReturnValue(Promise.resolve(SAMPLE_TYPE)) + common.facade.loadUsages.mockReturnValue(Promise.resolve({})) + common.facade.loadGlobalPropertyTypes.mockReturnValue(Promise.resolve([])) + common.facade.executeOperations.mockReturnValue(Promise.resolve({})) + + await common.controller.load() + + common.controller.handleAddSection() + common.controller.handleAddProperty() + + common.controller.handleChange(TypeFormSelectionType.PROPERTY, { + id: 'property-0', + field: 'scope', + value: scope }) - - test('add local property', async () => { - await testAddProperty('local') + common.controller.handleChange(TypeFormSelectionType.PROPERTY, { + id: 'property-0', + field: 'code', + value: 'NEW_CODE' }) - - test('add global property', async () => { - await testAddProperty('global') + common.controller.handleChange(TypeFormSelectionType.PROPERTY, { + id: 'property-0', + field: 'dataType', + value: 'VARCHAR' }) - - test('update local property assignment', async () => { - await testUpdatePropertyAssignment( - SAMPLE_TYPE_WITH_LOCAL_PROPERTY, - LOCAL_PROPERTY_TYPE - ) + common.controller.handleChange(TypeFormSelectionType.PROPERTY, { + id: 'property-0', + field: 'label', + value: 'NEW_LABEL' }) - - test('update global property assignment', async () => { - await testUpdatePropertyAssignment( - SAMPLE_TYPE_WITH_GLOBAL_PROPERTY, - GLOBAL_PROPERTY_TYPE - ) + common.controller.handleChange(TypeFormSelectionType.PROPERTY, { + id: 'property-0', + field: 'description', + value: 'NEW_DESCRIPTION' }) - test('update local property type if possible', async () => { - await testUpdatePropertyTypeIfPossible( - SAMPLE_TYPE_WITH_LOCAL_PROPERTY, - LOCAL_PROPERTY_TYPE, - LOCAL_PROPERTY_ASSIGNMENT - ) - }) + await common.controller.handleSave() - test('update global property type if possible', async () => { - await testUpdatePropertyTypeIfPossible( - SAMPLE_TYPE_WITH_GLOBAL_PROPERTY, - GLOBAL_PROPERTY_TYPE, - GLOBAL_PROPERTY_ASSIGNMENT - ) - }) + const propertyTypeCode = scope === 'local' ? 'TEST_TYPE.NEW_CODE' : 'NEW_CODE' - test('delete local property', async () => { - await testDeleteProperty( - SAMPLE_TYPE_WITH_LOCAL_PROPERTY, - LOCAL_PROPERTY_TYPE + expectExecuteOperations([ + createPropertyTypeOperation({ + code: propertyTypeCode, + dataType: openbis.DataType.VARCHAR, + label: 'NEW_LABEL' + }), + setPropertyAssignmentOperation( + SAMPLE_TYPE.getCode(), + propertyTypeCode, + false ) - }) + ]) +} - test('delete global property', async () => { - await testDeleteProperty( - SAMPLE_TYPE_WITH_GLOBAL_PROPERTY, - GLOBAL_PROPERTY_TYPE - ) - }) +async function doTestUpdatePropertyAssignment(type, propertyType) { + common.facade.loadType.mockReturnValue(Promise.resolve(type)) + common.facade.loadUsages.mockReturnValue(Promise.resolve({})) + common.facade.executeOperations.mockReturnValue(Promise.resolve({})) - test('delete local property last assignment', async () => { - await testDeletePropertyLastAssignment( - SAMPLE_TYPE_WITH_LOCAL_PROPERTY, - LOCAL_PROPERTY_TYPE - ) - }) + await common.controller.load() - test('delete global property last assignment', async () => { - await testDeletePropertyLastAssignment( - SAMPLE_TYPE_WITH_GLOBAL_PROPERTY, - GLOBAL_PROPERTY_TYPE - ) + common.controller.handleChange(TypeFormSelectionType.PROPERTY, { + id: 'property-0', + field: 'mandatory', + value: true }) - async function testAddProperty(scope) { - const SAMPLE_TYPE = new openbis.SampleType() - SAMPLE_TYPE.setCode('TEST_TYPE') - SAMPLE_TYPE.setGeneratedCodePrefix('TEST_PREFIX') - - facade.loadType.mockReturnValue(Promise.resolve(SAMPLE_TYPE)) - facade.loadUsages.mockReturnValue(Promise.resolve({})) - facade.loadGlobalPropertyTypes.mockReturnValue(Promise.resolve([])) - facade.executeOperations.mockReturnValue(Promise.resolve({})) + await common.controller.handleSave() - await controller.load() + expectExecuteOperations([ + setPropertyAssignmentOperation(type.getCode(), propertyType.getCode(), true) + ]) +} - controller.handleAddSection() - controller.handleAddProperty() +async function doTestUpdatePropertyTypeIfPossible( + type, + propertyType, + propertyAssignment +) { + common.facade.loadType.mockReturnValue(Promise.resolve(type)) + common.facade.loadUsages.mockReturnValue(Promise.resolve({})) + common.facade.executeOperations.mockReturnValue(Promise.resolve({})) - controller.handleChange(TypeFormSelectionType.PROPERTY, { - id: 'property-0', - field: 'scope', - value: scope - }) - controller.handleChange(TypeFormSelectionType.PROPERTY, { - id: 'property-0', - field: 'code', - value: 'NEW_CODE' - }) - controller.handleChange(TypeFormSelectionType.PROPERTY, { - id: 'property-0', - field: 'dataType', - value: 'VARCHAR' - }) - controller.handleChange(TypeFormSelectionType.PROPERTY, { - id: 'property-0', - field: 'label', - value: 'NEW_LABEL' - }) - controller.handleChange(TypeFormSelectionType.PROPERTY, { - id: 'property-0', - field: 'description', - value: 'NEW_DESCRIPTION' - }) + await common.controller.load() - await controller.handleSave() - - const propertyTypeCode = - scope === 'local' ? 'TEST_TYPE.NEW_CODE' : 'NEW_CODE' - - expectExecuteOperations([ - createPropertyTypeOperation({ - code: propertyTypeCode, - dataType: openbis.DataType.VARCHAR, - label: 'NEW_LABEL' - }), - setPropertyAssignmentOperation( - SAMPLE_TYPE.getCode(), - propertyTypeCode, - false - ) - ]) - } - - async function testUpdatePropertyAssignment(type, propertyType) { - facade.loadType.mockReturnValue(Promise.resolve(type)) - facade.loadUsages.mockReturnValue(Promise.resolve({})) - facade.executeOperations.mockReturnValue(Promise.resolve({})) + common.controller.handleChange(TypeFormSelectionType.PROPERTY, { + id: 'property-0', + field: 'label', + value: 'Updated label' + }) - await controller.load() + await common.controller.handleSave() - controller.handleChange(TypeFormSelectionType.PROPERTY, { - id: 'property-0', - field: 'mandatory', - value: true - }) + expectExecuteOperations([ + updatePropertyTypeOperation(propertyType.getCode(), 'Updated label'), + setPropertyAssignmentOperation( + type.getCode(), + propertyType.getCode(), + propertyAssignment.isMandatory() + ) + ]) +} - await controller.handleSave() +async function doTestDeleteProperty(type, propertyType) { + common.facade.loadType.mockReturnValue(Promise.resolve(type)) + common.facade.loadUsages.mockReturnValue(Promise.resolve({})) + common.facade.executeOperations.mockReturnValue(Promise.resolve({})) - expectExecuteOperations([ - setPropertyAssignmentOperation( - type.getCode(), - propertyType.getCode(), - true - ) - ]) - } + await common.controller.load() - async function testUpdatePropertyTypeIfPossible( - type, - propertyType, - propertyAssignment - ) { - facade.loadType.mockReturnValue(Promise.resolve(type)) - facade.loadUsages.mockReturnValue(Promise.resolve({})) - facade.executeOperations.mockReturnValue(Promise.resolve({})) - - await controller.load() - - controller.handleChange(TypeFormSelectionType.PROPERTY, { - id: 'property-0', - field: 'label', - value: 'Updated label' + common.controller.handleSelectionChange(TypeFormSelectionType.PROPERTY, { + id: 'property-0' + }) + common.controller.handleRemove() + + await common.controller.handleSave() + + expectExecuteOperations([ + deletePropertyAssignmentOperation( + type.getCode(), + propertyType.getCode(), + false + ), + setPropertyAssignmentOperation(type.getCode()) + ]) +} + +async function doTestDeletePropertyLastAssignment(type, propertyType) { + common.facade.loadType.mockReturnValue(Promise.resolve(type)) + common.facade.loadUsages.mockReturnValue(Promise.resolve({})) + common.facade.loadAssignments.mockReturnValue( + Promise.resolve({ + [propertyType.getCode()]: 1 }) + ) + common.facade.executeOperations.mockReturnValue(Promise.resolve({})) - await controller.handleSave() + await common.controller.load() - expectExecuteOperations([ - updatePropertyTypeOperation(propertyType.getCode(), 'Updated label'), - setPropertyAssignmentOperation( - type.getCode(), - propertyType.getCode(), - propertyAssignment.isMandatory() - ) - ]) - } - - async function testDeleteProperty(type, propertyType) { - facade.loadType.mockReturnValue(Promise.resolve(type)) - facade.loadUsages.mockReturnValue(Promise.resolve({})) - facade.executeOperations.mockReturnValue(Promise.resolve({})) - - await controller.load() - - controller.handleSelectionChange(TypeFormSelectionType.PROPERTY, { - id: 'property-0' - }) - controller.handleRemove() - - await controller.handleSave() - - expectExecuteOperations([ - deletePropertyAssignmentOperation( - type.getCode(), - propertyType.getCode(), - false - ), - setPropertyAssignmentOperation(type.getCode()) - ]) - } - - async function testDeletePropertyLastAssignment(type, propertyType) { - facade.loadType.mockReturnValue(Promise.resolve(type)) - facade.loadUsages.mockReturnValue(Promise.resolve({})) - facade.loadAssignments.mockReturnValue( - Promise.resolve({ - [propertyType.getCode()]: 1 - }) + common.controller.handleSelectionChange(TypeFormSelectionType.PROPERTY, { + id: 'property-0' + }) + common.controller.handleRemove() + + await common.controller.handleSave() + + expectExecuteOperations([ + deletePropertyAssignmentOperation( + type.getCode(), + propertyType.getCode(), + false + ), + deletePropertyTypeOperation(propertyType.getCode()), + setPropertyAssignmentOperation(type.getCode()) + ]) +} + +function createPropertyTypeOperation({ + code: propertyTypeCode, + dataType: propertyDataType, + vocabulary: propertyTypeVocabulary, + label: propertyTypeLabel +}) { + const creation = new openbis.PropertyTypeCreation() + creation.setCode(propertyTypeCode) + creation.setDataType(propertyDataType) + if (propertyTypeVocabulary) { + creation.setVocabularyId( + new openbis.VocabularyPermId(propertyTypeVocabulary) ) - facade.executeOperations.mockReturnValue(Promise.resolve({})) - - await controller.load() - - controller.handleSelectionChange(TypeFormSelectionType.PROPERTY, { - id: 'property-0' - }) - controller.handleRemove() - - await controller.handleSave() - - expectExecuteOperations([ - deletePropertyAssignmentOperation( - type.getCode(), - propertyType.getCode(), - false - ), - deletePropertyTypeOperation(propertyType.getCode()), - setPropertyAssignmentOperation(type.getCode()) - ]) } - - function createPropertyTypeOperation({ - code: propertyTypeCode, - dataType: propertyDataType, - vocabulary: propertyTypeVocabulary, - label: propertyTypeLabel - }) { - const creation = new openbis.PropertyTypeCreation() - creation.setCode(propertyTypeCode) - creation.setDataType(propertyDataType) - if (propertyTypeVocabulary) { - creation.setVocabularyId( - new openbis.VocabularyPermId(propertyTypeVocabulary) - ) - } - creation.setLabel(propertyTypeLabel) - return new openbis.CreatePropertyTypesOperation([creation]) + creation.setLabel(propertyTypeLabel) + return new openbis.CreatePropertyTypesOperation([creation]) +} + +function updatePropertyTypeOperation(propertyTypeCode, propertyTypeLabel) { + const update = new openbis.PropertyTypeUpdate() + update.setTypeId(new openbis.PropertyTypePermId(propertyTypeCode)) + update.setLabel(propertyTypeLabel) + return new openbis.UpdatePropertyTypesOperation([update]) +} + +function deletePropertyTypeOperation(propertyTypeCode) { + const id = new openbis.PropertyTypePermId(propertyTypeCode) + const options = new openbis.PropertyTypeDeletionOptions() + options.setReason('deleted via ng_ui') + return new openbis.DeletePropertyTypesOperation([id], options) +} + +function setPropertyAssignmentOperation( + typeCode, + propertyCode, + propertyMandatory +) { + const assignments = [] + if (propertyCode) { + let assignment = new openbis.PropertyAssignmentCreation() + assignment.setPropertyTypeId(new openbis.PropertyTypePermId(propertyCode)) + assignment.setMandatory(propertyMandatory) + assignments.push(assignment) } - function updatePropertyTypeOperation(propertyTypeCode, propertyTypeLabel) { - const update = new openbis.PropertyTypeUpdate() - update.setTypeId(new openbis.PropertyTypePermId(propertyTypeCode)) - update.setLabel(propertyTypeLabel) - return new openbis.UpdatePropertyTypesOperation([update]) - } - - function deletePropertyTypeOperation(propertyTypeCode) { - const id = new openbis.PropertyTypePermId(propertyTypeCode) - const options = new openbis.PropertyTypeDeletionOptions() - options.setReason('deleted via ng_ui') - return new openbis.DeletePropertyTypesOperation([id], options) - } + const update = new openbis.SampleTypeUpdate() + update.setTypeId( + new openbis.EntityTypePermId(typeCode, openbis.EntityKind.SAMPLE) + ) + update.getPropertyAssignments().set(assignments) + + return new openbis.UpdateSampleTypesOperation([update]) +} + +function deletePropertyAssignmentOperation(typeCode, propertyCode, force) { + const assignmentId = new openbis.PropertyAssignmentPermId( + new openbis.EntityTypePermId(typeCode, openbis.EntityKind.SAMPLE), + new openbis.PropertyTypePermId(propertyCode) + ) + + const update = new openbis.SampleTypeUpdate() + update.setTypeId( + new openbis.EntityTypePermId(typeCode, openbis.EntityKind.SAMPLE) + ) + update.getPropertyAssignments().remove([assignmentId]) + update.getPropertyAssignments().setForceRemovingAssignments(force) + + return new openbis.UpdateSampleTypesOperation([update]) +} + +function expectExecuteOperations(expectedOperations) { + expect(common.facade.executeOperations).toHaveBeenCalledTimes(1) + const actualOperations = common.facade.executeOperations.mock.calls[0][0] + expect(actualOperations.length).toEqual(expectedOperations.length) + actualOperations.forEach((actualOperation, index) => { + expect(actualOperation).toMatchObject(expectedOperations[index]) + }) +} - function setPropertyAssignmentOperation( - typeCode, - propertyCode, - propertyMandatory - ) { - const assignments = [] - if (propertyCode) { - let assignment = new openbis.PropertyAssignmentCreation() - assignment.setPropertyTypeId(new openbis.PropertyTypePermId(propertyCode)) - assignment.setMandatory(propertyMandatory) - assignments.push(assignment) - } - - const update = new openbis.SampleTypeUpdate() - update.setTypeId( - new openbis.EntityTypePermId(typeCode, openbis.EntityKind.SAMPLE) - ) - update.getPropertyAssignments().set(assignments) +const LOCAL_PROPERTY_TYPE = new openbis.PropertyType() +LOCAL_PROPERTY_TYPE.setCode('TEST_TYPE.TEST_PROPERTY_TYPE') +LOCAL_PROPERTY_TYPE.setLabel('TEST_LABEL') +LOCAL_PROPERTY_TYPE.setDescription('TEST_DESCRIPTION') +LOCAL_PROPERTY_TYPE.setDataType(openbis.DataType.INTEGER) - return new openbis.UpdateSampleTypesOperation([update]) - } +const LOCAL_PROPERTY_ASSIGNMENT = new openbis.PropertyAssignment() +LOCAL_PROPERTY_ASSIGNMENT.setPropertyType(LOCAL_PROPERTY_TYPE) - function deletePropertyAssignmentOperation(typeCode, propertyCode, force) { - const assignmentId = new openbis.PropertyAssignmentPermId( - new openbis.EntityTypePermId(typeCode, openbis.EntityKind.SAMPLE), - new openbis.PropertyTypePermId(propertyCode) - ) +const SAMPLE_TYPE_WITH_LOCAL_PROPERTY = new openbis.SampleType() +SAMPLE_TYPE_WITH_LOCAL_PROPERTY.setCode('TEST_TYPE') +SAMPLE_TYPE_WITH_LOCAL_PROPERTY.setGeneratedCodePrefix('TEST_PREFIX') +SAMPLE_TYPE_WITH_LOCAL_PROPERTY.setPropertyAssignments([ + LOCAL_PROPERTY_ASSIGNMENT +]) - const update = new openbis.SampleTypeUpdate() - update.setTypeId( - new openbis.EntityTypePermId(typeCode, openbis.EntityKind.SAMPLE) - ) - update.getPropertyAssignments().remove([assignmentId]) - update.getPropertyAssignments().setForceRemovingAssignments(force) +const GLOBAL_PROPERTY_TYPE = new openbis.PropertyType() +GLOBAL_PROPERTY_TYPE.setCode('TEST_PROPERTY_TYPE') +GLOBAL_PROPERTY_TYPE.setLabel('TEST_LABEL') +GLOBAL_PROPERTY_TYPE.setDescription('TEST_DESCRIPTION') +GLOBAL_PROPERTY_TYPE.setDataType(openbis.DataType.INTEGER) - return new openbis.UpdateSampleTypesOperation([update]) - } +const GLOBAL_PROPERTY_ASSIGNMENT = new openbis.PropertyAssignment() +GLOBAL_PROPERTY_ASSIGNMENT.setPropertyType(GLOBAL_PROPERTY_TYPE) - function expectExecuteOperations(expectedOperations) { - expect(facade.executeOperations).toHaveBeenCalledTimes(1) - const actualOperations = facade.executeOperations.mock.calls[0][0] - expect(actualOperations.length).toEqual(expectedOperations.length) - actualOperations.forEach((actualOperation, index) => { - expect(actualOperation).toMatchObject(expectedOperations[index]) - }) - } -}) +const SAMPLE_TYPE_WITH_GLOBAL_PROPERTY = new openbis.SampleType() +SAMPLE_TYPE_WITH_GLOBAL_PROPERTY.setCode('TEST_TYPE') +SAMPLE_TYPE_WITH_GLOBAL_PROPERTY.setGeneratedCodePrefix('TEST_PREFIX') +SAMPLE_TYPE_WITH_GLOBAL_PROPERTY.setPropertyAssignments([ + GLOBAL_PROPERTY_ASSIGNMENT +]) diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerSelectionChange.test.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerSelectionChange.test.js index 54f3c0ee0f36947b8f8d2daae53841ef67213693..a9064239bb76e1e799a6321334c9435a3a9e5f5a 100644 --- a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerSelectionChange.test.js +++ b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerSelectionChange.test.js @@ -1,97 +1,88 @@ -import ComponentContext from '@srcTest/js/components/common/ComponentContext.js' -import TypeFormControler from '@src/js/components/types/form/TypeFormController.js' +import TypeFormControllerTest from '@srcTest/js/components/types/form/TypeFormControllerTest.js' import TypeFormSelectionType from '@src/js/components/types/form/TypeFormSelectionType.js' -import TypeFormFacade from '@src/js/components/types/form/TypeFormFacade' import objectTypes from '@src/js/common/consts/objectType.js' import fixture from '@srcTest/js/common/fixture.js' -jest.mock('@src/js/components/types/form/TypeFormFacade') - -let context = null -let facade = null -let controller = null +let common = null beforeEach(() => { - jest.resetAllMocks() - context = new ComponentContext() - context.setProps({ - object: { - id: 'TEST_OBJECT_ID', - type: objectTypes.OBJECT_TYPE - } + common = new TypeFormControllerTest() + common.beforeEach() + common.init({ + id: 'TEST_OBJECT_ID', + type: objectTypes.OBJECT_TYPE }) - facade = new TypeFormFacade() - controller = new TypeFormControler(facade) - controller.init(context) }) afterEach(() => { - expect(facade.loadType).toHaveBeenCalledWith(context.getProps().object) - expect(facade.loadUsages).toHaveBeenCalledWith(context.getProps().object) + common.afterEach() }) -describe('TypeFormController.handleSelectionChange', () => { - test('section', async () => { - facade.loadType.mockReturnValue( - Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) - ) - facade.loadUsages.mockReturnValue(Promise.resolve({})) - - await controller.load() - - expect(context.getState()).toMatchObject({ - selection: null - }) - - controller.handleSelectionChange(TypeFormSelectionType.SECTION, { - id: 'section-0' - }) - - expect(context.getState()).toMatchObject({ - selection: { - type: TypeFormSelectionType.SECTION, - params: { - id: 'section-0' - } +describe(TypeFormControllerTest.SUITE, () => { + test('select a section', testSelectSection) + test('select a property', testSelectProperty) +}) + +async function testSelectSection() { + common.facade.loadType.mockReturnValue( + Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) + ) + common.facade.loadUsages.mockReturnValue(Promise.resolve({})) + + await common.controller.load() + + expect(common.context.getState()).toMatchObject({ + selection: null + }) + + common.controller.handleSelectionChange(TypeFormSelectionType.SECTION, { + id: 'section-0' + }) + + expect(common.context.getState()).toMatchObject({ + selection: { + type: TypeFormSelectionType.SECTION, + params: { + id: 'section-0' } - }) + } + }) - controller.handleSelectionChange() + common.controller.handleSelectionChange() - expect(context.getState()).toMatchObject({ - selection: null - }) + expect(common.context.getState()).toMatchObject({ + selection: null }) +} - test('property', async () => { - facade.loadType.mockReturnValue( - Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) - ) - facade.loadUsages.mockReturnValue(Promise.resolve({})) +async function testSelectProperty() { + common.facade.loadType.mockReturnValue( + Promise.resolve(fixture.TEST_SAMPLE_TYPE_DTO) + ) + common.facade.loadUsages.mockReturnValue(Promise.resolve({})) - await controller.load() + await common.controller.load() - expect(context.getState()).toMatchObject({ - selection: null - }) + expect(common.context.getState()).toMatchObject({ + selection: null + }) - controller.handleSelectionChange(TypeFormSelectionType.PROPERTY, { - id: 'property-0' - }) + common.controller.handleSelectionChange(TypeFormSelectionType.PROPERTY, { + id: 'property-0' + }) - expect(context.getState()).toMatchObject({ - selection: { - type: TypeFormSelectionType.PROPERTY, - params: { - id: 'property-0' - } + expect(common.context.getState()).toMatchObject({ + selection: { + type: TypeFormSelectionType.PROPERTY, + params: { + id: 'property-0' } - }) + } + }) - controller.handleSelectionChange() + common.controller.handleSelectionChange() - expect(context.getState()).toMatchObject({ - selection: null - }) + expect(common.context.getState()).toMatchObject({ + selection: null }) -}) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerTest.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerTest.js new file mode 100644 index 0000000000000000000000000000000000000000..d2feec9a5387e79931b329b1d74563bf9b2a399e --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerTest.js @@ -0,0 +1,32 @@ +import ComponentContext from '@srcTest/js/components/common/ComponentContext.js' +import TypeFormControler from '@src/js/components/types/form/TypeFormController.js' +import TypeFormFacade from '@src/js/components/types/form/TypeFormFacade' + +jest.mock('@src/js/components/types/form/TypeFormFacade') + +export default class TypeFormControllerTest { + static SUITE = 'TypeFormController' + + beforeEach() { + jest.resetAllMocks() + } + + init(object) { + this.context = new ComponentContext() + this.context.setProps({ + object + }) + this.facade = new TypeFormFacade() + this.controller = new TypeFormControler(this.facade) + this.controller.init(this.context) + } + + afterEach() { + expect(this.facade.loadType).toHaveBeenCalledWith( + this.context.getProps().object + ) + expect(this.facade.loadUsages).toHaveBeenCalledWith( + this.context.getProps().object + ) + } +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerValidate.test.js b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerValidate.test.js new file mode 100644 index 0000000000000000000000000000000000000000..11f6f3867516e629179fb41916a96ae214164f4a --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/TypeFormControllerValidate.test.js @@ -0,0 +1,86 @@ +import TypeFormControllerTest from '@srcTest/js/components/types/form/TypeFormControllerTest.js' +import TypeFormSelectionType from '@src/js/components/types/form/TypeFormSelectionType.js' +import objectTypes from '@src/js/common/consts/objectType.js' +import openbis from '@srcTest/js/services/openbis.js' + +let common = null + +beforeEach(() => { + common = new TypeFormControllerTest() + common.beforeEach() + common.init({ + id: 'TEST_OBJECT_ID', + type: objectTypes.OBJECT_TYPE + }) +}) + +afterEach(() => { + common.afterEach() +}) + +describe(TypeFormControllerTest.SUITE, () => { + test('validate', testValidate) +}) + +async function testValidate() { + const SAMPLE_TYPE = new openbis.SampleType() + + common.facade.loadType.mockReturnValue(Promise.resolve(SAMPLE_TYPE)) + common.facade.loadUsages.mockReturnValue(Promise.resolve({})) + + await common.controller.load() + common.controller.handleAddSection() + common.controller.handleAddProperty() + + expect(common.context.getState()).toMatchObject({ + selection: { + type: TypeFormSelectionType.PROPERTY, + params: { + id: 'property-0' + } + }, + type: { + errors: 0 + }, + properties: [ + { + id: 'property-0', + code: { value: null }, + dataType: { value: null }, + label: { value: null }, + description: { value: null }, + errors: 0 + } + ] + }) + + await common.controller.handleSave() + + expect(common.context.getState()).toMatchObject({ + selection: { + type: TypeFormSelectionType.TYPE, + params: { + part: 'code' + } + }, + type: { + code: { + error: 'Code cannot be empty' + }, + generatedCodePrefix: { + error: 'Generated code prefix cannot be empty' + }, + errors: 2 + }, + properties: [ + { + id: 'property-0', + code: { value: null, error: 'Code cannot be empty' }, + dataType: { value: null, error: 'Data Type cannot be empty' }, + label: { value: null, error: 'Label cannot be empty' }, + description: { value: null, error: 'Description cannot be empty' }, + errors: 4 + } + ] + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponent.test.js b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponent.test.js deleted file mode 100644 index ad977807e226111084403ac4c4b3c6741218c638..0000000000000000000000000000000000000000 --- a/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponent.test.js +++ /dev/null @@ -1,1310 +0,0 @@ -import React from 'react' -import ComponentTest from '@srcTest/js/components/common/ComponentTest.js' -import VocabularyForm from '@src/js/components/types/form/VocabularyForm.jsx' -import VocabularyFormWrapper from '@srcTest/js/components/types/form/wrapper/VocabularyFormWrapper.js' -import VocabularyFormController from '@src/js/components/types/form/VocabularyFormController.js' -import VocabularyFormFacade from '@src/js/components/types/form/VocabularyFormFacade' -import objectTypes from '@src/js/common/consts/objectType.js' -import openbis from '@srcTest/js/services/openbis.js' -import fixture from '@srcTest/js/common/fixture.js' - -jest.mock('@src/js/components/types/form/VocabularyFormFacade') - -let common = null -let facade = null -let controller = null - -beforeEach(() => { - common = new ComponentTest( - object => <VocabularyForm object={object} controller={controller} />, - wrapper => new VocabularyFormWrapper(wrapper) - ) - common.beforeEach() - - facade = new VocabularyFormFacade() - controller = new VocabularyFormController(facade) -}) - -describe('VocabularyFormComponent', () => { - test('load new', testLoadNew) - test('load existing', testLoadExisting) - test('sort', testSort) - test('filter', testFilter) - test('page', testPage) - test('select term', testSelectTerm) - test('follow selected term', testFollowSelectedTerm) - test('add term', testAddTerm) - test('remove term', testRemoveTerm) - test('change term', testChangeTerm) - test('change vocabulary', testChangeVocabulary) - test('validate term', testValidateTerm) - test('validate vocabulary', testValidateVocabulary) - test('internal', testInternal) -}) - -async function testLoadNew() { - const form = await mountNew() - - form.expectJSON({ - grid: { - rows: [] - }, - parameters: { - vocabulary: { - title: 'Vocabulary', - code: { - label: 'Code', - value: null, - enabled: true, - mode: 'edit' - }, - description: { - label: 'Description', - value: null, - enabled: true, - mode: 'edit' - }, - urlTemplate: { - label: 'URL template', - value: null, - enabled: true, - mode: 'edit' - } - } - }, - buttons: { - addTerm: { - enabled: true - }, - removeTerm: { - enabled: false - }, - save: { - enabled: true - }, - edit: null, - cancel: null, - message: null - } - }) -} - -async function testLoadExisting() { - const form = await mountExisting() - - const gridJSON = { - columns: [ - { - field: 'code.value', - label: 'Code', - filter: { - value: null - }, - sort: 'asc' - }, - { - field: 'label.value', - label: 'Label', - filter: { - value: null - }, - sort: null - }, - { - field: 'description.value', - label: 'Description', - filter: { - value: null - }, - sort: null - }, - { - field: 'official.value', - label: 'Official', - filter: { - value: null - }, - sort: null - } - ], - rows: fixture.TEST_VOCABULARY_DTO.terms.map(term => ({ - values: { - 'code.value': term.getCode(), - 'label.value': term.getLabel(), - 'description.value': term.getDescription(), - 'official.value': String(term.isOfficial()) - }, - selected: false - })) - } - - form.expectJSON({ - grid: gridJSON, - parameters: { - vocabulary: { - title: 'Vocabulary', - code: { - label: 'Code', - value: fixture.TEST_VOCABULARY_DTO.getCode(), - mode: 'view' - }, - description: { - label: 'Description', - value: fixture.TEST_VOCABULARY_DTO.getDescription(), - mode: 'view' - }, - urlTemplate: { - label: 'URL template', - value: fixture.TEST_VOCABULARY_DTO.getUrlTemplate(), - mode: 'view' - } - } - }, - buttons: { - edit: { - enabled: true - }, - addTerm: null, - removeTerm: null, - save: null, - cancel: null, - message: null - } - }) - - form.getButtons().getEdit().click() - await form.update() - - form.expectJSON({ - grid: gridJSON, - parameters: { - vocabulary: { - title: 'Vocabulary', - code: { - label: 'Code', - value: fixture.TEST_VOCABULARY_DTO.getCode(), - enabled: false, - mode: 'edit' - }, - description: { - label: 'Description', - value: fixture.TEST_VOCABULARY_DTO.getDescription(), - enabled: true, - mode: 'edit' - }, - urlTemplate: { - label: 'URL template', - value: fixture.TEST_VOCABULARY_DTO.getUrlTemplate(), - enabled: true, - mode: 'edit' - } - } - }, - buttons: { - addTerm: { - enabled: true - }, - removeTerm: { - enabled: false - }, - save: { - enabled: true - }, - cancel: { - enabled: true - }, - edit: null, - message: null - } - }) -} - -async function testSort() { - const form = await mountNew() - - const labels = [ - 'Term 1', - 'term 11', - 'Term 2', - 'TERM A', - 'term B', - 'Term A1', - 'tErM A11', - 'term A2' - ] - - for (let i = 0; i < labels.length; i++) { - form.getButtons().getAddTerm().click() - await form.update() - form.getParameters().getTerm().getLabel().change(labels[i]) - await form.update() - } - - form.getGrid().getColumns()[1].getLabel().click() - await form.update() - - form.expectJSON({ - grid: { - columns: [ - { field: 'code.value', sort: null }, - { field: 'label.value', sort: 'asc' }, - { field: 'description.value', sort: null }, - { field: 'official.value', sort: null } - ], - rows: [ - { values: { 'label.value': 'Term 1' } }, - { values: { 'label.value': 'Term 2' } }, - { values: { 'label.value': 'term 11' } }, - { values: { 'label.value': 'TERM A' } }, - { values: { 'label.value': 'Term A1' } }, - { values: { 'label.value': 'term A2' } }, - { values: { 'label.value': 'tErM A11' } }, - { values: { 'label.value': 'term B' } } - ] - } - }) - - form.getGrid().getColumns()[1].getLabel().click() - await form.update() - - form.expectJSON({ - grid: { - columns: [ - { field: 'code.value', sort: null }, - { field: 'label.value', sort: 'desc' }, - { field: 'description.value', sort: null }, - { field: 'official.value', sort: null } - ], - rows: [ - { values: { 'label.value': 'term B' } }, - { values: { 'label.value': 'tErM A11' } }, - { values: { 'label.value': 'term A2' } }, - { values: { 'label.value': 'Term A1' } }, - { values: { 'label.value': 'TERM A' } }, - { values: { 'label.value': 'term 11' } }, - { values: { 'label.value': 'Term 2' } }, - { values: { 'label.value': 'Term 1' } } - ] - } - }) -} - -async function testFilter() { - const form = await mountNew() - - const labels = [ - 'some 1', - 'SOME 2', - 'Some 3', - 'another 1', - 'ANOTHER 2', - 'Another 3' - ] - - for (let i = 0; i < labels.length; i++) { - form.getButtons().getAddTerm().click() - await form.update() - form.getParameters().getTerm().getLabel().change(labels[i]) - await form.update() - } - - form.getGrid().getColumns()[1].getFilter().change('some') - await form.update() - - form.expectJSON({ - grid: { - columns: [ - { field: 'code.value', filter: { value: null } }, - { field: 'label.value', filter: { value: 'some' } }, - { field: 'description.value', filter: { value: null } }, - { field: 'official.value', filter: { value: null } } - ], - rows: [ - { values: { 'label.value': 'some 1' } }, - { values: { 'label.value': 'SOME 2' } }, - { values: { 'label.value': 'Some 3' } } - ], - paging: { - range: '1-3 of 3' - } - } - }) - - form.getGrid().getColumns()[1].getFilter().change('1') - await form.update() - - form.expectJSON({ - grid: { - columns: [ - { field: 'code.value', filter: { value: null } }, - { field: 'label.value', filter: { value: '1' } }, - { field: 'description.value', filter: { value: null } }, - { field: 'official.value', filter: { value: null } } - ], - rows: [ - { values: { 'label.value': 'some 1' } }, - { values: { 'label.value': 'another 1' } } - ], - paging: { - range: '1-2 of 2' - } - } - }) -} - -async function testPage() { - const form = await mountNew() - - for (let i = 1; i <= 23; i++) { - form.getButtons().getAddTerm().click() - await form.update() - form.getParameters().getTerm().getLabel().change(String(i)) - await form.update() - } - - form.getGrid().getColumns()[1].getLabel().click() - await form.update() - - form.getGrid().getPaging().getPageSize().change(5) - await form.update() - - form.expectJSON({ - grid: { - rows: [ - { values: { 'label.value': '1' } }, - { values: { 'label.value': '2' } }, - { values: { 'label.value': '3' } }, - { values: { 'label.value': '4' } }, - { values: { 'label.value': '5' } } - ], - paging: { - range: '1-5 of 23' - } - } - }) - - form.getGrid().getPaging().getNextPage().click() - await form.update() - - form.expectJSON({ - grid: { - rows: [ - { values: { 'label.value': '6' } }, - { values: { 'label.value': '7' } }, - { values: { 'label.value': '8' } }, - { values: { 'label.value': '9' } }, - { values: { 'label.value': '10' } } - ], - paging: { - range: '6-10 of 23' - } - } - }) - - form.getGrid().getPaging().getLastPage().click() - await form.update() - - form.expectJSON({ - grid: { - rows: [ - { values: { 'label.value': '21' } }, - { values: { 'label.value': '22' } }, - { values: { 'label.value': '23' } } - ], - paging: { - range: '21-23 of 23' - } - } - }) - - form.getGrid().getPaging().getPrevPage().click() - await form.update() - - form.expectJSON({ - grid: { - rows: [ - { values: { 'label.value': '16' } }, - { values: { 'label.value': '17' } }, - { values: { 'label.value': '18' } }, - { values: { 'label.value': '19' } }, - { values: { 'label.value': '20' } } - ], - paging: { - range: '16-20 of 23' - } - } - }) - - form.getGrid().getPaging().getFirstPage().click() - await form.update() - - form.expectJSON({ - grid: { - rows: [ - { values: { 'label.value': '1' } }, - { values: { 'label.value': '2' } }, - { values: { 'label.value': '3' } }, - { values: { 'label.value': '4' } }, - { values: { 'label.value': '5' } } - ], - paging: { - range: '1-5 of 23' - } - } - }) -} - -async function testSelectTerm() { - const form = await mountExisting() - - form.getGrid().getRows()[1].click() - await form.update() - - form.getButtons().getEdit().click() - await form.update() - - form.expectJSON({ - grid: { - rows: [ - { selected: false }, - { selected: true }, - { selected: false }, - { selected: false }, - { selected: false }, - { selected: false } - ] - }, - parameters: { - term: { - title: 'Term', - code: { - label: 'Code', - value: fixture.TEST_TERM_2_DTO.getCode(), - enabled: false, - mode: 'edit' - }, - label: { - label: 'Label', - value: fixture.TEST_TERM_2_DTO.getLabel(), - enabled: true, - mode: 'edit' - }, - description: { - label: 'Description', - value: fixture.TEST_TERM_2_DTO.getDescription(), - enabled: true, - mode: 'edit' - }, - official: { - label: 'Official', - value: fixture.TEST_TERM_2_DTO.isOfficial(), - enabled: false, - mode: 'edit' - } - } - }, - buttons: { - addTerm: { - enabled: true - }, - removeTerm: { - enabled: true - }, - save: { - enabled: true - }, - cancel: { - enabled: true - }, - edit: null, - message: null - } - }) -} - -async function testFollowSelectedTerm() { - const form = await mountNew() - - const labels = [ - 'Term 10', - 'Term 20', - 'Term 30', - 'Term 40', - 'Term 50', - 'Term 60' - ] - - for (let i = 0; i < labels.length; i++) { - form.getButtons().getAddTerm().click() - await form.update() - form.getParameters().getTerm().getLabel().change(labels[i]) - await form.update() - } - - form.getGrid().getPaging().getPageSize().change(5) - await form.update() - - form.getGrid().getColumns()[1].getLabel().click() - await form.update() - - form.expectJSON({ - grid: { - rows: [ - { values: { 'label.value': 'Term 10' }, selected: false }, - { values: { 'label.value': 'Term 20' }, selected: false }, - { values: { 'label.value': 'Term 30' }, selected: false }, - { values: { 'label.value': 'Term 40' }, selected: false }, - { values: { 'label.value': 'Term 50' }, selected: false } - ], - paging: { - range: '1-5 of 6' - } - }, - parameters: { - term: { - label: { - value: 'Term 60' - }, - messages: [ - { - type: 'warning', - text: - 'The selected term is currently not visible in the term list due to the chosen filtering and paging.' - } - ] - } - } - }) - - form.getGrid().getRows()[0].click() - await form.update() - - form.getParameters().getTerm().getLabel().change('Term 25') - await form.update() - - form.expectJSON({ - grid: { - rows: [ - { values: { 'label.value': 'Term 20' }, selected: false }, - { values: { 'label.value': 'Term 25' }, selected: true }, - { values: { 'label.value': 'Term 30' }, selected: false }, - { values: { 'label.value': 'Term 40' }, selected: false }, - { values: { 'label.value': 'Term 50' }, selected: false } - ], - paging: { - range: '1-5 of 6' - } - }, - parameters: { - term: { - label: { - value: 'Term 25' - }, - messages: [] - } - } - }) - - form.getParameters().getTerm().getLabel().change('Term 65') - await form.update() - - form.expectJSON({ - grid: { - rows: [{ values: { 'label.value': 'Term 65' }, selected: true }], - paging: { - range: '6-6 of 6' - } - }, - parameters: { - term: { - label: { - value: 'Term 65' - }, - messages: [] - } - } - }) - - form.getGrid().getPaging().getFirstPage().click() - await form.update() - - form.expectJSON({ - grid: { - rows: [ - { values: { 'label.value': 'Term 20' }, selected: false }, - { values: { 'label.value': 'Term 30' }, selected: false }, - { values: { 'label.value': 'Term 40' }, selected: false }, - { values: { 'label.value': 'Term 50' }, selected: false }, - { values: { 'label.value': 'Term 60' }, selected: false } - ], - paging: { - range: '1-5 of 6' - } - }, - parameters: { - term: { - label: { - value: 'Term 65' - }, - messages: [ - { - type: 'warning', - text: - 'The selected term is currently not visible in the term list due to the chosen filtering and paging.' - } - ] - } - } - }) -} - -async function testAddTerm() { - const form = await mountExisting() - - form.expectJSON({ - grid: { - columns: [ - { field: 'code.value', sort: 'asc' }, - { field: 'label.value', sort: null }, - { field: 'description.value', sort: null }, - { field: 'official.value', sort: null } - ], - rows: [ - fixture.TEST_TERM_1_DTO, - fixture.TEST_TERM_2_DTO, - fixture.TEST_TERM_3_DTO, - fixture.TEST_TERM_4_DTO, - fixture.TEST_TERM_5_DTO, - fixture.TEST_TERM_6_DTO - ].map(term => ({ - values: { - 'code.value': term.getCode() - }, - selected: false - })), - paging: { - pageSize: { - value: 10 - }, - range: '1-6 of 6' - } - } - }) - - form.getGrid().getColumns()[0].getLabel().click() - await form.update() - - form.getGrid().getPaging().getPageSize().change(5) - await form.update() - - form.getButtons().getEdit().click() - await form.update() - - form.getButtons().getAddTerm().click() - await form.update() - - form.expectJSON({ - grid: { - columns: [ - { field: 'code.value', sort: 'desc' }, - { field: 'label.value', sort: null }, - { field: 'description.value', sort: null }, - { field: 'official.value', sort: null } - ], - rows: [ - { - values: { 'code.value': fixture.TEST_TERM_1_DTO.getCode() }, - selected: false - }, - { - values: { 'code.value': null }, - selected: true - } - ], - paging: { - pageSize: { - value: 5 - }, - range: '6-7 of 7' - } - }, - parameters: { - term: { - title: 'Term', - code: { - label: 'Code', - value: null, - enabled: true, - mode: 'edit' - }, - label: { - label: 'Label', - value: null, - enabled: true, - mode: 'edit' - }, - description: { - label: 'Description', - value: null, - enabled: true, - mode: 'edit' - }, - official: { - label: 'Official', - value: true, - enabled: true, - mode: 'edit' - } - } - }, - buttons: { - addTerm: { - enabled: true - }, - removeTerm: { - enabled: true - }, - save: { - enabled: true - }, - cancel: { - enabled: true - }, - edit: null, - message: { - text: 'You have unsaved changes.', - type: 'warning' - } - } - }) -} - -async function testRemoveTerm() { - const form = await mountExisting() - - form.getGrid().getPaging().getPageSize().change(5) - form.getGrid().getPaging().getNextPage().click() - await form.update() - - form.getGrid().getRows()[0].click() - await form.update() - - form.expectJSON({ - grid: { - rows: [fixture.TEST_TERM_6_DTO].map(term => ({ - values: { - 'code.value': term.getCode(), - 'label.value': term.getLabel(), - 'description.value': term.getDescription(), - 'official.value': String(term.isOfficial()) - }, - selected: true - })), - paging: { - pageSize: { - value: 5 - }, - range: '6-6 of 6' - } - } - }) - - form.getButtons().getEdit().click() - await form.update() - - form.getButtons().getRemoveTerm().click() - await form.update() - - form.expectJSON({ - grid: { - rows: [ - fixture.TEST_TERM_1_DTO, - fixture.TEST_TERM_2_DTO, - fixture.TEST_TERM_3_DTO, - fixture.TEST_TERM_4_DTO, - fixture.TEST_TERM_5_DTO - ].map(term => ({ - values: { - 'code.value': term.getCode(), - 'label.value': term.getLabel(), - 'description.value': term.getDescription(), - 'official.value': String(term.isOfficial()) - }, - selected: false - })), - paging: { - pageSize: { - value: 5 - }, - range: '1-5 of 5' - } - }, - parameters: { - vocabulary: { - title: 'Vocabulary', - code: { - label: 'Code', - value: fixture.TEST_VOCABULARY_DTO.getCode(), - enabled: false, - mode: 'edit' - }, - description: { - label: 'Description', - value: fixture.TEST_VOCABULARY_DTO.getDescription(), - enabled: true, - mode: 'edit' - }, - urlTemplate: { - label: 'URL template', - value: fixture.TEST_VOCABULARY_DTO.getUrlTemplate(), - enabled: true, - mode: 'edit' - } - } - }, - buttons: { - addTerm: { - enabled: true - }, - removeTerm: { - enabled: false - }, - save: { - enabled: true - }, - cancel: { - enabled: true - }, - edit: null, - message: { - text: 'You have unsaved changes.', - type: 'warning' - } - } - }) -} - -async function testChangeTerm() { - const form = await mountExisting() - - form.getButtons().getEdit().click() - await form.update() - - form.getGrid().getRows()[1].click() - await form.update() - - form.expectJSON({ - grid: { - rows: [ - { values: { 'label.value': fixture.TEST_TERM_1_DTO.getLabel() } }, - { values: { 'label.value': fixture.TEST_TERM_2_DTO.getLabel() } }, - { values: { 'label.value': fixture.TEST_TERM_3_DTO.getLabel() } }, - { values: { 'label.value': fixture.TEST_TERM_4_DTO.getLabel() } }, - { values: { 'label.value': fixture.TEST_TERM_5_DTO.getLabel() } }, - { values: { 'label.value': fixture.TEST_TERM_6_DTO.getLabel() } } - ] - }, - parameters: { - term: { - title: 'Term', - label: { - label: 'Label', - value: fixture.TEST_TERM_2_DTO.getLabel(), - enabled: true, - mode: 'edit' - } - } - }, - buttons: { - message: null - } - }) - - form.getParameters().getTerm().getLabel().change('New Label') - await form.update() - - form.expectJSON({ - grid: { - rows: [ - { values: { 'label.value': fixture.TEST_TERM_1_DTO.getLabel() } }, - { values: { 'label.value': 'New Label' } }, - { values: { 'label.value': fixture.TEST_TERM_3_DTO.getLabel() } }, - { values: { 'label.value': fixture.TEST_TERM_4_DTO.getLabel() } }, - { values: { 'label.value': fixture.TEST_TERM_5_DTO.getLabel() } }, - { values: { 'label.value': fixture.TEST_TERM_6_DTO.getLabel() } } - ] - }, - parameters: { - term: { - title: 'Term', - label: { - label: 'Label', - value: 'New Label', - enabled: true, - mode: 'edit' - } - } - }, - buttons: { - message: { - text: 'You have unsaved changes.', - type: 'warning' - } - } - }) -} - -async function testChangeVocabulary() { - const form = await mountExisting() - - form.getButtons().getEdit().click() - await form.update() - - form.expectJSON({ - parameters: { - vocabulary: { - title: 'Vocabulary', - description: { - label: 'Description', - value: fixture.TEST_VOCABULARY_DTO.getDescription(), - enabled: true, - mode: 'edit' - } - } - }, - buttons: { - message: null - } - }) - - form - .getParameters() - .getVocabulary() - .getDescription() - .change('New Description') - await form.update() - - form.expectJSON({ - parameters: { - vocabulary: { - title: 'Vocabulary', - description: { - label: 'Description', - value: 'New Description', - enabled: true, - mode: 'edit' - } - } - }, - buttons: { - message: { - text: 'You have unsaved changes.', - type: 'warning' - } - } - }) -} - -async function testValidateTerm() { - const form = await mountExisting() - - form.getButtons().getEdit().click() - await form.update() - - form.getButtons().getAddTerm().click() - await form.update() - - form.getGrid().getPaging().getPageSize().change(5) - await form.update() - - form.getGrid().getPaging().getNextPage().click() - await form.update() - - form.expectJSON({ - grid: { - rows: [fixture.TEST_TERM_5_DTO, fixture.TEST_TERM_6_DTO].map(term => ({ - values: { - 'code.value': term.getCode() - }, - selected: false - })), - paging: { - pageSize: { - value: 5 - }, - range: '6-7 of 7' - } - }, - parameters: { - term: { - title: 'Term', - code: { - value: null, - error: null - } - } - }, - buttons: { - message: { - text: 'You have unsaved changes.', - type: 'warning' - } - } - }) - - form.getButtons().getSave().click() - await form.update() - - form.expectJSON({ - grid: { - rows: [ - { - values: { - 'code.value': null, - 'label.value': null, - 'description.value': null, - 'official.value': String(true) - }, - selected: true - }, - { values: { 'code.value': fixture.TEST_TERM_1_DTO.getCode() } }, - { values: { 'code.value': fixture.TEST_TERM_2_DTO.getCode() } }, - { values: { 'code.value': fixture.TEST_TERM_3_DTO.getCode() } }, - { values: { 'code.value': fixture.TEST_TERM_4_DTO.getCode() } } - ], - paging: { - pageSize: { - value: 5 - }, - range: '1-5 of 7' - } - }, - parameters: { - term: { - title: 'Term', - code: { - value: null, - error: 'Code cannot be empty', - focused: true - } - } - }, - buttons: { - message: { - text: 'You have unsaved changes.', - type: 'warning' - } - } - }) - - form.getParameters().getTerm().getCode().change('I am illegal') - await form.update() - - form.getButtons().getSave().click() - await form.update() - - form.expectJSON({ - parameters: { - term: { - code: { - value: 'I am illegal', - error: 'Code can only contain A-Z, a-z, 0-9 and _, -, ., :', - focused: true - } - } - } - }) -} - -async function testValidateVocabulary() { - const form = await mountNew() - - form.getButtons().getAddTerm().click() - await form.update() - - form.getButtons().getSave().click() - await form.update() - - form.expectJSON({ - grid: { - rows: [ - { - values: { - 'code.value': null, - 'label.value': null, - 'description.value': null, - 'official.value': String(true) - }, - selected: false - } - ] - }, - parameters: { - vocabulary: { - title: 'Vocabulary', - code: { - value: null, - error: 'Code cannot be empty', - focused: true - } - } - }, - buttons: { - message: { - text: 'You have unsaved changes.', - type: 'warning' - } - } - }) - - form.getParameters().getVocabulary().getCode().change('I am illegal') - await form.update() - - form.getButtons().getSave().click() - await form.update() - - form.expectJSON({ - parameters: { - vocabulary: { - code: { - value: 'I am illegal', - error: 'Code can only contain A-Z, a-z, 0-9 and _, -, .', - focused: true - } - } - } - }) -} - -async function testInternal() { - await doTestInternal(false, fixture.TEST_USER_DTO, fixture.TEST_USER_DTO) - await doTestInternal(true, fixture.TEST_USER_DTO, fixture.TEST_USER_DTO) - await doTestInternal(false, fixture.TEST_USER_DTO, fixture.SYSTEM_USER_DTO) - await doTestInternal(true, fixture.TEST_USER_DTO, fixture.SYSTEM_USER_DTO) - await doTestInternal(false, fixture.SYSTEM_USER_DTO, fixture.TEST_USER_DTO) - await doTestInternal(true, fixture.SYSTEM_USER_DTO, fixture.TEST_USER_DTO) - await doTestInternal(false, fixture.SYSTEM_USER_DTO, fixture.SYSTEM_USER_DTO) - await doTestInternal(true, fixture.SYSTEM_USER_DTO, fixture.SYSTEM_USER_DTO) -} - -async function doTestInternal( - vocabularyInternal, - vocabularyRegistrator, - termRegistrator -) { - const isSystemInternalVocabulary = - vocabularyInternal && - vocabularyRegistrator.userId === fixture.SYSTEM_USER_DTO.userId - - const isSystemInternalTerm = - vocabularyInternal && - termRegistrator.userId === fixture.SYSTEM_USER_DTO.userId - - const term = new openbis.VocabularyTerm() - term.setCode('TEST_TERM') - term.setDescription('Test Term Description') - term.setLabel('Test Term Label') - term.setRegistrator(termRegistrator) - term.setOfficial(true) - - const vocabulary = new openbis.Vocabulary() - vocabulary.setCode('TEST_VOCABULARY') - vocabulary.setDescription('Test Vocabulary Description') - vocabulary.setUrlTemplate('Test Vocabulary Url Template') - vocabulary.setTerms([term]) - vocabulary.setManagedInternally(vocabularyInternal) - vocabulary.setRegistrator(vocabularyRegistrator) - - facade.loadVocabulary.mockReturnValue(Promise.resolve(vocabulary)) - - const form = await common.mount({ - id: vocabulary.getCode(), - type: objectTypes.VOCABULARY_TYPE - }) - - form.getButtons().getEdit().click() - await form.update() - - form.expectJSON({ - parameters: { - vocabulary: { - title: 'Vocabulary', - messages: isSystemInternalVocabulary - ? [ - { - type: 'lock', - text: - 'This is a system internal vocabulary. The vocabulary parameters cannot be changed.' - } - ] - : [], - code: { - value: vocabulary.getCode(), - enabled: false - }, - description: { - value: vocabulary.getDescription(), - enabled: !isSystemInternalVocabulary - }, - urlTemplate: { - value: vocabulary.getUrlTemplate(), - enabled: !isSystemInternalVocabulary - } - } - } - }) - - form.getGrid().getRows()[0].click() - await form.update() - - form.expectJSON({ - parameters: { - term: { - title: 'Term', - messages: isSystemInternalTerm - ? [ - { - type: 'lock', - text: - 'This is a system internal term. The term parameters cannot be changed. The term cannot be removed.' - } - ] - : [], - code: { - value: term.getCode(), - enabled: false - }, - description: { - value: term.getDescription(), - enabled: !isSystemInternalTerm - }, - label: { - value: term.getLabel(), - enabled: !isSystemInternalTerm - } - } - }, - buttons: { - removeTerm: { - enabled: !isSystemInternalTerm - } - } - }) -} - -async function mountNew() { - return await common.mount({ - type: objectTypes.NEW_VOCABULARY_TYPE - }) -} - -async function mountExisting() { - facade.loadVocabulary.mockReturnValue( - Promise.resolve(fixture.TEST_VOCABULARY_DTO) - ) - - return await common.mount({ - id: fixture.TEST_VOCABULARY_DTO.getCode(), - type: objectTypes.VOCABULARY_TYPE - }) -} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentAddTerm.test.js b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentAddTerm.test.js new file mode 100644 index 0000000000000000000000000000000000000000..7f663672d577f0f74f8f84a1c9cff801a6a7a3f8 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentAddTerm.test.js @@ -0,0 +1,134 @@ +import VocabularyFormComponentTest from '@srcTest/js/components/types/form/VocabularyFormComponentTest.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new VocabularyFormComponentTest() + common.beforeEach() +}) + +describe(VocabularyFormComponentTest.SUITE, () => { + test('add term', testAddTerm) +}) + +async function testAddTerm() { + const form = await common.mountExisting(fixture.TEST_VOCABULARY_DTO) + + form.expectJSON({ + grid: { + columns: [ + { field: 'code.value', sort: 'asc' }, + { field: 'label.value', sort: null }, + { field: 'description.value', sort: null }, + { field: 'official.value', sort: null } + ], + rows: [ + fixture.TEST_TERM_1_DTO, + fixture.TEST_TERM_2_DTO, + fixture.TEST_TERM_3_DTO, + fixture.TEST_TERM_4_DTO, + fixture.TEST_TERM_5_DTO, + fixture.TEST_TERM_6_DTO + ].map(term => ({ + values: { + 'code.value': term.getCode() + }, + selected: false + })), + paging: { + pageSize: { + value: 10 + }, + range: '1-6 of 6' + } + } + }) + + form.getGrid().getColumns()[0].getLabel().click() + await form.update() + + form.getGrid().getPaging().getPageSize().change(5) + await form.update() + + form.getButtons().getEdit().click() + await form.update() + + form.getButtons().getAddTerm().click() + await form.update() + + form.expectJSON({ + grid: { + columns: [ + { field: 'code.value', sort: 'desc' }, + { field: 'label.value', sort: null }, + { field: 'description.value', sort: null }, + { field: 'official.value', sort: null } + ], + rows: [ + { + values: { 'code.value': fixture.TEST_TERM_1_DTO.getCode() }, + selected: false + }, + { + values: { 'code.value': null }, + selected: true + } + ], + paging: { + pageSize: { + value: 5 + }, + range: '6-7 of 7' + } + }, + parameters: { + term: { + title: 'Term', + code: { + label: 'Code', + value: null, + enabled: true, + mode: 'edit' + }, + label: { + label: 'Label', + value: null, + enabled: true, + mode: 'edit' + }, + description: { + label: 'Description', + value: null, + enabled: true, + mode: 'edit' + }, + official: { + label: 'Official', + value: true, + enabled: true, + mode: 'edit' + } + } + }, + buttons: { + addTerm: { + enabled: true + }, + removeTerm: { + enabled: true + }, + save: { + enabled: true + }, + cancel: { + enabled: true + }, + edit: null, + message: { + text: 'You have unsaved changes.', + type: 'warning' + } + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentChangeTerm.test.js b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentChangeTerm.test.js new file mode 100644 index 0000000000000000000000000000000000000000..7f2d0bac3aa42836191caafd38ff395ef171fa56 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentChangeTerm.test.js @@ -0,0 +1,83 @@ +import VocabularyFormComponentTest from '@srcTest/js/components/types/form/VocabularyFormComponentTest.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new VocabularyFormComponentTest() + common.beforeEach() +}) + +describe(VocabularyFormComponentTest.SUITE, () => { + test('change term', testChangeTerm) +}) + +async function testChangeTerm() { + const form = await common.mountExisting(fixture.TEST_VOCABULARY_DTO) + + form.getButtons().getEdit().click() + await form.update() + + form.getGrid().getRows()[1].click() + await form.update() + + form.expectJSON({ + grid: { + rows: [ + { values: { 'label.value': fixture.TEST_TERM_1_DTO.getLabel() } }, + { values: { 'label.value': fixture.TEST_TERM_2_DTO.getLabel() } }, + { values: { 'label.value': fixture.TEST_TERM_3_DTO.getLabel() } }, + { values: { 'label.value': fixture.TEST_TERM_4_DTO.getLabel() } }, + { values: { 'label.value': fixture.TEST_TERM_5_DTO.getLabel() } }, + { values: { 'label.value': fixture.TEST_TERM_6_DTO.getLabel() } } + ] + }, + parameters: { + term: { + title: 'Term', + label: { + label: 'Label', + value: fixture.TEST_TERM_2_DTO.getLabel(), + enabled: true, + mode: 'edit' + } + } + }, + buttons: { + message: null + } + }) + + form.getParameters().getTerm().getLabel().change('New Label') + await form.update() + + form.expectJSON({ + grid: { + rows: [ + { values: { 'label.value': fixture.TEST_TERM_1_DTO.getLabel() } }, + { values: { 'label.value': 'New Label' } }, + { values: { 'label.value': fixture.TEST_TERM_3_DTO.getLabel() } }, + { values: { 'label.value': fixture.TEST_TERM_4_DTO.getLabel() } }, + { values: { 'label.value': fixture.TEST_TERM_5_DTO.getLabel() } }, + { values: { 'label.value': fixture.TEST_TERM_6_DTO.getLabel() } } + ] + }, + parameters: { + term: { + title: 'Term', + label: { + label: 'Label', + value: 'New Label', + enabled: true, + mode: 'edit' + } + } + }, + buttons: { + message: { + text: 'You have unsaved changes.', + type: 'warning' + } + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentChangeVocabulary.test.js b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentChangeVocabulary.test.js new file mode 100644 index 0000000000000000000000000000000000000000..be88fcd6ef2c9206c4c1b0bb786b62d156890bb4 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentChangeVocabulary.test.js @@ -0,0 +1,64 @@ +import VocabularyFormComponentTest from '@srcTest/js/components/types/form/VocabularyFormComponentTest.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new VocabularyFormComponentTest() + common.beforeEach() +}) + +describe(VocabularyFormComponentTest.SUITE, () => { + test('change vocabulary', testChangeVocabulary) +}) + +async function testChangeVocabulary() { + const form = await common.mountExisting(fixture.TEST_VOCABULARY_DTO) + + form.getButtons().getEdit().click() + await form.update() + + form.expectJSON({ + parameters: { + vocabulary: { + title: 'Vocabulary', + description: { + label: 'Description', + value: fixture.TEST_VOCABULARY_DTO.getDescription(), + enabled: true, + mode: 'edit' + } + } + }, + buttons: { + message: null + } + }) + + form + .getParameters() + .getVocabulary() + .getDescription() + .change('New Description') + await form.update() + + form.expectJSON({ + parameters: { + vocabulary: { + title: 'Vocabulary', + description: { + label: 'Description', + value: 'New Description', + enabled: true, + mode: 'edit' + } + } + }, + buttons: { + message: { + text: 'You have unsaved changes.', + type: 'warning' + } + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentFilter.test.js b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentFilter.test.js new file mode 100644 index 0000000000000000000000000000000000000000..271d434b0d582614baa4ce337e6f0724ef594d62 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentFilter.test.js @@ -0,0 +1,75 @@ +import VocabularyFormComponentTest from '@srcTest/js/components/types/form/VocabularyFormComponentTest.js' + +let common = null + +beforeEach(() => { + common = new VocabularyFormComponentTest() + common.beforeEach() +}) + +describe(VocabularyFormComponentTest.SUITE, () => { + test('filter', testFilter) +}) + +async function testFilter() { + const form = await common.mountNew() + + const labels = [ + 'some 1', + 'SOME 2', + 'Some 3', + 'another 1', + 'ANOTHER 2', + 'Another 3' + ] + + for (let i = 0; i < labels.length; i++) { + form.getButtons().getAddTerm().click() + await form.update() + form.getParameters().getTerm().getLabel().change(labels[i]) + await form.update() + } + + form.getGrid().getColumns()[1].getFilter().change('some') + await form.update() + + form.expectJSON({ + grid: { + columns: [ + { field: 'code.value', filter: { value: null } }, + { field: 'label.value', filter: { value: 'some' } }, + { field: 'description.value', filter: { value: null } }, + { field: 'official.value', filter: { value: null } } + ], + rows: [ + { values: { 'label.value': 'some 1' } }, + { values: { 'label.value': 'SOME 2' } }, + { values: { 'label.value': 'Some 3' } } + ], + paging: { + range: '1-3 of 3' + } + } + }) + + form.getGrid().getColumns()[1].getFilter().change('1') + await form.update() + + form.expectJSON({ + grid: { + columns: [ + { field: 'code.value', filter: { value: null } }, + { field: 'label.value', filter: { value: '1' } }, + { field: 'description.value', filter: { value: null } }, + { field: 'official.value', filter: { value: null } } + ], + rows: [ + { values: { 'label.value': 'some 1' } }, + { values: { 'label.value': 'another 1' } } + ], + paging: { + range: '1-2 of 2' + } + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentInternal.test.js b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentInternal.test.js new file mode 100644 index 0000000000000000000000000000000000000000..682b7c5f0e7f84d2af19824267a41982fe1955aa --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentInternal.test.js @@ -0,0 +1,131 @@ +import VocabularyFormComponentTest from '@srcTest/js/components/types/form/VocabularyFormComponentTest.js' +import objectTypes from '@src/js/common/consts/objectType.js' +import openbis from '@srcTest/js/services/openbis.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new VocabularyFormComponentTest() + common.beforeEach() +}) + +describe(VocabularyFormComponentTest.SUITE, () => { + test('internal', testInternal) +}) + +async function testInternal() { + await doTestInternal(false, fixture.TEST_USER_DTO, fixture.TEST_USER_DTO) + await doTestInternal(true, fixture.TEST_USER_DTO, fixture.TEST_USER_DTO) + await doTestInternal(false, fixture.TEST_USER_DTO, fixture.SYSTEM_USER_DTO) + await doTestInternal(true, fixture.TEST_USER_DTO, fixture.SYSTEM_USER_DTO) + await doTestInternal(false, fixture.SYSTEM_USER_DTO, fixture.TEST_USER_DTO) + await doTestInternal(true, fixture.SYSTEM_USER_DTO, fixture.TEST_USER_DTO) + await doTestInternal(false, fixture.SYSTEM_USER_DTO, fixture.SYSTEM_USER_DTO) + await doTestInternal(true, fixture.SYSTEM_USER_DTO, fixture.SYSTEM_USER_DTO) +} + +async function doTestInternal( + vocabularyInternal, + vocabularyRegistrator, + termRegistrator +) { + const isSystemInternalVocabulary = + vocabularyInternal && + vocabularyRegistrator.userId === fixture.SYSTEM_USER_DTO.userId + + const isSystemInternalTerm = + vocabularyInternal && + termRegistrator.userId === fixture.SYSTEM_USER_DTO.userId + + const term = new openbis.VocabularyTerm() + term.setCode('TEST_TERM') + term.setDescription('Test Term Description') + term.setLabel('Test Term Label') + term.setRegistrator(termRegistrator) + term.setOfficial(true) + + const vocabulary = new openbis.Vocabulary() + vocabulary.setCode('TEST_VOCABULARY') + vocabulary.setDescription('Test Vocabulary Description') + vocabulary.setUrlTemplate('Test Vocabulary Url Template') + vocabulary.setTerms([term]) + vocabulary.setManagedInternally(vocabularyInternal) + vocabulary.setRegistrator(vocabularyRegistrator) + + common.facade.loadVocabulary.mockReturnValue(Promise.resolve(vocabulary)) + + const form = await common.mount({ + id: vocabulary.getCode(), + type: objectTypes.VOCABULARY_TYPE + }) + + form.getButtons().getEdit().click() + await form.update() + + form.expectJSON({ + parameters: { + vocabulary: { + title: 'Vocabulary', + messages: isSystemInternalVocabulary + ? [ + { + type: 'lock', + text: + 'This is a system internal vocabulary. The vocabulary parameters cannot be changed.' + } + ] + : [], + code: { + value: vocabulary.getCode(), + enabled: false + }, + description: { + value: vocabulary.getDescription(), + enabled: !isSystemInternalVocabulary + }, + urlTemplate: { + value: vocabulary.getUrlTemplate(), + enabled: !isSystemInternalVocabulary + } + } + } + }) + + form.getGrid().getRows()[0].click() + await form.update() + + form.expectJSON({ + parameters: { + term: { + title: 'Term', + messages: isSystemInternalTerm + ? [ + { + type: 'lock', + text: + 'This is a system internal term. The term parameters cannot be changed. The term cannot be removed.' + } + ] + : [], + code: { + value: term.getCode(), + enabled: false + }, + description: { + value: term.getDescription(), + enabled: !isSystemInternalTerm + }, + label: { + value: term.getLabel(), + enabled: !isSystemInternalTerm + } + } + }, + buttons: { + removeTerm: { + enabled: !isSystemInternalTerm + } + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentLoad.test.js b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentLoad.test.js new file mode 100644 index 0000000000000000000000000000000000000000..e83b3957ac7ae360e8fd27791fc78d06885fc980 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentLoad.test.js @@ -0,0 +1,191 @@ +import VocabularyFormComponentTest from '@srcTest/js/components/types/form/VocabularyFormComponentTest.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new VocabularyFormComponentTest() + common.beforeEach() +}) + +describe(VocabularyFormComponentTest.SUITE, () => { + test('load new', testLoadNew) + test('load existing', testLoadExisting) +}) + +async function testLoadNew() { + const form = await common.mountNew() + + form.expectJSON({ + grid: { + rows: [] + }, + parameters: { + vocabulary: { + title: 'Vocabulary', + code: { + label: 'Code', + value: null, + enabled: true, + mode: 'edit' + }, + description: { + label: 'Description', + value: null, + enabled: true, + mode: 'edit' + }, + urlTemplate: { + label: 'URL template', + value: null, + enabled: true, + mode: 'edit' + } + } + }, + buttons: { + addTerm: { + enabled: true + }, + removeTerm: { + enabled: false + }, + save: { + enabled: true + }, + edit: null, + cancel: null, + message: null + } + }) +} + +async function testLoadExisting() { + const form = await common.mountExisting(fixture.TEST_VOCABULARY_DTO) + + const gridJSON = { + columns: [ + { + field: 'code.value', + label: 'Code', + filter: { + value: null + }, + sort: 'asc' + }, + { + field: 'label.value', + label: 'Label', + filter: { + value: null + }, + sort: null + }, + { + field: 'description.value', + label: 'Description', + filter: { + value: null + }, + sort: null + }, + { + field: 'official.value', + label: 'Official', + filter: { + value: null + }, + sort: null + } + ], + rows: fixture.TEST_VOCABULARY_DTO.terms.map(term => ({ + values: { + 'code.value': term.getCode(), + 'label.value': term.getLabel(), + 'description.value': term.getDescription(), + 'official.value': String(term.isOfficial()) + }, + selected: false + })) + } + + form.expectJSON({ + grid: gridJSON, + parameters: { + vocabulary: { + title: 'Vocabulary', + code: { + label: 'Code', + value: fixture.TEST_VOCABULARY_DTO.getCode(), + mode: 'view' + }, + description: { + label: 'Description', + value: fixture.TEST_VOCABULARY_DTO.getDescription(), + mode: 'view' + }, + urlTemplate: { + label: 'URL template', + value: fixture.TEST_VOCABULARY_DTO.getUrlTemplate(), + mode: 'view' + } + } + }, + buttons: { + edit: { + enabled: true + }, + addTerm: null, + removeTerm: null, + save: null, + cancel: null, + message: null + } + }) + + form.getButtons().getEdit().click() + await form.update() + + form.expectJSON({ + grid: gridJSON, + parameters: { + vocabulary: { + title: 'Vocabulary', + code: { + label: 'Code', + value: fixture.TEST_VOCABULARY_DTO.getCode(), + enabled: false, + mode: 'edit' + }, + description: { + label: 'Description', + value: fixture.TEST_VOCABULARY_DTO.getDescription(), + enabled: true, + mode: 'edit' + }, + urlTemplate: { + label: 'URL template', + value: fixture.TEST_VOCABULARY_DTO.getUrlTemplate(), + enabled: true, + mode: 'edit' + } + } + }, + buttons: { + addTerm: { + enabled: true + }, + removeTerm: { + enabled: false + }, + save: { + enabled: true + }, + cancel: { + enabled: true + }, + edit: null, + message: null + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentPage.test.js b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentPage.test.js new file mode 100644 index 0000000000000000000000000000000000000000..6d02ecead0a3b4792bdd0af2039f66b785009132 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentPage.test.js @@ -0,0 +1,114 @@ +import VocabularyFormComponentTest from '@srcTest/js/components/types/form/VocabularyFormComponentTest.js' + +let common = null + +beforeEach(() => { + common = new VocabularyFormComponentTest() + common.beforeEach() +}) + +describe(VocabularyFormComponentTest.SUITE, () => { + test('page', testPage) +}) + +async function testPage() { + const form = await common.mountNew() + + for (let i = 1; i <= 23; i++) { + form.getButtons().getAddTerm().click() + await form.update() + form.getParameters().getTerm().getLabel().change(String(i)) + await form.update() + } + + form.getGrid().getColumns()[1].getLabel().click() + await form.update() + + form.getGrid().getPaging().getPageSize().change(5) + await form.update() + + form.expectJSON({ + grid: { + rows: [ + { values: { 'label.value': '1' } }, + { values: { 'label.value': '2' } }, + { values: { 'label.value': '3' } }, + { values: { 'label.value': '4' } }, + { values: { 'label.value': '5' } } + ], + paging: { + range: '1-5 of 23' + } + } + }) + + form.getGrid().getPaging().getNextPage().click() + await form.update() + + form.expectJSON({ + grid: { + rows: [ + { values: { 'label.value': '6' } }, + { values: { 'label.value': '7' } }, + { values: { 'label.value': '8' } }, + { values: { 'label.value': '9' } }, + { values: { 'label.value': '10' } } + ], + paging: { + range: '6-10 of 23' + } + } + }) + + form.getGrid().getPaging().getLastPage().click() + await form.update() + + form.expectJSON({ + grid: { + rows: [ + { values: { 'label.value': '21' } }, + { values: { 'label.value': '22' } }, + { values: { 'label.value': '23' } } + ], + paging: { + range: '21-23 of 23' + } + } + }) + + form.getGrid().getPaging().getPrevPage().click() + await form.update() + + form.expectJSON({ + grid: { + rows: [ + { values: { 'label.value': '16' } }, + { values: { 'label.value': '17' } }, + { values: { 'label.value': '18' } }, + { values: { 'label.value': '19' } }, + { values: { 'label.value': '20' } } + ], + paging: { + range: '16-20 of 23' + } + } + }) + + form.getGrid().getPaging().getFirstPage().click() + await form.update() + + form.expectJSON({ + grid: { + rows: [ + { values: { 'label.value': '1' } }, + { values: { 'label.value': '2' } }, + { values: { 'label.value': '3' } }, + { values: { 'label.value': '4' } }, + { values: { 'label.value': '5' } } + ], + paging: { + range: '1-5 of 23' + } + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentRemoveTerm.test.js b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentRemoveTerm.test.js new file mode 100644 index 0000000000000000000000000000000000000000..20bed8d71e655abd5fc83bd3601f7d94ffa4d0cb --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentRemoveTerm.test.js @@ -0,0 +1,118 @@ +import VocabularyFormComponentTest from '@srcTest/js/components/types/form/VocabularyFormComponentTest.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new VocabularyFormComponentTest() + common.beforeEach() +}) + +describe(VocabularyFormComponentTest.SUITE, () => { + test('remove term', testRemoveTerm) +}) + +async function testRemoveTerm() { + const form = await common.mountExisting(fixture.TEST_VOCABULARY_DTO) + + form.getGrid().getPaging().getPageSize().change(5) + form.getGrid().getPaging().getNextPage().click() + await form.update() + + form.getGrid().getRows()[0].click() + await form.update() + + form.expectJSON({ + grid: { + rows: [fixture.TEST_TERM_6_DTO].map(term => ({ + values: { + 'code.value': term.getCode(), + 'label.value': term.getLabel(), + 'description.value': term.getDescription(), + 'official.value': String(term.isOfficial()) + }, + selected: true + })), + paging: { + pageSize: { + value: 5 + }, + range: '6-6 of 6' + } + } + }) + + form.getButtons().getEdit().click() + await form.update() + + form.getButtons().getRemoveTerm().click() + await form.update() + + form.expectJSON({ + grid: { + rows: [ + fixture.TEST_TERM_1_DTO, + fixture.TEST_TERM_2_DTO, + fixture.TEST_TERM_3_DTO, + fixture.TEST_TERM_4_DTO, + fixture.TEST_TERM_5_DTO + ].map(term => ({ + values: { + 'code.value': term.getCode(), + 'label.value': term.getLabel(), + 'description.value': term.getDescription(), + 'official.value': String(term.isOfficial()) + }, + selected: false + })), + paging: { + pageSize: { + value: 5 + }, + range: '1-5 of 5' + } + }, + parameters: { + vocabulary: { + title: 'Vocabulary', + code: { + label: 'Code', + value: fixture.TEST_VOCABULARY_DTO.getCode(), + enabled: false, + mode: 'edit' + }, + description: { + label: 'Description', + value: fixture.TEST_VOCABULARY_DTO.getDescription(), + enabled: true, + mode: 'edit' + }, + urlTemplate: { + label: 'URL template', + value: fixture.TEST_VOCABULARY_DTO.getUrlTemplate(), + enabled: true, + mode: 'edit' + } + } + }, + buttons: { + addTerm: { + enabled: true + }, + removeTerm: { + enabled: false + }, + save: { + enabled: true + }, + cancel: { + enabled: true + }, + edit: null, + message: { + text: 'You have unsaved changes.', + type: 'warning' + } + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentSelectTerm.test.js b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentSelectTerm.test.js new file mode 100644 index 0000000000000000000000000000000000000000..148d4b4c3cc826554c756884a53533b7dca1535c --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentSelectTerm.test.js @@ -0,0 +1,218 @@ +import VocabularyFormComponentTest from '@srcTest/js/components/types/form/VocabularyFormComponentTest.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new VocabularyFormComponentTest() + common.beforeEach() +}) + +describe(VocabularyFormComponentTest.SUITE, () => { + test('select term', testSelectTerm) + test('follow selected term', testFollowSelectedTerm) +}) + +async function testSelectTerm() { + const form = await common.mountExisting(fixture.TEST_VOCABULARY_DTO) + + form.getGrid().getRows()[1].click() + await form.update() + + form.getButtons().getEdit().click() + await form.update() + + form.expectJSON({ + grid: { + rows: [ + { selected: false }, + { selected: true }, + { selected: false }, + { selected: false }, + { selected: false }, + { selected: false } + ] + }, + parameters: { + term: { + title: 'Term', + code: { + label: 'Code', + value: fixture.TEST_TERM_2_DTO.getCode(), + enabled: false, + mode: 'edit' + }, + label: { + label: 'Label', + value: fixture.TEST_TERM_2_DTO.getLabel(), + enabled: true, + mode: 'edit' + }, + description: { + label: 'Description', + value: fixture.TEST_TERM_2_DTO.getDescription(), + enabled: true, + mode: 'edit' + }, + official: { + label: 'Official', + value: fixture.TEST_TERM_2_DTO.isOfficial(), + enabled: false, + mode: 'edit' + } + } + }, + buttons: { + addTerm: { + enabled: true + }, + removeTerm: { + enabled: true + }, + save: { + enabled: true + }, + cancel: { + enabled: true + }, + edit: null, + message: null + } + }) +} + +async function testFollowSelectedTerm() { + const form = await common.mountNew() + + const labels = [ + 'Term 10', + 'Term 20', + 'Term 30', + 'Term 40', + 'Term 50', + 'Term 60' + ] + + for (let i = 0; i < labels.length; i++) { + form.getButtons().getAddTerm().click() + await form.update() + form.getParameters().getTerm().getLabel().change(labels[i]) + await form.update() + } + + form.getGrid().getPaging().getPageSize().change(5) + await form.update() + + form.getGrid().getColumns()[1].getLabel().click() + await form.update() + + form.expectJSON({ + grid: { + rows: [ + { values: { 'label.value': 'Term 10' }, selected: false }, + { values: { 'label.value': 'Term 20' }, selected: false }, + { values: { 'label.value': 'Term 30' }, selected: false }, + { values: { 'label.value': 'Term 40' }, selected: false }, + { values: { 'label.value': 'Term 50' }, selected: false } + ], + paging: { + range: '1-5 of 6' + } + }, + parameters: { + term: { + label: { + value: 'Term 60' + }, + messages: [ + { + type: 'warning', + text: + 'The selected term is currently not visible in the term list due to the chosen filtering and paging.' + } + ] + } + } + }) + + form.getGrid().getRows()[0].click() + await form.update() + + form.getParameters().getTerm().getLabel().change('Term 25') + await form.update() + + form.expectJSON({ + grid: { + rows: [ + { values: { 'label.value': 'Term 20' }, selected: false }, + { values: { 'label.value': 'Term 25' }, selected: true }, + { values: { 'label.value': 'Term 30' }, selected: false }, + { values: { 'label.value': 'Term 40' }, selected: false }, + { values: { 'label.value': 'Term 50' }, selected: false } + ], + paging: { + range: '1-5 of 6' + } + }, + parameters: { + term: { + label: { + value: 'Term 25' + }, + messages: [] + } + } + }) + + form.getParameters().getTerm().getLabel().change('Term 65') + await form.update() + + form.expectJSON({ + grid: { + rows: [{ values: { 'label.value': 'Term 65' }, selected: true }], + paging: { + range: '6-6 of 6' + } + }, + parameters: { + term: { + label: { + value: 'Term 65' + }, + messages: [] + } + } + }) + + form.getGrid().getPaging().getFirstPage().click() + await form.update() + + form.expectJSON({ + grid: { + rows: [ + { values: { 'label.value': 'Term 20' }, selected: false }, + { values: { 'label.value': 'Term 30' }, selected: false }, + { values: { 'label.value': 'Term 40' }, selected: false }, + { values: { 'label.value': 'Term 50' }, selected: false }, + { values: { 'label.value': 'Term 60' }, selected: false } + ], + paging: { + range: '1-5 of 6' + } + }, + parameters: { + term: { + label: { + value: 'Term 65' + }, + messages: [ + { + type: 'warning', + text: + 'The selected term is currently not visible in the term list due to the chosen filtering and paging.' + } + ] + } + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentSort.test.js b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentSort.test.js new file mode 100644 index 0000000000000000000000000000000000000000..43c178d60f60a1c877f3cbe9451f4d15b525ee19 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentSort.test.js @@ -0,0 +1,82 @@ +import VocabularyFormComponentTest from '@srcTest/js/components/types/form/VocabularyFormComponentTest.js' + +let common = null + +beforeEach(() => { + common = new VocabularyFormComponentTest() + common.beforeEach() +}) + +describe(VocabularyFormComponentTest.SUITE, () => { + test('sort', testSort) +}) + +async function testSort() { + const form = await common.mountNew() + + const labels = [ + 'Term 1', + 'term 11', + 'Term 2', + 'TERM A', + 'term B', + 'Term A1', + 'tErM A11', + 'term A2' + ] + + for (let i = 0; i < labels.length; i++) { + form.getButtons().getAddTerm().click() + await form.update() + form.getParameters().getTerm().getLabel().change(labels[i]) + await form.update() + } + + form.getGrid().getColumns()[1].getLabel().click() + await form.update() + + form.expectJSON({ + grid: { + columns: [ + { field: 'code.value', sort: null }, + { field: 'label.value', sort: 'asc' }, + { field: 'description.value', sort: null }, + { field: 'official.value', sort: null } + ], + rows: [ + { values: { 'label.value': 'Term 1' } }, + { values: { 'label.value': 'Term 2' } }, + { values: { 'label.value': 'term 11' } }, + { values: { 'label.value': 'TERM A' } }, + { values: { 'label.value': 'Term A1' } }, + { values: { 'label.value': 'term A2' } }, + { values: { 'label.value': 'tErM A11' } }, + { values: { 'label.value': 'term B' } } + ] + } + }) + + form.getGrid().getColumns()[1].getLabel().click() + await form.update() + + form.expectJSON({ + grid: { + columns: [ + { field: 'code.value', sort: null }, + { field: 'label.value', sort: 'desc' }, + { field: 'description.value', sort: null }, + { field: 'official.value', sort: null } + ], + rows: [ + { values: { 'label.value': 'term B' } }, + { values: { 'label.value': 'tErM A11' } }, + { values: { 'label.value': 'term A2' } }, + { values: { 'label.value': 'Term A1' } }, + { values: { 'label.value': 'TERM A' } }, + { values: { 'label.value': 'term 11' } }, + { values: { 'label.value': 'Term 2' } }, + { values: { 'label.value': 'Term 1' } } + ] + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentTest.js b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentTest.js new file mode 100644 index 0000000000000000000000000000000000000000..0f97784748b3130bd6eaad5586b3b027d0f3cb89 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentTest.js @@ -0,0 +1,44 @@ +import React from 'react' +import ComponentTest from '@srcTest/js/components/common/ComponentTest.js' +import VocabularyForm from '@src/js/components/types/form/VocabularyForm.jsx' +import VocabularyFormWrapper from '@srcTest/js/components/types/form/wrapper/VocabularyFormWrapper.js' +import VocabularyFormController from '@src/js/components/types/form/VocabularyFormController.js' +import VocabularyFormFacade from '@src/js/components/types/form/VocabularyFormFacade' +import objectTypes from '@src/js/common/consts/objectType.js' + +jest.mock('@src/js/components/types/form/VocabularyFormFacade') + +export default class VocabularyFormComponentTest extends ComponentTest { + static SUITE = 'VocabularyFormComponent' + + constructor() { + super( + object => <VocabularyForm object={object} controller={this.controller} />, + wrapper => new VocabularyFormWrapper(wrapper) + ) + this.facade = null + this.controller = null + } + + async beforeEach() { + super.beforeEach() + + this.facade = new VocabularyFormFacade() + this.controller = new VocabularyFormController(this.facade) + } + + async mountNew() { + return await this.mount({ + type: objectTypes.NEW_VOCABULARY_TYPE + }) + } + + async mountExisting(vocabulary) { + this.facade.loadVocabulary.mockReturnValue(Promise.resolve(vocabulary)) + + return await this.mount({ + id: vocabulary.getCode(), + type: objectTypes.VOCABULARY_TYPE + }) + } +} diff --git a/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentValidate.test.js b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentValidate.test.js new file mode 100644 index 0000000000000000000000000000000000000000..845255df284eb7314333f3161a991136b3a8a08e --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/types/form/VocabularyFormComponentValidate.test.js @@ -0,0 +1,185 @@ +import VocabularyFormComponentTest from '@srcTest/js/components/types/form/VocabularyFormComponentTest.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new VocabularyFormComponentTest() + common.beforeEach() +}) + +describe(VocabularyFormComponentTest.SUITE, () => { + test('validate term', testValidateTerm) + test('validate vocabulary', testValidateVocabulary) +}) + +async function testValidateTerm() { + const form = await common.mountExisting(fixture.TEST_VOCABULARY_DTO) + + form.getButtons().getEdit().click() + await form.update() + + form.getButtons().getAddTerm().click() + await form.update() + + form.getGrid().getPaging().getPageSize().change(5) + await form.update() + + form.getGrid().getPaging().getNextPage().click() + await form.update() + + form.expectJSON({ + grid: { + rows: [fixture.TEST_TERM_5_DTO, fixture.TEST_TERM_6_DTO].map(term => ({ + values: { + 'code.value': term.getCode() + }, + selected: false + })), + paging: { + pageSize: { + value: 5 + }, + range: '6-7 of 7' + } + }, + parameters: { + term: { + title: 'Term', + code: { + value: null, + error: null + } + } + }, + buttons: { + message: { + text: 'You have unsaved changes.', + type: 'warning' + } + } + }) + + form.getButtons().getSave().click() + await form.update() + + form.expectJSON({ + grid: { + rows: [ + { + values: { + 'code.value': null, + 'label.value': null, + 'description.value': null, + 'official.value': String(true) + }, + selected: true + }, + { values: { 'code.value': fixture.TEST_TERM_1_DTO.getCode() } }, + { values: { 'code.value': fixture.TEST_TERM_2_DTO.getCode() } }, + { values: { 'code.value': fixture.TEST_TERM_3_DTO.getCode() } }, + { values: { 'code.value': fixture.TEST_TERM_4_DTO.getCode() } } + ], + paging: { + pageSize: { + value: 5 + }, + range: '1-5 of 7' + } + }, + parameters: { + term: { + title: 'Term', + code: { + value: null, + error: 'Code cannot be empty', + focused: true + } + } + }, + buttons: { + message: { + text: 'You have unsaved changes.', + type: 'warning' + } + } + }) + + form.getParameters().getTerm().getCode().change('I am illegal') + await form.update() + + form.getButtons().getSave().click() + await form.update() + + form.expectJSON({ + parameters: { + term: { + code: { + value: 'I am illegal', + error: 'Code can only contain A-Z, a-z, 0-9 and _, -, ., :', + focused: true + } + } + } + }) +} + +async function testValidateVocabulary() { + const form = await common.mountNew() + + form.getButtons().getAddTerm().click() + await form.update() + + form.getButtons().getSave().click() + await form.update() + + form.expectJSON({ + grid: { + rows: [ + { + values: { + 'code.value': null, + 'label.value': null, + 'description.value': null, + 'official.value': String(true) + }, + selected: false + } + ] + }, + parameters: { + vocabulary: { + title: 'Vocabulary', + code: { + value: null, + error: 'Code cannot be empty', + focused: true + } + } + }, + buttons: { + message: { + text: 'You have unsaved changes.', + type: 'warning' + } + } + }) + + form.getParameters().getVocabulary().getCode().change('I am illegal') + await form.update() + + form.getButtons().getSave().click() + await form.update() + + form.expectJSON({ + parameters: { + vocabulary: { + code: { + value: 'I am illegal', + error: 'Code can only contain A-Z, a-z, 0-9 and _, -, .', + focused: true + } + } + } + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserComponent.test.js b/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserComponent.test.js deleted file mode 100644 index 107efc4836eba59deb265105a2b51bf6ef7f88cf..0000000000000000000000000000000000000000 --- a/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserComponent.test.js +++ /dev/null @@ -1,144 +0,0 @@ -import React from 'react' -import ComponentTest from '@srcTest/js/components/common/ComponentTest.js' -import BrowserWrapper from '@srcTest/js/components/common/browser/wrapper/BrowserWrapper.js' -import UserBrowser from '@src/js/components/users/browser/UserBrowser.jsx' -import openbis from '@srcTest/js/services/openbis.js' -import fixture from '@srcTest/js/common/fixture.js' - -let common = null - -beforeEach(() => { - common = new ComponentTest( - () => <UserBrowser />, - wrapper => new BrowserWrapper(wrapper) - ) - common.beforeEach() - - openbis.mockSearchPersons([fixture.TEST_USER_DTO, fixture.ANOTHER_USER_DTO]) - openbis.mockSearchGroups([ - fixture.TEST_USER_GROUP_DTO, - fixture.ANOTHER_USER_GROUP_DTO, - fixture.ALL_USERS_GROUP_DTO - ]) -}) - -describe('browser', () => { - test('load', testLoad) - test('open/close', testOpenClose) - test('filter', testFilter) -}) - -async function testLoad() { - const browser = await common.mount() - - browser.expectJSON({ - filter: { - value: null - }, - nodes: [ - { level: 0, text: 'Users' }, - { level: 0, text: 'Groups' } - ] - }) -} - -async function testOpenClose() { - const browser = await common.mount() - - browser.getNodes()[0].getIcon().click() - await browser.update() - - browser.expectJSON({ - filter: { - value: null - }, - nodes: [ - { level: 0, text: 'Users' }, - { level: 1, text: fixture.ANOTHER_USER_DTO.userId }, - { level: 1, text: fixture.TEST_USER_DTO.userId }, - { level: 0, text: 'Groups' } - ] - }) - - browser.getNodes()[3].getIcon().click() - await browser.update() - - browser.expectJSON({ - filter: { - value: null - }, - nodes: [ - { level: 0, text: 'Users' }, - { level: 1, text: fixture.ANOTHER_USER_DTO.userId }, - { level: 1, text: fixture.TEST_USER_DTO.userId }, - { level: 0, text: 'Groups' }, - { level: 1, text: fixture.ALL_USERS_GROUP_DTO.code }, - { level: 1, text: fixture.ANOTHER_USER_GROUP_DTO.code }, - { level: 1, text: fixture.TEST_USER_GROUP_DTO.code } - ] - }) - - browser.getNodes()[0].getIcon().click() - await browser.update() - - browser.expectJSON({ - filter: { - value: null - }, - nodes: [ - { level: 0, text: 'Users' }, - { level: 0, text: 'Groups' }, - { level: 1, text: fixture.ALL_USERS_GROUP_DTO.code }, - { level: 1, text: fixture.ANOTHER_USER_GROUP_DTO.code }, - { level: 1, text: fixture.TEST_USER_GROUP_DTO.code } - ] - }) - - browser.getNodes()[1].getIcon().click() - await browser.update() - - browser.expectJSON({ - filter: { - value: null - }, - nodes: [ - { level: 0, text: 'Users' }, - { level: 0, text: 'Groups' } - ] - }) -} - -async function testFilter() { - const browser = await common.mount() - - browser.getFilter().change(fixture.ANOTHER_USER_GROUP_DTO.code.toUpperCase()) - await browser.update() - - browser.expectJSON({ - filter: { - value: fixture.ANOTHER_USER_GROUP_DTO.code.toUpperCase() - }, - nodes: [ - { level: 0, text: 'Groups' }, - { level: 1, text: fixture.ANOTHER_USER_GROUP_DTO.code } - ] - }) - - browser.getFilter().getClearIcon().click() - await browser.update() - - browser.expectJSON({ - filter: { - value: null - }, - nodes: [ - { level: 0, text: 'Users' }, - { level: 1, text: fixture.ANOTHER_USER_DTO.userId }, - { level: 1, text: fixture.TEST_USER_DTO.userId }, - { level: 0, text: 'Groups' }, - { level: 1, text: fixture.ALL_USERS_GROUP_DTO.code }, - { level: 1, text: fixture.ANOTHER_USER_GROUP_DTO.code }, - { level: 1, text: fixture.TEST_USER_GROUP_DTO.code } - ] - }) -} diff --git a/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserComponentFilter.test.js b/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserComponentFilter.test.js new file mode 100644 index 0000000000000000000000000000000000000000..04f1956e8d8005d8753fdeaf4a7c6a0bf17a8184 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserComponentFilter.test.js @@ -0,0 +1,48 @@ +import UserBrowserComponentTest from '@srcTest/js/components/users/browser/UserBrowserComponentTest.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new UserBrowserComponentTest() + common.beforeEach() +}) + +describe(UserBrowserComponentTest.SUITE, () => { + test('filter', testFilter) +}) + +async function testFilter() { + const browser = await common.mount() + + browser.getFilter().change(fixture.ANOTHER_USER_GROUP_DTO.code.toUpperCase()) + await browser.update() + + browser.expectJSON({ + filter: { + value: fixture.ANOTHER_USER_GROUP_DTO.code.toUpperCase() + }, + nodes: [ + { level: 0, text: 'Groups' }, + { level: 1, text: fixture.ANOTHER_USER_GROUP_DTO.code } + ] + }) + + browser.getFilter().getClearIcon().click() + await browser.update() + + browser.expectJSON({ + filter: { + value: null + }, + nodes: [ + { level: 0, text: 'Users' }, + { level: 1, text: fixture.ANOTHER_USER_DTO.userId }, + { level: 1, text: fixture.TEST_USER_DTO.userId }, + { level: 0, text: 'Groups' }, + { level: 1, text: fixture.ALL_USERS_GROUP_DTO.code }, + { level: 1, text: fixture.ANOTHER_USER_GROUP_DTO.code }, + { level: 1, text: fixture.TEST_USER_GROUP_DTO.code } + ] + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserComponentLoad.test.js b/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserComponentLoad.test.js new file mode 100644 index 0000000000000000000000000000000000000000..01313c11f6e2b221fb0c129a2a563e16f98ee784 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserComponentLoad.test.js @@ -0,0 +1,26 @@ +import UserBrowserComponentTest from '@srcTest/js/components/users/browser/UserBrowserComponentTest.js' + +let common = null + +beforeEach(() => { + common = new UserBrowserComponentTest() + common.beforeEach() +}) + +describe(UserBrowserComponentTest.SUITE, () => { + test('load', testLoad) +}) + +async function testLoad() { + const browser = await common.mount() + + browser.expectJSON({ + filter: { + value: null + }, + nodes: [ + { level: 0, text: 'Users' }, + { level: 0, text: 'Groups' } + ] + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserComponentOpenClose.test.js b/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserComponentOpenClose.test.js new file mode 100644 index 0000000000000000000000000000000000000000..6b1b76af2bc0ecd3a4f7a3fd01b698706a6c921b --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserComponentOpenClose.test.js @@ -0,0 +1,79 @@ +import UserBrowserComponentTest from '@srcTest/js/components/users/browser/UserBrowserComponentTest.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new UserBrowserComponentTest() + common.beforeEach() +}) + +describe(UserBrowserComponentTest.SUITE, () => { + test('open/close', testOpenClose) +}) + +async function testOpenClose() { + const browser = await common.mount() + + browser.getNodes()[0].getIcon().click() + await browser.update() + + browser.expectJSON({ + filter: { + value: null + }, + nodes: [ + { level: 0, text: 'Users' }, + { level: 1, text: fixture.ANOTHER_USER_DTO.userId }, + { level: 1, text: fixture.TEST_USER_DTO.userId }, + { level: 0, text: 'Groups' } + ] + }) + + browser.getNodes()[3].getIcon().click() + await browser.update() + + browser.expectJSON({ + filter: { + value: null + }, + nodes: [ + { level: 0, text: 'Users' }, + { level: 1, text: fixture.ANOTHER_USER_DTO.userId }, + { level: 1, text: fixture.TEST_USER_DTO.userId }, + { level: 0, text: 'Groups' }, + { level: 1, text: fixture.ALL_USERS_GROUP_DTO.code }, + { level: 1, text: fixture.ANOTHER_USER_GROUP_DTO.code }, + { level: 1, text: fixture.TEST_USER_GROUP_DTO.code } + ] + }) + + browser.getNodes()[0].getIcon().click() + await browser.update() + + browser.expectJSON({ + filter: { + value: null + }, + nodes: [ + { level: 0, text: 'Users' }, + { level: 0, text: 'Groups' }, + { level: 1, text: fixture.ALL_USERS_GROUP_DTO.code }, + { level: 1, text: fixture.ANOTHER_USER_GROUP_DTO.code }, + { level: 1, text: fixture.TEST_USER_GROUP_DTO.code } + ] + }) + + browser.getNodes()[1].getIcon().click() + await browser.update() + + browser.expectJSON({ + filter: { + value: null + }, + nodes: [ + { level: 0, text: 'Users' }, + { level: 0, text: 'Groups' } + ] + }) +} diff --git a/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserComponentTest.js b/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserComponentTest.js new file mode 100644 index 0000000000000000000000000000000000000000..8e023fc037ed7bde9fdea1422ccbeadba4f7fb04 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserComponentTest.js @@ -0,0 +1,28 @@ +import React from 'react' +import ComponentTest from '@srcTest/js/components/common/ComponentTest.js' +import BrowserWrapper from '@srcTest/js/components/common/browser/wrapper/BrowserWrapper.js' +import UserBrowser from '@src/js/components/users/browser/UserBrowser.jsx' +import openbis from '@srcTest/js/services/openbis.js' +import fixture from '@srcTest/js/common/fixture.js' + +export default class UserBrowserComponentTest extends ComponentTest { + static SUITE = 'UserBrowserComponent' + + constructor() { + super( + () => <UserBrowser />, + wrapper => new BrowserWrapper(wrapper) + ) + } + + async beforeEach() { + super.beforeEach() + + openbis.mockSearchPersons([fixture.TEST_USER_DTO, fixture.ANOTHER_USER_DTO]) + openbis.mockSearchGroups([ + fixture.TEST_USER_GROUP_DTO, + fixture.ANOTHER_USER_GROUP_DTO, + fixture.ALL_USERS_GROUP_DTO + ]) + } +} diff --git a/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserController.test.js b/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserController.test.js deleted file mode 100644 index b34feb5bcc31ccacd6347cbd03c247050fbd96ac..0000000000000000000000000000000000000000 --- a/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserController.test.js +++ /dev/null @@ -1,305 +0,0 @@ -import UserBrowserController from '@src/js/components/users/browser/UserBrowserController.js' -import ComponentContext from '@srcTest/js/components/common/ComponentContext.js' -import openbis from '@srcTest/js/services/openbis.js' -import pages from '@src/js/common/consts/pages.js' -import objectType from '@src/js/common/consts/objectType.js' -import actions from '@src/js/store/actions/actions.js' -import fixture from '@srcTest/js/common/fixture.js' - -let context = null -let controller = null - -beforeEach(() => { - jest.resetAllMocks() - - context = new ComponentContext() - controller = new UserBrowserController() - controller.init(context) -}) - -describe('browser', () => { - test('load', testLoad) - test('filter', testFilter) - test('select node', testSelectNode) - test('select another node', testSelectAnotherNode) - test('select virtual node', testSelectVirtualNode) - test('expand and collapse node', testExpandAndCollapseNode) -}) - -async function testLoad() { - openbis.mockSearchPersons([fixture.TEST_USER_DTO, fixture.ANOTHER_USER_DTO]) - openbis.mockSearchGroups([ - fixture.TEST_USER_GROUP_DTO, - fixture.ANOTHER_USER_GROUP_DTO, - fixture.ALL_USERS_GROUP_DTO - ]) - - await controller.load() - - expect(controller.getNodes()).toMatchObject([ - { - text: 'Users', - expanded: false, - selected: false - }, - { - text: 'Groups', - expanded: false, - selected: false - } - ]) - - context.expectNoActions() -} - -async function testFilter() { - openbis.mockSearchPersons([fixture.TEST_USER_DTO, fixture.ANOTHER_USER_DTO]) - openbis.mockSearchGroups([ - fixture.TEST_USER_GROUP_DTO, - fixture.ANOTHER_USER_GROUP_DTO, - fixture.ALL_USERS_GROUP_DTO - ]) - - await controller.load() - controller.filterChange('ANOTHER') - - expect(controller.getNodes()).toMatchObject([ - { - text: 'Users', - expanded: true, - selected: false, - children: [ - { - text: fixture.ANOTHER_USER_DTO.userId, - expanded: false, - selected: false - } - ] - }, - { - text: 'Groups', - expanded: true, - selected: false, - children: [ - { - text: fixture.ANOTHER_USER_GROUP_DTO.code, - expanded: false, - selected: false - } - ] - } - ]) - - context.expectNoActions() -} - -async function testSelectNode() { - openbis.mockSearchPersons([fixture.TEST_USER_DTO, fixture.ANOTHER_USER_DTO]) - openbis.mockSearchGroups([ - fixture.TEST_USER_GROUP_DTO, - fixture.ANOTHER_USER_GROUP_DTO, - fixture.ALL_USERS_GROUP_DTO - ]) - - await controller.load() - - controller.nodeSelect('users/' + fixture.TEST_USER_DTO.userId) - - expect(controller.getNodes()).toMatchObject([ - { - text: 'Users', - expanded: false, - selected: false, - children: [ - { - text: fixture.ANOTHER_USER_DTO.userId, - expanded: false, - selected: false - }, - { - text: fixture.TEST_USER_DTO.userId, - expanded: false, - selected: true - } - ] - }, - { - text: 'Groups', - expanded: false, - selected: false, - children: [ - { - text: fixture.ALL_USERS_GROUP_DTO.code, - expanded: false, - selected: false - }, - { - text: fixture.ANOTHER_USER_GROUP_DTO.code, - expanded: false, - selected: false - }, - { - text: fixture.TEST_USER_GROUP_DTO.code, - expanded: false, - selected: false - } - ] - } - ]) - expectOpenUserAction(fixture.TEST_USER_DTO.userId) - - controller.nodeSelect('groups/' + fixture.ANOTHER_USER_GROUP_DTO.code) - - expect(controller.getNodes()).toMatchObject([ - { - text: 'Users', - expanded: false, - selected: false, - children: [ - { - text: fixture.ANOTHER_USER_DTO.userId, - expanded: false, - selected: false - }, - { - text: fixture.TEST_USER_DTO.userId, - expanded: false, - selected: false - } - ] - }, - { - text: 'Groups', - expanded: false, - selected: false, - children: [ - { - text: fixture.ALL_USERS_GROUP_DTO.code, - expanded: false, - selected: false - }, - { - text: fixture.ANOTHER_USER_GROUP_DTO.code, - expanded: false, - selected: true - }, - { - text: fixture.TEST_USER_GROUP_DTO.code, - expanded: false, - selected: false - } - ] - } - ]) - expectOpenGroupAction(fixture.ANOTHER_USER_GROUP_DTO.code) -} - -async function testSelectAnotherNode() { - openbis.mockSearchPersons([fixture.TEST_USER_DTO, fixture.ANOTHER_USER_DTO]) - openbis.mockSearchGroups([]) - - await controller.load() - controller.nodeSelect('users/' + fixture.TEST_USER_DTO.userId) - controller.nodeSelect('users/' + fixture.ANOTHER_USER_DTO.userId) - - expect(controller.getNodes()).toMatchObject([ - { - text: 'Users', - expanded: false, - selected: false, - children: [ - { - text: fixture.ANOTHER_USER_DTO.userId, - expanded: false, - selected: true - }, - { - text: fixture.TEST_USER_DTO.userId, - expanded: false, - selected: false - } - ] - }, - { - text: 'Groups', - expanded: false, - selected: false, - children: [] - } - ]) - - expectOpenUserAction(fixture.TEST_USER_DTO.userId) - expectOpenUserAction(fixture.ANOTHER_USER_DTO.userId) -} - -async function testSelectVirtualNode() { - openbis.mockSearchPersons([fixture.TEST_USER_DTO, fixture.ANOTHER_USER_DTO]) - openbis.mockSearchGroups([]) - - await controller.load() - controller.nodeSelect('users') - - expect(controller.getNodes()).toMatchObject([ - { - text: 'Users', - expanded: false, - selected: true - }, - { - text: 'Groups', - expanded: false, - selected: false - } - ]) - - context.expectNoActions() -} - -async function testExpandAndCollapseNode() { - openbis.mockSearchPersons([]) - openbis.mockSearchGroups([fixture.TEST_USER_GROUP_DTO]) - - await controller.load() - controller.nodeExpand('groups') - - expect(controller.getNodes()).toMatchObject([ - { - text: 'Users', - expanded: false, - selected: false - }, - { - text: 'Groups', - expanded: true, - selected: false - } - ]) - - context.expectNoActions() - controller.nodeCollapse('groups') - - expect(controller.getNodes()).toMatchObject([ - { - text: 'Users', - expanded: false, - selected: false - }, - { - text: 'Groups', - expanded: false, - selected: false - } - ]) - - context.expectNoActions() -} - -function expectOpenUserAction(userId) { - context.expectAction(actions.objectOpen(pages.USERS, objectType.USER, userId)) -} - -function expectOpenGroupAction(groupId) { - context.expectAction( - actions.objectOpen(pages.USERS, objectType.USER_GROUP, groupId) - ) -} diff --git a/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserControllerExpandCollapseNode.test.js b/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserControllerExpandCollapseNode.test.js new file mode 100644 index 0000000000000000000000000000000000000000..87068ca8bcac589cc9aed00b4747fea45b6b13e3 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserControllerExpandCollapseNode.test.js @@ -0,0 +1,53 @@ +import UserBrowserControllerTest from '@srcTest/js/components/users/browser/UserBrowserControllerTest.js' +import openbis from '@srcTest/js/services/openbis.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new UserBrowserControllerTest() + common.beforeEach() +}) + +describe(UserBrowserControllerTest.SUITE, () => { + test('expand and collapse node', testExpandAndCollapseNode) +}) + +async function testExpandAndCollapseNode() { + openbis.mockSearchPersons([]) + openbis.mockSearchGroups([fixture.TEST_USER_GROUP_DTO]) + + await common.controller.load() + common.controller.nodeExpand('groups') + + expect(common.controller.getNodes()).toMatchObject([ + { + text: 'Users', + expanded: false, + selected: false + }, + { + text: 'Groups', + expanded: true, + selected: false + } + ]) + + common.context.expectNoActions() + common.controller.nodeCollapse('groups') + + expect(common.controller.getNodes()).toMatchObject([ + { + text: 'Users', + expanded: false, + selected: false + }, + { + text: 'Groups', + expanded: false, + selected: false + } + ]) + + common.context.expectNoActions() +} diff --git a/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserControllerFilter.test.js b/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserControllerFilter.test.js new file mode 100644 index 0000000000000000000000000000000000000000..264a18f11649ed46bfffe9093ce12963d11f226b --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserControllerFilter.test.js @@ -0,0 +1,55 @@ +import UserBrowserControllerTest from '@srcTest/js/components/users/browser/UserBrowserControllerTest.js' +import openbis from '@srcTest/js/services/openbis.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new UserBrowserControllerTest() + common.beforeEach() +}) + +describe(UserBrowserControllerTest.SUITE, () => { + test('filter', testFilter) +}) + +async function testFilter() { + openbis.mockSearchPersons([fixture.TEST_USER_DTO, fixture.ANOTHER_USER_DTO]) + openbis.mockSearchGroups([ + fixture.TEST_USER_GROUP_DTO, + fixture.ANOTHER_USER_GROUP_DTO, + fixture.ALL_USERS_GROUP_DTO + ]) + + await common.controller.load() + common.controller.filterChange('ANOTHER') + + expect(common.controller.getNodes()).toMatchObject([ + { + text: 'Users', + expanded: true, + selected: false, + children: [ + { + text: fixture.ANOTHER_USER_DTO.userId, + expanded: false, + selected: false + } + ] + }, + { + text: 'Groups', + expanded: true, + selected: false, + children: [ + { + text: fixture.ANOTHER_USER_GROUP_DTO.code, + expanded: false, + selected: false + } + ] + } + ]) + + common.context.expectNoActions() +} diff --git a/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserControllerLoad.test.js b/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserControllerLoad.test.js new file mode 100644 index 0000000000000000000000000000000000000000..c219f4255f0e626e04dd872f78a6de2e0c7cb5f1 --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserControllerLoad.test.js @@ -0,0 +1,40 @@ +import UserBrowserControllerTest from '@srcTest/js/components/users/browser/UserBrowserControllerTest.js' +import openbis from '@srcTest/js/services/openbis.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new UserBrowserControllerTest() + common.beforeEach() +}) + +describe(UserBrowserControllerTest.SUITE, () => { + test('load', testLoad) +}) + +async function testLoad() { + openbis.mockSearchPersons([fixture.TEST_USER_DTO, fixture.ANOTHER_USER_DTO]) + openbis.mockSearchGroups([ + fixture.TEST_USER_GROUP_DTO, + fixture.ANOTHER_USER_GROUP_DTO, + fixture.ALL_USERS_GROUP_DTO + ]) + + await common.controller.load() + + expect(common.controller.getNodes()).toMatchObject([ + { + text: 'Users', + expanded: false, + selected: false + }, + { + text: 'Groups', + expanded: false, + selected: false + } + ]) + + common.context.expectNoActions() +} diff --git a/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserControllerSelectNode.test.js b/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserControllerSelectNode.test.js new file mode 100644 index 0000000000000000000000000000000000000000..9d6e88713b39830ac1a7b47107021680afa6b33e --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserControllerSelectNode.test.js @@ -0,0 +1,178 @@ +import UserBrowserControllerTest from '@srcTest/js/components/users/browser/UserBrowserControllerTest.js' +import openbis from '@srcTest/js/services/openbis.js' +import fixture from '@srcTest/js/common/fixture.js' + +let common = null + +beforeEach(() => { + common = new UserBrowserControllerTest() + common.beforeEach() +}) + +describe(UserBrowserControllerTest.SUITE, () => { + test('select node', testSelectNode) + test('select another node', testSelectAnotherNode) + test('select virtual node', testSelectVirtualNode) +}) + +async function testSelectNode() { + openbis.mockSearchPersons([fixture.TEST_USER_DTO, fixture.ANOTHER_USER_DTO]) + openbis.mockSearchGroups([ + fixture.TEST_USER_GROUP_DTO, + fixture.ANOTHER_USER_GROUP_DTO, + fixture.ALL_USERS_GROUP_DTO + ]) + + await common.controller.load() + + common.controller.nodeSelect('users/' + fixture.TEST_USER_DTO.userId) + + expect(common.controller.getNodes()).toMatchObject([ + { + text: 'Users', + expanded: false, + selected: false, + children: [ + { + text: fixture.ANOTHER_USER_DTO.userId, + expanded: false, + selected: false + }, + { + text: fixture.TEST_USER_DTO.userId, + expanded: false, + selected: true + } + ] + }, + { + text: 'Groups', + expanded: false, + selected: false, + children: [ + { + text: fixture.ALL_USERS_GROUP_DTO.code, + expanded: false, + selected: false + }, + { + text: fixture.ANOTHER_USER_GROUP_DTO.code, + expanded: false, + selected: false + }, + { + text: fixture.TEST_USER_GROUP_DTO.code, + expanded: false, + selected: false + } + ] + } + ]) + common.expectOpenUserAction(fixture.TEST_USER_DTO.userId) + + common.controller.nodeSelect('groups/' + fixture.ANOTHER_USER_GROUP_DTO.code) + + expect(common.controller.getNodes()).toMatchObject([ + { + text: 'Users', + expanded: false, + selected: false, + children: [ + { + text: fixture.ANOTHER_USER_DTO.userId, + expanded: false, + selected: false + }, + { + text: fixture.TEST_USER_DTO.userId, + expanded: false, + selected: false + } + ] + }, + { + text: 'Groups', + expanded: false, + selected: false, + children: [ + { + text: fixture.ALL_USERS_GROUP_DTO.code, + expanded: false, + selected: false + }, + { + text: fixture.ANOTHER_USER_GROUP_DTO.code, + expanded: false, + selected: true + }, + { + text: fixture.TEST_USER_GROUP_DTO.code, + expanded: false, + selected: false + } + ] + } + ]) + common.expectOpenGroupAction(fixture.ANOTHER_USER_GROUP_DTO.code) +} + +async function testSelectAnotherNode() { + openbis.mockSearchPersons([fixture.TEST_USER_DTO, fixture.ANOTHER_USER_DTO]) + openbis.mockSearchGroups([]) + + await common.controller.load() + common.controller.nodeSelect('users/' + fixture.TEST_USER_DTO.userId) + common.controller.nodeSelect('users/' + fixture.ANOTHER_USER_DTO.userId) + + expect(common.controller.getNodes()).toMatchObject([ + { + text: 'Users', + expanded: false, + selected: false, + children: [ + { + text: fixture.ANOTHER_USER_DTO.userId, + expanded: false, + selected: true + }, + { + text: fixture.TEST_USER_DTO.userId, + expanded: false, + selected: false + } + ] + }, + { + text: 'Groups', + expanded: false, + selected: false, + children: [] + } + ]) + + common.expectOpenUserAction(fixture.TEST_USER_DTO.userId) + common.expectOpenUserAction(fixture.ANOTHER_USER_DTO.userId) +} + +async function testSelectVirtualNode() { + openbis.mockSearchPersons([fixture.TEST_USER_DTO, fixture.ANOTHER_USER_DTO]) + openbis.mockSearchGroups([]) + + await common.controller.load() + common.controller.nodeSelect('users') + + expect(common.controller.getNodes()).toMatchObject([ + { + text: 'Users', + expanded: false, + selected: true + }, + { + text: 'Groups', + expanded: false, + selected: false + } + ]) + + common.context.expectNoActions() +} diff --git a/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserControllerTest.js b/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserControllerTest.js new file mode 100644 index 0000000000000000000000000000000000000000..9bde4e3bd654fabc49f5fa90e6a74423ffca3c1d --- /dev/null +++ b/openbis_ng_ui/srcTest/js/components/users/browser/UserBrowserControllerTest.js @@ -0,0 +1,29 @@ +import UserBrowserController from '@src/js/components/users/browser/UserBrowserController.js' +import ComponentContext from '@srcTest/js/components/common/ComponentContext.js' +import pages from '@src/js/common/consts/pages.js' +import objectType from '@src/js/common/consts/objectType.js' +import actions from '@src/js/store/actions/actions.js' + +export default class UserBrowserControllerTest { + static SUITE = 'UserBrowserController' + + beforeEach() { + jest.resetAllMocks() + + this.context = new ComponentContext() + this.controller = new UserBrowserController() + this.controller.init(this.context) + } + + expectOpenUserAction(userId) { + this.context.expectAction( + actions.objectOpen(pages.USERS, objectType.USER, userId) + ) + } + + expectOpenGroupAction(groupId) { + this.context.expectAction( + actions.objectOpen(pages.USERS, objectType.USER_GROUP, groupId) + ) + } +} diff --git a/openbis_standard_technologies/admin-console.gradle b/openbis_standard_technologies/admin-console.gradle index c29b8c8663c46919bc26031ebc6b875ea46f7e66..3f10332b1164bdaf0ed9e19f70c67894722464a2 100644 --- a/openbis_standard_technologies/admin-console.gradle +++ b/openbis_standard_technologies/admin-console.gradle @@ -31,8 +31,7 @@ task adminConsole(type: Jar) { project(':openbis').compileJava.outputs.getFiles().getAsFileTree().plus( project(':openbis_api').compileJava.outputs.getFiles().getAsFileTree().plus( project(':screening').compileJava.outputs.getFiles().getAsFileTree().plus( - project(':rtd_phosphonetx').compileJava.outputs.getFiles().getAsFileTree().plus( - project(':datastore_server').compileJava.outputs.getFiles().getAsFileTree()))))))).matching { + project(':datastore_server').compileJava.outputs.getFiles().getAsFileTree())))))).matching { include 'ch/systemsx/cisd/common/spring/HttpInvokerUtils.class' include 'ch/systemsx/cisd/common/**/*.class' diff --git a/openbis_standard_technologies/build.gradle b/openbis_standard_technologies/build.gradle index 3025d3456cb4ab9d84d2a01213472106939ce628..b86485fea962bc4a252b37f38792e81e6bfa819f 100644 --- a/openbis_standard_technologies/build.gradle +++ b/openbis_standard_technologies/build.gradle @@ -33,7 +33,6 @@ evaluationDependsOn(':authentication') evaluationDependsOn(':dbmigration') evaluationDependsOn(':openbis') evaluationDependsOn(':datastore_server') -evaluationDependsOn(':rtd_phosphonetx') evaluationDependsOn(':screening') evaluationDependsOn(':rtd_yeastx') evaluationDependsOn(':deep_sequencing_unit') @@ -45,7 +44,6 @@ evaluationDependsOn(':openbis_ng_ui') apply from: '../gradle/javaproject.gradle' apply from: 'query-api.gradle' apply from: 'screening-api.gradle' -apply from: 'proteomics-api.gradle' apply from: 'clients.gradle' apply from: 'admin-console.gradle' @@ -62,8 +60,7 @@ configurations.create('javadoc_compilation') def jettyVersion = '9.4.30' dependencies { - compile project(':screening'), - project(':rtd_phosphonetx') + compile project(':screening') providedCompile 'google:gwt-user:2.4' @@ -83,11 +80,11 @@ dependencies { datastore_server project(':deep_sequencing_unit'), project(':rtd_yeastx'), project(':screening'), - project(':rtd_phosphonetx'), project(':plasmid'), 'bioformats:bioformats:6.5.1', 'imagej:ij:1.43u', 'cisd:cisd-openbis-knime-server:13.6.0.r29301', + 'apache:xml-apis:1.3.03', 'slf4j:slf4j:1.6.2', 'slf4j:slf4j-log4j12:1.6.2', 'sybit:image-viewer:0.3.6' @@ -98,15 +95,13 @@ dependencies { project(path:':openbis-common', configuration: 'archives'), project(path:':openbis', configuration: 'archives'), project(path:':datastore_server', configuration: 'archives'), - project(path:':rtd_phosphonetx', configuration: 'archives'), project(path:':screening', configuration: 'archives'), 'sis:sis-base:18.09.0:sources', 'cisd:cisd-args4j:9.11.2:sources', 'cisd:cisd-hotdeploy:13.01.0:sources' - javadoc_compilation project(path:':rtd_phosphonetx'), - project(path:':screening') - + javadoc_compilation project(path:':screening') + testCompile (project(path: ':openbis', configuration: 'tests')) { exclude group: 'google', module: 'gwt-user' } @@ -155,8 +150,6 @@ task compileGwt (dependsOn: classes, type: JavaExec) { project(":openbis_api").sourceSets.main.java.srcDirs, project(":screening").sourceSets.main.java.srcDirs, project(":screening").sourceSets.main.output.resourcesDir, - project(":rtd_phosphonetx").sourceSets.main.java.srcDirs, - project(":rtd_phosphonetx").sourceSets.main.output.resourcesDir, configurations.gwt ] } @@ -208,8 +201,6 @@ ext.classpathEntries = files( project(':screening').file('source/java/screening-applicationContext.xml'), project(':screening').file('source/java/screening-dssApplicationContext.xml'), project(':screening').file('source/java/screening-plugin-applicationContext.xml'), - project(':rtd_phosphonetx').file('source/java/proteomics-applicationContext.xml'), - project(':rtd_phosphonetx').file('source/java/proteomics-plugin-applicationContext.xml'), project(':common').file('source/java/genericCommonContext.xml'), 'source/java/standard-technologies-applicationContext.xml' ) @@ -303,12 +294,6 @@ war { exclude "sql/generic/_ERD" duplicatesStrategy 'exclude' } - - from('../rtd_phosphonetx/source/sql'){ - into("WEB-INF/classes") - include "proteomics/**/*.sql" - } - } def downloadCorePlugin(url, pluginname) { @@ -329,7 +314,6 @@ task zipCorePlugins(type: SymZip) { downloadCorePlugin('https://github.com/aarpon/obit_flow_core_technology/archive/release/20.x.zip', 'flow') downloadCorePlugin('https://github.com/aarpon/obit_microscopy_core_technology/archive/release/20.x.zip', 'microscopy') downloadCorePlugin('https://github.com/aarpon/obit_shared_core_technology/archive/release/20.x.zip', 'shared') - from project(':rtd_phosphonetx').fileTree(dir: 'source/core-plugins', includes:['proteomics/**', 'proteomics-optional/**'], excludes:['**/dss/**', '**/package-to-dist']) from project(':screening').fileTree(dir: 'source/core-plugins', includes:['screening/**', 'screening-optional/**'], excludes:['**/dss/**', '**/package-to-dist']) from project(':deep_sequencing_unit').fileTree(dir: 'source/core-plugins', includes:['illumina-ngs/**'], excludes:['**/dss/**', '**/package-to-dist']) from fileTree(dir: 'targets/downloads/obit_flow_core_technology-release-20.x/core-plugins', includes:['flow/**']) @@ -444,11 +428,6 @@ task zipDss(type: Zip, dependsOn: signWebStartJars) { into 'datastore_server/etc'; } - from (project(':rtd_phosphonetx').fileTree(dir: 'source/core-plugins', includes:['proteomics/**', 'proteomics-optional/**'], excludes:['**/as/**', '**/package-to-dist']).plus( - project(':screening').fileTree(dir: 'source/core-plugins', includes:['screening/**', 'screening-optional/**'], excludes:['**/as/**', '**/package-to-dist']).plus( - project(':deep_sequencing_unit').fileTree(dir: 'source/core-plugins', includes:['illumina-ngs/**'], excludes:['**/as/**', '**/package-to-dist'])))) { - into 'core-plugins' - } } task zipBdlServer(type: Zip, dependsOn: project(':big_data_link_server').tasks.distZip) { @@ -466,12 +445,11 @@ task obisZip(type: Zip) { from '../obis/' } -task clientsAndApis(type: Zip, dependsOn: [dssClientZip, queryApiZip, apiV3Zip, proteomicsApiZip, screeningApiZip, pybisZip, obisZip]) { +task clientsAndApis(type: Zip, dependsOn: [dssClientZip, queryApiZip, apiV3Zip, screeningApiZip, pybisZip, obisZip]) { baseName 'openBIS-clients-and-APIs' from dssClientZip.archivePath from queryApiZip.archivePath from apiV3Zip.archivePath - from proteomicsApiZip.archivePath from screeningApiZip.archivePath from pybisZip.archivePath from obisZip.archivePath diff --git a/openbis_standard_technologies/proteomics-api.gradle b/openbis_standard_technologies/proteomics-api.gradle deleted file mode 100644 index ae337a13c6d26e99cbb155ecaf2ab6bd0948cd61..0000000000000000000000000000000000000000 --- a/openbis_standard_technologies/proteomics-api.gradle +++ /dev/null @@ -1,92 +0,0 @@ - -task proteomicsApiJar(type: Jar) { - baseName 'openBIS-proteomics-API' - includeEmptyDirs false - from project(':commonbase').compileJava.outputs.getFiles().getAsFileTree().plus( - project(':common').compileJava.outputs.getFiles().getAsFileTree().plus( - project(':openbis-common').compileJava.outputs.getFiles().getAsFileTree().plus( - project(':openbis').compileJava.outputs.getFiles().getAsFileTree().plus( - project(':openbis_api').compileJava.outputs.getFiles().getAsFileTree().plus( - project(':rtd_phosphonetx').compileJava.outputs.getFiles().getAsFileTree() ))))).matching { - include "ch/systemsx/cisd/common/exceptions/**/*.class" - include "ch/systemsx/cisd/common/spring/HttpInvokerUtils.class" - include "ch/systemsx/cisd/common/api/**/*.class" - exclude "ch/systemsx/cisd/common/api/server/**/*.class" - include "ch/systemsx/cisd/openbis/common/api/**/*.class" - exclude "ch/systemsx/cisd/openbis/common/api/server/**/*.class" - include "ch/systemsx/cisd/openbis/plugin/proteomics/**/api/**/*.class" - exclude "ch/systemsx/cisd/openbis/**/server/api/**/*.class" - include "ch/systemsx/cisd/openbis/generic/shared/api/**/*.class" - include "ch/systemsx/cisd/openbis/plugin/proteomics/*BuildAndEnvironmentInfo.class" - include "*.INFO" - } -} - -task proteomicsApiSources(type: Zip) { - archiveName 'sources-proteomics-api.zip' - from project(':commonbase').files('source/java').getAsFileTree().plus( - project(':common').files('source/java').getAsFileTree().plus( - project(':openbis-common').files('source/java').getAsFileTree().plus( - project(':openbis').files('source/java').getAsFileTree().plus( - project(':openbis_api').files('source/java').getAsFileTree().plus( - project(':rtd_phosphonetx').files('source/java').getAsFileTree()))))).matching { - include "ch/systemsx/cisd/common/exceptions/**/*.java" - include "ch/systemsx/cisd/common/spring/HttpInvokerUtils.java" - include "ch/systemsx/cisd/common/api/**/*.java" - exclude "ch/systemsx/cisd/common/api/server/**/*.java" - include "ch/systemsx/cisd/openbis/common/api/**/*.java" - exclude "ch/systemsx/cisd/openbis/common/api/server/**/*.java" - include "ch/systemsx/cisd/openbis/plugin/proteomics/**/api/**/*.java" - exclude "ch/systemsx/cisd/openbis/**/server/api/**/*.java" - include "ch/systemsx/cisd/openbis/generic/shared/api/**/*.java" - include "ch/systemsx/cisd/openbis/plugin/proteomics/*BuildAndEnvironmentInfo.java" - } -} - -configurations.create('proteomicsApiJavadoc') -dependencies { - proteomicsApiJavadoc project(':rtd_phosphonetx') -} - -task proteomicsApiJavaDoc(type: Javadoc) { - source proteomicsApiSources.inputs.getFiles().getAsFileTree().matching { - include "**/*.java" - } - classpath = configurations.proteomicsApiJavadoc -} - -task proteomicsApiJavaDocZip(type: Zip, dependsOn: proteomicsApiJavaDoc) { - archiveName 'javadoc-proteomics-api.zip' - from proteomicsApiJavaDoc.destinationDir -} - - -configurations.create('proteomicsApiDependencies') -dependencies { - proteomicsApiDependencies 'sis:sis-base:18.09.0', - 'apache:httpclient:4.3.6', - 'apache:httpcore:4.3.3', - 'apache:log4j:1.2.15', - 'springframework:spring-aop:5.0.1.RELEASE', - 'springframework:spring-beans:5.0.1.RELEASE', - 'springframework:spring-context:5.0.1.RELEASE', - 'springframework:spring-core:5.0.1.RELEASE', - 'springframework:spring-web:5.0.1.RELEASE', - 'springframework:spring-webmvc:5.0.1.RELEASE', - 'springframework:spring-expression:5.0.1.RELEASE', - 'apache:commons-logging:1.2', - 'marathon:marathon-spring-util:1.2.5', - 'aopalliance:aopalliance:1.0' -} - -task proteomicsApiZip(type: Zip) { - baseName 'openBIS-proteomics-API' - from proteomicsApiJar.archivePath - from proteomicsApiSources.archivePath - from proteomicsApiJavaDocZip.archivePath - from configurations.proteomicsApiDependencies - into 'openBIS-proteomics-API' -} -proteomicsApiZip.dependsOn proteomicsApiJar -proteomicsApiZip.dependsOn proteomicsApiSources -proteomicsApiZip.dependsOn proteomicsApiJavaDocZip diff --git a/openbis_standard_technologies/resource/gwt.tar.gz b/openbis_standard_technologies/resource/gwt.tar.gz index 4b2c69cc188c05dbb301922d3a302ecfe154ac9b..b46ad372eb9f086bbfa835f37251808c9fe6afef 100644 Binary files a/openbis_standard_technologies/resource/gwt.tar.gz and b/openbis_standard_technologies/resource/gwt.tar.gz differ diff --git a/openbis_standard_technologies/settings.gradle b/openbis_standard_technologies/settings.gradle index c5d11ff9434eedc79a0ebd73a05575c943eaef2f..550d8a405555407efb4df309efa4f703cf331a5b 100644 --- a/openbis_standard_technologies/settings.gradle +++ b/openbis_standard_technologies/settings.gradle @@ -1,3 +1,3 @@ includeFlat 'commonbase', 'common', 'openbis_api', 'openbis-common', 'authentication', 'dbmigration', 'openbis', - 'datastore_server', 'screening', 'rtd_yeastx', 'rtd_phosphonetx', 'deep_sequencing_unit', 'plasmid', 'big_data_link_server', + 'datastore_server', 'screening', 'rtd_yeastx', 'deep_sequencing_unit', 'plasmid', 'big_data_link_server', 'openbis_ng_ui' diff --git a/rtd_cina/settings.gradle b/rtd_cina/settings.gradle index 600ae08b3aa6bb8a35d042136ad87725179050e6..251ea7819844d063703a7d7c535735cabc2a8793 100644 --- a/rtd_cina/settings.gradle +++ b/rtd_cina/settings.gradle @@ -1,3 +1,3 @@ includeFlat 'commonbase', 'common', 'openbis_api', 'openbis-common', 'authentication', 'dbmigration', 'openbis', - 'datastore_server', 'screening', 'rtd_yeastx', 'rtd_phosphonetx', 'deep_sequencing_unit', 'plasmid', 'openbis_standard_technologies', + 'datastore_server', 'screening', 'rtd_yeastx', 'deep_sequencing_unit', 'plasmid', 'openbis_standard_technologies', 'big_data_link_server', 'openbis_ng_ui' diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/DataSetProteinGrid.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/DataSetProteinGrid.java index cabb2019d32cfd9eff49162f047e2f4b6f92a602..107f6cbbba41c24fe9d96f58e8b2588367883ac2 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/DataSetProteinGrid.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/DataSetProteinGrid.java @@ -20,11 +20,11 @@ import java.util.Arrays; import java.util.List; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.TypedTableGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdAndCodeHolder; diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/PhosphoNetXModule.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/PhosphoNetXModule.java index ab8df0a59c553e03fdb87fddc342c0e0b0f43d77..c736783747dfb8d8cf21f53c1305251a43652d13 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/PhosphoNetXModule.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/PhosphoNetXModule.java @@ -25,14 +25,14 @@ import com.extjs.gxt.ui.client.widget.menu.MenuItem; import com.google.gwt.user.client.rpc.AsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.DisposableTabContent; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DatabaseModificationAwareComponent; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.ViewLocator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.ActionMenu; import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.ITabActionMenuItemDefinition; import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.TabActionMenuItemFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.plugin.IModule; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; +import ch.systemsx.cisd.openbis.generic.shared.basic.BasicConstant; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithIdentifier; import ch.systemsx.cisd.openbis.generic.shared.basic.URLMethodWithParameters; import ch.systemsx.cisd.openbis.plugin.proteomics.client.web.client.IPhosphoNetXClientServiceAsync; @@ -83,7 +83,7 @@ public class PhosphoNetXModule implements IModule public String tryGetLink() { URLMethodWithParameters url = new URLMethodWithParameters(""); - url.addParameter(ViewLocator.ACTION_PARAMETER, getName()); + url.addParameter((String) BasicConstant.LOCATOR_ACTION_PARAMETER, getName()); return url.toString().substring(1); } }); diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinByExperimentBrowerToolBar.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinByExperimentBrowerToolBar.java index 801411307928307bc38d8d2d26a55d22be6ee044..d58e10da11f3c52bd9b116390a5ec21ae9581605 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinByExperimentBrowerToolBar.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinByExperimentBrowerToolBar.java @@ -34,13 +34,13 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.AbstractImagePrototype; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.SimplifiedBaseModelData; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.VocabularyTermModel; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.VocabularyTermSelectionWidget; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.FieldUtil; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.IDataRefreshCallback; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Vocabulary; diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinByExperimentBrowserGrid.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinByExperimentBrowserGrid.java index f43a89aa15f6d503d38d39bbc06581b0103ae7b3..0667f7b297ba9fe97bb82feec4f0b452d21875c2 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinByExperimentBrowserGrid.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinByExperimentBrowserGrid.java @@ -29,7 +29,6 @@ import com.extjs.gxt.ui.client.widget.layout.RowData; import com.extjs.gxt.ui.client.widget.layout.RowLayout; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AbstractTabItemFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DispatcherHelper; @@ -39,6 +38,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.ID import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.IDataRefreshCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinRelatedSampleGrid.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinRelatedSampleGrid.java index 8c09e7b8f8da1998eb01532b4c773816c127d15e..0c430904fc748fa946d8eefd364764509f9daefe 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinRelatedSampleGrid.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinRelatedSampleGrid.java @@ -22,7 +22,6 @@ import java.util.List; import com.extjs.gxt.ui.client.widget.LayoutContainer; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DisplayTypeIDGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.TypedTableGrid; @@ -30,6 +29,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.ICellListenerAndLinkGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinSamplesSection.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinSamplesSection.java index c822d86be81fcec6ea011b8b30344a4d8dd45cbc..365c2d64c71456ab55b2c69b939109bace72a979 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinSamplesSection.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinSamplesSection.java @@ -20,11 +20,11 @@ import com.extjs.gxt.ui.client.widget.ContentPanel; import com.extjs.gxt.ui.client.widget.layout.FitLayout; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.TabContent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.IDatabaseModificationObserver; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdAndCodeHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.plugin.proteomics.client.web.client.IPhosphoNetXClientServiceAsync; diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinSequenceGrid.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinSequenceGrid.java index 52b52f91c427dae6e483ac75578735a2cd992380..05f9e20152d63a130527c4df00c4fbe70882a868 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinSequenceGrid.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinSequenceGrid.java @@ -20,11 +20,11 @@ import java.util.Arrays; import java.util.List; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.TypedTableGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinSummaryGrid.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinSummaryGrid.java index 392dda0da9df192ee7b1283d6b1c4be3f97b3461..6dc527a0d59c861db25c48592f412a9fed24ad2f 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinSummaryGrid.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinSummaryGrid.java @@ -20,11 +20,11 @@ import java.util.Arrays; import java.util.List; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.TypedTableGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinViewLocatorResolver.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinViewLocatorResolver.java index b00dc062029abd64e514f476861f36e65bdf0ca0..f6d7f3eea2db4ddb976aba705bd8403af09c697b 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinViewLocatorResolver.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinViewLocatorResolver.java @@ -23,6 +23,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework. import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.AbstractViewLocatorResolver; import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.ViewLocator; import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; +import ch.systemsx.cisd.openbis.generic.shared.basic.BasicConstant; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.URLMethodWithParameters; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; @@ -88,7 +89,7 @@ public class ProteinViewLocatorResolver extends AbstractViewLocatorResolver static String createLink(final Experiment experiment, ProteinInfo entity) { URLMethodWithParameters url = new URLMethodWithParameters(""); - url.addParameter(ViewLocator.ACTION_PARAMETER, ACTION); + url.addParameter((String) BasicConstant.LOCATOR_ACTION_PARAMETER, ACTION); url.addParameter(ProteinViewLocatorResolver.EXPERIMENT_PERM_ID, experiment.getPermId()); url.addParameter(ProteinViewLocatorResolver.PROTEIN_ID, diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinViewer.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinViewer.java index 0ff91ea6592010c2bb487ecea616cf96ae81d031..d061ad1f615d35ce71cf0eb36714ca25eba13f39 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinViewer.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/ProteinViewer.java @@ -37,7 +37,6 @@ import ch.systemsx.cisd.common.shared.basic.string.StringUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AsyncCallbackWithProgressBar; import ch.systemsx.cisd.openbis.generic.client.web.client.application.DisposableTabContent; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AbstractTabItemFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.CompositeDatabaseModificationObserver; @@ -50,6 +49,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.Abstrac import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.RowLayoutManager; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.property.PropertyGrid; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithIdentifier; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdAndCodeHolder; diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/RawDataSampleGrid.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/RawDataSampleGrid.java index ac167bb8561889f36dffa61224ef9a48ce9c86bd..67d0e66e6f173096e6aec649708f8b2b574d9f35 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/RawDataSampleGrid.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/RawDataSampleGrid.java @@ -22,7 +22,6 @@ import static ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModifica import java.util.List; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DatabaseModificationAwareComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.TypedTableGrid; @@ -31,6 +30,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.Di import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.ICellListenerAndLinkGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedActionWithResult; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/wizard/BiologicalSampleGrid.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/wizard/BiologicalSampleGrid.java index f4d2db89f958d2b0ef740de8c132ec5ea604b463..707918e0db2b7d61002a489a8a045766c5ffc1dc 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/wizard/BiologicalSampleGrid.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/wizard/BiologicalSampleGrid.java @@ -20,11 +20,11 @@ import java.util.Arrays; import java.util.List; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.TypedTableGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.BrowserGridPagingToolBar.PagingToolBarButtonKind; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/wizard/ParentlessMsInjectionSampleGrid.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/wizard/ParentlessMsInjectionSampleGrid.java index 8f8d9ae6aeb58cf323345b61025181127797cd15..9f61b5e643c7272972cbc03407d87f0ba17d4fd6 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/wizard/ParentlessMsInjectionSampleGrid.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/client/application/wizard/ParentlessMsInjectionSampleGrid.java @@ -20,11 +20,11 @@ import java.util.Arrays; import java.util.List; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.TypedTableGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.BrowserGridPagingToolBar.PagingToolBarButtonKind; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; diff --git a/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/server/PhosphoNetXClientServiceTest.java b/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/server/PhosphoNetXClientServiceTest.java index ac48a2e4f8f1793c50171a73d3a7e1d2344dbbd9..6eee125b577dfe12c22d17e4244a4d6b51f07eb1 100644 --- a/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/server/PhosphoNetXClientServiceTest.java +++ b/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/proteomics/client/web/server/PhosphoNetXClientServiceTest.java @@ -47,9 +47,9 @@ import ch.systemsx.cisd.openbis.generic.client.web.server.resultset.DefaultResul import ch.systemsx.cisd.openbis.generic.client.web.server.resultset.IOriginalDataProvider; import ch.systemsx.cisd.openbis.generic.client.web.server.resultset.IResultSet; import ch.systemsx.cisd.openbis.generic.client.web.server.resultset.IResultSetManager; -import ch.systemsx.cisd.openbis.generic.server.SessionConstants; import ch.systemsx.cisd.openbis.generic.shared.WebClientConfigurationProvider; import ch.systemsx.cisd.openbis.generic.shared.basic.GridRowModel; +import ch.systemsx.cisd.openbis.generic.shared.basic.SessionConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelColumnHeader; import ch.systemsx.cisd.openbis.generic.shared.util.CacheManager; diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/Constants.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/Constants.java index 27a92b5b197a7fed9b7f8e2a900c8b431434ed71..340c6d08bebd9d64cb4ef508b416bf735bf03ab3 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/Constants.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/Constants.java @@ -16,7 +16,7 @@ package ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.ScreeningConstants; /** diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningModule.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningModule.java index 6a1bf9ea20e65259af59121130903402265ee6bb..f995ba16df6f91e82fa9f2669c3c525aabcdc3de 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningModule.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/ScreeningModule.java @@ -24,7 +24,6 @@ import java.util.List; import com.extjs.gxt.ui.client.widget.menu.MenuItem; import com.google.gwt.user.client.rpc.AsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.TabContent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DatabaseModificationAwareComponent; @@ -32,6 +31,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.Actio import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.ITabActionMenuItemDefinition; import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.TabActionMenuItemFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.plugin.IModule; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithIdentifier; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers.WellSearchComponent; diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/AnalysisProcedureChooser.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/AnalysisProcedureChooser.java index f37e3a1e08cd3725e040aa2c8aa83013ae7ac5d7..0c32e2985cc6ca4eabe983478b7ddf08a917b435 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/AnalysisProcedureChooser.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/AnalysisProcedureChooser.java @@ -32,11 +32,11 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.Widget; import ch.systemsx.cisd.common.shared.basic.string.StringUtils; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.LabeledItem; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.SimpleModelComboBox; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IMessageProvider; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.Dict; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.ScreeningDisplaySettingsManager; diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentAnalysisSummaryGrid.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentAnalysisSummaryGrid.java index a2c997ff3b37a087178713d5d655bc734c908ebb..ff4cd13ef6072e72445b1c15af23aa33d7614ba9 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentAnalysisSummaryGrid.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ExperimentAnalysisSummaryGrid.java @@ -19,13 +19,13 @@ package ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application. import static ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.grids.FeatureVectorSummaryGridColumnIDs.RANK_PREFIX; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.TypedTableGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.ICellListenerAndLinkGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ColumnIDUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolder; diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialDisambiguationGrid.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialDisambiguationGrid.java index 50305df7caf86d1ae12645835b9e1004f51ea1cf..c1d0ff2df9b85b8659adc0a2f83bf42e5589c53a 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialDisambiguationGrid.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialDisambiguationGrid.java @@ -27,7 +27,6 @@ import com.google.gwt.i18n.client.DateTimeFormat; import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AbstractTabItemFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DefaultTabItem; @@ -40,6 +39,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget. import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.WindowUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ColumnIDUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.MaterialGridColumnIDs; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialFeaturesFromAllExperimentsGrid.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialFeaturesFromAllExperimentsGrid.java index 158f2243cdc60ead41d86a8f4fd3b1d52971fd78..2a23d14e665919e87729789a629eb6f9bc507a69 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialFeaturesFromAllExperimentsGrid.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialFeaturesFromAllExperimentsGrid.java @@ -17,12 +17,12 @@ package ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.TypedTableGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.ICellListenerAndLinkGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithPermId; diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialReplicaFeatureSummaryGrid.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialReplicaFeatureSummaryGrid.java index 7311791f709b20509a9e7cf5d744485d1282713a..077c9a9c4f4c3998556977f6bc01b54c1c5e932f 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialReplicaFeatureSummaryGrid.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/MaterialReplicaFeatureSummaryGrid.java @@ -17,11 +17,11 @@ package ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.TypedTableGrid; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateMetadataBrowser.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateMetadataBrowser.java index a137dd10cfe4e7f1f327478f91dbdbaa8e8bc50a..c2f39d91aa42dd0dfd4d32fcd03184ba3fe4f825 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateMetadataBrowser.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/PlateMetadataBrowser.java @@ -17,7 +17,6 @@ package ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.detailviewers; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AbstractTabItemFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DefaultTabItem; @@ -31,6 +30,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.ICellListenerAndLinkGenerator; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; import ch.systemsx.cisd.openbis.generic.shared.basic.IEntityInformationHolderWithPermId; diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellSearchGrid.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellSearchGrid.java index ce7c14410097c03782e8c6126410d7e6695cc6b9..35cd1d295227877bab8a4f87bf77febd09531d31 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellSearchGrid.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellSearchGrid.java @@ -35,7 +35,6 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.Widget; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.AbstractTabItemFactory; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DefaultTabItem; @@ -51,6 +50,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.ID import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.listener.OpenEntityDetailsTabAction; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.IDelegatedAction; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GridRowModels; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TypedTableResultSet; diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/locator/GlobalWellSearchLocatorResolver.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/locator/GlobalWellSearchLocatorResolver.java index 33c3bdd0c20ab63bc1b6b49cad3edbbe6bae7d75..04bcf39e8c065451e5c0c8d77d3d56d360165869 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/locator/GlobalWellSearchLocatorResolver.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/locator/GlobalWellSearchLocatorResolver.java @@ -11,6 +11,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.Ab import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.MaterialCodeUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.application.locator.ViewLocator; import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException; +import ch.systemsx.cisd.openbis.generic.shared.basic.BasicConstant; import ch.systemsx.cisd.openbis.generic.shared.basic.URLMethodWithParameters; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.ScreeningModule; @@ -92,7 +93,7 @@ public class GlobalWellSearchLocatorResolver extends AbstractViewLocatorResolver public static String createQueryBrowserLink() { URLMethodWithParameters url = new URLMethodWithParameters(""); - url.addParameter(ViewLocator.ACTION_PARAMETER, + url.addParameter(BasicConstant.LOCATOR_ACTION_PARAMETER, ScreeningLinkExtractor.GLOBAL_WELL_SEARCH_ACTION); return url.toStringWithoutDelimiterPrefix(); } diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/sample/LibrarySampleBatchRegistrationForm.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/sample/LibrarySampleBatchRegistrationForm.java index 5369e907271cfc033148521cd50789c9b89c69cb..a50d362a96a02e3c0ff8048446b00728bf0c7fea 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/sample/LibrarySampleBatchRegistrationForm.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/sample/LibrarySampleBatchRegistrationForm.java @@ -25,7 +25,6 @@ import com.extjs.gxt.ui.client.widget.form.SimpleComboBox; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.VocabularyTermModel; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.AbstractBatchRegistrationForm; @@ -34,6 +33,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.E import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.VocabularyTermSelectionWidget; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.FieldUtil; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ExperimentIdentifier; +import ch.systemsx.cisd.openbis.generic.client.web.client.dto.GenericConstants; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Vocabulary; import ch.systemsx.cisd.openbis.plugin.screening.client.web.client.IScreeningClientServiceAsync; import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.LibraryRegistrationInfo; diff --git a/ui-test/settings.gradle b/ui-test/settings.gradle index 0a592e2bc8cddca335e8523a8d46de2deec9928c..4b1ece93db3486a9dd1438328712a221f60c1782 100644 --- a/ui-test/settings.gradle +++ b/ui-test/settings.gradle @@ -1,2 +1,2 @@ includeFlat 'commonbase', 'common', 'openbis_api', 'openbis-common', 'authentication', 'dbmigration', 'openbis', - 'datastore_server', 'screening', 'rtd_yeastx', 'rtd_phosphonetx', 'deep_sequencing_unit', 'plasmid', 'openbis_standard_technologies' + 'datastore_server', 'screening', 'rtd_yeastx', 'deep_sequencing_unit', 'plasmid', 'openbis_standard_technologies'