Skip to content
This repository has been archived by the owner on Sep 22, 2021. It is now read-only.

Commit

Permalink
🐛 fix timecard plan creator
Browse files Browse the repository at this point in the history
  • Loading branch information
Aceysx committed Dec 7, 2020
1 parent 063ac36 commit 26b3991
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/ui/timecard/settings/plan-creator-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ class PlanCreatorBox extends React.Component {
const {labels = [], tasks = []} = this.props
return <div style={{margin: '10px 0'}}>
{
tasks.map((task, i) => {
tasks.map((task) => {
const {index, title, labelId, cost} = task
console.log(task)
return <InputGroup compact style={{margin: '10px 0'}}>
<Select value={labelId}
style={{width: 100}}
Expand All @@ -84,7 +83,7 @@ class PlanCreatorBox extends React.Component {
onChange={cost => this.updateTaskChange(index, cost)}
value={cost}/>
{
i > 0
tasks.length > 1
? <Tag onClick={() => this.removeTask(index)}
className='tag cursor_pointer'
style={{background: '#fff', borderStyle: 'dashed', margin: 0}}>
Expand Down
6 changes: 3 additions & 3 deletions src/ui/timecard/settings/template-management-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const DEFAULT_TEMPLATE = {
class TemplateManagementBox extends React.Component {
state = {
currentTemplate: DEFAULT_TEMPLATE,
isCreateTemplateModalOpen: true
isCreateTemplateModalOpen: false
}

changeTemplateTitle = e => {
Expand Down Expand Up @@ -48,8 +48,8 @@ class TemplateManagementBox extends React.Component {
return <Panel header={title} key={id}>
{
tasks.map(task => {
const {index, title, cost, label} = task
const fountLabel = labels.find(item => item.id === label) || {}
const {index, title, cost, labelId} = task
const fountLabel = labels.find(item => item.id === labelId) || {}
return <p><Tag key={index}
className='tag'
color={fountLabel.color}>
Expand Down
3 changes: 2 additions & 1 deletion src/ui/timecard/timecard-plan-creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export default class TimecardPlanCreator extends React.Component {
return false;
}
}

reset = () => {
this.setState({
date: moment(new Date().getTime()),
Expand All @@ -81,7 +82,7 @@ export default class TimecardPlanCreator extends React.Component {
const {id, tasks} = found
this.setState({
templateId: id,
tasks
tasks: JSON.parse(JSON.stringify(tasks))
})
}

Expand Down

0 comments on commit 26b3991

Please sign in to comment.