fix: unable to create new kpi issue (#10361)

* updated cypres.config to run searchflow last

* updated cypress config

* fixed kpi creation issue

* reverting cypress change
This commit is contained in:
Shailesh Parmar 2023-02-28 20:12:01 +05:30 committed by GitHub
parent 909cedeca1
commit f4fc1b6438
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -142,7 +142,7 @@ const AddKPIPage = () => {
const handleChartSelect = (value: string) => {
const selectedChartValue = dataInsightCharts.find(
(chart) => chart.id === value
(chart) => chart.fullyQualifiedName === value
);
setSelectedChart(selectedChartValue);
};
@ -191,7 +191,6 @@ const AddKPIPage = () => {
const targetValue = getKpiTargetValueByMetricType(metricType, metricValue);
const formData: CreateKpiRequest = {
// TODO: this needs to be fullyQualifiedName of the dataInsightChart
dataInsightChart: values.dataInsightChart,
description,
name: kebabCase(`${values.displayName} ${selectedMetric?.name}`),
@ -256,10 +255,10 @@ const AddKPIPage = () => {
data-testid="dataInsightChart"
notFoundContent={t('message.all-charts-are-mapped')}
placeholder={t('label.select-a-chart')}
value={selectedChart?.id}
value={selectedChart?.fullyQualifiedName}
onChange={handleChartSelect}>
{chartOptions.map((chart) => (
<Option key={chart.id}>
<Option key={chart.fullyQualifiedName}>
{chart.displayName || chart.name}
</Option>
))}