Skip to content

Commit

Permalink
Add interop and investigation score to mobile results
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRyanSmith committed Oct 22, 2024
1 parent fa3d19e commit d685387
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
1 change: 1 addition & 0 deletions webapp/components/interop-data-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class InteropDataManager {
this.previousInvestigationTotalScore =
this.#calcInvestigationTotalScore(this.previousInvestigationScores);
}
console.log(this.investigationScores);
if (this.investigationScores) {
this.investigationTotalScore =
this.#calcInvestigationTotalScore(this.investigationScores);
Expand Down
9 changes: 9 additions & 0 deletions webapp/components/interop-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,15 @@ export const interopData = {
'interop-2023-url',
],
'score_as_group': false
},
{
'name': 'Active Investigations',
'rows': [
'Accessibility Testing',
'Mobile Testing',
'WebAssembly Testing'
],
'score_as_group': true
}
],
'mobile_focus_areas': [
Expand Down
12 changes: 5 additions & 7 deletions webapp/components/interop-summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ class InteropSummary extends PolymerElement {
}

const summaryDiv = this.shadowRoot.querySelector('.summary-container');
// Don't display the interop score for Interop 2021 or mobile view.
if (this.year === '2021' || this.isMobileScoresView) {
// Don't display the interop score for Interop 2021.
if (this.year === '2021') {
const interopDiv = this.shadowRoot.querySelector('#interopSummary');
interopDiv.style.display = 'none';
summaryDiv.style.minHeight = '275px';
Expand All @@ -213,7 +213,7 @@ class InteropSummary extends PolymerElement {

shouldDisplayInvestigationNumber() {
const scores = this.dataManager.getYearProp('investigationScores');
return scores !== null && scores !== undefined && !this.isMobileScoresView;
return scores !== null && scores !== undefined;
}

// roundScore defines the rounding rules for the top-level scores.
Expand Down Expand Up @@ -252,10 +252,8 @@ class InteropSummary extends PolymerElement {
(this.isMobileScoresView && scoreElements.length !== scores.length + 1)) {
return;
}
if (!this.isMobileScoresView) {
// Update interop summary number first.
this.updateSummaryScore(scoreElements[0], scores[scores.length - 1][summaryFeatureName]);
}
// Update interop summary number first.
this.updateSummaryScore(scoreElements[0], scores[scores.length - 1][summaryFeatureName]);
// Update the rest of the browser scores.
for (let i = 1; i < scores.length; i++) {
this.updateSummaryScore(scoreElements[i], scores[i - 1][summaryFeatureName]);
Expand Down
9 changes: 9 additions & 0 deletions webapp/static/interop-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,15 @@
"interop-2023-url"
],
"score_as_group": false
},
{
"name": "Active Investigations",
"rows": [
"Accessibility Testing",
"Mobile Testing",
"WebAssembly Testing"
],
"score_as_group": true
}
],
"mobile_focus_areas": [
Expand Down

0 comments on commit d685387

Please sign in to comment.