Skip to content

Commit

Permalink
[frontend] change the config name of downloading
Browse files Browse the repository at this point in the history
  • Loading branch information
guzhongren committed Nov 11, 2024
1 parent 3d74e76 commit 76a0b47
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ describe('MetricsStepper', () => {
});

it('should export json when click save button', async () => {
const expectedFileName = 'config';
const expectedFileName = `-Heartbeat`;
const expectedJson = {
board: undefined,
calendarType: Calendar.Regular,
Expand All @@ -345,7 +345,7 @@ describe('MetricsStepper', () => {
});

it('should export json when click save button when pipelineTool, sourceControl, and board is not empty', async () => {
const expectedFileName = 'config';
const expectedFileName = `-Heartbeat`;
const expectedJson = {
board: { boardId: '', email: '', site: '', token: '', type: 'Jira' },
calendarType: Calendar.Regular,
Expand All @@ -363,15 +363,15 @@ describe('MetricsStepper', () => {
};

setup();
await fillMetricsData();
fillMetricsData();

await userEvent.click(screen.getByText(SAVE));

expect(exportToJsonFile).toHaveBeenCalledWith(expectedFileName, expectedJson);
});

it('should export json file when click save button in metrics page given all content is empty', async () => {
const expectedFileName = 'config';
const expectedFileName = 'test-project-Name-Heartbeat';
const expectedJson = {
advancedSettings: null,
assigneeFilter: ASSIGNEE_FILTER_TYPES.LAST_ASSIGNEE,
Expand Down Expand Up @@ -423,7 +423,7 @@ describe('MetricsStepper', () => {
}, 50000);

it('should export json file when click save button in report page given all content is empty', async () => {
const expectedFileName = 'config';
const expectedFileName = 'test-project-Name-Heartbeat';
const expectedJson = {
advancedSettings: null,
assigneeFilter: ASSIGNEE_FILTER_TYPES.LAST_ASSIGNEE,
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/containers/MetricsStepper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ const MetricsStepper = () => {
reworkTimesSettings: importedData.reworkTimesSettings,
};
const jsonData = activeStep === METRICS_STEPS.CONFIG ? configData : { ...configData, ...metricsData };
exportToJsonFile('config', jsonData);
// exportToJsonFile('config', jsonData);
exportToJsonFile(`${config.basic.projectName.split(' ').join('-')}-Heartbeat`, jsonData)

Check failure on line 392 in frontend/src/containers/MetricsStepper/index.tsx

View workflow job for this annotation

GitHub Actions / frontend-check

Insert `;`

Check failure on line 392 in frontend/src/containers/MetricsStepper/index.tsx

View workflow job for this annotation

GitHub Actions / frontend-check

Missing semicolon
};

const handleNext = () => {
Expand Down

0 comments on commit 76a0b47

Please sign in to comment.