-
Notifications
You must be signed in to change notification settings - Fork 160
Description
Motivation
Adding the ability to choose between duplicating to a new project or the same project provides users with more flexibility and reduces unnecessary project clutter. This enhancement improves the user experience by supporting common workflows where developers need multiple instances of the same service configuration within a single project.
Current Behavior
The project duplication feature only supports creating a new project with the selected services. Users must provide a project name and description, and the duplicated services are always placed in a newly created project. There is no option to duplicate services within the current project.
Reproduction Steps:
- Navigate to a project in the dashboard that contains multiple services (applications, databases, etc.)
- Open the duplicate project dialog
- Select one or more services to duplicate
- Observe that you can only enter a new project name and description
- Complete the duplication process
- Observe that you are redirected to a new project containing the duplicated services
- Note that there is no way to duplicate services into the same project
Expected Behavior
Users should be able to choose whether to duplicate selected services to a new project or to the same project. When duplicating to the same project, service names should be automatically suffixed with "(copy)" to distinguish them from the originals, and the user should remain on the current project page. When duplicating to a new project, the behavior should remain as it currently is.
Acceptance Criteria:
- A radio button group allows users to select between "New project" and "Same project" duplication modes
- When "New project" is selected, the name and description fields are shown and required
- When "Same project" is selected, the name and description fields are hidden and not required
- Services duplicated to the same project have "(copy)" appended to their names automatically
- After duplicating to a new project, the user is redirected to the new project page
- After duplicating to the same project, the user remains on the current project page and the dialog closes
- The success toast message reflects which duplication mode was used
Steps To Test
- Navigate to a project with at least one service (application or database)
- Open the duplicate services dialog
- Verify the radio button group appears with "New project" selected by default
- Verify that name and description fields are visible and required
- Select the "Same project" radio option
- Verify that name and description fields are hidden
- Select one or more services and click duplicate
- Verify the services are duplicated within the same project with "(copy)" appended to their names
- Verify you remain on the current project page
- Open the dialog again, select "New project", provide a name, select services, and duplicate
- Verify a new project is created and you are redirected to it
- Verify the duplicated services in the new project do not have "(copy)" in their names
Submission
Download https://cap.so/ to record your screen (use Studio mode). Export as an mp4, and drag and drop into an issue comment below.
Guide to submitting pull requests: https://hackmd.io/@timothy1ee/Hky8kV3hlx