Skip to content

Commit

Permalink
fix: make front-end show by default the results for the last 2 months
Browse files Browse the repository at this point in the history
Users seem to find it more useful to see by default the results
for the last 2 months instead of the last release.
  • Loading branch information
sf-v committed Apr 8, 2022
1 parent 6af1872 commit fb6f9ff
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions packages/@best/frontend/server/static/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const buildStaticFrontend = async (results: BenchmarkResultsSnapshot[], g

const options = {
projectNames,
timingOptions: ['all', '2-months', 'last-release'],
timingOptions: ['2-months', 'last-release', 'all'],
config: { apiDatabase: globalConfig.apiDatabase }
}

Expand All @@ -51,4 +51,4 @@ export const buildStaticFrontend = async (results: BenchmarkResultsSnapshot[], g
}

return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default class ComponentBenchmark extends LightningElement {

if (this.element) {
relayout(this.element, this.currentLayout);

// eslint-disable-next-line lwc/no-raf, @lwc/lwc/no-async-operation
window.requestAnimationFrame(() => {
this.updateGraphZoom();
Expand Down Expand Up @@ -141,7 +141,7 @@ export default class ComponentBenchmark extends LightningElement {

rawClickHandler(event) {
const grandParent = event.target.parentElement.parentElement;

if (grandParent !== this.element && this.recentHoverData) {
this.traceClicked();
}
Expand Down Expand Up @@ -199,7 +199,7 @@ export default class ComponentBenchmark extends LightningElement {
this.selectedPoints[idx] = { ...pastPoint, pendingCompare: false };
return false;
}

return true;
})
} else {
Expand All @@ -210,7 +210,7 @@ export default class ComponentBenchmark extends LightningElement {
this.selectedPoints[idx] = { ...pastPoint, hidden: true, pendingCompare: true };
return false;
}

return true;
})
}
Expand Down Expand Up @@ -271,4 +271,4 @@ export default class ComponentBenchmark extends LightningElement {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ export default class ComponentMenubar extends LightningElement {
get timingOptions() {
const items = [
{
title: 'Since Last Release',
id: 'last-release'
}, {
title: 'Past 2 Months',
id: '2-months'
}, {
title: 'Since Last Release',
id: 'last-release'
}, {
title: 'All Time',
id: 'all'
Expand Down Expand Up @@ -95,4 +95,4 @@ export default class ComponentMenubar extends LightningElement {
'xaxis.autorange': true
}))
}
}
}
4 changes: 2 additions & 2 deletions packages/@best/frontend/src/modules/store/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ export async function fetchSnapshots(project, timing) {
const timeParams = timeQuery(project, timing);
const response = await fetch(createURL(`${project.id}/snapshots?${timeParams}`));
const { snapshots } = await response.json();
return snapshots || [];
return snapshots || [];
}

export async function fetchCommitInfo(commit) {
const response = await fetch(createURL(`info/${commit}`));
const { commit: info, error } = await response.json();
return info || { error };
}
}
4 changes: 2 additions & 2 deletions packages/@best/frontend/src/modules/store/store/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function benchmarks(

export function view(
state = {
timing: 'last-release',
timing: '2-months',
benchmark: 'all',
metric: 'all',
zoom: {}, // this goes directly to/from plotly,
Expand Down Expand Up @@ -114,4 +114,4 @@ export function commitInfo(
default:
return state
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default class ViewBenchmarks extends LightningElement {
if (! bench) {
return '';
}

let date;
if (zoom) {
const beginIndex = Math.ceil(zoom[0]);
Expand All @@ -86,7 +86,7 @@ export default class ViewBenchmarks extends LightningElement {
if (! bench) {
return '';
}

let date;
if (zoom) {
const endIndex = Math.floor(zoom[1]);
Expand Down

0 comments on commit fb6f9ff

Please sign in to comment.