Skip to content
Merged
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
4 changes: 2 additions & 2 deletions packages/components/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 packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@labkey/components",
"version": "6.68.0",
"version": "6.68.1",
"description": "Components, models, actions, and utility functions for LabKey applications and pages",
"sideEffects": false,
"files": [
Expand Down
5 changes: 5 additions & 0 deletions packages/components/releaseNotes/components.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# @labkey/components
Components, models, actions, and utility functions for LabKey applications and pages

### version 6.68.1
*Released* 2 November 2025
- Issue 52063: Domain designer to handle lookup to a query with a pipe character
- don't just split on '|', as the queryName could contain '|' characters

### version 6.68.0
*Released* 2 November 2025
- Add auditing of what method was used for CRUD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import {

import {
acceptablePropertyType,
decodeLookup,
DEFAULT_TEXT_CHOICE_VALIDATOR,
DomainDesign,
DomainField,
Expand Down Expand Up @@ -1522,3 +1523,51 @@ describe('resolveLookupQueryValue', () => {
);
});
});

describe('decodeLookup', () => {
test('base', () => {
let result = decodeLookup('http://www.w3.org/2001/XMLSchema#string|query');
expect(result.rangeURI).toBe('http://www.w3.org/2001/XMLSchema#string');
expect(result.queryName).toBe('query');

result = decodeLookup('http://www.w3.org/2001/XMLSchema#int|anotherQuery');
expect(result.rangeURI).toBe('http://www.w3.org/2001/XMLSchema#int');
expect(result.queryName).toBe('anotherQuery');

result = decodeLookup('http://www.w3.org/2001/XMLSchema#dateTime|dateQuery');
expect(result.rangeURI).toBe('http://www.w3.org/2001/XMLSchema#dateTime');
expect(result.queryName).toBe('dateQuery');
});

test('invalid', () => {
let result = decodeLookup(undefined);
expect(result.rangeURI).toBeUndefined();
expect(result.queryName).toBeUndefined();

result = decodeLookup('invalidStringWithoutDelimiter');
expect(result.rangeURI).toBe('invalidStringWithoutDelimiter');
expect(result.queryName).toBeUndefined();

result = decodeLookup('');
expect(result.rangeURI).toBe('');
expect(result.queryName).toBeUndefined();

result = decodeLookup('onlyDelimiter|');
expect(result.rangeURI).toBe('onlyDelimiter');
expect(result.queryName).toBe('');

result = decodeLookup('|onlyQueryName');
expect(result.rangeURI).toBe('');
expect(result.queryName).toBe('onlyQueryName');
});

test('multipl | delimiters', () => {
let result = decodeLookup('http://www.w3.org/2001/XMLSchema#string|query|extra');
expect(result.rangeURI).toBe('http://www.w3.org/2001/XMLSchema#string');
expect(result.queryName).toBe('query|extra');

result = decodeLookup('http://www.w3.org/2001/XMLSchema#int|another|query|with|pipes');
expect(result.rangeURI).toBe('http://www.w3.org/2001/XMLSchema#int');
expect(result.queryName).toBe('another|query|with|pipes');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,10 @@ export function getValidValuesDetailStr(validValues: string[]): string {
}

export function decodeLookup(value: string): { queryName: string; rangeURI: string } {
const [rangeURI, queryName] = value ? value.split('|') : [undefined, undefined];
// Issue 52063: don't just split on '|', as the queryName could contain '|' characters
const separatorIndex = value?.indexOf('|') ?? -1;
const rangeURI = separatorIndex === -1 ? value : value.substring(0, separatorIndex);
const queryName = separatorIndex === -1 ? undefined : value.substring(separatorIndex + 1);

return {
queryName,
Expand Down