Skip to content

Commit

Permalink
AB#777: Add Sub-Tasks field to efforts
Browse files Browse the repository at this point in the history
  • Loading branch information
mk-simsoft committed Mar 6, 2023
1 parent 833b488 commit b2fb83a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 7 deletions.
6 changes: 2 additions & 4 deletions anet-dictionary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,9 @@ fields:
label: Instant assessment Question 3

parentTask:
label: Parent task
label: Parent objective / effort
placeholder: Start typing to search for a higher level task
childTask:
label: Child task
placeholder: Start typing to search for a lower level task
childrenTasks: Sub efforts
taskedOrganizations:
label: Tasked organizations
placeholder: Search for an organization...
Expand Down
31 changes: 30 additions & 1 deletion client/src/pages/tasks/Show.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ import React, { useContext, useState } from "react"
import { connect } from "react-redux"
import { useLocation, useParams } from "react-router-dom"
import Settings from "settings"
import {
ListGroup,
ListGroupItem
} from "react-bootstrap"
import DictionaryField from "../../HOC/DictionaryField"

const GQL_GET_TASK = gql`
Expand All @@ -55,6 +59,10 @@ const GQL_GET_TASK = gql`
shortName
longName
}
childrenTasks {
uuid
shortName
}
descendantTasks(query: { pageNum: 0, pageSize: 0 }) {
uuid
shortName
Expand Down Expand Up @@ -166,6 +174,7 @@ const TaskShow = ({ pageDispatchers }) => {
const ShortNameField = DictionaryField(Field)
const LongNameField = DictionaryField(Field)
const TaskParentTask = DictionaryField(Field)
const TaskChildrenTasks = DictionaryField(Field)
const PlannedCompletionField = DictionaryField(Field)
const ProjectedCompletionField = DictionaryField(Field)

Expand Down Expand Up @@ -278,7 +287,7 @@ const TaskShow = ({ pageDispatchers }) => {
)
}
/>
{task.parentTask && task.parentTask.uuid && (
{Settings.fields.task.parentTask && task.parentTask?.uuid && (
<TaskParentTask
dictProps={Settings.fields.task.parentTask}
name="parentTask"
Expand All @@ -293,6 +302,26 @@ const TaskShow = ({ pageDispatchers }) => {
}
/>
)}
{Settings.fields.task.childrenTasks && task.childrenTasks.length > 0 && (
<TaskChildrenTasks
dictProps={Settings.fields.task.childrenTasks}
name="subEfforts"
component={FieldHelper.ReadonlyField}
humanValue={
<ListGroup>
{task.childrenTasks?.map(task => (
<ListGroupItem key={task.uuid}>
<LinkTo
showIcon={false}
modelType="Task"
model={task}
/>
</ListGroupItem>
))}
</ListGroup>
}
/>
)}
{Settings.fields.task.plannedCompletion && (
<PlannedCompletionField
dictProps={Settings.fields.task.plannedCompletion}
Expand Down
6 changes: 4 additions & 2 deletions src/main/resources/anet-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,10 @@ properties:
"$ref": "#/$defs/inputField"
parentTask:
"$ref": "#/$defs/inputField"
childTask:
"$ref": "#/$defs/inputField"
childrenTasks:
type: string
title: The sub tasks for this field
description: Used in the UI where a sub tasks for task is shown.
taskedOrganizations:
"$ref": "#/$defs/inputField"
responsiblePositions:
Expand Down

0 comments on commit b2fb83a

Please sign in to comment.