From 2a79f8ca412eb39b721c936045b248e77141ed60 Mon Sep 17 00:00:00 2001 From: zhou-yinyuan <147299494+zhou-yinyuan@users.noreply.github.com> Date: Sat, 14 Sep 2024 15:04:16 +0800 Subject: [PATCH] ADM-1006 [frontend]: update the name in for the pipeline and repo in the doar metrics chart page (#1608) * ADM-1006 [frontend]: update the name in for the pipeline and repo in the doar metrics chart page * ADM-1006 [frontend]: fix the mark icon in the date picker in the metrics page * ADM-1006 [frontend]: fix the multiple popup * ADM-1006 [frontend]: fix the bug about retry * ADM-1006 [frontend]: fix the bug not call get repo api when retry * ADM-1006 [frontend]: fix test and test coverage * ADM-1006 [frontend]: fix e2e test * ADM-1006 [frontend]: fix trivy * ADM-1006 [frontend]: fix sonar issues * ADM-1006 [frontend]: fix the gitleaks * ADM-1006 [frontend]: fix the gitleaks * ADM-1006 [frontend]: try to test gitleaks * ADM-1006 [frontend]: try to test gitleaks * ADM-1006 [frontend]: fix gitleaks --- .github/workflows/build-and-deploy.yml | 2 +- .trivyignore | 1 + .../SourceControlConfiguration.test.tsx | 27 ++++-- .../SourceControlMetricSelection.test.tsx | 80 +++++++++++++----- .../__tests__/context/configSlice.test.ts | 7 ++ .../create-new/board-20240812-20240818.csv | 13 ++- .../create-new/board-20240819-20240825.csv | 9 +- .../create-new/board-20240826-20240902.csv | 11 ++- ...for-deployment-board-20240812-20240818.csv | 13 ++- ...for-deployment-board-20240819-20240825.csv | 8 +- ...for-deployment-board-20240826-20240902.csv | 11 ++- .../board-data-with-analysis-board-status.csv | 13 ++- .../PresentationForErrorCases/index.tsx | 2 +- .../SourceControlMetricSelection/index.tsx | 84 +++++++++---------- .../SouceControlConfiguration/index.tsx | 33 +++----- .../ReportStep/DoraMetricsChart/index.tsx | 2 +- frontend/src/context/config/configSlice.ts | 32 ++++--- frontend/src/context/stepper/StepperSlice.tsx | 4 + ...SourceControlConfigurationBranchEffect.tsx | 41 ++++++++- ...etSourceControlConfigurationCrewEffect.tsx | 32 +++++++ ...ControlConfigurationOrganizationEffect.tsx | 35 ++++++++ ...etSourceControlConfigurationRepoEffect.tsx | 44 +++++++++- 22 files changed, 350 insertions(+), 154 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index a3b69d4fe0..fbf4c96ed9 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -47,7 +47,7 @@ jobs: run: | docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \ -v "${PWD}:/path" \ - ghcr.io/gitleaks/gitleaks:latest \ + ghcr.io/gitleaks/gitleaks:v8.18.4 \ detect \ --source="/path" \ -v --redact diff --git a/.trivyignore b/.trivyignore index c615baf61d..c32475be18 100644 --- a/.trivyignore +++ b/.trivyignore @@ -26,3 +26,4 @@ CVE-2023-50387 CVE-2023-50868 CVE-2024-34750 CVE-2024-5171 +CVE-2024-38816 diff --git a/frontend/__tests__/containers/MetricsStep/SourceControlConfiguration/SourceControlConfiguration.test.tsx b/frontend/__tests__/containers/MetricsStep/SourceControlConfiguration/SourceControlConfiguration.test.tsx index b9ec01579e..24e786e28f 100644 --- a/frontend/__tests__/containers/MetricsStep/SourceControlConfiguration/SourceControlConfiguration.test.tsx +++ b/frontend/__tests__/containers/MetricsStep/SourceControlConfiguration/SourceControlConfiguration.test.tsx @@ -251,11 +251,14 @@ describe('SourceControlConfiguration', () => { }); it('should display error UI and retry when get repo failed status returns AllFailedTimeout', async () => { - const getSourceControlRepoInfo = jest.fn(); + const getSourceControlInfo = jest.fn(); mockRepoEffectResponse = { ...mockInitRepoEffectResponse, stepFailedStatus: MetricsDataFailStatus.AllFailedTimeout, - getSourceControlRepoInfo, + }; + mockOrganizationEffectResponse = { + ...mockInitOrganizationEffectResponse, + getSourceControlInfo, }; setup(); @@ -268,15 +271,18 @@ describe('SourceControlConfiguration', () => { await userEvent.click(retryButton); }); - expect(getSourceControlRepoInfo).toHaveBeenCalledTimes(1); + expect(getSourceControlInfo).toHaveBeenCalledTimes(1); }); it('should display error UI and retry when get branch failed status returns AllFailedTimeout', async () => { - const getSourceControlBranchInfo = jest.fn(); + const getSourceControlInfo = jest.fn(); mockBranchEffectResponse = { ...mockInitBranchEffectResponse, stepFailedStatus: MetricsDataFailStatus.AllFailedTimeout, - getSourceControlBranchInfo, + }; + mockOrganizationEffectResponse = { + ...mockInitOrganizationEffectResponse, + getSourceControlInfo, }; setup(); @@ -289,15 +295,18 @@ describe('SourceControlConfiguration', () => { await userEvent.click(retryButton); }); - expect(getSourceControlBranchInfo).toHaveBeenCalledTimes(1); + expect(getSourceControlInfo).toHaveBeenCalledTimes(1); }); it('should display error UI and retry when get crew failed status returns AllFailedTimeout', async () => { - const getSourceControlCrewInfo = jest.fn(); + const getSourceControlInfo = jest.fn(); mockCrewEffectResponse = { ...mockInitCrewEffectResponse, stepFailedStatus: MetricsDataFailStatus.AllFailedTimeout, - getSourceControlCrewInfo, + }; + mockOrganizationEffectResponse = { + ...mockInitOrganizationEffectResponse, + getSourceControlInfo, }; mockSourceControlSettings = [ { id: 0, organization: 'mockOrgName', repo: 'mockRepoName', branches: ['mockBranch1'] }, @@ -314,6 +323,6 @@ describe('SourceControlConfiguration', () => { await userEvent.click(retryButton); }); - expect(getSourceControlCrewInfo).toHaveBeenCalledTimes(1); + expect(getSourceControlInfo).toHaveBeenCalledTimes(1); }); }); diff --git a/frontend/__tests__/containers/MetricsStep/SourceControlConfiguration/SourceControlMetricSelection.test.tsx b/frontend/__tests__/containers/MetricsStep/SourceControlConfiguration/SourceControlMetricSelection.test.tsx index db7e2fff80..7e563f949a 100644 --- a/frontend/__tests__/containers/MetricsStep/SourceControlConfiguration/SourceControlMetricSelection.test.tsx +++ b/frontend/__tests__/containers/MetricsStep/SourceControlConfiguration/SourceControlMetricSelection.test.tsx @@ -13,36 +13,18 @@ const mockInitRepoEffectResponse = { isGetRepo: true, isLoading: false, getSourceControlRepoInfo: jest.fn(), - info: { - code: 200, - data: undefined, - errorTitle: '', - errorMessage: '', - }, stepFailedStatus: MetricsDataFailStatus.NotFailed, }; const mockInitBranchEffectResponse = { isLoading: false, getSourceControlBranchInfo: jest.fn(), isGetBranch: true, - info: { - code: 200, - data: undefined, - errorTitle: '', - errorMessage: '', - }, stepFailedStatus: MetricsDataFailStatus.NotFailed, }; const mockInitCrewEffectResponse = { isLoading: false, getSourceControlCrewInfo: jest.fn(), isGetAllCrews: true, - info: { - code: 200, - data: undefined, - errorTitle: '', - errorMessage: '', - }, stepFailedStatus: MetricsDataFailStatus.NotFailed, }; @@ -93,6 +75,7 @@ jest.mock('@src/context/config/configSlice', () => ({ selectSourceControlOrganizations: jest.fn().mockReturnValue(['mockOrgName', 'mockOrgName1']), selectSourceControlRepos: jest.fn().mockImplementation(() => mockSelectSourceControlRepos), selectSourceControlBranches: jest.fn().mockImplementation(() => mockSelectSourceControlBranches), + selectSourceControlTimes: jest.fn().mockReturnValue([]), selectDateRange: jest.fn().mockReturnValue([ { startDate: '2024-07-31T00:00:00.000+08:00', endDate: '2024-08-02T23:59:59.999+08:00' }, { startDate: '2024-07-15T00:00:00.000+08:00', endDate: '2024-07-28T23:59:59.999+08:00' }, @@ -221,10 +204,69 @@ describe('SourceControlMetricSelection', () => { }); expect(onUpdateSourceControl).toHaveBeenCalledTimes(2); - expect(getSourceControlBranchInfoFunction).toHaveBeenCalledTimes(1); + expect(getSourceControlBranchInfoFunction).toHaveBeenCalledTimes(0); expect(getSourceControlCrewInfoFunction).toHaveBeenCalledTimes(2); }); + it('should update source control when get repo is empty', async () => { + mockSelectSourceControlRepos = []; + setup(); + + await act(async () => { + await userEvent.click(screen.getAllByRole('button', { name: LIST_OPEN })[0]); + }); + const listBox = within(screen.getByRole('listbox')); + await act(async () => { + await userEvent.click(listBox.getByText('mockOrgName1')); + }); + const getSourceControlRepoInfo = jest.fn(); + mockRepoEffectResponse = { + ...mockRepoEffectResponse, + getSourceControlRepoInfo, + }; + + expect(onUpdateSourceControl).toHaveBeenCalledTimes(1); + }); + + it('should update source control when get branch is empty', async () => { + mockSelectSourceControlBranches = []; + setup(); + + await act(async () => { + await userEvent.click(screen.getAllByRole('button', { name: LIST_OPEN })[1]); + }); + const listBox = within(screen.getByRole('listbox')); + await act(async () => { + await userEvent.click(listBox.getByText('mockRepoName1')); + }); + const getSourceControlBranchInfo = jest.fn(); + mockBranchEffectResponse = { + ...mockBranchEffectResponse, + getSourceControlBranchInfo, + }; + + expect(onUpdateSourceControl).toHaveBeenCalledTimes(1); + }); + + it('should update source control when get crew is empty', async () => { + setup(); + + await act(async () => { + await userEvent.click(screen.getAllByRole('button', { name: LIST_OPEN })[2]); + }); + const listBox = within(screen.getByRole('listbox')); + await act(async () => { + await userEvent.click(listBox.getByText('mockBranchName1')); + }); + const getSourceControlCrewInfo = jest.fn(); + mockCrewEffectResponse = { + ...mockCrewEffectResponse, + getSourceControlCrewInfo, + }; + + expect(onUpdateSourceControl).toHaveBeenCalledTimes(1); + }); + it('should add partial failed 4xx notification when any failed status is PartialFailed4xx', async () => { mockCrewEffectResponse = { ...mockCrewEffectResponse, diff --git a/frontend/__tests__/context/configSlice.test.ts b/frontend/__tests__/context/configSlice.test.ts index 81887f7ff4..bf0163442d 100644 --- a/frontend/__tests__/context/configSlice.test.ts +++ b/frontend/__tests__/context/configSlice.test.ts @@ -4,6 +4,7 @@ import configReducer, { selectSourceControlCrews, selectSourceControlOrganizations, selectSourceControlRepos, + selectSourceControlTimes, selectSteps, updateCalendarType, updateDateRange, @@ -474,6 +475,12 @@ describe('select methods', () => { const branches = selectSourceControlBranches(store.getState(), 'test-org1', 'test-repo1'); expect(branches).toEqual(['test-branch1', 'test-branch2']); }); + + it('should get all times when call selectSourceControlTimes function', () => { + const times = selectSourceControlTimes(store.getState(), 'test-org1', 'test-repo1', 'test-branch1'); + expect(times).toEqual(['1-2', '1-3']); + }); + it('should get all crews when call selectSourceControlCrews function', () => { const crews = selectSourceControlCrews(store.getState(), 'test-org1', 'test-repo1', 'test-branch1', 1, 2); expect(crews).toEqual(['test-crew1', 'test-crew2']); diff --git a/frontend/e2e/fixtures/create-new/board-20240812-20240818.csv b/frontend/e2e/fixtures/create-new/board-20240812-20240818.csv index 3dabaf50dd..fd985599c4 100644 --- a/frontend/e2e/fixtures/create-new/board-20240812-20240818.csv +++ b/frontend/e2e/fixtures/create-new/board-20240812-20240818.csv @@ -1,7 +1,6 @@ -"Issue key","Summary","Issue Type","Status","Status Date","Story Points","assignee","Reporter","Project Key","Project Name","Priority","Parent Summary","Sprint","Labels","Cycle Time","Story testing-1","Design","Vulnerability","Flagged","Fix versions","Partner","Time tracking","Story point estimate","QA","Feature/Operation","Story testing-2","Cycle Time / Story Points","Todo Days","Analysis Days","Design Days","In Dev Days","Block Days","Review Days","Waiting For Testing Days","Testing Days","Waiting For Deployment Days","OriginCycleTime: TODO","OriginCycleTime: TESTING","OriginCycleTime: WAIT FOR TEST","OriginCycleTime: DOING","OriginCycleTime: REVIEW","OriginCycleTime: BLOCKED","Rework: total - In dev","Rework: from Block","Rework: from Review","Rework: from Waiting for testing","Rework: from Testing","Rework: from Done" -"ADM-992","[FE] adds ‘story points’ dimension for 'classification' in report page","Story","Done","2024-08-14","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","Medium","Precise on Metrics","Sprint42","","1.96","","","","","","","None","3.0","","","","0.65","14.76","0","0","1.24","0","0","0","0.72","0","14.76","0.72","0","1.24","0","0","0","0","0","0","0","0" -"ADM-966","[FE&BE] export data when user mapped 'Design' & ‘Waiting for deployment' in board mapping","Story","Done","2024-08-13","2.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","Medium","easy to use","Sprint42","","1.95","","","","","","","None","2.0","","","","0.98","42.00","0","0","0.89","0","0.06","0.09","0.91","0","42.00","0.91","0.09","0.89","0.06","0","0","0","0","0","0","0" -"ADM-965","[FE&BE] add a heartbeat state 'Design' &'Waiting for deployment' in board mapping","Story","Done","2024-08-12","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","Medium","easy to use","Sprint42","","1.96","","","","","","","None","3.0","","","","0.65","42.75","0","0","1.05","0","0","0.01","0.90","0","42.75","0.90","0.01","1.05","0","0","0","0","0","0","0","0" -,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -"ADM-999","[FE&BE] support lead time for changes for single data source- case1(metrics)","Story","Blocked","2024-09-06","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 44","","0","","","","","","","None","3.0","","","","0","16.20","0","0","7.93","1.94","0","0.01","1.11","0","16.20","1.11","0.01","7.93","0","1.94",,,,,, -"ADM-1003","[FE&BE]support lead time for changes for single data source- case1(report)","Story","Doing","2024-09-05","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 44","","0","","","","","","","None","3.0","","","","0","15.99","0","0","2.94","0","0","0","0","0","15.99","0","0","2.94","0","0",,,,,, +"Issue key","Summary","Issue Type","Status","Status Date","Story Points","assignee","Reporter","Project Key","Project Name","Priority","Parent Summary","Sprint","Labels","Cycle Time","Story testing-1","Design","Vulnerability","Flagged","Fix versions","Partner","Time tracking","Story point estimate","QA","Feature/Operation","Story testing-2","Cycle Time / Story Points","Todo Days","Analysis Days","Design Days","In Dev Days","Block Days","Review Days","Waiting For Testing Days","Testing Days","Waiting For Deployment Days","OriginCycleTime: TODO","OriginCycleTime: TESTING","OriginCycleTime: WAIT FOR TEST","OriginCycleTime: DOING","OriginCycleTime: REVIEW","Rework: total - In dev","Rework: from Block","Rework: from Review","Rework: from Waiting for testing","Rework: from Testing","Rework: from Done" +"ADM-992","[FE] adds ‘story points’ dimension for 'classification' in report page","Story","Done","2024-08-14","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","Medium","Precise on Metrics","Sprint42","","1.96","","","","","","","None","3.0","","","","0.65","14.76","0","0","1.24","0","0","0","0.72","0","14.76","0.72","0","1.24","0","0","0","0","0","0","0" +"ADM-966","[FE&BE] export data when user mapped 'Design' & ‘Waiting for deployment' in board mapping","Story","Done","2024-08-13","2.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","Medium","easy to use","Sprint42","","1.95","","","","","","","None","2.0","","","","0.98","42.00","0","0","0.89","0","0.06","0.09","0.91","0","42.00","0.91","0.09","0.89","0.06","0","0","0","0","0","0" +"ADM-965","[FE&BE] add a heartbeat state 'Design' &'Waiting for deployment' in board mapping","Story","Done","2024-08-12","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","Medium","easy to use","Sprint42","","1.96","","","","","","","None","3.0","","","","0.65","42.75","0","0","1.05","0","0","0.01","0.90","0","42.75","0.90","0.01","1.05","0","0","0","0","0","0","0" +,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"ADM-1006","[FE]optimize the mark logic on date picker in metrics&report page","Story","Doing","2024-09-13","2.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 44","","0","","","","","","","None","2.0","","","","0","6.94","0","0","0.82","0","0","0","0","0","6.94","0","0","0.82","0",,,,,, diff --git a/frontend/e2e/fixtures/create-new/board-20240819-20240825.csv b/frontend/e2e/fixtures/create-new/board-20240819-20240825.csv index 07f17b5e6b..f34c494dda 100644 --- a/frontend/e2e/fixtures/create-new/board-20240819-20240825.csv +++ b/frontend/e2e/fixtures/create-new/board-20240819-20240825.csv @@ -1,5 +1,4 @@ -"Issue key","Summary","Issue Type","Status","Status Date","Story Points","assignee","Reporter","Project Key","Project Name","Priority","Parent Summary","Sprint","Labels","Cycle Time","Story testing-1","Design","Vulnerability","Flagged","Fix versions","Partner","Time tracking","Story point estimate","QA","Feature/Operation","Story testing-2","Cycle Time / Story Points","Todo Days","Analysis Days","Design Days","In Dev Days","Block Days","Review Days","Waiting For Testing Days","Testing Days","Waiting For Deployment Days","OriginCycleTime: TODO","OriginCycleTime: TESTING","OriginCycleTime: WAIT FOR TEST","OriginCycleTime: DOING","OriginCycleTime: REVIEW","OriginCycleTime: BLOCKED","Rework: total - In dev","Rework: from Block","Rework: from Review","Rework: from Waiting for testing","Rework: from Testing","Rework: from Done" -"ADM-997","[FE] add a mark for new functions (release 1.3.0)","Story","Done","2024-08-19","1.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","Medium","easy to use","Sprint42","","1.98","","","","","","","None","1.0","","","","1.98","10.54","0","0","1.31","0","0","0.65","0.02","0","10.54","0.02","0.65","1.31","0","0","0","0","0","0","0","0" -,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -"ADM-999","[FE&BE] support lead time for changes for single data source- case1(metrics)","Story","Blocked","2024-09-06","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 44","","0","","","","","","","None","3.0","","","","0","16.20","0","0","7.93","1.94","0","0.01","1.11","0","16.20","1.11","0.01","7.93","0","1.94",,,,,, -"ADM-1003","[FE&BE]support lead time for changes for single data source- case1(report)","Story","Doing","2024-09-05","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 44","","0","","","","","","","None","3.0","","","","0","15.99","0","0","2.94","0","0","0","0","0","15.99","0","0","2.94","0","0",,,,,, +"Issue key","Summary","Issue Type","Status","Status Date","Story Points","assignee","Reporter","Project Key","Project Name","Priority","Parent Summary","Sprint","Labels","Cycle Time","Story testing-1","Design","Vulnerability","Flagged","Fix versions","Partner","Time tracking","Story point estimate","QA","Feature/Operation","Story testing-2","Cycle Time / Story Points","Todo Days","Analysis Days","Design Days","In Dev Days","Block Days","Review Days","Waiting For Testing Days","Testing Days","Waiting For Deployment Days","OriginCycleTime: TODO","OriginCycleTime: TESTING","OriginCycleTime: WAIT FOR TEST","OriginCycleTime: DOING","OriginCycleTime: REVIEW","Rework: total - In dev","Rework: from Block","Rework: from Review","Rework: from Waiting for testing","Rework: from Testing","Rework: from Done" +"ADM-997","[FE] add a mark for new functions (release 1.3.0)","Story","Done","2024-08-19","1.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","Medium","easy to use","Sprint42","","1.98","","","","","","","None","1.0","","","","1.98","10.54","0","0","1.31","0","0","0.65","0.02","0","10.54","0.02","0.65","1.31","0","0","0","0","0","0","0" +,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"ADM-1006","[FE]optimize the mark logic on date picker in metrics&report page","Story","Doing","2024-09-13","2.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 44","","0","","","","","","","None","2.0","","","","0","6.94","0","0","0.82","0","0","0","0","0","6.94","0","0","0.82","0",,,,,, diff --git a/frontend/e2e/fixtures/create-new/board-20240826-20240902.csv b/frontend/e2e/fixtures/create-new/board-20240826-20240902.csv index 80351bfcb4..733732eb07 100644 --- a/frontend/e2e/fixtures/create-new/board-20240826-20240902.csv +++ b/frontend/e2e/fixtures/create-new/board-20240826-20240902.csv @@ -1,6 +1,5 @@ -"Issue key","Summary","Issue Type","Status","Status Date","Story Points","assignee","Reporter","Project Key","Project Name","Priority","Parent Summary","Sprint","Labels","Cycle Time","Story testing-1","Design","Vulnerability","Flagged","Fix versions","Partner","Time tracking","Story point estimate","QA","Feature/Operation","Story testing-2","Cycle Time / Story Points","Todo Days","Analysis Days","Design Days","In Dev Days","Block Days","Review Days","Waiting For Testing Days","Testing Days","Waiting For Deployment Days","OriginCycleTime: TODO","OriginCycleTime: TESTING","OriginCycleTime: WAIT FOR TEST","OriginCycleTime: DOING","OriginCycleTime: REVIEW","OriginCycleTime: BLOCKED","Rework: total - In dev","Rework: from Block","Rework: from Review","Rework: from Waiting for testing","Rework: from Testing","Rework: from Done" -"ADM-1001","[BE] spike source control configuration API","Spike","Done","2024-08-26","2.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 43","","3.02","","","","","","","None","2.0","","","","1.51","5.86","0","0","2.99","0","0","0.03","0","0","5.86","0","0.03","2.99","0","0","0","0","0","0","0","0" -"ADM-998","[FE] support lead time for changes for single data source-config page","Story","Done","2024-08-26","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 43","","4.96","","","","","","","None","3.0","","","","1.65","11.00","0","0","2.00","0","0","0","2.96","0","11.00","2.96","0","2.00","0","0","0","0","0","0","0","0" -,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -"ADM-999","[FE&BE] support lead time for changes for single data source- case1(metrics)","Story","Blocked","2024-09-06","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 44","","0","","","","","","","None","3.0","","","","0","16.20","0","0","7.93","1.94","0","0.01","1.11","0","16.20","1.11","0.01","7.93","0","1.94",,,,,, -"ADM-1003","[FE&BE]support lead time for changes for single data source- case1(report)","Story","Doing","2024-09-05","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 44","","0","","","","","","","None","3.0","","","","0","15.99","0","0","2.94","0","0","0","0","0","15.99","0","0","2.94","0","0",,,,,, +"Issue key","Summary","Issue Type","Status","Status Date","Story Points","assignee","Reporter","Project Key","Project Name","Priority","Parent Summary","Sprint","Labels","Cycle Time","Story testing-1","Design","Vulnerability","Flagged","Fix versions","Partner","Time tracking","Story point estimate","QA","Feature/Operation","Story testing-2","Cycle Time / Story Points","Todo Days","Analysis Days","Design Days","In Dev Days","Block Days","Review Days","Waiting For Testing Days","Testing Days","Waiting For Deployment Days","OriginCycleTime: TODO","OriginCycleTime: TESTING","OriginCycleTime: WAIT FOR TEST","OriginCycleTime: DOING","OriginCycleTime: REVIEW","Rework: total - In dev","Rework: from Block","Rework: from Review","Rework: from Waiting for testing","Rework: from Testing","Rework: from Done" +"ADM-1001","[BE] spike source control configuration API","Spike","Done","2024-08-26","2.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 43","","3.02","","","","","","","None","2.0","","","","1.51","5.86","0","0","2.99","0","0","0.03","0","0","5.86","0","0.03","2.99","0","0","0","0","0","0","0" +"ADM-998","[FE] support lead time for changes for single data source-config page","Story","Done","2024-08-26","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 43","","4.96","","","","","","","None","3.0","","","","1.65","11.00","0","0","2.00","0","0","0","2.96","0","11.00","2.96","0","2.00","0","0","0","0","0","0","0" +,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"ADM-1006","[FE]optimize the mark logic on date picker in metrics&report page","Story","Doing","2024-09-13","2.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 44","","0","","","","","","","None","2.0","","","","0","6.94","0","0","0.81","0","0","0","0","0","6.94","0","0","0.81","0",,,,,, diff --git a/frontend/e2e/fixtures/create-new/with-design-and-wait-for-deployment-board-20240812-20240818.csv b/frontend/e2e/fixtures/create-new/with-design-and-wait-for-deployment-board-20240812-20240818.csv index 59f2afb1f1..5a333703ee 100644 --- a/frontend/e2e/fixtures/create-new/with-design-and-wait-for-deployment-board-20240812-20240818.csv +++ b/frontend/e2e/fixtures/create-new/with-design-and-wait-for-deployment-board-20240812-20240818.csv @@ -1,7 +1,6 @@ -"Issue key","Summary","Issue Type","Status","Status Date","Story Points","assignee","Reporter","Project Key","Project Name","Priority","Parent Summary","Sprint","Labels","Cycle Time","Story testing-1","Design","Vulnerability","Flagged","Fix versions","Partner","Time tracking","Story point estimate","QA","Feature/Operation","Story testing-2","Cycle Time / Story Points","Todo Days","Analysis Days","Design Days","In Dev Days","Block Days","Review Days","Waiting For Testing Days","Testing Days","Waiting For Deployment Days","OriginCycleTime: TODO","OriginCycleTime: TESTING","OriginCycleTime: WAIT FOR TEST","OriginCycleTime: DOING","OriginCycleTime: REVIEW","OriginCycleTime: BLOCKED","Rework: total - In dev","Rework: from Block","Rework: from Review","Rework: from Testing","Rework: from Waiting for deployment","Rework: from Done" -"ADM-992","[FE] adds ‘story points’ dimension for 'classification' in report page","Story","Done","2024-08-14","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","Medium","Precise on Metrics","Sprint42","","16.72","","","","","","","None","3.0","","","","5.57","0","0","14.76","1.24","0","0","0","0.72","0","14.76","0.72","0","1.24","0","0","0","0","0","0","0","0" -"ADM-966","[FE&BE] export data when user mapped 'Design' & ‘Waiting for deployment' in board mapping","Story","Done","2024-08-13","2.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","Medium","easy to use","Sprint42","","43.95","","","","","","","None","2.0","","","","21.98","0","0","42.00","0.89","0","0.06","0","0.91","0.09","42.00","0.91","0.09","0.89","0.06","0","0","0","0","0","0","0" -"ADM-965","[FE&BE] add a heartbeat state 'Design' &'Waiting for deployment' in board mapping","Story","Done","2024-08-12","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","Medium","easy to use","Sprint42","","44.71","","","","","","","None","3.0","","","","14.90","0","0","42.75","1.05","0","0","0","0.90","0.01","42.75","0.90","0.01","1.05","0","0","0","0","0","0","0","0" -,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -"ADM-999","[FE&BE] support lead time for changes for single data source- case1(metrics)","Story","Blocked","2024-09-06","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 44","","0","","","","","","","None","3.0","","","","0","0","0","16.20","7.93","1.94","0","0","1.11","0.01","16.20","1.11","0.01","7.93","0","1.94",,,,,, -"ADM-1003","[FE&BE]support lead time for changes for single data source- case1(report)","Story","Doing","2024-09-05","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 44","","0","","","","","","","None","3.0","","","","0","0","0","15.99","2.94","0","0","0","0","0","15.99","0","0","2.94","0","0",,,,,, +"Issue key","Summary","Issue Type","Status","Status Date","Story Points","assignee","Reporter","Project Key","Project Name","Priority","Parent Summary","Sprint","Labels","Cycle Time","Story testing-1","Design","Vulnerability","Flagged","Fix versions","Partner","Time tracking","Story point estimate","QA","Feature/Operation","Story testing-2","Cycle Time / Story Points","Todo Days","Analysis Days","Design Days","In Dev Days","Block Days","Review Days","Waiting For Testing Days","Testing Days","Waiting For Deployment Days","OriginCycleTime: TODO","OriginCycleTime: TESTING","OriginCycleTime: WAIT FOR TEST","OriginCycleTime: DOING","OriginCycleTime: REVIEW","Rework: total - In dev","Rework: from Block","Rework: from Review","Rework: from Testing","Rework: from Waiting for deployment","Rework: from Done" +"ADM-992","[FE] adds ‘story points’ dimension for 'classification' in report page","Story","Done","2024-08-14","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","Medium","Precise on Metrics","Sprint42","","16.72","","","","","","","None","3.0","","","","5.57","0","0","14.76","1.24","0","0","0","0.72","0","14.76","0.72","0","1.24","0","0","0","0","0","0","0" +"ADM-966","[FE&BE] export data when user mapped 'Design' & ‘Waiting for deployment' in board mapping","Story","Done","2024-08-13","2.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","Medium","easy to use","Sprint42","","43.95","","","","","","","None","2.0","","","","21.98","0","0","42.00","0.89","0","0.06","0","0.91","0.09","42.00","0.91","0.09","0.89","0.06","0","0","0","0","0","0" +"ADM-965","[FE&BE] add a heartbeat state 'Design' &'Waiting for deployment' in board mapping","Story","Done","2024-08-12","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","Medium","easy to use","Sprint42","","44.71","","","","","","","None","3.0","","","","14.90","0","0","42.75","1.05","0","0","0","0.90","0.01","42.75","0.90","0.01","1.05","0","0","0","0","0","0","0" +,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"ADM-1006","[FE]optimize the mark logic on date picker in metrics&report page","Story","Doing","2024-09-13","2.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 44","","0","","","","","","","None","2.0","","","","0","0","0","6.94","0.82","0","0","0","0","0","6.94","0","0","0.82","0",,,,,, diff --git a/frontend/e2e/fixtures/create-new/with-design-and-wait-for-deployment-board-20240819-20240825.csv b/frontend/e2e/fixtures/create-new/with-design-and-wait-for-deployment-board-20240819-20240825.csv index e7684d3557..9a0aebf107 100644 --- a/frontend/e2e/fixtures/create-new/with-design-and-wait-for-deployment-board-20240819-20240825.csv +++ b/frontend/e2e/fixtures/create-new/with-design-and-wait-for-deployment-board-20240819-20240825.csv @@ -1,4 +1,4 @@ -"Issue key","Summary","Issue Type","Status","Status Date","Story Points","assignee","Reporter","Project Key","Project Name","Priority","Parent Summary","Sprint","Labels","Cycle Time","Story testing-1","Design","Vulnerability","Flagged","Fix versions","Partner","Time tracking","Story point estimate","QA","Feature/Operation","Story testing-2","Cycle Time / Story Points","Todo Days","Analysis Days","Design Days","In Dev Days","Block Days","Review Days","Waiting For Testing Days","Testing Days","Waiting For Deployment Days","OriginCycleTime: TODO","OriginCycleTime: TESTING","OriginCycleTime: WAIT FOR TEST","OriginCycleTime: DOING","OriginCycleTime: REVIEW","OriginCycleTime: BLOCKED","Rework: total - In dev","Rework: from Block","Rework: from Review","Rework: from Testing","Rework: from Waiting for deployment","Rework: from Done" -"ADM-997","[FE] add a mark for new functions (release 1.3.0)","Story","Done","2024-08-19","1.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","Medium","easy to use","Sprint42","","12.52","","","","","","","None","1.0","","","","12.52","0","0","10.54","1.31","0","0","0","0.02","0.65","10.54","0.02","0.65","1.31","0","0","0","0","0","0","0","0" -,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -"ADM-999","[FE&BE] support lead time for changes for single data source- case1(metrics)","Story","Doing","2024-09-12","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 44","","0","","","","","","","None","3.0","","","","0","0","0","16.20","8.15","3.73","0","0","1.11","0.01","16.20","1.11","0.01","8.15","0","3.73",,,,,, +"Issue key","Summary","Issue Type","Status","Status Date","Story Points","assignee","Reporter","Project Key","Project Name","Priority","Parent Summary","Sprint","Labels","Cycle Time","Story testing-1","Design","Vulnerability","Flagged","Fix versions","Partner","Time tracking","Story point estimate","QA","Feature/Operation","Story testing-2","Cycle Time / Story Points","Todo Days","Analysis Days","Design Days","In Dev Days","Block Days","Review Days","Waiting For Testing Days","Testing Days","Waiting For Deployment Days","OriginCycleTime: TODO","OriginCycleTime: TESTING","OriginCycleTime: WAIT FOR TEST","OriginCycleTime: DOING","OriginCycleTime: REVIEW","Rework: total - In dev","Rework: from Block","Rework: from Review","Rework: from Testing","Rework: from Waiting for deployment","Rework: from Done" +"ADM-997","[FE] add a mark for new functions (release 1.3.0)","Story","Done","2024-08-19","1.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","Medium","easy to use","Sprint42","","12.52","","","","","","","None","1.0","","","","12.52","0","0","10.54","1.31","0","0","0","0.02","0.65","10.54","0.02","0.65","1.31","0","0","0","0","0","0","0" +,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"ADM-1006","[FE]optimize the mark logic on date picker in metrics&report page","Story","Doing","2024-09-13","2.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 44","","0","","","","","","","None","2.0","","","","0","0","0","6.94","0.82","0","0","0","0","0","6.94","0","0","0.82","0",,,,,, diff --git a/frontend/e2e/fixtures/create-new/with-design-and-wait-for-deployment-board-20240826-20240902.csv b/frontend/e2e/fixtures/create-new/with-design-and-wait-for-deployment-board-20240826-20240902.csv index 0a2350623c..ef5634eb43 100644 --- a/frontend/e2e/fixtures/create-new/with-design-and-wait-for-deployment-board-20240826-20240902.csv +++ b/frontend/e2e/fixtures/create-new/with-design-and-wait-for-deployment-board-20240826-20240902.csv @@ -1,6 +1,5 @@ -"Issue key","Summary","Issue Type","Status","Status Date","Story Points","assignee","Reporter","Project Key","Project Name","Priority","Parent Summary","Sprint","Labels","Cycle Time","Story testing-1","Design","Vulnerability","Flagged","Fix versions","Partner","Time tracking","Story point estimate","QA","Feature/Operation","Story testing-2","Cycle Time / Story Points","Todo Days","Analysis Days","Design Days","In Dev Days","Block Days","Review Days","Waiting For Testing Days","Testing Days","Waiting For Deployment Days","OriginCycleTime: TODO","OriginCycleTime: TESTING","OriginCycleTime: WAIT FOR TEST","OriginCycleTime: DOING","OriginCycleTime: REVIEW","OriginCycleTime: BLOCKED","Rework: total - In dev","Rework: from Block","Rework: from Review","Rework: from Testing","Rework: from Waiting for deployment","Rework: from Done" -"ADM-1001","[BE] spike source control configuration API","Spike","Done","2024-08-26","2.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 43","","8.88","","","","","","","None","2.0","","","","4.44","0","0","5.86","2.99","0","0","0","0","0.03","5.86","0","0.03","2.99","0","0","0","0","0","0","0","0" -"ADM-998","[FE] support lead time for changes for single data source-config page","Story","Done","2024-08-26","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 43","","15.96","","","","","","","None","3.0","","","","5.32","0","0","11.00","2.00","0","0","0","2.96","0","11.00","2.96","0","2.00","0","0","0","0","0","0","0","0" -,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -"ADM-999","[FE&BE] support lead time for changes for single data source- case1(metrics)","Story","Blocked","2024-09-06","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 44","","0","","","","","","","None","3.0","","","","0","0","0","16.20","7.93","1.94","0","0","1.11","0.01","16.20","1.11","0.01","7.93","0","1.94",,,,,, -"ADM-1003","[FE&BE]support lead time for changes for single data source- case1(report)","Story","Doing","2024-09-05","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 44","","0","","","","","","","None","3.0","","","","0","0","0","15.99","2.94","0","0","0","0","0","15.99","0","0","2.94","0","0",,,,,, +"Issue key","Summary","Issue Type","Status","Status Date","Story Points","assignee","Reporter","Project Key","Project Name","Priority","Parent Summary","Sprint","Labels","Cycle Time","Story testing-1","Design","Vulnerability","Flagged","Fix versions","Partner","Time tracking","Story point estimate","QA","Feature/Operation","Story testing-2","Cycle Time / Story Points","Todo Days","Analysis Days","Design Days","In Dev Days","Block Days","Review Days","Waiting For Testing Days","Testing Days","Waiting For Deployment Days","OriginCycleTime: TODO","OriginCycleTime: TESTING","OriginCycleTime: WAIT FOR TEST","OriginCycleTime: DOING","OriginCycleTime: REVIEW","Rework: total - In dev","Rework: from Block","Rework: from Review","Rework: from Testing","Rework: from Waiting for deployment","Rework: from Done" +"ADM-1001","[BE] spike source control configuration API","Spike","Done","2024-08-26","2.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 43","","8.88","","","","","","","None","2.0","","","","4.44","0","0","5.86","2.99","0","0","0","0","0.03","5.86","0","0.03","2.99","0","0","0","0","0","0","0" +"ADM-998","[FE] support lead time for changes for single data source-config page","Story","Done","2024-08-26","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 43","","15.96","","","","","","","None","3.0","","","","5.32","0","0","11.00","2.00","0","0","0","2.96","0","11.00","2.96","0","2.00","0","0","0","0","0","0","0" +,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"ADM-1006","[FE]optimize the mark logic on date picker in metrics&report page","Story","Doing","2024-09-13","2.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 44","","0","","","","","","","None","2.0","","","","0","0","0","6.94","0.82","0","0","0","0","0","6.94","0","0","0.82","0",,,,,, diff --git a/frontend/e2e/fixtures/import-file/board-data-with-analysis-board-status.csv b/frontend/e2e/fixtures/import-file/board-data-with-analysis-board-status.csv index 11b3593f46..6b3bd54b56 100644 --- a/frontend/e2e/fixtures/import-file/board-data-with-analysis-board-status.csv +++ b/frontend/e2e/fixtures/import-file/board-data-with-analysis-board-status.csv @@ -1,7 +1,6 @@ -"Issue key","Summary","Issue Type","Status","Status Date","Story Points","assignee","Reporter","Project Key","Project Name","Priority","Parent Summary","Sprint","Labels","Cycle Time","Story testing-1","Design","Vulnerability","Flagged","Fix versions","Partner","Time tracking","Story point estimate","QA","Feature/Operation","Story testing-2","Cycle Time / Story Points","Todo Days","Analysis Days","Design Days","In Dev Days","Block Days","Review Days","Waiting For Testing Days","Testing Days","Waiting For Deployment Days","OriginCycleTime: TODO","OriginCycleTime: TESTING","OriginCycleTime: WAIT FOR TEST","OriginCycleTime: DOING","OriginCycleTime: REVIEW","OriginCycleTime: BLOCKED","Rework: total - In dev","Rework: from Block","Rework: from Review","Rework: from Testing","Rework: from Done" -"ADM-992","[FE] adds ‘story points’ dimension for 'classification' in report page","Story","Done","2024-08-14","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","Medium","Precise on Metrics","Sprint42","","1.96","","","","","","","None","3.0","","","","0.65","14.76","0","0","1.24","0","0","0","0.72","0","14.76","0.72","0","1.24","0","0","0","0","0","0","0" -"ADM-966","[FE&BE] export data when user mapped 'Design' & ‘Waiting for deployment' in board mapping","Story","Done","2024-08-13","2.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","Medium","easy to use","Sprint42","","1.95","","","","","","","None","2.0","","","","0.98","42.00","0.09","0","0.89","0","0.06","0","0.91","0","42.00","0.91","0.09","0.89","0.06","0","0","0","0","0","0" -"ADM-965","[FE&BE] add a heartbeat state 'Design' &'Waiting for deployment' in board mapping","Story","Done","2024-08-12","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","Medium","easy to use","Sprint42","","1.96","","","","","","","None","3.0","","","","0.65","42.75","0.01","0","1.05","0","0","0","0.90","0","42.75","0.90","0.01","1.05","0","0","0","0","0","0","0" -,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -"ADM-999","[FE&BE] support lead time for changes for single data source- case1(metrics)","Story","Blocked","2024-09-06","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 44","","0","","","","","","","None","3.0","","","","0","16.20","0.01","0","7.93","1.95","0","0","1.11","0","16.20","1.11","0.01","7.93","0","1.95",,,,, -"ADM-1003","[FE&BE]support lead time for changes for single data source- case1(report)","Story","Doing","2024-09-05","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 44","","0","","","","","","","None","3.0","","","","0","15.99","0","0","2.95","0","0","0","0","0","15.99","0","0","2.95","0","0",,,,, +"Issue key","Summary","Issue Type","Status","Status Date","Story Points","assignee","Reporter","Project Key","Project Name","Priority","Parent Summary","Sprint","Labels","Cycle Time","Story testing-1","Design","Vulnerability","Flagged","Fix versions","Partner","Time tracking","Story point estimate","QA","Feature/Operation","Story testing-2","Cycle Time / Story Points","Todo Days","Analysis Days","Design Days","In Dev Days","Block Days","Review Days","Waiting For Testing Days","Testing Days","Waiting For Deployment Days","OriginCycleTime: TODO","OriginCycleTime: TESTING","OriginCycleTime: WAIT FOR TEST","OriginCycleTime: DOING","OriginCycleTime: REVIEW","Rework: total - In dev","Rework: from Block","Rework: from Review","Rework: from Testing","Rework: from Done" +"ADM-992","[FE] adds ‘story points’ dimension for 'classification' in report page","Story","Done","2024-08-14","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","Medium","Precise on Metrics","Sprint42","","1.96","","","","","","","None","3.0","","","","0.65","14.76","0","0","1.24","0","0","0","0.72","0","14.76","0.72","0","1.24","0","0","0","0","0","0" +"ADM-966","[FE&BE] export data when user mapped 'Design' & ‘Waiting for deployment' in board mapping","Story","Done","2024-08-13","2.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","Medium","easy to use","Sprint42","","1.95","","","","","","","None","2.0","","","","0.98","42.00","0.09","0","0.89","0","0.06","0","0.91","0","42.00","0.91","0.09","0.89","0.06","0","0","0","0","0" +"ADM-965","[FE&BE] add a heartbeat state 'Design' &'Waiting for deployment' in board mapping","Story","Done","2024-08-12","3.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","Medium","easy to use","Sprint42","","1.96","","","","","","","None","3.0","","","","0.65","42.75","0.01","0","1.05","0","0","0","0.90","0","42.75","0.90","0.01","1.05","0","0","0","0","0","0" +,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"ADM-1006","[FE]optimize the mark logic on date picker in metrics&report page","Story","Doing","2024-09-13","2.0","YinYuan Zhou","Yufan Wang","ADM","Auto Dora Metrics","High","lead time for changes","Sprint 44","","0","","","","","","","None","2.0","","","","0","6.94","0","0","0.81","0","0","0","0","0","6.94","0","0","0.81","0",,,,, diff --git a/frontend/src/components/Metrics/MetricsStep/DeploymentFrequencySettings/PresentationForErrorCases/index.tsx b/frontend/src/components/Metrics/MetricsStep/DeploymentFrequencySettings/PresentationForErrorCases/index.tsx index ae0abb4039..a793fea532 100644 --- a/frontend/src/components/Metrics/MetricsStep/DeploymentFrequencySettings/PresentationForErrorCases/index.tsx +++ b/frontend/src/components/Metrics/MetricsStep/DeploymentFrequencySettings/PresentationForErrorCases/index.tsx @@ -12,7 +12,7 @@ import errorSvg from '@src/assets/PipelineInfoError.svg'; import React, { useCallback } from 'react'; export interface IPresentationForErrorCasesProps { - retry: () => Promise; + retry: () => void; isLoading: boolean; code: number | string | undefined | null; errorTitle: string; diff --git a/frontend/src/containers/MetricsStep/SouceControlConfiguration/SourceControlMetricSelection/index.tsx b/frontend/src/containers/MetricsStep/SouceControlConfiguration/SourceControlMetricSelection/index.tsx index 19eecaf124..08eb130f38 100644 --- a/frontend/src/containers/MetricsStep/SouceControlConfiguration/SourceControlMetricSelection/index.tsx +++ b/frontend/src/containers/MetricsStep/SouceControlConfiguration/SourceControlMetricSelection/index.tsx @@ -1,22 +1,22 @@ -import { - ButtonWrapper, - PipelineMetricSelectionWrapper, - RemoveButton, - WarningMessage, -} from '@src/containers/MetricsStep/DeploymentFrequencySettings/PipelineMetricSelection/style'; import { selectDateRange, selectSourceControlBranches, selectSourceControlOrganizations, selectSourceControlRepos, + selectSourceControlTimes, } from '@src/context/config/configSlice'; +import { + ButtonWrapper, + PipelineMetricSelectionWrapper, + RemoveButton, + WarningMessage, +} from '@src/containers/MetricsStep/DeploymentFrequencySettings/PipelineMetricSelection/style'; import { AxiosRequestErrorCode, MESSAGE, SOURCE_CONTROL_CONFIG_TITLE, SOURCE_CONTROL_ERROR_MESSAGE, } from '@src/constants/resources'; -import { IPresentationForErrorCasesProps } from '@src/components/Metrics/MetricsStep/DeploymentFrequencySettings/PresentationForErrorCases'; import { selectSourceControlConfigurationSettings, updateShouldGetSourceControlConfig, @@ -26,6 +26,7 @@ import { useGetSourceControlConfigurationRepoEffect } from '@src/hooks/useGetSou import { useGetSourceControlConfigurationCrewEffect } from '@src/hooks/useGetSourceControlConfigurationCrewEffect'; import { SourceControlBranch } from '@src/containers/MetricsStep/SouceControlConfiguration/SourceControlBranch'; import { SingleSelection } from '@src/containers/MetricsStep/DeploymentFrequencySettings/SingleSelection'; +import { ErrorInfoType } from '@src/containers/MetricsStep/SouceControlConfiguration'; import { addNotification } from '@src/context/notification/NotificationSlice'; import { MetricsDataFailStatus } from '@src/constants/commons'; import { useAppDispatch, useAppSelector } from '@src/hooks'; @@ -42,7 +43,7 @@ interface SourceControlMetricSelectionProps { }; isShowRemoveButton: boolean; onRemoveSourceControl: (id: number) => void; - handleUpdateErrorInfo: (errorInfo: IPresentationForErrorCasesProps) => void; + handleUpdateErrorInfo: (errorInfo: ErrorInfoType) => void; onUpdateSourceControl: (id: number, label: string, value: string | StringConstructor[] | string[]) => void; isDuplicated: boolean; setLoadingCompletedNumber: React.Dispatch>; @@ -96,7 +97,7 @@ export const SourceControlMetricSelection = ({ }; useEffect(() => { - if (isInitialMount.current && !isGetRepo && organization && repoNameOptions.length === 0) { + if (isInitialMount.current && !isGetRepo && organization) { getSourceControlRepoInfo(organization, dateRanges, id); isInitialMount.current = false; } @@ -104,7 +105,7 @@ export const SourceControlMetricSelection = ({ }, [isGetRepo]); useEffect(() => { - if (!isGetBranch && isGetRepo && organization && repo && branchNameOptions.length === 0) { + if (!isGetBranch && isGetRepo && organization && repo) { getSourceControlBranchInfo(organization, repo, id); } // eslint-disable-next-line react-hooks/exhaustive-deps @@ -153,19 +154,6 @@ export const SourceControlMetricSelection = ({ ); } }; - const retry = () => { - if (getRepoFailedStatus === MetricsDataFailStatus.AllFailedTimeout) { - return getSourceControlRepoInfo(organization, dateRanges, id); - } else if (getBranchFailedStatus === MetricsDataFailStatus.AllFailedTimeout) { - return getSourceControlBranchInfo(organization, repo, id); - } else { - return Promise.all( - selectedBranches!.map((it) => getSourceControlCrewInfo(organization, repo, it, dateRanges)), - ).then(() => { - dispatch(updateShouldGetSourceControlConfig(false)); - }); - } - }; const codeFunction = () => { if ( getRepoFailedStatus === MetricsDataFailStatus.AllFailedTimeout || @@ -177,45 +165,51 @@ export const SourceControlMetricSelection = ({ return 404; } }; - if (!isLoading) { + const code = codeFunction(); + const errorInfo: ErrorInfoType = { + code, + errorTitle: SOURCE_CONTROL_CONFIG_TITLE, + errorMessage: SOURCE_CONTROL_ERROR_MESSAGE, + }; + const isError = + getRepoFailedStatus === MetricsDataFailStatus.AllFailedTimeout || + getRepoFailedStatus === MetricsDataFailStatus.AllFailed4xx || + getBranchFailedStatus === MetricsDataFailStatus.AllFailedTimeout || + getBranchFailedStatus === MetricsDataFailStatus.AllFailed4xx || + getCrewFailedStatus === MetricsDataFailStatus.AllFailedTimeout || + getCrewFailedStatus === MetricsDataFailStatus.AllFailed4xx; + if (!isLoading && isGetAllCrews) { popup(); - const code = codeFunction(); - const errorInfo: IPresentationForErrorCasesProps = { - code, - errorTitle: SOURCE_CONTROL_CONFIG_TITLE, - errorMessage: SOURCE_CONTROL_ERROR_MESSAGE, - retry, - isLoading, - }; - const isError = - getRepoFailedStatus === MetricsDataFailStatus.AllFailedTimeout || - getRepoFailedStatus === MetricsDataFailStatus.AllFailed4xx || - getBranchFailedStatus === MetricsDataFailStatus.AllFailedTimeout || - getBranchFailedStatus === MetricsDataFailStatus.AllFailed4xx || - getCrewFailedStatus === MetricsDataFailStatus.AllFailedTimeout || - getCrewFailedStatus === MetricsDataFailStatus.AllFailed4xx; - if (isError) { - handleUpdateErrorInfo(errorInfo); - } + } + if (!isLoading && isError) { + handleUpdateErrorInfo(errorInfo); } // eslint-disable-next-line react-hooks/exhaustive-deps }, [dispatch, getBranchFailedStatus, getCrewFailedStatus, getRepoFailedStatus, isLoading]); const handleOnUpdateOrganization = (id: number, label: string, value: string | []): void => { onUpdateSourceControl(id, label, value); - getSourceControlRepoInfo(value.toString(), dateRanges, id); + const newOrganization = value.toString(); + if (selectSourceControlRepos(storeContext, newOrganization).length === 0) { + getSourceControlRepoInfo(newOrganization, dateRanges, id); + } }; const handleOnUpdateRepo = (id: number, label: string, value: string | []): void => { onUpdateSourceControl(id, label, value); - getSourceControlBranchInfo(organization, value.toString(), id); + const newRepo = value.toString(); + if (selectSourceControlBranches(storeContext, organization, newRepo).length === 0) { + getSourceControlBranchInfo(organization, newRepo, id); + } }; const handleOnUpdateBranches = (id: number, label: string, value: string[]): void => { const branchNeedGetCrews = value.filter((it) => selectedBranches?.every((branch) => branch !== it)); onUpdateSourceControl(id, label, value); Promise.all( - branchNeedGetCrews.map((branch) => getSourceControlCrewInfo(organization, repo, branch, dateRanges)), + branchNeedGetCrews + .filter((branch) => selectSourceControlTimes(storeContext, organization, repo, branch).length === 0) + .map((branch) => getSourceControlCrewInfo(organization, repo, branch, dateRanges)), ).then(() => { dispatch(updateShouldGetSourceControlConfig(false)); }); diff --git a/frontend/src/containers/MetricsStep/SouceControlConfiguration/index.tsx b/frontend/src/containers/MetricsStep/SouceControlConfiguration/index.tsx index f8a7a53655..6fae8c51a1 100644 --- a/frontend/src/containers/MetricsStep/SouceControlConfiguration/index.tsx +++ b/frontend/src/containers/MetricsStep/SouceControlConfiguration/index.tsx @@ -4,10 +4,8 @@ import { selectSourceControlConfigurationSettings, updateSourceControlConfigurationSettings, } from '@src/context/Metrics/metricsSlice'; -import PresentationForErrorCases, { - IPresentationForErrorCasesProps, -} from '@src/components/Metrics/MetricsStep/DeploymentFrequencySettings/PresentationForErrorCases'; import { useGetSourceControlConfigurationOrganizationEffect } from '@src/hooks/useGetSourceControlConfigurationOrganizationEffect'; +import PresentationForErrorCases from '@src/components/Metrics/MetricsStep/DeploymentFrequencySettings/PresentationForErrorCases'; import { SourceControlMetricSelection } from '@src/containers/MetricsStep/SouceControlConfiguration/SourceControlMetricSelection'; import { useMetricsStepValidationCheckContext } from '@src/hooks/useMetricsStepValidationCheckContext'; import { selectDateRange, selectSourceControlCrews } from '@src/context/config/configSlice'; @@ -24,6 +22,12 @@ import { HttpStatusCode } from 'axios'; import { store } from '@src/store'; import dayjs from 'dayjs'; +export interface ErrorInfoType { + code: number | string | undefined | null; + errorTitle: string; + errorMessage: string; +} + export const SourceControlConfiguration = () => { const dispatch = useAppDispatch(); const storeContext = store.getState(); @@ -32,11 +36,7 @@ export const SourceControlConfiguration = () => { const sourceControlConfigurationSettings = useAppSelector(selectSourceControlConfigurationSettings); const { getDuplicatedSourceControlIds } = useMetricsStepValidationCheckContext(); const [loadingCompletedNumber, setLoadingCompletedNumber] = useState(0); - const [errorInfo, setErrorInfo] = useState({ - ...info, - retry: getSourceControlInfo, - isLoading: isLoading, - }); + const [errorInfo, setErrorInfo] = useState(info); const dateRanges = useAppSelector(selectDateRange); const realSourceControlConfigurationSettings = isFirstFetch ? [] : sourceControlConfigurationSettings; const totalSourceControlNumber = realSourceControlConfigurationSettings.length; @@ -70,21 +70,12 @@ export const SourceControlConfiguration = () => { const handleUpdateSourceControl = (id: number, label: string, value: string | StringConstructor[] | string[]) => { dispatch(updateSourceControlConfigurationSettings({ updateId: id, label: label.toLowerCase(), value })); }; - const handleUpdateErrorInfo = (newErrorInfo: IPresentationForErrorCasesProps) => { - const errorInfoList: IPresentationForErrorCasesProps[] = [newErrorInfo, errorInfo].filter( - (it) => it.code !== HttpStatusCode.Ok, - ); - const error = errorInfoList.length === 0 ? newErrorInfo : errorInfoList[0]; - setErrorInfo(error); + const handleUpdateErrorInfo = (newErrorInfo: ErrorInfoType) => { + setErrorInfo(newErrorInfo); }; useEffect(() => { - handleUpdateErrorInfo({ - ...info, - retry: getSourceControlInfo, - isLoading: isLoading, - }); - // eslint-disable-next-line react-hooks/exhaustive-deps + handleUpdateErrorInfo(info); }, [info]); const shouldShowCrews = @@ -96,7 +87,7 @@ export const SourceControlConfiguration = () => { <> {isLoading && } {errorInfo?.code !== HttpStatusCode.Ok ? ( - + ) : ( <> diff --git a/frontend/src/containers/ReportStep/DoraMetricsChart/index.tsx b/frontend/src/containers/ReportStep/DoraMetricsChart/index.tsx index cf2e69c962..dd4f0f4584 100644 --- a/frontend/src/containers/ReportStep/DoraMetricsChart/index.tsx +++ b/frontend/src/containers/ReportStep/DoraMetricsChart/index.tsx @@ -333,7 +333,7 @@ export const DoraMetricsChart = ({ options={pipelineNameOptions} value={selectedPipeline} onUpDatePipeline={(value) => onUpdatePipeline(value)} - title={'Pipeline/Step'} + title={'Pipeline/Repo'} /> diff --git a/frontend/src/context/config/configSlice.ts b/frontend/src/context/config/configSlice.ts index 42c4476fde..4a4d98a003 100644 --- a/frontend/src/context/config/configSlice.ts +++ b/frontend/src/context/config/configSlice.ts @@ -311,6 +311,27 @@ export const selectSourceControlBranches = (state: RootState, organization: stri ), ]; +const getSourceControlTimesInfo = (state: RootState, organization: string, repo: string, branch: string) => { + return state.config.sourceControl.verifiedResponse.repoList.children + .filter((item) => item.name === 'organization') + .filter((item) => item.value === organization) + .flatMap((item) => item.children) + .filter((item) => item.name === 'repo') + .filter((item) => item.value === repo) + .flatMap((item) => item.children) + .filter((item) => item.name === 'branch') + .filter((item) => item.value === branch) + .flatMap((item) => item.children); +}; + +export const selectSourceControlTimes = (state: RootState, organization: string, repo: string, branch: string) => [ + ...new Set( + getSourceControlTimesInfo(state, organization, repo, branch) + .filter((item) => item.name === 'time') + .flatMap((item) => item.value), + ), +]; + export const selectSourceControlCrews = ( state: RootState, organization: string, @@ -320,16 +341,7 @@ export const selectSourceControlCrews = ( endTime: number, ) => [ ...new Set( - state.config.sourceControl.verifiedResponse.repoList.children - .filter((item) => item.name === 'organization') - .filter((item) => item.value === organization) - .flatMap((item) => item.children) - .filter((item) => item.name === 'repo') - .filter((item) => item.value === repo) - .flatMap((item) => item.children) - .filter((item) => item.name === 'branch') - .filter((item) => item.value === branch) - .flatMap((item) => item.children) + getSourceControlTimesInfo(state, organization, repo, branch) .filter((item) => item.name === 'time') .filter((item) => item.value === `${startTime}-${endTime}`) .flatMap((item) => item.children) diff --git a/frontend/src/context/stepper/StepperSlice.tsx b/frontend/src/context/stepper/StepperSlice.tsx index d2879e119d..d91ad48b3f 100644 --- a/frontend/src/context/stepper/StepperSlice.tsx +++ b/frontend/src/context/stepper/StepperSlice.tsx @@ -12,6 +12,10 @@ export interface IMetricsPageLoadingStatus { boardInfo?: LoadingStatus; pipelineInfo?: LoadingStatus; pipelineStep?: LoadingStatus; + sourceControlOrganization?: LoadingStatus; + sourceControlRepo?: LoadingStatus; + sourceControlBranch?: LoadingStatus; + sourceControlCrew?: LoadingStatus; } export interface IReportPageLoadingStatus { diff --git a/frontend/src/hooks/useGetSourceControlConfigurationBranchEffect.tsx b/frontend/src/hooks/useGetSourceControlConfigurationBranchEffect.tsx index 37ac623ad9..2389802dac 100644 --- a/frontend/src/hooks/useGetSourceControlConfigurationBranchEffect.tsx +++ b/frontend/src/hooks/useGetSourceControlConfigurationBranchEffect.tsx @@ -2,11 +2,17 @@ import { selectShouldGetSourceControlConfig, updateSourceControlConfigurationSettingsFirstInto, } from '@src/context/Metrics/metricsSlice'; -import { selectSourceControl, updateSourceControlVerifiedResponse } from '@src/context/config/configSlice'; +import { + selectDateRange, + selectSourceControl, + updateSourceControlVerifiedResponse, +} from '@src/context/config/configSlice'; import { sourceControlClient } from '@src/clients/sourceControl/SourceControlClient'; +import { updateMetricsPageLoadingStatus } from '@src/context/stepper/StepperSlice'; import { useAppDispatch, useAppSelector } from '@src/hooks/index'; import { MetricsDataFailStatus } from '@src/constants/commons'; import { SourceControlTypes } from '@src/constants/resources'; +import { formatDateToTimestampString } from '@src/utils/util'; import { useState } from 'react'; export interface IUseGetSourceControlConfigurationBranchInterface { @@ -22,6 +28,7 @@ export const useGetSourceControlConfigurationBranchEffect = (): IUseGetSourceCon const [isGetBranch, setIsGetBranch] = useState(!shouldGetSourceControlConfig); const restoredSourceControlInfo = useAppSelector(selectSourceControl); const [stepFailedStatus, setStepFailedStatus] = useState(MetricsDataFailStatus.NotFailed); + const dateRangeList = useAppSelector(selectDateRange); function getEnumKeyByEnumValue(enumValue: string): SourceControlTypes { return Object.entries(SourceControlTypes) @@ -37,8 +44,40 @@ export const useGetSourceControlConfigurationBranchEffect = (): IUseGetSourceCon repo: repo, }; setIsLoading(true); + dispatch( + updateMetricsPageLoadingStatus( + dateRangeList.map((it) => { + return { + startDate: formatDateToTimestampString(it.startDate!), + loadingStatus: { + sourceControlBranch: { + isLoading: true, + isLoaded: false, + isLoadedWithError: false, + }, + }, + }; + }), + ), + ); try { sourceControlClient.getBranch(params).then((response) => { + dispatch( + updateMetricsPageLoadingStatus( + dateRangeList.map((it) => { + return { + startDate: formatDateToTimestampString(it.startDate!), + loadingStatus: { + sourceControlBranch: { + isLoading: false, + isLoaded: true, + isLoadedWithError: response.code !== 200, + }, + }, + }; + }), + ), + ); if (response.code === 400) { setStepFailedStatus(MetricsDataFailStatus.AllFailed4xx); } else if (response.code === 200) { diff --git a/frontend/src/hooks/useGetSourceControlConfigurationCrewEffect.tsx b/frontend/src/hooks/useGetSourceControlConfigurationCrewEffect.tsx index 5cffc861fe..231f208ca0 100644 --- a/frontend/src/hooks/useGetSourceControlConfigurationCrewEffect.tsx +++ b/frontend/src/hooks/useGetSourceControlConfigurationCrewEffect.tsx @@ -1,9 +1,11 @@ import { DateRange, selectSourceControl, updateSourceControlVerifiedResponse } from '@src/context/config/configSlice'; import { selectShouldGetSourceControlConfig } from '@src/context/Metrics/metricsSlice'; import { sourceControlClient } from '@src/clients/sourceControl/SourceControlClient'; +import { updateMetricsPageLoadingStatus } from '@src/context/stepper/StepperSlice'; import { FULFILLED, REJECTED, SourceControlTypes } from '@src/constants/resources'; import { useAppDispatch, useAppSelector } from '@src/hooks/index'; import { MetricsDataFailStatus } from '@src/constants/commons'; +import { formatDateToTimestampString } from '@src/utils/util'; import { useState } from 'react'; import dayjs from 'dayjs'; @@ -40,6 +42,22 @@ export const useGetSourceControlConfigurationCrewEffect = (): IUseGetSourceContr dateRanges: DateRange[], ) => { setIsLoading(true); + dispatch( + updateMetricsPageLoadingStatus( + dateRanges.map((it) => { + return { + startDate: formatDateToTimestampString(it.startDate!), + loadingStatus: { + sourceControlCrew: { + isLoading: true, + isLoaded: false, + isLoadedWithError: false, + }, + }, + }; + }), + ), + ); const allCrewsRes = await Promise.allSettled( dateRanges.flatMap((dateRange) => { const params = { @@ -76,6 +94,20 @@ export const useGetSourceControlConfigurationCrewEffect = (): IUseGetSourceContr } allCrewsRes.forEach((response, index) => { + dispatch( + updateMetricsPageLoadingStatus([ + { + startDate: formatDateToTimestampString(dateRanges[index].startDate!), + loadingStatus: { + sourceControlCrew: { + isLoading: false, + isLoaded: true, + isLoadedWithError: response.status !== FULFILLED, + }, + }, + }, + ]), + ); if (response.status === FULFILLED) { setIsGetAllCrews(true); const startTime = dayjs(dateRanges[index].startDate).startOf('date').valueOf(); diff --git a/frontend/src/hooks/useGetSourceControlConfigurationOrganizationEffect.tsx b/frontend/src/hooks/useGetSourceControlConfigurationOrganizationEffect.tsx index 9ea62dbb52..2cae005955 100644 --- a/frontend/src/hooks/useGetSourceControlConfigurationOrganizationEffect.tsx +++ b/frontend/src/hooks/useGetSourceControlConfigurationOrganizationEffect.tsx @@ -1,5 +1,6 @@ import { clearSourceControlVerifiedResponse, + selectDateRange, selectSourceControl, updateSourceControlVerifiedResponse, } from '@src/context/config/configSlice'; @@ -9,9 +10,11 @@ import { } from '@src/context/Metrics/metricsSlice'; import { ISourceControlGetOrganizationResponseDTO } from '@src/clients/sourceControl/dto/response'; import { sourceControlClient } from '@src/clients/sourceControl/SourceControlClient'; +import { updateMetricsPageLoadingStatus } from '@src/context/stepper/StepperSlice'; import { useAppDispatch, useAppSelector } from '@src/hooks/index'; import { useCallback, useEffect, useRef, useState } from 'react'; import { SourceControlTypes } from '@src/constants/resources'; +import { formatDateToTimestampString } from '@src/utils/util'; import { HttpStatusCode } from 'axios'; export interface IUseGetSourceControlConfigurationStateInterface { @@ -35,6 +38,7 @@ export const useGetSourceControlConfigurationOrganizationEffect = const restoredSourceControlInfo = useAppSelector(selectSourceControl); const shouldGetSourceControlConfig = useAppSelector(selectShouldGetSourceControlConfig); const [isFirstFetch, setIsFirstFetch] = useState(shouldGetSourceControlConfig); + const dateRangeList = useAppSelector(selectDateRange); function getEnumKeyByEnumValue(enumValue: string): SourceControlTypes { return Object.entries(SourceControlTypes) @@ -48,6 +52,22 @@ export const useGetSourceControlConfigurationOrganizationEffect = token: restoredSourceControlInfo.token, }; setIsLoading(true); + dispatch( + updateMetricsPageLoadingStatus( + dateRangeList.map((it) => { + return { + startDate: formatDateToTimestampString(it.startDate!), + loadingStatus: { + sourceControlOrganization: { + isLoading: true, + isLoaded: false, + isLoadedWithError: false, + }, + }, + }; + }), + ), + ); try { const response = await sourceControlClient.getOrganization(params); setInfo(response); @@ -65,10 +85,25 @@ export const useGetSourceControlConfigurationOrganizationEffect = }), ); } + dispatch( + updateMetricsPageLoadingStatus( + dateRangeList.map((dateRange) => ({ + startDate: formatDateToTimestampString(dateRange.startDate!), + loadingStatus: { + sourceControlOrganization: { + isLoading: false, + isLoaded: true, + isLoadedWithError: response.code !== HttpStatusCode.Ok, + }, + }, + })), + ), + ); } finally { setIsLoading(false); setIsFirstFetch(false); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [dispatch, restoredSourceControlInfo.token, restoredSourceControlInfo.type]); useEffect(() => { diff --git a/frontend/src/hooks/useGetSourceControlConfigurationRepoEffect.tsx b/frontend/src/hooks/useGetSourceControlConfigurationRepoEffect.tsx index cd8ed53d02..fed2c3daf0 100644 --- a/frontend/src/hooks/useGetSourceControlConfigurationRepoEffect.tsx +++ b/frontend/src/hooks/useGetSourceControlConfigurationRepoEffect.tsx @@ -2,17 +2,23 @@ import { selectShouldGetSourceControlConfig, updateSourceControlConfigurationSettingsFirstInto, } from '@src/context/Metrics/metricsSlice'; -import { DateRange, selectSourceControl, updateSourceControlVerifiedResponse } from '@src/context/config/configSlice'; +import { + DateRangeList, + selectSourceControl, + updateSourceControlVerifiedResponse, +} from '@src/context/config/configSlice'; import { sourceControlClient } from '@src/clients/sourceControl/SourceControlClient'; +import { updateMetricsPageLoadingStatus } from '@src/context/stepper/StepperSlice'; import { FULFILLED, REJECTED, SourceControlTypes } from '@src/constants/resources'; import { useAppDispatch, useAppSelector } from '@src/hooks/index'; import { MetricsDataFailStatus } from '@src/constants/commons'; +import { formatDateToTimestampString } from '@src/utils/util'; import { useState } from 'react'; import dayjs from 'dayjs'; export interface IUseGetSourceControlConfigurationRepoInterface { readonly isLoading: boolean; - readonly getSourceControlRepoInfo: (value: string, dateRanges: DateRange[], id: number) => Promise; + readonly getSourceControlRepoInfo: (value: string, dateRanges: DateRangeList, id: number) => Promise; readonly isGetRepo: boolean; readonly stepFailedStatus: MetricsDataFailStatus; } @@ -31,8 +37,24 @@ export const useGetSourceControlConfigurationRepoEffect = (): IUseGetSourceContr .map((it) => it[1])[0]; } - const getSourceControlRepoInfo = async (organization: string, dateRanges: DateRange[], id: number) => { + const getSourceControlRepoInfo = async (organization: string, dateRanges: DateRangeList, id: number) => { setIsLoading(true); + dispatch( + updateMetricsPageLoadingStatus( + dateRanges.map((it) => { + return { + startDate: formatDateToTimestampString(it.startDate!), + loadingStatus: { + sourceControlRepo: { + isLoading: true, + isLoaded: false, + isLoadedWithError: false, + }, + }, + }; + }), + ), + ); const allRepoRes = await Promise.allSettled( dateRanges.flatMap((dateRange) => { const params = { @@ -66,7 +88,21 @@ export const useGetSourceControlConfigurationRepoEffect = (): IUseGetSourceContr } } - allRepoRes.forEach((response) => { + allRepoRes.forEach((response, index) => { + dispatch( + updateMetricsPageLoadingStatus([ + { + startDate: formatDateToTimestampString(dateRanges[index].startDate!), + loadingStatus: { + sourceControlRepo: { + isLoading: false, + isLoaded: true, + isLoadedWithError: response.status !== FULFILLED, + }, + }, + }, + ]), + ); if (response.status === FULFILLED) { setIsGetRepo(true); dispatch(