website: Support new widget types for labelling (#966)

* website: Support new widget types for labelling

Adds proper support for yes/no spam style questions as well as a simple interface for flag style labels.

Also cleaned up the Task component to fix some rerender issues.

* website: Fix some UI text, adjust yes/no button alignment

* website: Remove left over console.log

Co-authored-by: notmd <33456881+notmd@users.noreply.github.com>

---------

Co-authored-by: notmd <33456881+notmd@users.noreply.github.com>
This commit is contained in:
Adrian Cowan
2023-01-28 17:07:43 +01:00
committed by GitHub
co-authored by notmd
parent 314c590dd2
commit ab4dce3f60
21 changed files with 504 additions and 353 deletions
@@ -11,6 +11,10 @@ describe("labeling assistant replies", () => {
// For specific task pages the no task available result is normal.
if (type === undefined) return;
cy.get('[data-cy="label-question"]').each((label) => {
// Click the no button, this generally approves the spam check
cy.wrap(label).find('[data-cy="no"]').click();
});
cy.get('[data-cy="label-options"]').each((label) => {
// Click the 4th option
cy.wrap(label).find('[data-cy="radio-option"]').eq(3).click();
@@ -11,6 +11,10 @@ describe("labeling initial prompts", () => {
// For specific task pages the no task available result is normal.
if (type === undefined) return;
cy.get('[data-cy="label-question"]').each((label) => {
// Click the no button, this generally approves the spam check
cy.wrap(label).find('[data-cy="no"]').click();
});
cy.get('[data-cy="label-options"]').each((label) => {
// Click the 4th option
cy.wrap(label).find('[data-cy="radio-option"]').eq(3).click();
@@ -11,6 +11,10 @@ describe("labeling prompter replies", () => {
// For specific task pages the no task available result is normal.
if (type === undefined) return;
cy.get('[data-cy="label-question"]').each((label) => {
// Click the no button, this generally approves the spam check
cy.wrap(label).find('[data-cy="no"]').click();
});
cy.get('[data-cy="label-options"]').each((label) => {
// Click the 4th option
cy.wrap(label).find('[data-cy="radio-option"]').eq(3).click();
+4 -9
View File
@@ -44,6 +44,10 @@ describe("handles random tasks", () => {
break;
}
case "label-task": {
cy.get('[data-cy="label-question"]').each((label) => {
// Click the no button, this generally approves the spam check
cy.wrap(label).find('[data-cy="no"]').click();
});
cy.get('[data-cy="label-options"]').each((label) => {
// Click the 4th option
cy.wrap(label).find('[data-cy="radio-option"]').eq(3).click();
@@ -55,15 +59,6 @@ describe("handles random tasks", () => {
break;
}
case "spam-task": {
cy.get('[data-cy="not-spam-button"]').click();
cy.get('[data-cy="review"]').click();
cy.get('[data-cy="submit"]').click();
break;
}
case undefined: {
throw new Error("No tasks available, but at least create initial prompt expected");
}