add best text & screenshot match sorting options (#1726)

This commit is contained in:
Emma Segal-Grossman 2024-04-22 20:53:17 -04:00 committed by GitHub
parent 7871d30ba1
commit 1f59c0b452
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -197,7 +197,7 @@ export class PageList extends TailwindElement {
label=${msg("Sort by:")} label=${msg("Sort by:")}
size="small" size="small"
pill pill
value="screenshotMatch" value="worstScreenshotMatch"
@sl-change=${(e: Event) => { @sl-change=${(e: Event) => {
const { value } = e.target as SlSelect; const { value } = e.target as SlSelect;
const detail: QaSortChangeDetail = { const detail: QaSortChangeDetail = {
@ -205,11 +205,19 @@ export class PageList extends TailwindElement {
sortDirection: this.orderBy.direction === "asc" ? 1 : -1, sortDirection: this.orderBy.direction === "asc" ? 1 : -1,
}; };
switch (value) { switch (value) {
case "screenshotMatch": case "bestScreenshotMatch":
detail.sortBy = "screenshotMatch";
detail.sortDirection = -1;
break;
case "worstScreenshotMatch":
detail.sortBy = "screenshotMatch"; detail.sortBy = "screenshotMatch";
detail.sortDirection = 1; detail.sortDirection = 1;
break; break;
case "textMatch": case "bestTextMatch":
detail.sortBy = "textMatch";
detail.sortDirection = -1;
break;
case "worstTextMatch":
detail.sortBy = "textMatch"; detail.sortBy = "textMatch";
detail.sortDirection = 1; detail.sortDirection = 1;
break; break;
@ -243,10 +251,16 @@ export class PageList extends TailwindElement {
); );
}} }}
> >
<sl-option value="screenshotMatch" <sl-option value="bestScreenshotMatch"
>${msg("Best Screenshot Match")}</sl-option
>
<sl-option value="worstScreenshotMatch"
>${msg("Worst Screenshot Match")}</sl-option >${msg("Worst Screenshot Match")}</sl-option
> >
<sl-option value="textMatch" <sl-option value="bestTextMatch"
>${msg("Best Extracted Text Match")}</sl-option
>
<sl-option value="worstTextMatch"
>${msg("Worst Extracted Text Match")}</sl-option >${msg("Worst Extracted Text Match")}</sl-option
> >
<sl-option value="comments">${msg("Most Comments")}</sl-option> <sl-option value="comments">${msg("Most Comments")}</sl-option>