2023-09-08 23:51:59 +08:00
|
|
|
import { v4 as uuidv4 } from 'uuid';
|
|
|
|
|
|
|
|
import { getScenarioContext } from '../support/scenarioContext';
|
|
|
|
|
|
|
|
import { configurePanel, PartialAddPanelConfig } from './configurePanel';
|
|
|
|
|
|
|
|
export const addPanel = (config?: Partial<PartialAddPanelConfig>) =>
|
2023-09-22 22:06:49 +08:00
|
|
|
getScenarioContext().then(({ lastAddedDataSource }) =>
|
2023-09-08 23:51:59 +08:00
|
|
|
configurePanel({
|
|
|
|
dataSourceName: lastAddedDataSource,
|
|
|
|
panelTitle: `e2e-${uuidv4()}`,
|
|
|
|
...config,
|
|
|
|
isEdit: false,
|
|
|
|
})
|
|
|
|
);
|