Update acrding review changes
This commit is contained in:
parent
ede7ca0150
commit
207f95fcda
1 changed files with 6 additions and 8 deletions
|
@ -58,15 +58,13 @@ const Kanban = (props: Props) => {
|
||||||
const currentView = useAppSelector(getCurrentView)
|
const currentView = useAppSelector(getCurrentView)
|
||||||
const cardTemplates: Card[] = useAppSelector(getCurrentBoardTemplates)
|
const cardTemplates: Card[] = useAppSelector(getCurrentBoardTemplates)
|
||||||
const {board, activeView, cards, groupByProperty, visibleGroups, hiddenGroups, hiddenCardsCount} = props
|
const {board, activeView, cards, groupByProperty, visibleGroups, hiddenGroups, hiddenCardsCount} = props
|
||||||
const [defaultTemplateID, setDefaultTemplateID] = useState('')
|
const [defaultTemplateID, setDefaultTemplateID] = useState<string>()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if(currentView.fields && currentView.fields.defaultTemplateId) {
|
if(currentView && currentView.fields && currentView.fields.defaultTemplateId) {
|
||||||
cardTemplates.forEach((cardTemplate) => {
|
if(cardTemplates.find(ct => ct.id === currentView.fields.defaultTemplateId)) {
|
||||||
if(cardTemplate.id === currentView.fields.defaultTemplateId) {
|
setDefaultTemplateID(currentView.fields.defaultTemplateId)
|
||||||
setDefaultTemplateID(currentView.fields.defaultTemplateId)
|
}
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}, [currentView])
|
}, [currentView])
|
||||||
|
|
||||||
|
@ -310,7 +308,7 @@ const Kanban = (props: Props) => {
|
||||||
<BoardPermissionGate permissions={[Permission.ManageBoardCards]}>
|
<BoardPermissionGate permissions={[Permission.ManageBoardCards]}>
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if(defaultTemplateID !== '') {
|
if(defaultTemplateID) {
|
||||||
props.addCardFromTemplate(defaultTemplateID, group.option.id)
|
props.addCardFromTemplate(defaultTemplateID, group.option.id)
|
||||||
} else {
|
} else {
|
||||||
props.addCard(group.option.id, true)
|
props.addCard(group.option.id, true)
|
||||||
|
|
Loading…
Reference in a new issue