Skip to content

Commit

Permalink
🐛 Fix/non markdown text area not clean (argilla-io#3775)
Browse files Browse the repository at this point in the history
If the record has text area with non markdown, sometimes when the user
wants to clear the record that text area doesn't clear

---------

Co-authored-by: keithCuniah <[email protected]>
  • Loading branch information
damianpumar and keithCuniah committed Sep 15, 2023
1 parent 670e658 commit 02b2d61
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ These are the section headers that we use:

### Fixed

- Fixed `remove user modification in text component on clear answers` ([#3775](https://github.com/argilla-io/argilla/pull/3775))
- Fixed `Highlight raw text field in dataset feedback task` ([#3731](https://github.com/argilla-io/argilla/pull/3731))
- Fixed `Field title too long` ([#3734](https://github.com/argilla-io/argilla/pull/3734))
- Fixed error messages when deleting a `DatasetForTextClassification` ([#3652](https://github.com/argilla-io/argilla/pull/3652))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const useQuestionFormViewModel = () => {

const discard = (record: Record) => {
debounceForAutoSave.stop();
beforeUnload.destroy();

queue.enqueue(() => {
return discardUseCase.execute(record);
Expand All @@ -31,6 +32,7 @@ export const useQuestionFormViewModel = () => {

const submit = (record: Record) => {
debounceForAutoSave.stop();
beforeUnload.destroy();

queue.enqueue(() => {
return submitUseCase.execute(record);
Expand All @@ -39,6 +41,7 @@ export const useQuestionFormViewModel = () => {

const clear = (record: Record) => {
debounceForAutoSave.stop();
beforeUnload.destroy();

queue.enqueue(() => {
return clearUseCase.execute(record);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ export default {
reset() {
this.currentValue = this.value;
this.sanitizedCurrentValue = " ";
this.sanitizedCurrentValue = this.currentValue;
this.$nextTick(() => {
this.sanitizedCurrentValue = this.currentValue;
});
},
exitEditionMode() {
this.$refs.text.blur();
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
10 changes: 1 addition & 9 deletions frontend/e2e/annotation-mode-page/annotation-mode.page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,9 @@ test.describe("Annotate page", () => {
test("clear all questions", async ({ page }) => {
await goToAnnotationPage(page);

await page.getByRole("button", { name: "Clear" }).click();

await expect(page).toHaveScreenshot();

await page
.getByText("Review Rating", { exact: true })
.scrollIntoViewIfNeeded();

await expect(page).toHaveScreenshot();

await page.getByText("Ranking", { exact: true }).scrollIntoViewIfNeeded();
await page.getByRole("button", { name: "Clear" }).click();

await expect(page).toHaveScreenshot();
});
Expand Down

0 comments on commit 02b2d61

Please sign in to comment.