Skip to content

Commit

Permalink
Adding disabled run button tooltips to calibrate (#5888)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Szendrey authored Dec 19, 2024
1 parent 474eb07 commit db3b6a0
Showing 1 changed file with 21 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
/>
<span class="flex gap-2">
<tera-pyciemss-cancel-button class="mr-auto" :simulation-run-id="cancelRunId" />
<Button label="Run" icon="pi pi-play" @click="runCalibrate" :disabled="disableRunButton" />
<div v-tooltip="runButtonMessage">
<Button label="Run" icon="pi pi-play" @click="runCalibrate" :disabled="isRunDisabled" />
</div>
</span>
</div>

Expand Down Expand Up @@ -700,13 +702,24 @@ const resetState = () => {
});
};
const disableRunButton = computed(
() =>
!currentDatasetFileName.value ||
!csvAsset.value ||
!modelConfigId.value ||
!datasetId.value ||
knobs.value.timestampColName === ''
// Checks for disabling run button:
const isMappingfilled = computed(
() => mapping.value.find((ele) => ele.datasetVariable && ele.modelVariable) && knobs.value.timestampColName
);
const areNodeInputsFilled = computed(() => datasetId.value && modelConfigId.value);
const isRunDisabled = computed(() => !isMappingfilled.value || !areNodeInputsFilled.value);
const mappingFilledTooltip = computed(() =>
!isMappingfilled.value ? 'Must contain a Timestamp column and at least one filled in mapping. \n' : ''
);
const nodeInputsFilledTooltip = computed(() =>
!areNodeInputsFilled.value ? 'Must a valid dataset and model configuration\n' : ''
);
const runButtonMessage = computed(() =>
isRunDisabled.value ? `${mappingFilledTooltip.value} ${nodeInputsFilledTooltip.value}` : ''
);
const selectedOutputId = ref<string>();
Expand Down

0 comments on commit db3b6a0

Please sign in to comment.