Skip to content

Commit 97412c7

Browse files
Remove code to support Edit with Grid from Bulk Edit (Issue 52658 follow up) (#1784)
1 parent 3e6af72 commit 97412c7

6 files changed

Lines changed: 11 additions & 143 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.38.1",
3+
"version": "6.38.2",
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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# @labkey/components
22
Components, models, actions, and utility functions for LabKey applications and pages
33

4+
### version 6.38.2
5+
*Released*: 30 April 2025
6+
- Remove remnants of Edit with Grid from Bulk Edit modal
7+
- Remove unneeded parameters for `EditableGridLoaderFromSelection` and `convertQueryDataToEditorData`
8+
49
### version 6.38.1
510
*Released*: 24 April 2025
611
- Issue 52929: App hit selection summary grid doesn't render hit selection check icon if assay name ends with colon

packages/components/src/internal/components/editable/EditableGridLoaderFromSelection.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,10 @@ export class EditableGridLoaderFromSelection implements EditableGridLoader {
3636
queryModel: QueryModel;
3737
queryInfo: QueryInfo;
3838
requiredColumns: string[];
39-
updateData: Map<string, any>; // keys here are column fieldKey
4039

4140
constructor(
4241
id: string,
4342
queryModel: QueryModel,
44-
updateData: Map<string, any>,
4543
requiredColumns?: string[],
4644
omittedColumns?: string[],
4745
columns?: QueryColumn[],
@@ -56,7 +54,6 @@ export class EditableGridLoaderFromSelection implements EditableGridLoader {
5654
this.mode = EditorMode.Update;
5755
this.queryModel = queryModel;
5856
this.queryInfo = queryModel.queryInfo;
59-
this.updateData = updateData || Map<string, any>();
6057
this.requiredColumns = requiredColumns || [];
6158
this.omittedColumns = omittedColumns || [];
6259
this.idsNotToUpdate = idsNotToUpdate || [];
@@ -81,13 +78,7 @@ export class EditableGridLoaderFromSelection implements EditableGridLoader {
8178
);
8279

8380
return {
84-
data: EditorModel.convertQueryDataToEditorData(
85-
data,
86-
this.queryInfo,
87-
this.updateData,
88-
this.idsNotToUpdate,
89-
this.fieldsNotToUpdate
90-
),
81+
data: EditorModel.convertQueryDataToEditorData(data),
9182
dataIds,
9283
};
9384
}

packages/components/src/internal/components/editable/models.test.ts

Lines changed: 1 addition & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -327,114 +327,7 @@ describe('EditorModel', () => {
327327
expect(EditorModel.getEditorDataFromQueryValueMap(data)).toEqual(undefined);
328328
});
329329

330-
test('convertQueryDataToEditorData with updates', () => {
331-
const queryData = fromJS({
332-
1: {
333-
noValue: {
334-
color: 'blue',
335-
displayValue: 'blue',
336-
},
337-
withValue: {
338-
value: 'orange',
339-
ignoreMe: 'nothing to see',
340-
},
341-
'withDisplay/Value': {
342-
value: 'b',
343-
displayValue: 'blue',
344-
otherField: 'irrelevant',
345-
},
346-
doNotChangeMe: {
347-
value: 'fred',
348-
},
349-
},
350-
2: {
351-
noValue: {
352-
color: 'blue',
353-
displayValue: 'blue',
354-
},
355-
withValue: {
356-
value: 'orangish',
357-
ignoreMe: 'nothing to see',
358-
},
359-
'withDisplay/Value': {
360-
value: 'b',
361-
displayValue: 'black',
362-
otherField: 'irrelevant',
363-
},
364-
doNotChangeMe: {
365-
value: 'maroon',
366-
},
367-
},
368-
});
369-
const updates = Map<any, any>({
370-
withValue: 'purple',
371-
withDisplay$SValue: 'teal',
372-
});
373-
const queryInfo2 = new QueryInfo({
374-
columns: new ExtendedMap({
375-
novalue: new QueryColumn({
376-
name: 'noValue',
377-
fieldKey: 'noValue',
378-
}),
379-
withvalue: new QueryColumn({
380-
name: 'withValue',
381-
fieldKey: 'withValue',
382-
}),
383-
withdisplay$svalue: new QueryColumn({
384-
name: 'withDisplay/Value',
385-
fieldKey: 'withDisplay$SValue',
386-
}),
387-
donotchangeme: new QueryColumn({
388-
name: 'doNotChangeMe',
389-
fieldKey: 'doNotChangeMe',
390-
}),
391-
}),
392-
});
393-
const result = EditorModel.convertQueryDataToEditorData(queryData, queryInfo2, updates);
394-
expect(result).toStrictEqual(
395-
Map<string, any>({
396-
1: Map<string, any>({
397-
withValue: 'purple',
398-
'withDisplay/Value': 'teal',
399-
doNotChangeMe: 'fred',
400-
}),
401-
2: Map<string, any>({
402-
withValue: 'purple',
403-
'withDisplay/Value': 'teal',
404-
doNotChangeMe: 'maroon',
405-
}),
406-
})
407-
);
408-
409-
const result2 = EditorModel.convertQueryDataToEditorData(
410-
queryData,
411-
queryInfo2,
412-
updates,
413-
[1],
414-
['WithValue', 'WithDisplay$SValue']
415-
);
416-
expect(result2).toStrictEqual(
417-
Map<string, any>({
418-
1: Map<string, any>({
419-
withValue: 'orange',
420-
'withDisplay/Value': List([
421-
{
422-
value: 'b',
423-
displayValue: 'blue',
424-
},
425-
]),
426-
doNotChangeMe: 'fred',
427-
}),
428-
2: Map<string, any>({
429-
withValue: 'purple',
430-
'withDisplay/Value': 'teal',
431-
doNotChangeMe: 'maroon',
432-
}),
433-
})
434-
);
435-
});
436-
437-
test('convertQueryDataToEditorData without updates', () => {
330+
test('convertQueryDataToEditorData', () => {
438331
const queryData = fromJS({
439332
1: {
440333
noValue: {

packages/components/src/internal/components/editable/models.ts

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -691,38 +691,17 @@ export class EditorModel
691691

692692
static convertQueryDataToEditorData(
693693
data: Map<string, any>, // this map is keyed by column name
694-
queryInfo?: QueryInfo,
695-
updates?: Map<string, any>, // this map is keyed by column fieldKey
696-
idsNotToUpdate?: number[],
697-
fieldsNotToUpdate?: string[] // keys here are column fieldKey
698694
): Map<string, Map<string, any>> {
699-
const fieldsNotToUpdateLower = fieldsNotToUpdate?.map(f => f.toLowerCase()) ?? [];
700-
701695
return data
702696
.map((valueMap, id) => {
703-
const returnMap = valueMap.reduce((m, valueMap_, key) => {
697+
return valueMap.reduce((m, valueMap_, key) => {
704698
const editorData = EditorModel.getEditorDataFromQueryValueMap(valueMap_);
705699
if (editorData === undefined) {
706700
return m;
707701
}
708702

709703
return m.set(key, editorData);
710704
}, Map<string, any>());
711-
712-
if (!queryInfo || !updates) {
713-
return returnMap;
714-
}
715-
716-
let trimmedUpdates = Map<string, any>();
717-
const isNotUpdateId = idsNotToUpdate && idsNotToUpdate.indexOf(parseInt(id, 10)) > -1;
718-
updates.forEach((value, fieldKey) => {
719-
const col = queryInfo.getColumn(fieldKey);
720-
const isFieldNotToUpdate = fieldsNotToUpdateLower.indexOf(fieldKey.toLowerCase()) > -1;
721-
if (!isFieldNotToUpdate || !isNotUpdateId) {
722-
trimmedUpdates = trimmedUpdates.set(col.name, value);
723-
}
724-
});
725-
return returnMap.merge(trimmedUpdates);
726705
})
727706
.toMap();
728707
}

0 commit comments

Comments
 (0)