Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
}
},
"dependencies": {
"@labkey/components": "7.26.4",
"@labkey/components": "7.26.5-fb-mvtcBatch3.1",
"@labkey/themes": "1.8.0"
},
"devDependencies": {
Expand Down
16 changes: 8 additions & 8 deletions experiment/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion experiment/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test-integration": "cross-env NODE_ENV=test jest --ci --runInBand -c test/js/jest.config.integration.js"
},
"dependencies": {
"@labkey/components": "7.26.4"
"@labkey/components": "7.26.5-fb-mvtcBatch3.1"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason not to also bump the @labkey/components version for the other package.json cases in platform? I think it is nice to keep all 4 of them in sync.

},
"devDependencies": {
"@labkey/build": "9.1.0",
Expand Down
71 changes: 70 additions & 1 deletion experiment/src/client/test/integration/DataClassCrud.ispec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,14 @@ describe('Multi Value Text Choice', () => {
{
...MVTC_FIELD_PROP,
name: fieldName
},
{
name: 'MultiLineField',
rangeURI:"http://www.w3.org/2001/XMLSchema#multiLine",
}
];

let domainId = -1, domainURI = '', propertyId, propertyURI;
let domainId = -1, domainURI = '', propertyId, propertyURI, mlPropertyId, mlPropertyURI;
const createPayload = {
kind: 'DataClass',
domainDesign: { name: dataType, fields },
Expand All @@ -541,6 +545,9 @@ describe('Multi Value Text Choice', () => {
const field = domain.fields[0];
propertyId = field.propertyId;
propertyURI = field.propertyURI;
const mlField = domain.fields[1];
mlPropertyId = mlField.propertyId;
mlPropertyURI = mlField.propertyURI;
return true;
});

Expand Down Expand Up @@ -786,6 +793,12 @@ describe('Multi Value Text Choice', () => {
name: fieldName,
propertyId,
propertyURI
},
{
name: 'MultiLineField',
rangeURI:"http://www.w3.org/2001/XMLSchema#multiLine",
propertyId: mlPropertyId,
propertyURI: mlPropertyURI
}
],
domainId,
Expand All @@ -801,6 +814,62 @@ describe('Multi Value Text Choice', () => {
result = await getDataClassDataByName(dataNameImported[0], dataType, '*', topFolderOptions, editorUserOptions);
expect(caseInsensitive(result, fieldName)).toEqual('Abnormal, Plasma'); // convert from ['Abnormal', 'Plasma'] to 'Abnormal, Plasma'

// GitHub Issue 951: Multi-line values converted to text choices lose multi-line editability
// verify cannot convert MultiLine field to MultiValue Text Choice
updatePayload = {
domainId,
domainDesign: {
name: dataType,
fields: [
{
name: fieldName,
propertyId,
propertyURI
},
{
...MVTC_FIELD_PROP,
name: 'MultiLineField',
propertyId: mlPropertyId,
propertyURI: mlPropertyURI
}
],
domainId,
domainURI
},
options: {
rowId: dataClassRowId,
name: dataType,
nameExpression: 'S-${' + fieldNameInExpression + '}'
}
};
failedUpdate = await server.post('property', 'saveDomain', updatePayload, {...topFolderOptions, ...adminOptions});
expect(failedUpdate?.['body']?.['exception']).toContain('Cannot convert a multiline text field to a text choice field.');

// verify cannot convert MultiLine field to Text Choice field
updatePayload = {
domainId,
domainDesign: {
name: dataType,
fields: [
{
...TC_FIELD_PROP,
name: 'MultiLineField',
propertyId: mlPropertyId,
propertyURI: mlPropertyURI
}
],
domainId,
domainURI
},
options: {
rowId: dataClassRowId,
name: dataType,
nameExpression: 'S-${genId}'
}
};
failedUpdate = await server.post('property', 'saveDomain', updatePayload, {...topFolderOptions, ...adminOptions});
expect(failedUpdate?.['body']?.['exception']).toContain('Cannot convert a multiline text field to a text choice field.');

});

});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
import java.util.Objects;
import java.util.Set;

import static org.labkey.api.data.ColumnRenderPropertiesImpl.TEXT_CHOICE_CONCEPT_URI;

public class DomainPropertyImpl implements DomainProperty
{
private final DomainImpl _domain;
Expand Down Expand Up @@ -859,6 +861,13 @@ else if (newType == PropertyType.MULTI_CHOICE || oldType == PropertyType.MULTI_C
if (PropertyType.FILE_LINK.getInputType().equalsIgnoreCase(oldType.getInputType()) && oldType != newType)
throw new ChangePropertyDescriptorException("Cannot convert an instance of " + oldType.name() + " to " + newType.name() + ".");

// GitHub Issue 951: Multi-line values converted to text choices lose multi-line editability
if (oldType == PropertyType.MULTI_LINE &&
(PropertyType.MULTI_CHOICE == newType ||TEXT_CHOICE_CONCEPT_URI.equals(_pd.getConceptURI())))
{
throw new ChangePropertyDescriptorException("Cannot convert a multiline text field to a text choice field.");
}

OntologyManager.validatePropertyDescriptor(_pd);
Table.update(user, OntologyManager.getTinfoPropertyDescriptor(), _pd, _pdOld.getPropertyId());
OntologyManager.ensurePropertyDomain(_pd, dd, sortOrder);
Expand Down
Loading