Skip to content

Commit

Permalink
UX revisions to drill down header (#4697)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Chang <[email protected]>
  • Loading branch information
ngraham76 and mwdchang authored Sep 9, 2024
1 parent 9590a8d commit 0509cc1
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@
:output="selectedOutputId"
@update:selection="(e) => emit('update:selection', e)"
/>
<section v-if="!isEmpty(menuItems)" class="mx-2">
<Button icon="pi pi-ellipsis-v" rounded text @click.stop="toggleEllipsisMenu" />
<Menu ref="ellipsisMenu" :model="menuItems" popup />
</section>
</template>
</template>
<template #actions>
Expand Down Expand Up @@ -141,7 +137,6 @@ import TeraTooltip from '@/components/widgets/tera-tooltip.vue';
const props = defineProps<{
node: WorkflowNode<any>;
menuItems?: any[];
title?: string;
tooltip?: string;
isDraft?: boolean;
Expand Down Expand Up @@ -198,9 +193,6 @@ const outputOptions = computed(() => {
];
});
const ellipsisMenu = ref();
const toggleEllipsisMenu = (event: MouseEvent) => ellipsisMenu.value.toggle(event);
// Drilldown navigation and animations
const leftChevronButton = ref<ComponentPublicInstance<typeof Button> | null>(null);
const rightChevronButton = ref<ComponentPublicInstance<typeof Button> | null>(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<tera-drilldown
v-bind="$attrs"
:node="node"
:menu-items="menuItems"
@on-close-clicked="emit('close')"
@update-state="(state: any) => emit('update-state', state)"
hide-dropdown
Expand Down Expand Up @@ -259,17 +258,6 @@ const isEditingDescription = ref(false);
const newDescription = ref('');
const descriptionTextareaRef = ref<ComponentPublicInstance<typeof Textarea> | null>(null);
const menuItems = computed(() => [
{
label: 'Download',
icon: 'pi pi-download',
disabled: isSaveDisabled.value,
command: () => {
downloadModelArchive();
}
}
]);
const emit = defineEmits(['append-output', 'update-state', 'select-output', 'close', 'update-output-port']);
interface BasicKnobs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
ref="drilldownRef"
v-bind="$attrs"
:node="node"
:menu-items="menuItems"
:is-draft="isDraft"
@update:selection="onSelection"
@on-close-clicked="emit('close')"
Expand Down Expand Up @@ -196,16 +195,6 @@ const executeResponse = ref({
traceback: ''
});
const menuItems = computed(() => [
{
label: 'Save as new model',
icon: 'pi pi-pencil',
command: () => {
showSaveModelModal.value = true;
}
}
]);
const updateLlmQuery = (query: string) => {
llmThoughts.value = [];
llmQuery.value = query;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template>
<tera-drilldown
:node="node"
:menu-items="menuItems"
@update:selection="onSelection"
@on-close-clicked="emit('close')"
@update-state="(state: any) => emit('update-state', state)"
Expand Down Expand Up @@ -324,17 +323,6 @@ function removeEquation(index: number) {
emit('update-state', clonedState.value);
}
const menuItems = computed(() => [
{
label: 'Save as new model',
icon: 'pi pi-download',
disabled: !selectedModel.value,
command: () => {
showSaveModelModal.value = true;
}
}
]);
function getEquations() {
const newEquations = multipleEquations.value.split('\n');
newEquations.forEach((equation) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template>
<tera-drilldown
:node="node"
:menu-items="menuItems"
:is-draft="isDraft"
@on-close-clicked="emit('close')"
@update-state="(state: any) => emit('update-state', state)"
Expand Down Expand Up @@ -159,16 +158,6 @@ const props = defineProps<{
}>();
const emit = defineEmits(['append-output', 'update-state', 'close', 'update-output-port', 'select-output']);
const menuItems = computed(() => [
{
label: 'Save as new model',
icon: 'pi pi-pencil',
command: () => {
showSaveModelModal.value = true;
}
}
]);
enum StratifyTabs {
Wizard = 'Wizard',
Notebook = 'Notebook'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template>
<tera-drilldown
:node="node"
:menu-items="menuItems"
@update:selection="onSelection"
@on-close-clicked="emit('close')"
@update-state="(state: any) => emit('update-state', state)"
Expand Down Expand Up @@ -191,7 +190,7 @@ import TeraCarousel from '@/components/widgets/tera-carousel.vue';
import { WorkflowNode } from '@/types/workflow';
import { getDataset, getClimateDatasetPreview, getClimateSubsetId } from '@/services/dataset';
import type { Dataset } from '@/types/Types';
import { AssetType } from '@/types/Types';
// import { AssetType } from '@/types/Types';
import TabView from 'primevue/tabview';
import TabPanel from 'primevue/tabpanel';
// import InputText from 'primevue/inputtext';
Expand All @@ -201,7 +200,7 @@ import Calender from 'primevue/calendar';
import Checkbox from 'primevue/checkbox';
import Slider from 'primevue/slider';
import { logger } from '@/utils/logger';
import { useProjects } from '@/composables/project';
// import { useProjects } from '@/composables/project';
import { SubsetDataOperationState } from './subset-data-operation';
const props = defineProps<{
Expand Down Expand Up @@ -338,17 +337,6 @@ function mutateLoadingState(isLoading: boolean) {
emit('update-state', state);
}
const menuItems = computed(() => [
{
label: 'Add subset to project datasets',
icon: 'pi pi-pencil',
disabled: !subset.value,
command: () => {
addSubsetToProject();
}
}
]);
function updateState() {
const state = cloneDeep(props.node.state);
state.datasetId = dataset.value?.id ?? null;
Expand All @@ -365,15 +353,16 @@ function updateState() {
emit('update-state', state);
}
async function addSubsetToProject() {
const projectId = useProjects().activeProject.value?.id;
if (subset.value?.id && projectId) {
await useProjects().addAsset(AssetType.Dataset, subset.value.id, projectId);
logger.info(`New dataset saved as ${subset.value.name}`);
} else {
logger.error('Subset ID not found.');
}
}
// FIXME: removed drilldown hamburger menu
// async function addSubsetToProject() {
// const projectId = useProjects().activeProject.value?.id;
// if (subset.value?.id && projectId) {
// await useProjects().addAsset(AssetType.Dataset, subset.value.id, projectId);
// logger.info(`New dataset saved as ${subset.value.name}`);
// } else {
// logger.error('Subset ID not found.');
// }
// }
async function run() {
console.log('running');
Expand Down

0 comments on commit 0509cc1

Please sign in to comment.