@finos/legend-application-studio 13.0.1 → 13.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/lib/components/editor/command/project-search.css +1 -1
  2. package/lib/components/editor/command/project-search.css.map +1 -1
  3. package/lib/components/editor/command-center/ProjectSearchCommand.d.ts.map +1 -1
  4. package/lib/components/editor/command-center/ProjectSearchCommand.js +11 -3
  5. package/lib/components/editor/command-center/ProjectSearchCommand.js.map +1 -1
  6. package/lib/components/editor/edit-panel/FunctionEditor.d.ts.map +1 -1
  7. package/lib/components/editor/edit-panel/FunctionEditor.js +41 -34
  8. package/lib/components/editor/edit-panel/FunctionEditor.js.map +1 -1
  9. package/lib/components/editor/edit-panel/GenerationSpecificationEditor.d.ts.map +1 -1
  10. package/lib/components/editor/edit-panel/GenerationSpecificationEditor.js +35 -54
  11. package/lib/components/editor/edit-panel/GenerationSpecificationEditor.js.map +1 -1
  12. package/lib/components/editor/edit-panel/GrammarTextEditor.d.ts.map +1 -1
  13. package/lib/components/editor/edit-panel/GrammarTextEditor.js +2 -2
  14. package/lib/components/editor/edit-panel/GrammarTextEditor.js.map +1 -1
  15. package/lib/components/editor/edit-panel/RuntimeEditor.d.ts.map +1 -1
  16. package/lib/components/editor/edit-panel/RuntimeEditor.js +11 -20
  17. package/lib/components/editor/edit-panel/RuntimeEditor.js.map +1 -1
  18. package/lib/components/editor/edit-panel/data-editor/DataElementEditor.d.ts.map +1 -1
  19. package/lib/components/editor/edit-panel/data-editor/DataElementEditor.js +4 -8
  20. package/lib/components/editor/edit-panel/data-editor/DataElementEditor.js.map +1 -1
  21. package/lib/components/editor/edit-panel/data-editor/RelationalCSVDataEditor.js +1 -1
  22. package/lib/components/editor/edit-panel/data-editor/RelationalCSVDataEditor.js.map +1 -1
  23. package/lib/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.d.ts.map +1 -1
  24. package/lib/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.js +3 -7
  25. package/lib/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.js.map +1 -1
  26. package/lib/components/editor/edit-panel/external-format-editor/BindingElementEditor.d.ts.map +1 -1
  27. package/lib/components/editor/edit-panel/external-format-editor/BindingElementEditor.js +2 -2
  28. package/lib/components/editor/edit-panel/external-format-editor/BindingElementEditor.js.map +1 -1
  29. package/lib/components/editor/edit-panel/external-format-editor/SchemaSetElementEditor.js +1 -1
  30. package/lib/components/editor/edit-panel/external-format-editor/SchemaSetElementEditor.js.map +1 -1
  31. package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.d.ts.map +1 -1
  32. package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.js +2 -9
  33. package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.js.map +1 -1
  34. package/lib/components/editor/edit-panel/mapping-editor/FlatDataPropertyMappingEditor.d.ts.map +1 -1
  35. package/lib/components/editor/edit-panel/mapping-editor/FlatDataPropertyMappingEditor.js +3 -4
  36. package/lib/components/editor/edit-panel/mapping-editor/FlatDataPropertyMappingEditor.js.map +1 -1
  37. package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.d.ts.map +1 -1
  38. package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.js +3 -10
  39. package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.js.map +1 -1
  40. package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.d.ts.map +1 -1
  41. package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.js +4 -10
  42. package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.js.map +1 -1
  43. package/lib/components/editor/edit-panel/mapping-editor/MappingExplorer.js +7 -9
  44. package/lib/components/editor/edit-panel/mapping-editor/MappingExplorer.js.map +1 -1
  45. package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.d.ts.map +1 -1
  46. package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.js +9 -12
  47. package/lib/components/editor/edit-panel/mapping-editor/MappingTestEditor.js.map +1 -1
  48. package/lib/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.d.ts.map +1 -1
  49. package/lib/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.js +12 -10
  50. package/lib/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.js.map +1 -1
  51. package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.js +2 -2
  52. package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.js.map +1 -1
  53. package/lib/components/editor/edit-panel/mapping-editor/OperationSetImplementationEditor.d.ts.map +1 -1
  54. package/lib/components/editor/edit-panel/mapping-editor/OperationSetImplementationEditor.js +5 -7
  55. package/lib/components/editor/edit-panel/mapping-editor/OperationSetImplementationEditor.js.map +1 -1
  56. package/lib/components/editor/edit-panel/mapping-editor/PurePropertyMappingEditor.d.ts.map +1 -1
  57. package/lib/components/editor/edit-panel/mapping-editor/PurePropertyMappingEditor.js +3 -4
  58. package/lib/components/editor/edit-panel/mapping-editor/PurePropertyMappingEditor.js.map +1 -1
  59. package/lib/components/editor/edit-panel/mapping-editor/relational/RelationalPropertyMappingEditor.d.ts.map +1 -1
  60. package/lib/components/editor/edit-panel/mapping-editor/relational/RelationalPropertyMappingEditor.js +1 -1
  61. package/lib/components/editor/edit-panel/mapping-editor/relational/RelationalPropertyMappingEditor.js.map +1 -1
  62. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionEditor.d.ts.map +1 -1
  63. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionEditor.js +3 -5
  64. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionEditor.js.map +1 -1
  65. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.d.ts.map +1 -1
  66. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.js +9 -6
  67. package/lib/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.js.map +1 -1
  68. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.js +1 -1
  69. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.js.map +1 -1
  70. package/lib/components/editor/edit-panel/uml-editor/AssociationEditor.d.ts.map +1 -1
  71. package/lib/components/editor/edit-panel/uml-editor/AssociationEditor.js +4 -8
  72. package/lib/components/editor/edit-panel/uml-editor/AssociationEditor.js.map +1 -1
  73. package/lib/components/editor/edit-panel/uml-editor/ClassEditor.d.ts.map +1 -1
  74. package/lib/components/editor/edit-panel/uml-editor/ClassEditor.js +157 -57
  75. package/lib/components/editor/edit-panel/uml-editor/ClassEditor.js.map +1 -1
  76. package/lib/components/editor/edit-panel/uml-editor/EnumerationEditor.d.ts.map +1 -1
  77. package/lib/components/editor/edit-panel/uml-editor/EnumerationEditor.js +39 -21
  78. package/lib/components/editor/edit-panel/uml-editor/EnumerationEditor.js.map +1 -1
  79. package/lib/components/editor/edit-panel/uml-editor/ProfileEditor.d.ts.map +1 -1
  80. package/lib/components/editor/edit-panel/uml-editor/ProfileEditor.js +62 -9
  81. package/lib/components/editor/edit-panel/uml-editor/ProfileEditor.js.map +1 -1
  82. package/lib/components/editor/edit-panel/uml-editor/PropertyEditor.d.ts.map +1 -1
  83. package/lib/components/editor/edit-panel/uml-editor/PropertyEditor.js +4 -8
  84. package/lib/components/editor/edit-panel/uml-editor/PropertyEditor.js.map +1 -1
  85. package/lib/components/editor/edit-panel/uml-editor/StereotypeSelector.d.ts +7 -1
  86. package/lib/components/editor/edit-panel/uml-editor/StereotypeSelector.d.ts.map +1 -1
  87. package/lib/components/editor/edit-panel/uml-editor/StereotypeSelector.js +33 -5
  88. package/lib/components/editor/edit-panel/uml-editor/StereotypeSelector.js.map +1 -1
  89. package/lib/components/editor/edit-panel/uml-editor/TaggedValueEditor.d.ts +7 -1
  90. package/lib/components/editor/edit-panel/uml-editor/TaggedValueEditor.d.ts.map +1 -1
  91. package/lib/components/editor/edit-panel/uml-editor/TaggedValueEditor.js +35 -7
  92. package/lib/components/editor/edit-panel/uml-editor/TaggedValueEditor.js.map +1 -1
  93. package/lib/components/editor/side-bar/CreateNewElementModal.d.ts.map +1 -1
  94. package/lib/components/editor/side-bar/CreateNewElementModal.js +4 -4
  95. package/lib/components/editor/side-bar/CreateNewElementModal.js.map +1 -1
  96. package/lib/components/editor/side-bar/Explorer.d.ts.map +1 -1
  97. package/lib/components/editor/side-bar/Explorer.js +8 -15
  98. package/lib/components/editor/side-bar/Explorer.js.map +1 -1
  99. package/lib/components/shared/StudioLambdaEditor.d.ts +1 -0
  100. package/lib/components/shared/StudioLambdaEditor.d.ts.map +1 -1
  101. package/lib/components/shared/StudioLambdaEditor.js +2 -2
  102. package/lib/components/shared/StudioLambdaEditor.js.map +1 -1
  103. package/lib/components/workspace-setup/WorkspaceSetup.js +1 -1
  104. package/lib/components/workspace-setup/WorkspaceSetup.js.map +1 -1
  105. package/lib/index.css +2 -2
  106. package/lib/index.css.map +1 -1
  107. package/lib/package.json +5 -5
  108. package/lib/stores/EditorStore.d.ts.map +1 -1
  109. package/lib/stores/EditorStore.js +7 -7
  110. package/lib/stores/EditorStore.js.map +1 -1
  111. package/lib/stores/editor/NewElementState.d.ts.map +1 -1
  112. package/lib/stores/editor/NewElementState.js +8 -2
  113. package/lib/stores/editor/NewElementState.js.map +1 -1
  114. package/lib/stores/editor-state/GenerationSpecificationEditorState.d.ts +0 -2
  115. package/lib/stores/editor-state/GenerationSpecificationEditorState.d.ts.map +1 -1
  116. package/lib/stores/editor-state/GenerationSpecificationEditorState.js +1 -8
  117. package/lib/stores/editor-state/GenerationSpecificationEditorState.js.map +1 -1
  118. package/lib/stores/editor-state/element-editor-state/ElementEditorState.d.ts.map +1 -1
  119. package/lib/stores/editor-state/element-editor-state/ElementEditorState.js +2 -4
  120. package/lib/stores/editor-state/element-editor-state/ElementEditorState.js.map +1 -1
  121. package/lib/stores/editor-state/element-editor-state/mapping/MappingEditorState.js +1 -1
  122. package/lib/stores/editor-state/element-editor-state/mapping/MappingEditorState.js.map +1 -1
  123. package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.js +1 -1
  124. package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.js.map +1 -1
  125. package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.d.ts +4 -1
  126. package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.d.ts.map +1 -1
  127. package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.js +31 -15
  128. package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.js.map +1 -1
  129. package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.d.ts +6 -3
  130. package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.d.ts.map +1 -1
  131. package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.js +30 -17
  132. package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
  133. package/lib/stores/editor-state/element-editor-state/service/ServiceRegistrationState.js +1 -1
  134. package/lib/stores/editor-state/element-editor-state/service/ServiceRegistrationState.js.map +1 -1
  135. package/lib/stores/graphModifier/DomainGraphModifierHelper.d.ts +10 -0
  136. package/lib/stores/graphModifier/DomainGraphModifierHelper.d.ts.map +1 -1
  137. package/lib/stores/graphModifier/DomainGraphModifierHelper.js +31 -1
  138. package/lib/stores/graphModifier/DomainGraphModifierHelper.js.map +1 -1
  139. package/lib/stores/shared/DnDUtil.d.ts +1 -2
  140. package/lib/stores/shared/DnDUtil.d.ts.map +1 -1
  141. package/lib/stores/shared/DnDUtil.js +0 -2
  142. package/lib/stores/shared/DnDUtil.js.map +1 -1
  143. package/package.json +13 -13
  144. package/src/components/editor/command-center/ProjectSearchCommand.tsx +13 -2
  145. package/src/components/editor/edit-panel/FunctionEditor.tsx +220 -152
  146. package/src/components/editor/edit-panel/GenerationSpecificationEditor.tsx +154 -184
  147. package/src/components/editor/edit-panel/GrammarTextEditor.tsx +4 -5
  148. package/src/components/editor/edit-panel/RuntimeEditor.tsx +89 -90
  149. package/src/components/editor/edit-panel/data-editor/DataElementEditor.tsx +57 -40
  150. package/src/components/editor/edit-panel/data-editor/RelationalCSVDataEditor.tsx +1 -1
  151. package/src/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.tsx +50 -45
  152. package/src/components/editor/edit-panel/external-format-editor/BindingElementEditor.tsx +36 -32
  153. package/src/components/editor/edit-panel/external-format-editor/SchemaSetElementEditor.tsx +1 -1
  154. package/src/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.tsx +46 -41
  155. package/src/components/editor/edit-panel/mapping-editor/FlatDataPropertyMappingEditor.tsx +9 -7
  156. package/src/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.tsx +18 -21
  157. package/src/components/editor/edit-panel/mapping-editor/MappingExecutionBuilder.tsx +39 -29
  158. package/src/components/editor/edit-panel/mapping-editor/MappingExplorer.tsx +39 -39
  159. package/src/components/editor/edit-panel/mapping-editor/MappingTestEditor.tsx +82 -58
  160. package/src/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.tsx +66 -50
  161. package/src/components/editor/edit-panel/mapping-editor/NewMappingElementModal.tsx +2 -2
  162. package/src/components/editor/edit-panel/mapping-editor/OperationSetImplementationEditor.tsx +48 -45
  163. package/src/components/editor/edit-panel/mapping-editor/PurePropertyMappingEditor.tsx +12 -8
  164. package/src/components/editor/edit-panel/mapping-editor/relational/RelationalPropertyMappingEditor.tsx +2 -3
  165. package/src/components/editor/edit-panel/service-editor/ServiceExecutionEditor.tsx +75 -72
  166. package/src/components/editor/edit-panel/service-editor/ServiceExecutionQueryEditor.tsx +63 -43
  167. package/src/components/editor/edit-panel/service-editor/testable/ServiceTestableEditor.tsx +1 -1
  168. package/src/components/editor/edit-panel/uml-editor/AssociationEditor.tsx +55 -38
  169. package/src/components/editor/edit-panel/uml-editor/ClassEditor.tsx +813 -499
  170. package/src/components/editor/edit-panel/uml-editor/EnumerationEditor.tsx +209 -113
  171. package/src/components/editor/edit-panel/uml-editor/ProfileEditor.tsx +184 -52
  172. package/src/components/editor/edit-panel/uml-editor/PropertyEditor.tsx +62 -39
  173. package/src/components/editor/edit-panel/uml-editor/StereotypeSelector.tsx +137 -52
  174. package/src/components/editor/edit-panel/uml-editor/TaggedValueEditor.tsx +171 -88
  175. package/src/components/editor/side-bar/CreateNewElementModal.tsx +4 -2
  176. package/src/components/editor/side-bar/Explorer.tsx +13 -20
  177. package/src/components/shared/StudioLambdaEditor.tsx +3 -0
  178. package/src/components/workspace-setup/WorkspaceSetup.tsx +1 -1
  179. package/src/stores/EditorStore.ts +7 -6
  180. package/src/stores/editor/NewElementState.ts +8 -2
  181. package/src/stores/editor-state/GenerationSpecificationEditorState.ts +1 -15
  182. package/src/stores/editor-state/element-editor-state/ElementEditorState.ts +2 -3
  183. package/src/stores/editor-state/element-editor-state/mapping/MappingEditorState.ts +1 -1
  184. package/src/stores/editor-state/element-editor-state/mapping/MappingExecutionState.ts +1 -1
  185. package/src/stores/editor-state/element-editor-state/mapping/MappingTestState.ts +46 -29
  186. package/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts +39 -20
  187. package/src/stores/editor-state/element-editor-state/service/ServiceRegistrationState.ts +1 -1
  188. package/src/stores/graphModifier/DomainGraphModifierHelper.ts +92 -0
  189. package/src/stores/shared/DnDUtil.ts +0 -2
