-
Notifications
You must be signed in to change notification settings - Fork 47
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
feat(web): project recycle bin #1181
Merged
Merged
Changes from 16 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
990a500
initial implemention of recyle bin
mkumbobeaty d788229
Merge branch 'main' of github.com:reearth/reearth-visualizer into fea…
mkumbobeaty 357f863
implement recycle bin page and functionalities
mkumbobeaty bb1c9ad
fix translation
mkumbobeaty ea5cf3d
Merge branch 'main' of github.com:reearth/reearth-visualizer into fea…
mkumbobeaty 7db6db7
exclude deleted project
hexaforce d7bd14c
modify the 'UpdateProject' response
hexaforce 99c912c
modify the 'DeletedProjects' response
hexaforce 5b018e6
update the delete logic
mkumbobeaty 9454c95
Merge branch 'main' of github.com:reearth/reearth-visualizer into fea…
mkumbobeaty 2fd25f2
rename component
mkumbobeaty 1dfdf5e
fix typo
mkumbobeaty 7462265
Merge branch 'main' of github.com:reearth/reearth-visualizer into fea…
mkumbobeaty 75efa5a
fix typo
mkumbobeaty 22eb8ff
improve notifications
mkumbobeaty c1f90b4
remove console
mkumbobeaty d5c1e84
improve recycle bin implemention
mkumbobeaty 7142284
improvement and fix typo
mkumbobeaty 29ab921
update translation
mkumbobeaty d537b61
fix
mkumbobeaty 7e4639a
refactor delete logicd
mkumbobeaty 25059bf
refactor delete logics
mkumbobeaty 6a942f2
Merge branch 'feat/project-recylebin' of github.com:reearth/reearth-v…
mkumbobeaty d448594
Merge branch 'main' of github.com:reearth/reearth-visualizer into fea…
mkumbobeaty b4d23e9
fix translation conflict
mkumbobeaty b7db495
improve publish when project is removed
mkumbobeaty 9b209d0
fix based on comments
mkumbobeaty f9b2362
update the naming
mkumbobeaty 46edbd8
add word consistance
mkumbobeaty 9c4ee8e
Merge branch 'main' of github.com:reearth/reearth-visualizer into fea…
mkumbobeaty ebcef69
Merge branch 'main' of github.com:reearth/reearth-visualizer into fea…
mkumbobeaty 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
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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
68 changes: 68 additions & 0 deletions
68
web/src/beta/features/Dashboard/ContentsContainer/Projects/ProjectDeleteModal.tsx
This file contains 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,68 @@ | ||
import { | ||
Button, | ||
Icon, | ||
Modal, | ||
ModalPanel, | ||
Typography | ||
} from "@reearth/beta/lib/reearth-ui"; | ||
import { useT } from "@reearth/services/i18n"; | ||
import { styled } from "@reearth/services/theme"; | ||
import { FC } from "react"; | ||
|
||
type Props = { | ||
isVisible: boolean; | ||
onClose: () => void; | ||
onProjectDelete: () => void; | ||
}; | ||
const ProjectDeleteModal: FC<Props> = ({ | ||
isVisible, | ||
onClose, | ||
onProjectDelete | ||
}) => { | ||
const t = useT(); | ||
return ( | ||
<Modal size="small" visible={isVisible}> | ||
<ModalPanel | ||
actions={ | ||
<> | ||
<Button size="normal" title="Cancel" onClick={onClose} /> | ||
<Button | ||
size="normal" | ||
title="Remove" | ||
appearance="dangerous" | ||
onClick={onProjectDelete} | ||
/> | ||
</> | ||
} | ||
appearance="simple" | ||
> | ||
<Wrapper> | ||
<WarningIcon icon="warning" /> | ||
<Typography size="body"> | ||
{t("Your project will be move to trash.")} | ||
</Typography> | ||
<Typography size="body"> | ||
{t( | ||
"This means the project will no longer be published. But you can still see and restore you project from recycle bin." | ||
)} | ||
</Typography> | ||
</Wrapper> | ||
</ModalPanel> | ||
</Modal> | ||
); | ||
}; | ||
mkumbobeaty marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
export default ProjectDeleteModal; | ||
|
||
const Wrapper = styled("div")(({ theme }) => ({ | ||
display: "flex", | ||
flexDirection: "column", | ||
padding: theme.spacing.large, | ||
gap: theme.spacing.normal | ||
})); | ||
|
||
const WarningIcon = styled(Icon)(({ theme }) => ({ | ||
width: "24px", | ||
height: "24px", | ||
color: theme.warning.main | ||
})); |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
🛠️ Refactor suggestion
'deleteProject' Mutation Exists and Can Be Utilized
deleteProject
mutation, which can directly mark a project as deleted.deleteProject
function and update its implementation to use thedeleteProject
mutation instead ofupdateProject
.🔗 Analysis chain
Recommendation: Rename 'deleteProject' function for clarity
The
deleteProject
function uses theupdateProject
mutation to mark a project as deleted. Renaming the function to reflect its operation more accurately can improve code readability.Apply this diff to rename the function:
Additionally, if the API supports a dedicated
deleteProject
mutation, consider using it for a more precise operation.To check if a
deleteProject
mutation exists, run the following script:🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 8684