Skip to content

Commit 4526fbc

Browse files
authored
UI adjustments for MissingOneImplFeatureList (#1304)
* UI adjustments for MissingOneImplFeatureList * ignore prettier due to test assertion issues * Address comments
1 parent fe17cc0 commit 4526fbc

File tree

2 files changed

+28
-21
lines changed

2 files changed

+28
-21
lines changed

frontend/src/static/js/components/test/webstatus-stats-missing-one-impl-chart-panel.test.ts

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -229,16 +229,14 @@ describe('WebstatusStatsMissingOneImplChartPanel', () => {
229229
'#missing-one-implementation-list-header',
230230
);
231231
expect(header).to.exist;
232-
// Note: \n before chrome due to a complaint from lint in the html.
233-
expect(header!.textContent?.trim()).to.contain(
234-
'The missing feature IDs on 2024-01-01 for\n chrome',
235-
);
236-
237-
const anchor = header!.querySelector('a');
238-
expect(anchor).to.exist;
239-
expect(anchor?.getAttribute('href')).to.equal(
240-
'/?q=id%3Acss+OR+id%3Ahtml+OR+id%3Ajs+OR+id%3Abluetooth',
241-
);
232+
const expectedHeader = `
233+
<div slot="header" id="missing-one-implementation-list-header">
234+
The missing feature IDs on 2024-01-01 for
235+
Chrome:
236+
<a target="_blank" href="/?q=id%3Acss+OR+id%3Ahtml+OR+id%3Ajs+OR+id%3Abluetooth">4 features</a>
237+
</div>
238+
`;
239+
expect(header).dom.to.equal(expectedHeader);
242240

243241
const table = el.shadowRoot!.querySelector('.missing-features-table');
244242
expect(table).to.exist;
@@ -288,10 +286,13 @@ describe('WebstatusStatsMissingOneImplChartPanel', () => {
288286
'#missing-one-implementation-list-header',
289287
);
290288
expect(header).to.exist;
291-
// Note: \n before chrome due to a complaint from lint in the html.
292-
expect(header!.textContent?.trim()).to.contain(
293-
'No missing features for on 2024-01-01 for\n chrome',
294-
);
289+
const expectedHeader = `
290+
<div slot="header" id="missing-one-implementation-list-header">
291+
No missing features for on 2024-01-01 for
292+
Chrome
293+
</div>
294+
`;
295+
expect(header).dom.to.equal(expectedHeader);
295296

296297
const table = el.shadowRoot!.querySelector('.missing-features-table');
297298
expect(table).to.not.exist;

frontend/src/static/js/components/webstatus-stats-missing-one-impl-chart-panel.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ export class WebstatusStatsMissingOneImplChartPanel extends WebstatusLineChartPa
5959
overflow-x: auto;
6060
white-space: nowrap;
6161
}
62+
.missing-feature-id-link {
63+
padding-right: 1em;
64+
}
6265
`,
6366
];
6467
}
@@ -167,7 +170,7 @@ export class WebstatusStatsMissingOneImplChartPanel extends WebstatusLineChartPa
167170
);
168171
this.missingFeaturesList = features;
169172
this.selectedDate = targetDate.toISOString().substring(0, 10);
170-
this.selectedBrowser = targetBrowser;
173+
this.selectedBrowser = label;
171174
this.updateFeatureListHref(features);
172175
return features;
173176
},
@@ -187,16 +190,17 @@ export class WebstatusStatsMissingOneImplChartPanel extends WebstatusLineChartPa
187190
if (this.missingFeaturesList.length === 0) {
188191
return html`<div slot="header" id="${this.getPanelID()}-list-header">
189192
No missing features for on ${this.selectedDate} for
190-
${this.selectedBrowser}:
193+
${this.selectedBrowser}
191194
</div> `;
192195
}
193196

194197
return html`
195198
<div slot="header" id="${this.getPanelID()}-list-header">
196-
<a href="${this.featureListHref}" target="_blank">
197-
The missing feature IDs on ${this.selectedDate} for
198-
${this.selectedBrowser}
199-
</a>
199+
The missing feature IDs on ${this.selectedDate} for
200+
${this.selectedBrowser}:
201+
<a href="${this.featureListHref}" target="_blank"
202+
>${this.missingFeaturesList.length} features</a
203+
>
200204
</div>
201205
${this.renderMissingFeaturesTable()}
202206
`;
@@ -225,7 +229,9 @@ export class WebstatusStatsMissingOneImplChartPanel extends WebstatusLineChartPa
225229
const feature_id = this.missingFeaturesList[featureIndex].feature_id;
226230
cells.push(
227231
html` <td>
228-
<a href="/features/${feature_id}">${feature_id}</a>
232+
<a href="/features/${feature_id}" class="missing-feature-id-link"
233+
>${feature_id}</a
234+
>
229235
</td>`,
230236
);
231237
} else {

0 commit comments

Comments
 (0)