@@ -30,6 +30,7 @@ import {
30
30
  PencilIcon,
31
31
  TimesIcon,
32
32
  PlusIcon,
33
+ PanelDropZone,
33
34
  } from '@finos/legend-art';
34
35
  import { MappingEditorState } from '../../../../stores/editor-state/element-editor-state/mapping/MappingEditorState.js';
35
36
  import { TypeTree } from '../../../shared/TypeTree.js';
@@ -203,11 +204,15 @@ export const SourceValueInput = observer(
203
204
  },
204
205
  [isReadOnly, updateSourceValue, value],
205
206
  );
206
- const [{ canDrop }, dropRef] = useDrop(
207
+ const [{ canDrop }, dropRef] = useDrop<
208
+ TypeDragSource,
209
+ void,
210
+ { canDrop: boolean }
211
+ >(
207
212
  () => ({
208
213
  accept: CORE_DND_TYPE.TYPE_TREE_ENUM,
209
- drop: (item: TransformDropTarget): void => handleDrop(item),
210
- collect: (monitor): { canDrop: boolean } => ({
214
+ drop: (item) => handleDrop(item),
215
+ collect: (monitor) => ({
211
216
  canDrop: monitor.canDrop(),
212
217
  }),
213
218
  }),
@@ -365,11 +370,15 @@ export const EnumerationMappingEditor = observer(
365
370
  },
366
371
  [enumerationMapping, isReadOnly],
367
372
  );
368
- const [{ isDragOver, canDrop }, dropRef] = useDrop(
373
+ const [{ isDragOver, canDrop }, dropRef] = useDrop<
374
+ ElementDragSource,
375
+ void,
376
+ { isDragOver: boolean; canDrop: boolean }
377
+ >(
369
378
  () => ({
370
379
  accept: CORE_DND_TYPE.PROJECT_EXPLORER_ENUMERATION,
371
- drop: (item: ElementDragSource): void => handleDrop(item),
372
- collect: (monitor): { isDragOver: boolean; canDrop: boolean } => ({
380
+ drop: (item) => handleDrop(item),
381
+ collect: (monitor) => ({
373
382
  isDragOver: monitor.isOver({ shallow: true }),
374
383
  canDrop: monitor.canDrop(),
375
384
  }),
@@ -502,42 +511,38 @@ export const EnumerationMappingEditor = observer(
502
511
  </button>
503
512
  </div>
504
513
  </div>
505
- <div ref={dropRef} className="panel__content dnd__dropzone">
506
- {sourceType && isDragOver && !isReadOnly && (
507
- <div className="dnd__overlay"></div>
508
- )}
509
- {sourceType && (
510
- <div className="source-panel__explorer">
511
- {sourceType instanceof Enumeration && (
512
- <TypeTree type={sourceType} />
513
- )}
514
- {/* TODO?: do we need to show anything when the source type is string or integer */}
515
- </div>
516
- )}
517
- {!sourceType && (
518
- <BlankPanelPlaceholder
519
- placeholderText="Choose a source"
520
- onClick={showSourceSelectorModal}
521
- clickActionType="add"
522
- tooltipText="Drop an enumeration"
523
- dndProps={{
524
- isDragOver: isDragOver && !isReadOnly,
525
- canDrop: canDrop && !isReadOnly,
526
- }}
527
- readOnlyProps={
528
- !isReadOnly
529
- ? undefined
530
- : {
531
- placeholderText: 'No source',
532
- }
533
- }
514
+ <div className="panel__content">
515
+ <PanelDropZone
516
+ dropTargetConnector={dropRef}
517
+ isDragOver={
518
+ Boolean(sourceType) && isDragOver && !isReadOnly
519
+ }
520
+ >
521
+ {sourceType && (
522
+ <div className="source-panel__explorer">
523
+ {sourceType instanceof Enumeration && (
524
+ <TypeTree type={sourceType} />
525
+ )}
526
+ {/* TODO?: do we need to show anything when the source type is string or integer */}
527
+ </div>
528
+ )}
529
+ {!sourceType && (
530
+ <BlankPanelPlaceholder
531
+ text="Choose a source"
532
+ onClick={showSourceSelectorModal}
533
+ clickActionType="add"
534
+ tooltipText="Drop an enumeration"
535
+ isDropZoneActive={canDrop}
536
+ disabled={isReadOnly}
537
+ previewText="No source"
538
+ />
539
+ )}
540
+ <EnumerationMappingSourceSelectorModal
541
+ enumerationMapping={enumerationMapping}
542
+ open={openSourceSelectorModal}
543
+ closeModal={hideSourceSelectorModal}
534
544
  />
535
- )}
536
- <EnumerationMappingSourceSelectorModal
537
- enumerationMapping={enumerationMapping}
538
- open={openSourceSelectorModal}
539
- closeModal={hideSourceSelectorModal}
540
- />
545
+ </PanelDropZone>
541
546
  </div>
542
547
  </div>
543
548
  </ResizablePanel>
@@ -255,19 +255,21 @@ export const FlatDataPropertyMappingEditor = observer(
255
255
  },
256
256
  [disableEditingTransform, flatDataPropertyMappingState],
257
257
  );
258
- const [{ item }, drop] = useDrop(
258
+ const [{ dragItem }, drop] = useDrop<
259
+ FlatDataColumnDragSource,
260
+ void,
261
+ { dragItem: FlatDataColumnDragSource | undefined }
262
+ >(
259
263
  () => ({
260
264
  accept: [CORE_DND_TYPE.TYPE_TREE_PRIMITIVE],
261
- drop: (droppedItem: FlatDataPropertyMappingTransformDropTarget): void =>
262
- handleDrop(droppedItem),
263
- collect: (monitor): { item: FlatDataColumnDragSource | null } => ({
264
- item: monitor.getItem<FlatDataColumnDragSource | null>(),
265
+ drop: (_item) => handleDrop(_item),
266
+ collect: (monitor) => ({
267
+ dragItem:
268
+ monitor.getItem<FlatDataColumnDragSource | null>() ?? undefined,
265
269
  }),
266
270
  }),
267
271
  [handleDrop],
268
272
  );
269
- const dragItem =
270
- item instanceof FlatDataColumnDragSource ? item : undefined;
271
273
  const transformProps = {
272
274
  disableTransform:
273
275
  flatDataInstanceSetImplementationState.isConvertingTransformLambdaObjects,
@@ -25,6 +25,7 @@ import {
25
25
  AsteriskIcon,
26
26
  LongArrowAltDownIcon,
27
27
  PencilEditIcon,
28
+ PanelDropZone,
28
29
  } from '@finos/legend-art';
29
30
  import {
30
31
  CORE_DND_TYPE,
@@ -244,11 +245,15 @@ export const InstanceSetImplementationSourceExplorer = observer(
244
245
  setImplementation,
245
246
  ],
246
247
  );
247
- const [{ isDragOver, canDrop }, dropRef] = useDrop(
248
+ const [{ isDragOver, canDrop }, dropRef] = useDrop<
249
+ ElementDragSource,
250
+ void,
251
+ { isDragOver: boolean; canDrop: boolean }
252
+ >(
248
253
  () => ({
249
254
  accept: dndType,
250
- drop: (item: ElementDragSource): void => handleDrop(item),
251
- collect: (monitor): { isDragOver: boolean; canDrop: boolean } => ({
255
+ drop: (item) => handleDrop(item),
256
+ collect: (monitor) => ({
252
257
  isDragOver: monitor.isOver({ shallow: true }),
253
258
  canDrop: monitor.canDrop(),
254
259
  }),
@@ -318,11 +323,11 @@ export const InstanceSetImplementationSourceExplorer = observer(
318
323
  </button>
319
324
  </div>
320
325
  </div>
321
- <div ref={dropRef} className="panel__content dnd__dropzone">
322
- <>
323
- {srcElement && isDragOver && !isReadOnly && (
324
- <div className="dnd__overlay" />
325
- )}
326
+ <div className="panel__content">
327
+ <PanelDropZone
328
+ dropTargetConnector={dropRef}
329
+ isDragOver={isDragOver && !isReadOnly}
330
+ >
326
331
  {srcElement ? (
327
332
  <div className="source-panel__explorer">
328
333
  {srcElement instanceof Type && (
@@ -346,21 +351,13 @@ export const InstanceSetImplementationSourceExplorer = observer(
346
351
  </div>
347
352
  ) : (
348
353
  <BlankPanelPlaceholder
349
- placeholderText="Choose a source"
354
+ text="Choose a source"
350
355
  onClick={showSourceSelectorModal}
351
356
  clickActionType="add"
352
357
  tooltipText="Drop a class mapping source, or click to choose one"
353
- dndProps={{
354
- isDragOver: isDragOver && !isReadOnly,
355
- canDrop: canDrop && !isReadOnly,
356
- }}
357
- readOnlyProps={
358
- !isReadOnly
359
- ? undefined
360
- : {
361
- placeholderText: 'No source',
362
- }
363
- }
358
+ isDropZoneActive={canDrop}
359
+ disabled={isReadOnly}
360
+ previewText="No source"
364
361
  />
365
362
  )}
366
363
  {isUnsupported && (
@@ -377,7 +374,7 @@ export const InstanceSetImplementationSourceExplorer = observer(
377
374
  closeModal={hideSourceSelectorModal}
378
375
  />
379
376
  )}
380
- </>
377
+ </PanelDropZone>
381
378
  </div>
382
379
  </div>
383
380
  );
@@ -37,6 +37,7 @@ import {
37
37
  CaretDownIcon,
38
38
  RefreshIcon,
39
39
  RobotIcon,
40
+ PanelDropZone,
40
41
  } from '@finos/legend-art';
41
42
  import { observer } from 'mobx-react-lite';
42
43
  import {
@@ -204,7 +205,7 @@ const MappingExecutionQueryEditor = observer(
204
205
  flowResult(
205
206
  queryState.updateLamba(
206
207
  setImplementation
207
- ? editorStore.graphManagerState.graphManager.HACKY__createGetAllLambda(
208
+ ? editorStore.graphManagerState.graphManager.createGetAllRawLambda(
208
209
  guaranteeType(
209
210
  getMappingElementTarget(setImplementation),
210
211
  Class,
@@ -281,11 +282,15 @@ const MappingExecutionQueryEditor = observer(
281
282
  },
282
283
  [changeClassMapping],
283
284
  );
284
- const [{ isDragOver, canDrop }, dropRef] = useDrop(
285
+ const [{ isDragOver, canDrop }, dropRef] = useDrop<
286
+ MappingElementDragSource,
287
+ void,
288
+ { isDragOver: boolean; canDrop: boolean }
289
+ >(
285
290
  () => ({
286
291
  accept: CORE_DND_TYPE.MAPPING_EXPLORER_CLASS_MAPPING,
287
- drop: (item: MappingElementDragSource): void => handleDrop(item),
288
- collect: (monitor): { isDragOver: boolean; canDrop: boolean } => ({
292
+ drop: (item) => handleDrop(item),
293
+ collect: (monitor) => ({
289
294
  isDragOver: monitor.isOver({ shallow: true }),
290
295
  canDrop: monitor.canDrop(),
291
296
  }),
@@ -328,17 +333,19 @@ const MappingExecutionQueryEditor = observer(
328
333
  </div>
329
334
  )}
330
335
  {isStubbed_RawLambda(queryState.query) && (
331
- <div ref={dropRef} className="panel__content">
332
- <BlankPanelPlaceholder
333
- placeholderText="Choose a class mapping"
334
- onClick={showClassMappingSelectorModal}
335
- clickActionType="add"
336
- tooltipText="Drop a class mapping, or click to choose one to start building the query"
337
- dndProps={{
338
- isDragOver: isDragOver,
339
- canDrop: canDrop,
340
- }}
341
- />
336
+ <div className="panel__content">
337
+ <PanelDropZone
338
+ dropTargetConnector={dropRef}
339
+ isDragOver={isDragOver}
340
+ >
341
+ <BlankPanelPlaceholder
342
+ text="Choose a class mapping"
343
+ onClick={showClassMappingSelectorModal}
344
+ clickActionType="add"
345
+ tooltipText="Drop a class mapping, or click to choose one to start building the query"
346
+ isDropZoneActive={canDrop}
347
+ />
348
+ </PanelDropZone>
342
349
  </div>
343
350
  )}
344
351
  {openClassMappingSelectorModal && (
@@ -437,11 +444,15 @@ export const MappingExecutionEmptyInputDataBuilder = observer(
437
444
  },
438
445
  [changeClassMapping],
439
446
  );
440
- const [{ isDragOver, canDrop }, dropRef] = useDrop(
447
+ const [{ isDragOver, canDrop }, dropRef] = useDrop<
448
+ MappingElementDragSource,
449
+ void,
450
+ { isDragOver: boolean; canDrop: boolean }
451
+ >(
441
452
  () => ({
442
453
  accept: CORE_DND_TYPE.MAPPING_EXPLORER_CLASS_MAPPING,
443
- drop: (item: MappingElementDragSource): void => handleDrop(item),
444
- collect: (monitor): { isDragOver: boolean; canDrop: boolean } => ({
454
+ drop: (item) => handleDrop(item),
455
+ collect: (monitor) => ({
445
456
  isDragOver: monitor.isOver({ shallow: true }),
446
457
  canDrop: monitor.canDrop(),
447
458
  }),
@@ -450,17 +461,16 @@ export const MappingExecutionEmptyInputDataBuilder = observer(
450
461
  );
451
462
 
452
463
  return (
453
- <div ref={dropRef} className="panel__content">
454
- <BlankPanelPlaceholder
455
- placeholderText="Choose a class mapping"
456
- onClick={showClassMappingSelectorModal}
457
- clickActionType="add"
458
- tooltipText="Drop a class mapping, or click to choose one to generate input data"
459
- dndProps={{
460
- isDragOver: isDragOver,
461
- canDrop: canDrop,
462
- }}
463
- />
464
+ <div className="panel__content">
465
+ <PanelDropZone dropTargetConnector={dropRef} isDragOver={isDragOver}>
466
+ <BlankPanelPlaceholder
467
+ text="Choose a class mapping"
468
+ onClick={showClassMappingSelectorModal}
469
+ clickActionType="add"
470
+ tooltipText="Drop a class mapping, or click to choose one to generate input data"
471
+ isDropZoneActive={canDrop}
472
+ />
473
+ </PanelDropZone>
464
474
  </div>
465
475
  );
466
476
  },
@@ -27,8 +27,6 @@ import {
27
27
  clsx,
28
28
  TreeView,
29
29
  ContextMenu,
30
- VerticalAlignBottomIcon,
31
- AddIcon,
32
30
  PlusIcon,
33
31
  LockIcon,
34
32
  FireIcon,
@@ -36,6 +34,8 @@ import {
36
34
  ChevronRightIcon,
37
35
  ChevronDownIcon,
38
36
  FilterIcon,
37
+ PanelDropZone,
38
+ BlankPanelPlaceholder,
39
39
  } from '@finos/legend-art';
40
40
  import { MappingElementState } from '../../../../stores/editor-state/element-editor-state/mapping/MappingElementState.js';
41
41
  import { useDrop, useDrag } from 'react-dnd';
@@ -453,15 +453,19 @@ export const MappingExplorer = observer((props: { isReadOnly: boolean }) => {
453
453
  }),
454
454
  [isReadOnly, mappingEditorState],
455
455
  );
456
- const [{ isDragOver }, dropRef] = useDrop(
456
+ const [{ isDragOver }, dropRef] = useDrop<
457
+ ElementDragSource,
458
+ void,
459
+ { isDragOver: boolean }
460
+ >(
457
461
  () => ({
458
462
  accept: [
459
463
  CORE_DND_TYPE.PROJECT_EXPLORER_ENUMERATION,
460
464
  CORE_DND_TYPE.PROJECT_EXPLORER_CLASS,
461
465
  CORE_DND_TYPE.PROJECT_EXPLORER_ASSOCIATION,
462
466
  ],
463
- drop: (item: ElementDragSource): void => handleDrop(item),
464
- collect: (monitor): { isDragOver: boolean } => ({
467
+ drop: (item) => handleDrop(item),
468
+ collect: (monitor) => ({
465
469
  isDragOver: monitor.isOver({ shallow: true }),
466
470
  }),
467
471
  }),
@@ -553,41 +557,37 @@ export const MappingExplorer = observer((props: { isReadOnly: boolean }) => {
553
557
  }
554
558
  menuProps={{ elevation: 7 }}
555
559
  >
556
- <div
557
- ref={dropRef}
558
- className={clsx('mapping-explorer__content', {
559
- 'mapping-explorer__content--dnd-over': isDragOver && !isReadOnly,
560
- })}
560
+ <PanelDropZone
561
+ isDragOver={isDragOver && !isReadOnly}
562
+ dropTargetConnector={dropRef}
561
563
  >
562
- <TreeView
563
- components={{
564
- TreeNodeContainer: MappingElementTreeNodeContainer,
565
- }}
566
- treeData={mappingElementsTreeData}
567
- onNodeSelect={onNodeSelect}
568
- getChildNodes={getMappingElementTreeChildNodes}
569
- innerProps={{
570
- isReadOnly,
571
- onNodeExpand,
572
- }}
573
- />
574
- {/* TODO: use BlankPanelPlaceholder */}
575
- {!isReadOnly && !mappingElements.length && (
576
- <div
577
- className="mapping-explorer__content mapping-explorer__content__adder"
578
- onClick={openNewMapingModal}
579
- >
580
- <div className="mapping-explorer__content__adder__text">
581
- {'Add a mapping element'}
582
- </div>
583
- <div className="mapping-explorer__content__adder__action">
584
- <VerticalAlignBottomIcon className="mapping-explorer__content__adder__action__dnd-icon" />
585
- <AddIcon className="mapping-explorer__content__adder__action__add-icon" />
586
- </div>
587
- </div>
588
- )}
589
- <NewMappingElementModal />
590
- </div>
564
+ <div className="mapping-explorer__content">
565
+ <TreeView
566
+ components={{
567
+ TreeNodeContainer: MappingElementTreeNodeContainer,
568
+ }}
569
+ treeData={mappingElementsTreeData}
570
+ onNodeSelect={onNodeSelect}
571
+ getChildNodes={getMappingElementTreeChildNodes}
572
+ innerProps={{
573
+ isReadOnly,
574
+ onNodeExpand,
575
+ }}
576
+ />
577
+ {!isReadOnly && !mappingElements.length && (
578
+ <BlankPanelPlaceholder
579
+ text="Add a mapping element"
580
+ onClick={openNewMapingModal}
581
+ clickActionType="add"
582
+ tooltipText="Drop a class or an enumeration to start creating mappings"
583
+ isDropZoneActive={isDragOver && !isReadOnly}
584
+ disabled={isReadOnly}
585
+ previewText="No mapping"
586
+ />
587
+ )}
588
+ <NewMappingElementModal />
589
+ </div>
590
+ </PanelDropZone>
591
591
  </ContextMenu>
592
592
  </div>
593
593
  );
@@ -43,6 +43,8 @@ import {
43
43
  ErrorIcon,
44
44
  RefreshIcon,
45
45
  WrenchIcon,
46
+ PauseCircleIcon,
47
+ PanelDropZone,
46
48
  } from '@finos/legend-art';
47
49
  import { useDrop } from 'react-dnd';
48
50
  import {
@@ -123,7 +125,7 @@ const MappingTestQueryEditor = observer(
123
125
  flowResult(
124
126
  queryState.updateLamba(
125
127
  setImplementation
126
- ? editorStore.graphManagerState.graphManager.HACKY__createGetAllLambda(
128
+ ? editorStore.graphManagerState.graphManager.createGetAllRawLambda(
127
129
  guaranteeType(
128
130
  getMappingElementTarget(setImplementation),
129
131
  Class,
@@ -174,11 +176,15 @@ const MappingTestQueryEditor = observer(
174
176
  },
175
177
  [changeClassMapping],
176
178
  );
177
- const [{ isDragOver, canDrop }, dropRef] = useDrop(
179
+ const [{ isDragOver, canDrop }, dropRef] = useDrop<
180
+ MappingElementDragSource,
181
+ void,
182
+ { isDragOver: boolean; canDrop: boolean }
183
+ >(
178
184
  () => ({
179
185
  accept: CORE_DND_TYPE.MAPPING_EXPLORER_CLASS_MAPPING,
180
- drop: (item: MappingElementDragSource): void => handleDrop(item),
181
- collect: (monitor): { isDragOver: boolean; canDrop: boolean } => ({
186
+ drop: (item) => handleDrop(item),
187
+ collect: (monitor) => ({
182
188
  isDragOver: monitor.isOver({ shallow: true }),
183
189
  canDrop: monitor.canDrop(),
184
190
  }),
@@ -222,17 +228,20 @@ const MappingTestQueryEditor = observer(
222
228
  </div>
223
229
  )}
224
230
  {isStubbed_RawLambda(queryState.query) && (
225
- <div ref={dropRef} className="panel__content">
226
- <BlankPanelPlaceholder
227
- placeholderText="Choose a class mapping"
228
- onClick={showClassMappingSelectorModal}
229
- clickActionType="add"
230
- tooltipText="Drop a class mapping, or click to choose one to start building the query"
231
- dndProps={{
232
- isDragOver: isDragOver,
233
- canDrop: canDrop,
234
- }}
235
- />
231
+ <div className="panel__content">
232
+ <PanelDropZone
233
+ dropTargetConnector={dropRef}
234
+ isDragOver={isDragOver}
235
+ >
236
+ <BlankPanelPlaceholder
237
+ text="Choose a class mapping"
238
+ onClick={showClassMappingSelectorModal}
239
+ clickActionType="add"
240
+ tooltipText="Drop a class mapping, or click to choose one to start building the query"
241
+ isDropZoneActive={canDrop}
242
+ disabled={isReadOnly}
243
+ />
244
+ </PanelDropZone>
236
245
  </div>
237
246
  )}
238
247
  {openClassMappingSelectorModal && (
@@ -634,6 +643,10 @@ export const MappingTestEditor = observer(
634
643
  const runTest = applicationStore.guardUnhandledError(() =>
635
644
  flowResult(testState.runTest()),
636
645
  );
646
+ const cancelTest = (): void => {
647
+ testState.setIsRunningTest(false);
648
+ testState.setTestRunPromise(undefined);
649
+ };
637
650
  const executionPlanState = testState.executionPlanState;
638
651
  const generatePlan = applicationStore.guardUnhandledError(() =>
639
652
  flowResult(testState.generatePlan(false)),
@@ -686,53 +699,64 @@ export const MappingTestEditor = observer(
686
699
  ))}
687
700
  </div>
688
701
  <div className="mapping-test-editor__header__actions">
689
- <button
690
- className="mapping-test-editor__execute-btn"
691
- onClick={runTest}
692
- disabled={
693
- testState.isRunningTest ||
694
- testState.isExecutingTest ||
695
- testState.isGeneratingPlan
696
- }
697
- tabIndex={-1}
698
- >
699
- <div className="mapping-test-editor__execute-btn__label">
700
- <PlayIcon className="mapping-test-editor__execute-btn__label__icon" />
701
- <div className="mapping-test-editor__execute-btn__label__title">
702
- Run Test
702
+ {testState.isRunningTest ? (
703
+ <button
704
+ className="mapping-test-editor__stop-btn"
705
+ onClick={cancelTest}
706
+ tabIndex={-1}
707
+ >
708
+ <div className="btn--dark btn--caution mapping-test-editor__stop-btn__label">
709
+ <PauseCircleIcon className="mapping-test-editor__stop-btn__label__icon" />
710
+ <div className="mapping-test-editor__stop-btn__label__title">
711
+ Stop
712
+ </div>
703
713
  </div>
704
- </div>
705
- <DropdownMenu
706
- className="mapping-test-editor__execute-btn__dropdown-btn"
714
+ </button>
715
+ ) : (
716
+ <button
717
+ className="mapping-test-editor__execute-btn"
718
+ onClick={runTest}
707
719
  disabled={
708
- testState.isRunningTest ||
709
- testState.isExecutingTest ||
710
- testState.isGeneratingPlan
720
+ testState.isExecutingTest || testState.isGeneratingPlan
711
721
  }
712
- content={
713
- <MenuContent>
714
- <MenuContentItem
715
- className="mapping-test-editor__execute-btn__option"
716
- onClick={generatePlan}
717
- >
718
- Generate Plan
719
- </MenuContentItem>
720
- <MenuContentItem
721
- className="mapping-test-editor__execute-btn__option"
722
- onClick={debugPlanGeneration}
723
- >
724
- Debug
725
- </MenuContentItem>
726
- </MenuContent>
727
- }
728
- menuProps={{
729
- anchorOrigin: { vertical: 'bottom', horizontal: 'right' },
730
- transformOrigin: { vertical: 'top', horizontal: 'right' },
731
- }}
722
+ tabIndex={-1}
732
723
  >
733
- <CaretDownIcon />
734
- </DropdownMenu>
735
- </button>
724
+ <div className="mapping-test-editor__execute-btn__label">
725
+ <PlayIcon className="mapping-test-editor__execute-btn__label__icon" />
726
+ <div className="mapping-test-editor__execute-btn__label__title">
727
+ Run Test
728
+ </div>
729
+ </div>
730
+ <DropdownMenu
731
+ className="mapping-test-editor__execute-btn__dropdown-btn"
732
+ disabled={
733
+ testState.isExecutingTest || testState.isGeneratingPlan
734
+ }
735
+ content={
736
+ <MenuContent>
737
+ <MenuContentItem
738
+ className="mapping-test-editor__execute-btn__option"
739
+ onClick={generatePlan}
740
+ >
741
+ Generate Plan
742
+ </MenuContentItem>
743
+ <MenuContentItem
744
+ className="mapping-test-editor__execute-btn__option"
745
+ onClick={debugPlanGeneration}
746
+ >
747
+ Debug
748
+ </MenuContentItem>
749
+ </MenuContent>
750
+ }
751
+ menuProps={{
752
+ anchorOrigin: { vertical: 'bottom', horizontal: 'right' },
753
+ transformOrigin: { vertical: 'top', horizontal: 'right' },
754
+ }}
755
+ >
756
+ <CaretDownIcon />
757
+ </DropdownMenu>
758
+ </button>
759
+ )}
736
760
  </div>
737
761
  </div>
738
762
  <div className="mapping-test-editor__content">