Skip to content

Commit ad748d0

Browse files
feat: add citations for the knowledge graph - AB-938 (#1270)
* added citations field * i think feature is implemented * accidentally deleted a line * removing chanes to .gitignore * feat: hover over blueprint to delete * feat: hover over blueprint to delete * feat: hover over blueprint to delete, deleted unnecessary things * feat: hover over blueprint to delete, deleted more unnecessary things * feat: hover over blueprint to delete * feat: hover over blueprint to delete * feat: hover over blueprint to delete * feat: hover over blueprint to delete --------- Co-authored-by: Neelasha Bhattacharjee <46113280+Neelashab@users.noreply.github.com>
1 parent 9a99eb4 commit ad748d0

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ playground/
2525
*.mp4
2626
.turbo
2727
styles.css
28-
.aider*
28+
.aider*

src/ui/src/builder/sidebar/BuilderSidebarComponentTreeBranch.vue

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,15 @@
1717
:disable-collapse="COMPONENT_TYPES_ROOT.has(component.type)"
1818
:no-nested-space="COMPONENT_TYPES_ROOT.has(component.type)"
1919
:collapsed="isOutsideActivePage"
20+
:right-click-options="rightClickDropdownOptions"
21+
:dropdown-options="
22+
component?.type === 'blueprints_blueprint' &&
23+
isDeleteAllowed(props.componentId)
24+
? rightClickDropdownOptions
25+
: undefined
26+
"
2027
@select="select"
28+
@dropdown-select="handleDropdownSelect($event)"
2129
@dragover="handleDragOver"
2230
@dragstart="handleDragStart"
2331
@dragend="handleDragEnd"
@@ -83,6 +91,7 @@ import {
8391
COMPONENT_TYPES_TOP_LEVEL,
8492
} from "@/constants/component";
8593
import WdsIcon from "@/wds/WdsIcon.vue";
94+
import type { WdsDropdownMenuOption } from "@/wds/WdsDropdownMenu.vue";
8695
8796
const props = defineProps({
8897
componentId: { type: String, required: true },
@@ -91,6 +100,9 @@ const props = defineProps({
91100
92101
const treeBranch = ref<ComponentPublicInstance<typeof BuilderTree>>();
93102
103+
const rightClickDropdownOptions: WdsDropdownMenuOption[] = [
104+
{ label: "Delete", value: "delete", icon: "trash-2" },
105+
];
94106
const wf = inject(injectionKeys.core);
95107
const wfbm = inject(injectionKeys.builderManager);
96108
const selected = computed(() => wfbm.isComponentIdSelected(props.componentId));
@@ -101,11 +113,12 @@ const {
101113
moveComponent,
102114
goToComponentParentPage,
103115
isDraggingAllowed,
116+
isDeleteAllowed,
104117
} = useComponentActions(wf, wfbm, tracking);
105118
const { getComponentInfoFromDrag, removeInsertionCandidacy, isParentSuitable } =
106119
useDragDropComponent(wf);
107120
const { isComponentVisible } = useEvaluator(wf);
108-
const emit = defineEmits(["expandBranch"]);
121+
const emits = defineEmits(["expandBranch", "delete"]);
109122
110123
const q = computed(() => props.query?.toLocaleLowerCase() ?? "");
111124
@@ -145,7 +158,7 @@ async function select(ev: MouseEvent | KeyboardEvent) {
145158
function expand() {
146159
if (!treeBranch.value) return;
147160
treeBranch.value.expand();
148-
emit("expandBranch");
161+
emits("expandBranch");
149162
}
150163
151164
function scrollToShow() {
@@ -201,6 +214,10 @@ function handleDrop(ev: DragEvent) {
201214
removeInsertionCandidacy(ev);
202215
}
203216
217+
function handleDropdownSelect(action: string) {
218+
if (action === "delete") emits("delete");
219+
}
220+
204221
const isOutsideActivePage = computed(() => {
205222
if (!wf.activePageId.value) return false;
206223

0 commit comments

Comments
 (0)