-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add optimise timeline feature #2180
Merged
Merged
Changes from 16 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
ec60570
add optimise timeline feature
jonasongg b814317
change v if for date-indicators
jonasongg 8e943b7
add null checks for optimised date
jonasongg 7c6ed99
add tests for optimise timeline feature
jonasongg f6d754c
fix test failing on github
jonasongg e1d9a06
make date indicators grey
jonasongg 8b5fc11
Merge remote-tracking branch 'upstream/master' into add-optimise-time…
jonasongg 755fde6
reduce complexity of total calculation for optimise timeline
jonasongg b1b64ff
add change url when optimise timeline is checked
jonasongg 50a0ce9
fix lint
jonasongg fe97bf4
Merge remote-tracking branch 'upstream/master' into add-optimise-time…
jonasongg 30dbef1
add optimiseTimeline to data return type
jonasongg 0d4f5bb
Merge branch 'master' into add-optimise-timeline
jonasongg b7cdf85
fix data return type for c-ramp
jonasongg e47e8b0
Merge branch 'master' into add-optimise-timeline
jonasongg f3c19d4
Merge branch 'master' into add-optimise-timeline
ckcherry23 15c6bfa
fix optimise timeline when zoom subrange
jonasongg cb7faef
fix typo
jonasongg 67acd87
fix optimised timeline not showing on zoom panel
jonasongg 0fa2043
simplify logic
jonasongg 14adcad
remove whitespace
jonasongg 0d158b6
Merge branch 'master' into add-optimise-timeline
jonasongg c96ea51
fix zoom chart not working with optimise timeline
jonasongg 90345e6
Merge remote-tracking branch 'refs/remotes/origin/add-optimise-timeli…
jonasongg 500d8c9
refactor getSlicePos function
jonasongg 6f429c9
fix getCommitPos for optimise timeline
jonasongg 850a4d9
fix lint
jonasongg 2f39383
fix lint again
jonasongg c080688
reduce code dupe in openTabZoomSubrange
jonasongg 595883f
update ug for trim timeline
jonasongg 4f8de1f
fix zoom subrange optimise timeline
jonasongg 3b65d51
fix failing cypress
jonasongg 5c8411c
fix cypress
jonasongg 27d62ae
remove unnecessary prop passing
jonasongg 6ab4714
fix tab zoom for optimise timeline
jonasongg 4fe7575
refactor optimise min max date type
jonasongg 45a2a6d
fix lint
jonasongg dacab6a
fix double braces
jonasongg 819ab1d
fix optimisetimeline cypress test
jonasongg dbfcadb
Merge remote-tracking branch 'upstream/master' into add-optimise-time…
jonasongg cf282bd
Merge remote-tracking branch 'refs/remotes/upstream/add-optimise-time…
jonasongg cc52381
fix lint
jonasongg 4fe8177
remove whitespace
jonasongg 62a7854
add cypress for zoom and optimise timeline
jonasongg 6324e9c
fix cypress
jonasongg d5125c3
fix lint
jonasongg 77a3792
uncomment cypress test
jonasongg a97aa60
add comments
jonasongg faad1cc
add comments
ckcherry23 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
83 changes: 83 additions & 0 deletions
83
frontend/cypress/tests/chartView/chartView_optimiseTimeline.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
describe('optimise timeline', () => { | ||
it('ramp padding should only exist when optimise timeline is checked', () => { | ||
cy.get('#summary label.optimise-timeline > input:visible') | ||
.should('be.visible') | ||
.uncheck() | ||
.should('be.not.checked'); | ||
|
||
cy.get('#summary-charts .summary-chart') | ||
.first() | ||
.find('.summary-chart__ramp .ramp .ramp-padding') | ||
.should('have.css', 'left', '0px'); | ||
|
||
cy.get('#summary label.optimise-timeline > input:visible') | ||
.should('be.visible') | ||
.check() | ||
.should('be.checked'); | ||
|
||
cy.get('#summary-charts .summary-chart') | ||
.first() | ||
.find('.summary-chart__ramp .ramp .ramp-padding') | ||
.should('have.not.css', 'left', '0px'); | ||
}); | ||
|
||
it('should retain the same number of ramp slices', () => { | ||
cy.get('#summary-charts .summary-chart') | ||
.first() | ||
.find('.summary-chart__ramp .ramp .ramp-padding a') | ||
.then(($el) => { | ||
const rampSlices = $el.length; | ||
|
||
cy.get('#summary label.optimise-timeline > input:visible') | ||
.should('be.visible') | ||
.check() | ||
.should('be.checked'); | ||
|
||
cy.get('#summary-charts .summary-chart') | ||
.first() | ||
.find('.summary-chart__ramp .ramp .ramp-padding a') | ||
.should('have.length', rampSlices); | ||
}); | ||
}); | ||
|
||
it('start and end date indicators should exist', () => { | ||
cy.get('#summary label.optimise-timeline > input:visible') | ||
.should('be.visible') | ||
.check() | ||
.should('be.checked'); | ||
|
||
cy.get('#summary-charts .summary-chart') | ||
.first() | ||
.find('.summary-chart__ramp .date-indicators span') | ||
.first() | ||
.should('have.text', '5/3/2018'); | ||
|
||
cy.get('#summary-charts .summary-chart') | ||
.first() | ||
.find('.summary-chart__ramp .date-indicators span') | ||
.last() | ||
|
||
// 3/3 on GitHub CI, 3/4 on local | ||
.should('have.text', '3/3/2023'); | ||
}); | ||
|
||
it('no commits in range should not have date indicators', () => { | ||
cy.get('#summary label.optimise-timeline > input:visible') | ||
.should('be.visible') | ||
.check() | ||
.should('be.checked'); | ||
|
||
// change since date | ||
cy.get('input[name="since"]') | ||
.type('2018-12-31'); | ||
|
||
// change until date | ||
cy.get('input[name="until"]') | ||
.type('2019-01-01'); | ||
|
||
cy.get('#summary-charts .summary-chart') | ||
.first() | ||
.find('.summary-chart__ramp .date-indicators') | ||
.should('not.exist'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a Cypress test for whether the optimised timeline feature works with the chart zoom feature? This can be done in
chartView_zoomFeature.cy.js
.