Skip to content

Commit 7794dd5

Browse files
authored
cageUI fixes for layout editor (#868)
* Added top and bottom room objects * add top and bottom to editor * Bug fix for incorrect cage numbering search
1 parent 345c636 commit 7794dd5

7 files changed

Lines changed: 60 additions & 4 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
*
3+
* * Copyright (c) 2025 Board of Regents of the University of Wisconsin System
4+
* *
5+
* * Licensed under the Apache License, Version 2.0 (the "License");
6+
* * you may not use this file except in compliance with the License.
7+
* * You may obtain a copy of the License at
8+
* *
9+
* * http://www.apache.org/licenses/LICENSE-2.0
10+
* *
11+
* * Unless required by applicable law or agreed to in writing, software
12+
* * distributed under the License is distributed on an "AS IS" BASIS,
13+
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* * See the License for the specific language governing permissions and
15+
* * limitations under the License.
16+
*
17+
*/
18+
19+
insert into ehr_lookups.lookups (set_name,container,value, category, title)
20+
select setname, container, 105 as value, 'Room Object' as category, 'Top' as title from ehr_lookups.lookup_sets where setname='cageui_item_types';
21+
22+
insert into ehr_lookups.lookups (set_name,container,value, category, title)
23+
select setname, container, 106 as value, 'Room Object' as category, 'Bottom' as title from ehr_lookups.lookup_sets where setname='cageui_item_types';
Lines changed: 11 additions & 0 deletions
Loading
Lines changed: 8 additions & 0 deletions
Loading

CageUI/src/client/components/layoutEditor/Editor.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ const Editor: FC<EditorProps> = ({roomSize}) => {
216216
textElement.setAttribute('contentEditable', 'true');
217217
(textElement.children[0] as SVGTSpanElement).style.cursor = "pointer";
218218
(textElement.children[0] as SVGTSpanElement).style.pointerEvents = "auto";
219-
const cageGroupElement = textElement.closest(`[id^=${roomItemToString(updateItemType)}]`) as SVGGElement;
219+
const cageGroupElement = textElement.closest(`[id=${roomItemToString(updateItemType)}]`) as SVGGElement;
220220
setupEditCageEvent(cageGroupElement, setSelectedObj, contextMenuRef,setCtxMenuStyle, roomItemToString(updateItemType) as RackStringType);
221221
});
222222
}else{
@@ -810,6 +810,18 @@ const Editor: FC<EditorProps> = ({roomSize}) => {
810810
<div className={"layout-editor"}>
811811
<div ref={utilsRef} id="utils" className={"room-utils"}>
812812
<div className={'room-objects'}>
813+
<LayoutTooltip text={"Top"}>
814+
<RoomItemTemplate
815+
fileName={"top"}
816+
className={"draggable"}
817+
/>
818+
</LayoutTooltip>
819+
<LayoutTooltip text={"Bottom"}>
820+
<RoomItemTemplate
821+
fileName={"bottom"}
822+
className={"draggable"}
823+
/>
824+
</LayoutTooltip>
813825
<LayoutTooltip text={"Door"}>
814826
<RoomItemTemplate
815827
fileName={"door"}

CageUI/src/client/types/typings.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ export enum RoomObjectTypes {
5252
Door = 102,
5353
GateClosed = 103,
5454
GateOpen = 104,
55+
Top = 104,
56+
Bottom = 104,
5557
}
5658

5759
// value in the cage modifications table in EHR

CageUI/src/client/utils/LayoutEditorHelpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,10 +458,10 @@ export async function mergeRacks(props: MergeProps) {
458458
}
459459
if (action !== 'cancel') {
460460
let targetRackShape: d3.Selection<SVGGElement, {}, HTMLElement, any>
461-
= layoutSvg.select(`[id^=${targetRack.itemId}]`);
461+
= layoutSvg.select(`[id=${targetRack.itemId}]`);
462462

463463
let draggedRackShape: d3.Selection<SVGGElement, {}, HTMLElement, any>
464-
= layoutSvg.select(`[id^=${draggedRack.itemId}]`);
464+
= layoutSvg.select(`[id=${draggedRack.itemId}]`);
465465

466466
let newGroup: d3.Selection<SVGGElement, {}, HTMLElement, any>;
467467

CageUI/src/org/labkey/cageui/CageUIModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public String getName()
6060
@Override
6161
public @Nullable Double getSchemaVersion()
6262
{
63-
return 25.001;
63+
return 25.002;
6464
}
6565

6666
@Override

0 commit comments

Comments
 (0)