Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ playground/
*.mp4
.turbo
styles.css
.aider*
.aider*
21 changes: 2 additions & 19 deletions src/ui/src/builder/sidebar/BuilderSidebarComponentTreeBranch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,7 @@
:disable-collapse="COMPONENT_TYPES_ROOT.has(component.type)"
:no-nested-space="COMPONENT_TYPES_ROOT.has(component.type)"
:collapsed="isOutsideActivePage"
:right-click-options="rightClickDropdownOptions"
:dropdown-options="
component?.type === 'blueprints_blueprint' &&
isDeleteAllowed(props.componentId)
? rightClickDropdownOptions
: undefined
"
@select="select"
@dropdown-select="handleDropdownSelect($event)"
@dragover="handleDragOver"
@dragstart="handleDragStart"
@dragend="handleDragEnd"
Expand Down Expand Up @@ -91,7 +83,6 @@ import {
COMPONENT_TYPES_TOP_LEVEL,
} from "@/constants/component";
import WdsIcon from "@/wds/WdsIcon.vue";
import type { WdsDropdownMenuOption } from "@/wds/WdsDropdownMenu.vue";

const props = defineProps({
componentId: { type: String, required: true },
Expand All @@ -100,9 +91,6 @@ const props = defineProps({

const treeBranch = ref<ComponentPublicInstance<typeof BuilderTree>>();

const rightClickDropdownOptions: WdsDropdownMenuOption[] = [
{ label: "Delete", value: "delete", icon: "trash-2" },
];
const wf = inject(injectionKeys.core);
const wfbm = inject(injectionKeys.builderManager);
const selected = computed(() => wfbm.isComponentIdSelected(props.componentId));
Expand All @@ -113,12 +101,11 @@ const {
moveComponent,
goToComponentParentPage,
isDraggingAllowed,
isDeleteAllowed,
} = useComponentActions(wf, wfbm, tracking);
const { getComponentInfoFromDrag, removeInsertionCandidacy, isParentSuitable } =
useDragDropComponent(wf);
const { isComponentVisible } = useEvaluator(wf);
const emits = defineEmits(["expandBranch", "delete"]);
const emit = defineEmits(["expandBranch"]);

const q = computed(() => props.query?.toLocaleLowerCase() ?? "");

Expand Down Expand Up @@ -158,7 +145,7 @@ async function select(ev: MouseEvent | KeyboardEvent) {
function expand() {
if (!treeBranch.value) return;
treeBranch.value.expand();
emits("expandBranch");
emit("expandBranch");
}

function scrollToShow() {
Expand Down Expand Up @@ -214,10 +201,6 @@ function handleDrop(ev: DragEvent) {
removeInsertionCandidacy(ev);
}

function handleDropdownSelect(action: string) {
if (action === "delete") emits("delete");
}

const isOutsideActivePage = computed(() => {
if (!wf.activePageId.value) return false;

Expand Down