Skip to content

Commit 869f94f

Browse files
authored
Issue 52979: App grid customize view doesn't expand lookup field with special char (#1785)
### version 6.39.1 *Released*: 2 May 2025 - Issue 52979: App grid customize view doesn't expand lookup field with special char - Issue 52472: Re-clicking the Source Types, Sample Types or Assay links in the mega menu removes the sort=Name parameter from the url - Customize view available field data-fieldkey attribute to use encoded fieldKey values
1 parent c394b87 commit 869f94f

8 files changed

Lines changed: 31 additions & 12 deletions

File tree

packages/components/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@labkey/components",
3-
"version": "6.39.0",
3+
"version": "6.39.1",
44
"description": "Components, models, actions, and utility functions for LabKey applications and pages",
55
"sideEffects": false,
66
"files": [

packages/components/releaseNotes/components.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# @labkey/components
22
Components, models, actions, and utility functions for LabKey applications and pages
33

4+
### version 6.39.1
5+
*Released*: 2 May 2025
6+
- Issue 52979: App grid customize view doesn't expand lookup field with special char
7+
- Issue 52472: Re-clicking the Source Types, Sample Types or Assay links in the mega menu removes the sort=Name parameter from the url
8+
- Customize view available field data-fieldkey attribute to use encoded fieldKey values
9+
410
### version 6.39.0
511
*Released*: 2 May 2025
612
- Export `getSourceDomainDefaultSystemFields`

packages/components/src/internal/app/utils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ export function addSourcesSectionConfig(
580580
emptyText: 'No source types have been defined',
581581
filteredEmptyText: 'No source types available',
582582
iconURL: imageURL('_images', 'source_type.svg'),
583+
headerURLParams: { 'sourcetypegrid.sort': 'Name' }, // Issue 52472
583584
});
584585
if (user && userCanDesignSourceTypes(user)) {
585586
sourcesMenuConfig = sourcesMenuConfig.merge({
@@ -596,6 +597,7 @@ export function getSamplesSectionConfig(user: User): MenuSectionConfig {
596597
emptyText: 'No sample types have been defined',
597598
filteredEmptyText: 'No sample types available',
598599
iconURL: imageURL('_images', 'samples.svg'),
600+
headerURLParams: { 'samplesetgrid.sort': 'Name' }, // Issue 52472
599601
});
600602
if (user && user.hasDesignSampleTypesPermission()) {
601603
samplesMenuConfig = samplesMenuConfig.merge({
@@ -616,6 +618,7 @@ export function addAssaysSectionConfig(
616618
emptyText: 'No assays have been defined',
617619
filteredEmptyText: 'No assays available',
618620
iconURL: imageURL('_images', 'assay.svg'),
621+
headerURLParams: { 'allassaysgrid.sort': 'Name', 'activeassaysgrid.sort': 'Name' }, // Issue 52472
619622
});
620623
if (user && user.hasDesignAssaysPermission()) {
621624
assaysMenuConfig = assaysMenuConfig.merge({
@@ -660,6 +663,7 @@ function getMediaSectionConfig(): MenuSectionConfig {
660663
function getRegistrySectionConfig(): MenuSectionConfig {
661664
return new MenuSectionConfig({
662665
iconURL: imageURL('_images', 'molecule.svg'),
666+
headerURLParams: { 'query.sort': 'Name' }, // Issue 52472
663667
});
664668
}
665669

packages/components/src/internal/components/ColumnSelectionModal.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ export const ColumnChoice: FC<ColumnChoiceProps> = memo(props => {
105105
false
106106
);
107107
const supportsExpand = !!onExpandColumn;
108-
const colFieldKey = column.index;
109108
const disabled = disabledMsg !== undefined;
110109

111110
// 46256: use encoded fieldKeyPath
@@ -136,12 +135,12 @@ export const ColumnChoice: FC<ColumnChoiceProps> = memo(props => {
136135
);
137136

138137
return (
139-
<div className="list-group-item flex" key={colFieldKey} data-fieldkey={colFieldKey}>
138+
<div className="list-group-item flex" key={column.index} data-fieldkey={column.fieldKeyPath}>
140139
{supportsExpand && (
141140
<>
142141
{parentFieldKeys.map((parent, index) => (
143142
// eslint-disable-next-line react/no-array-index-key
144-
<div className="field-expand-icon" key={`${colFieldKey}|${index}`} />
143+
<div className="field-expand-icon" key={`${column.index}|${index}`} />
145144
))}
146145
<div className="field-expand-icon">
147146
{column.isLookup() && !isExpanded && (

packages/components/src/internal/components/navigation/ProductMenuSection.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,16 @@ export const ProductMenuSection: FC<MenuSectionProps> = memo(props => {
106106
section.productId,
107107
currentProductId,
108108
containerPath,
109-
undefined,
109+
config.headerURLParams,
110110
config.headerURLPart ?? section.key
111111
);
112112

113113
if (headerURL instanceof AppURL) {
114-
headerEl = <Link to={headerURL.toString()} className="menu-section-link">{label}</Link>;
114+
headerEl = (
115+
<Link to={headerURL.toString()} className="menu-section-link">
116+
{label}
117+
</Link>
118+
);
115119
} else {
116120
headerEl = <a href={getHref(headerURL)}>{label}</a>;
117121
}

packages/components/src/internal/components/navigation/model.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export class ProductMenuModel extends Record({
177177
});
178178

179179
return List<MenuSectionModel>(sections);
180-
};
180+
}
181181

182182
setLoadedSections(sections: List<MenuSectionModel>): ProductMenuModel {
183183
return this.merge({
@@ -219,6 +219,7 @@ export class MenuSectionConfig extends Record({
219219
filteredEmptyText: undefined,
220220
emptyAppURL: undefined,
221221
emptyURLText: 'Get started...',
222+
headerURLParams: undefined,
222223
headerURLPart: undefined,
223224
headerText: undefined,
224225
iconCls: undefined,
@@ -232,6 +233,7 @@ export class MenuSectionConfig extends Record({
232233
declare filteredEmptyText?: string;
233234
declare emptyAppURL?: AppURL;
234235
declare emptyURLText: string;
236+
declare headerURLParams: Record<string, any>;
235237
declare headerURLPart: string;
236238
declare headerText?: string;
237239
declare iconCls?: string;

packages/components/src/public/QueryModel/CustomizeGridViewModal.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ import { QueryColumn } from '../QueryColumn';
99

1010
import { SCHEMAS } from '../../internal/schemas';
1111

12-
import { QueryModel } from './QueryModel';
1312
import { QueryInfo } from '../QueryInfo';
1413

14+
import { QueryModel } from './QueryModel';
15+
1516
export const includedColumnsForCustomizationFilter = (column: QueryColumn, showAllColumns: boolean): boolean => {
1617
const isAncestor = column.fieldKeyPath?.indexOf('/Ancestors') >= 0;
1718
const isAncestorChild = column.fieldKeyPath?.indexOf('Ancestors/') >= 0;
@@ -34,12 +35,15 @@ export const includedColumnsForCustomizationFilter = (column: QueryColumn, showA
3435

3536
export const getExpandQueryInfo = async (queryInfo: QueryInfo, column: QueryColumn): Promise<QueryInfo> => {
3637
const fkQueryInfo = await getQueryDetails({
37-
fk: column.index,
38+
fk: column.fieldKeyPath, // Issue 52979: use encoded fieldKeyPath
3839
lookup: column.lookup,
3940
schemaQuery: queryInfo.schemaQuery,
4041
});
4142
// For data classes, we want to limit the Ancestor filters to exclude 'Samples'
42-
if (column.index === QueryColumn.ANCESTORS_PREFIX && queryInfo.schemaQuery.schemaName === SCHEMAS.DATA_CLASSES.SCHEMA) {
43+
if (
44+
column.fieldKey === QueryColumn.ANCESTORS_PREFIX &&
45+
queryInfo.schemaQuery.schemaName === SCHEMAS.DATA_CLASSES.SCHEMA
46+
) {
4347
fkQueryInfo.columns = fkQueryInfo.columns.filter(
4448
col => col.fieldKey !== 'Samples' && col.fieldKey !== 'MediaSamples'
4549
);

0 commit comments

Comments
 (0)