feat: open card after duplicate (#674)
Co-authored-by: arvinWahyoo <arvin@wahyoo.com>
This commit is contained in:
parent
766668ea82
commit
7d1a4f1393
3 changed files with 15 additions and 1 deletions
|
@ -155,6 +155,7 @@ class CenterPanel extends React.Component<Props, State> {
|
|||
readonly={this.props.readonly}
|
||||
onCardClicked={this.cardClicked}
|
||||
addCard={this.addCard}
|
||||
showCard={this.showCard}
|
||||
/>}
|
||||
|
||||
{activeView.viewType === 'table' &&
|
||||
|
|
|
@ -25,6 +25,7 @@ type Props = {
|
|||
readonly: boolean
|
||||
onCardClicked: (e: React.MouseEvent, card: Card) => void
|
||||
addCard: (groupByOptionId?: string, show?:boolean) => Promise<void>
|
||||
showCard: (cardId?: string) => void
|
||||
}
|
||||
|
||||
type State = {
|
||||
|
@ -130,6 +131,7 @@ class Kanban extends React.Component<Props, State> {
|
|||
this.props.onCardClicked(e, card)
|
||||
}}
|
||||
onDrop={this.onDropToCard}
|
||||
showCard={this.props.showCard}
|
||||
isManualSort={isManualSort}
|
||||
/>
|
||||
))}
|
||||
|
|
|
@ -24,6 +24,7 @@ type Props = {
|
|||
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void
|
||||
readonly: boolean
|
||||
onDrop: (srcCard: Card, dstCard: Card) => void
|
||||
showCard: (cardId?: string) => void
|
||||
isManualSort: boolean
|
||||
}
|
||||
|
||||
|
@ -63,7 +64,17 @@ const KanbanCard = React.memo((props: Props) => {
|
|||
id='duplicate'
|
||||
name={intl.formatMessage({id: 'KanbanCard.duplicate', defaultMessage: 'Duplicate'})}
|
||||
onClick={() => {
|
||||
mutator.duplicateCard(card.id)
|
||||
mutator.duplicateCard(
|
||||
card.id,
|
||||
'duplicate card',
|
||||
false,
|
||||
async (newCardId) => {
|
||||
props.showCard(newCardId)
|
||||
},
|
||||
async () => {
|
||||
props.showCard(undefined)
|
||||
},
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</Menu>
|
||||
|
|
Loading…
Reference in a new issue