Skip to content

Commit 2507bce

Browse files
committed
WIP
1 parent afdf8c0 commit 2507bce

1 file changed

Lines changed: 19 additions & 26 deletions

File tree

  • modules/apps/object/object-web/src/main/resources/META-INF/resources/js/components/ModelBuilder/Edges

modules/apps/object/object-web/src/main/resources/META-INF/resources/js/components/ModelBuilder/Edges/SelfEdge.tsx

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
44
*/
55

6+
import DropDown from '@clayui/drop-down';
67
import ClayList from '@clayui/list';
78
import ClayPopover from '@clayui/popover';
89
import {getLocalizableLabel} from '@liferay/object-js-components-web';
@@ -74,8 +75,7 @@ export default function SelfEdge({
7475
fill: '#0B5FFF',
7576
};
7677
});
77-
}
78-
else {
78+
} else {
7979
setEdgeStyle((style) => {
8080
return {...style, stroke: '#80ACFF'};
8181
});
@@ -117,11 +117,8 @@ export default function SelfEdge({
117117
/>
118118

119119
{selfRelationships && selfRelationships.length > 1 ? (
120-
<ClayPopover
121-
alignPosition="bottom"
122-
header="Self Relationships"
123-
show={activePopover}
124-
size="lg"
120+
<DropDown
121+
active={activePopover}
125122
trigger={
126123
<EdgeText
127124
label={label}
@@ -136,10 +133,12 @@ export default function SelfEdge({
136133
/>
137134
}
138135
>
139-
<ClayList>
140-
{selfRelationships.map((selfRelationship, index) => (
141-
<ClayList.Item
142-
flex
136+
<DropDown.ItemList items={selfRelationships}>
137+
{(
138+
selfRelationship: ObjectRelationship,
139+
index: number
140+
) => (
141+
<DropDown.Item
143142
key={index}
144143
onClick={() => {
145144
dispatch({
@@ -152,21 +151,15 @@ export default function SelfEdge({
152151
});
153152
}}
154153
>
155-
<ClayList.ItemField>
156-
{getLocalizableLabel(
157-
defaultLanguageId!,
158-
selfRelationship.label,
159-
selfRelationship.name
160-
)}
161-
</ClayList.ItemField>
162-
163-
<ClayList.ItemField>
164-
{selfRelationship.type}
165-
</ClayList.ItemField>
166-
</ClayList.Item>
167-
))}
168-
</ClayList>
169-
</ClayPopover>
154+
{getLocalizableLabel(
155+
defaultLanguageId!,
156+
selfRelationship.label,
157+
selfRelationship.name
158+
)}
159+
</DropDown.Item>
160+
)}
161+
</DropDown.ItemList>
162+
</DropDown>
170163
) : (
171164
<EdgeText
172165
label={label}

0 commit comments

Comments
 (0)