-
Notifications
You must be signed in to change notification settings - Fork 11
feat: APP-799 support for data post multi-user editing #2793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b0df5cb
feat: add post edited modal and submit logic
blushi 6e955b6
fix: modal displayed twice
blushi 9b15254
fix: time comparison and locales
blushi 675615b
fix: add missing updatedAt
blushi 7743a5c
chore: use save when saving draft
blushi fb92417
chore: review comments
blushi 15c448c
fix: post card badge position
blushi e546b10
feat: handle deleted post
blushi 650221b
fix: add missing file
blushi 4c92888
chore: rename state var
blushi 2ea4f12
fix: getPostsQuery initialParams
blushi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
web-marketplace/src/components/organisms/PostFlow/PostFlow.DeletedDraftModal.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| import { msg } from '@lingui/core/macro'; | ||
| import { useLingui } from '@lingui/react'; | ||
| import { Trans } from '@lingui/react/macro'; | ||
|
|
||
| import { RegenModalProps } from 'web-components/src/components/modal'; | ||
| import { SadBeeModal } from 'web-components/src/components/modal/SadBeeModal/SadBeeModal'; | ||
| import { CancelButtonFooter } from 'web-components/src/components/organisms/CancelButtonFooter/CancelButtonFooter'; | ||
| import { Body, Title } from 'web-components/src/components/typography'; | ||
|
|
||
| type DeletedDraftModalProps = { | ||
| onCancel: () => void; | ||
| onSubmit: () => void; | ||
| shouldSaveDraft: boolean; | ||
| } & RegenModalProps; | ||
|
|
||
| export const DeletedDraftModal = ({ | ||
| onCancel, | ||
| onSubmit, | ||
| open, | ||
| onClose, | ||
| shouldSaveDraft, | ||
| }: DeletedDraftModalProps) => { | ||
| const { _ } = useLingui(); | ||
| return ( | ||
| <SadBeeModal open={open} onClose={onClose}> | ||
| <Title variant="h4" className="text-center my-20"> | ||
| <Trans>Another user deleted this draft.</Trans> | ||
| <br /> | ||
| {shouldSaveDraft ? ( | ||
| <Trans>Restore and save your version?</Trans> | ||
| ) : ( | ||
| <Trans>Restore and publish your version?</Trans> | ||
| )} | ||
| </Title> | ||
| <Body size="lg" className="text-center mb-50"> | ||
| {shouldSaveDraft ? ( | ||
| <Trans>Save to keep your changes.</Trans> | ||
| ) : ( | ||
| <Trans>Publish to keep your changes.</Trans> | ||
| )} | ||
| </Body> | ||
| <CancelButtonFooter | ||
| label={shouldSaveDraft ? _(msg`save`) : _(msg`publish`)} | ||
| onCancel={onCancel} | ||
| onClick={onSubmit} | ||
| /> | ||
| </SadBeeModal> | ||
| ); | ||
| }; |
45 changes: 45 additions & 0 deletions
45
web-marketplace/src/components/organisms/PostFlow/PostFlow.EditedDraftModal.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import { msg } from '@lingui/core/macro'; | ||
| import { useLingui } from '@lingui/react'; | ||
| import { Trans } from '@lingui/react/macro'; | ||
|
|
||
| import { RegenModalProps } from 'web-components/src/components/modal'; | ||
| import { SadBeeModal } from 'web-components/src/components/modal/SadBeeModal/SadBeeModal'; | ||
| import { CancelButtonFooter } from 'web-components/src/components/organisms/CancelButtonFooter/CancelButtonFooter'; | ||
| import { Body, Title } from 'web-components/src/components/typography'; | ||
|
|
||
| type EditedDraftModalProps = { | ||
| onCancel: () => void; | ||
| onSubmit: () => void; | ||
| shouldSaveDraft: boolean; | ||
| } & RegenModalProps; | ||
|
|
||
| export const EditedDraftModal = ({ | ||
| onCancel, | ||
| onSubmit, | ||
| open, | ||
| onClose, | ||
| shouldSaveDraft, | ||
| }: EditedDraftModalProps) => { | ||
| const { _ } = useLingui(); | ||
| return ( | ||
| <SadBeeModal open={open} onClose={onClose}> | ||
| <Title variant="h4" className="text-center my-20"> | ||
| <Trans> | ||
| Someone made changes to this draft while you were editing. | ||
| </Trans> | ||
| </Title> | ||
| <Body size="lg" className="text-center mb-50"> | ||
| <Trans>You will overwrite their changes if you continue.</Trans> | ||
| </Body> | ||
| <CancelButtonFooter | ||
| label={ | ||
| shouldSaveDraft | ||
| ? _(msg`overwrite & save`) | ||
| : _(msg`overwrite & publish`) | ||
| } | ||
| onCancel={onCancel} | ||
| onClick={onSubmit} | ||
| /> | ||
| </SadBeeModal> | ||
| ); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.