Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

feat: OPTIC-2: Save draft on leave #1552

Merged
merged 4 commits into from
Sep 13, 2023
Merged

Conversation

Travis1282
Copy link
Contributor

PR fulfills these requirements

  • Commit message(s) and PR title follows the format [fix|feat|ci|chore|doc]: TICKET-ID: Short description of change made ex. fix: DEV-XXXX: Removed inconsistent code usage causing intermittent errors
  • Tests for the changes have been added/updated (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)
  • Best efforts were made to ensure docs/code are concise and coherent (checked for spelling/grammatical errors, commented out code, debug logs etc.)
  • Self-reviewed and ran all changes on a local instance (for bug fixes/features)

Change has impacts in these area(s)

(check all that apply)

  • Product design
  • Frontend

Describe the reason for change

lost drafts during timeout, no user feedback

What does this fix?

(if this is a bug fix)

What is the new behavior?

saved drafts when user navigates away from annotation page, gives toast feedback

What is the current behavior?

lost drafts during timeout, no user feedback

What libraries were added/updated?

(list all with version changes)

Does this change affect performance?

(if so describe the impacts positive or negative)

Does this change affect security?

(if so describe the impacts positive or negative)

What alternative approaches were there?

(briefly list any if applicable)

What feature flags were used to cover this change?

(briefly list any if applicable)

Does this PR introduce a breaking change?

(check only one)

  • Yes, and covered entirely by feature flag(s)
  • Yes, and covered partially by feature flag(s)
  • No
  • Not sure (briefly explain the situation below)

What level of testing was included in the change?

(check all that apply)

  • e2e
  • integration
  • unit

Which logical domain(s) does this change affect?

(for bug fixes/features, be as precise as possible. ex. Authentication, Annotation History, Review Stream etc.)

@codecov-commenter
Copy link

Codecov Report

Patch coverage is 66.66% of modified lines.

Files Changed Coverage
src/stores/Annotation/Annotation.js 57.14%
src/stores/AppStore.js 100.00%

📢 Thoughts on this report? Let us know!.


return self.store.submitDraft(self, params).then(self.onDraftSaved);
return self.store.submitDraft(self, params).then((res) => {
self.onDraftSaved(res);
Copy link
Contributor

@bmartel bmartel Sep 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do any other callers of saveDraft require that the onDraftSaved callback be the return of the function promise? I noticed we are changing to use the raw result instead so that we can get access to this information, I'm wondering if that might break other usages. Do we know for certain the usages expectation of this return?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to approve this with the caveat that we may have to consider this depending on whether any integration tests fail (and subsequently answer this question for us 😅).

@bmartel
Copy link
Contributor

bmartel commented Sep 13, 2023

/git merge master

Already up-to-date. Nothing to commit.

Workflow run

@Travis1282 Travis1282 merged commit 410981b into master Sep 13, 2023
13 of 14 checks passed
@Travis1282 Travis1282 deleted the fb-optic-2/save-draft-on-leave branch September 13, 2023 20:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants