Skip to content

OpenConceptLab/ocl_issues#2485 | Copy project#13

Open
snyaggarwal wants to merge 1 commit intomainfrom
issues#2485
Open

OpenConceptLab/ocl_issues#2485 | Copy project#13
snyaggarwal wants to merge 1 commit intomainfrom
issues#2485

Conversation

@snyaggarwal
Copy link
Copy Markdown
Contributor

@snyaggarwal snyaggarwal requested a review from paynejd April 24, 2026 02:39
@snyaggarwal snyaggarwal linked an issue Apr 24, 2026 that may be closed by this pull request
2 tasks
Copy link
Copy Markdown
Member

@paynejd paynejd left a comment

Choose a reason for hiding this comment

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

Two blockers below (UX inconsistency, broken indentation) plus a label rename:

Rename "Copy" → "Create similar". "Copy" implies a full duplicate. "Create similar" describes the actual behavior (config-only seed). Apply to:

  • Button text + tooltip in Controls.jsx and MapProjects.jsx
  • i18n keys: map_project.copy_projectmap_project.create_similar (en/es/zh); drop common.copy
  • URL param: ?copyFrom=?templateFrom= (cheap to change now, expensive once URLs are bookmarked)


const onCopyClick = event => {
event.preventDefault()
event.stopPropagation()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should open in the same tab to match the listing-page button.

Suggested change
event.stopPropagation()
history.push(`/map-projects/new?copyFrom=${encodeURIComponent(project.url)}`)

Comment on lines +158 to 168
<Button size='small' color='primary' variant='contained' sx={{textTransform: 'none', margin: '0 4px'}} href={`#${project.url}`}>
{t('common.open')}
</Button>
<Button size='small' color='error' variant='text' sx={{marginLeft: '8px', textTransform: 'none'}} onClick={() => setDeleteProject(project)}>
<Tooltip title={t('map_project.copy_project')}>
<Button size='small' variant='contained' color='secondary' sx={{margin: '0 4px', textTransform: 'none'}} onClick={event => onCopyClick(event, project)}>
{t('common.copy')}
</Button>
</Tooltip>
<Button size='small' color='error' variant='text' sx={{margin: '0 4px', textTransform: 'none'}} onClick={() => setDeleteProject(project)}>
{t('common.delete')}
</Button>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Fix indentation inconsistency.

Suggested change
<Button size='small' color='primary' variant='contained' sx={{textTransform: 'none', margin: '0 4px'}} href={`#${project.url}`}>
{t('common.open')}
</Button>
<Button size='small' color='error' variant='text' sx={{marginLeft: '8px', textTransform: 'none'}} onClick={() => setDeleteProject(project)}>
<Tooltip title={t('map_project.copy_project')}>
<Button size='small' variant='contained' color='secondary' sx={{margin: '0 4px', textTransform: 'none'}} onClick={event => onCopyClick(event, project)}>
{t('common.copy')}
</Button>
</Tooltip>
<Button size='small' color='error' variant='text' sx={{margin: '0 4px', textTransform: 'none'}} onClick={() => setDeleteProject(project)}>
{t('common.delete')}
</Button>
<Button size='small' color='primary' variant='contained' sx={{margin: '0 4px', textTransform: 'none'}} href={`#${project.url}`}>
{t('common.open')}
</Button>
<Tooltip title={t('map_project.copy_project')}>
<Button size='small' variant='contained' color='secondary' sx={{margin: '0 4px', textTransform: 'none'}} onClick={event => onCopyClick(event, project)}>
{t('common.copy')}
</Button>
</Tooltip>
<Button size='small' color='error' variant='text' sx={{margin: '0 4px', textTransform: 'none'}} onClick={() => setDeleteProject(project)}>
{t('common.delete')}
</Button>

}
if(copyFromProjectURL) {
copyFromProject()
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

copyFromProjectURL is read inside this effect but missing from deps. If mount-only is intentional, add // eslint-disable-next-line react-hooks/exhaustive-deps with a one-line reason.

}

const fetchAndSetProject = () => {
setLoadingProject(true)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Prefill name with "Copy of {original name}" so users don't land on a blank field. Requires adding name to the /configurations/ API response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a new Project from an existing project

2 participants