Added task types
This commit is contained in:
@@ -39,3 +39,5 @@ node_type_shot = {
|
|||||||
'form_schema': {},
|
'form_schema': {},
|
||||||
'parent': ['scene']
|
'parent': ['scene']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task_types = ['layout', 'animation', 'lighting', 'fx', 'rendering']
|
||||||
|
@@ -17,7 +17,9 @@ node_type_task = {
|
|||||||
'default': 'todo',
|
'default': 'todo',
|
||||||
'required': True,
|
'required': True,
|
||||||
},
|
},
|
||||||
|
'task_type': {
|
||||||
|
'type': 'string',
|
||||||
|
},
|
||||||
'assigned_to': {
|
'assigned_to': {
|
||||||
'type': 'dict',
|
'type': 'dict',
|
||||||
'schema': {
|
'schema': {
|
||||||
|
@@ -64,7 +64,8 @@ def setup_for_attract(project_url, replace=False, svn_url=None):
|
|||||||
Returns the updated project.
|
Returns the updated project.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from .node_types import NODE_TYPES
|
from .node_types import NODE_TYPES, shot
|
||||||
|
|
||||||
|
|
||||||
# Copy permissions from the project, then give everyone with PUT
|
# Copy permissions from the project, then give everyone with PUT
|
||||||
# access also DELETE access.
|
# access also DELETE access.
|
||||||
@@ -116,6 +117,10 @@ def setup_for_attract(project_url, replace=False, svn_url=None):
|
|||||||
log.info('Setting SVN URL to %s', svn_url)
|
log.info('Setting SVN URL to %s', svn_url)
|
||||||
attract_props['svn_url'] = svn_url
|
attract_props['svn_url'] = svn_url
|
||||||
|
|
||||||
|
# Set up task types
|
||||||
|
task_types = attract_props.setdefault('task_types', {})
|
||||||
|
task_types.setdefault(shot.node_type_shot['name'], shot.task_types)
|
||||||
|
|
||||||
_update_project(project)
|
_update_project(project)
|
||||||
|
|
||||||
log.info('Project %s was updated for Attract.', project_url)
|
log.info('Project %s was updated for Attract.', project_url)
|
||||||
|
@@ -24,7 +24,7 @@ class TaskManager(object):
|
|||||||
|
|
||||||
self._log.info("Task '%s' logged in SVN: %s", task_id, log_entry)
|
self._log.info("Task '%s' logged in SVN: %s", task_id, log_entry)
|
||||||
|
|
||||||
def create_task(self, project):
|
def create_task(self, project, task_type=None):
|
||||||
"""Creates a new task, owned by the current user.
|
"""Creates a new task, owned by the current user.
|
||||||
|
|
||||||
:rtype: pillarsdk.Node
|
:rtype: pillarsdk.Node
|
||||||
@@ -45,6 +45,9 @@ class TaskManager(object):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if task_type:
|
||||||
|
node_props['properties']['task_type'] = task_type
|
||||||
|
|
||||||
task = pillarsdk.Node(node_props)
|
task = pillarsdk.Node(node_props)
|
||||||
task.create(api=api)
|
task.create(api=api)
|
||||||
return task
|
return task
|
||||||
@@ -63,6 +66,7 @@ class TaskManager(object):
|
|||||||
task.name = fields.pop('name')
|
task.name = fields.pop('name')
|
||||||
task.description = fields.pop('description')
|
task.description = fields.pop('description')
|
||||||
task.properties.status = fields.pop('status')
|
task.properties.status = fields.pop('status')
|
||||||
|
task.properties.task_type = fields.pop('task_type', '').strip() or None
|
||||||
|
|
||||||
self._log.info('Saving task %s', task.to_dict())
|
self._log.info('Saving task %s', task.to_dict())
|
||||||
|
|
||||||
|
@@ -4,6 +4,9 @@ script(src="{{ url_for('static_attract', filename='js/tasks.js') }}",async=true)
|
|||||||
.input-group
|
.input-group
|
||||||
span.input-group-addon#task-addon-name(title='Name') N
|
span.input-group-addon#task-addon-name(title='Name') N
|
||||||
input.form-control(name="name",autofocus=true,type=text,placeholder='Task name',aria-describedby="task-addon-name",value="{{ task.name|hide_none }}")
|
input.form-control(name="name",autofocus=true,type=text,placeholder='Task name',aria-describedby="task-addon-name",value="{{ task.name|hide_none }}")
|
||||||
|
.input-group
|
||||||
|
span.input-group-addon#task-addon-type(title='Task type') T
|
||||||
|
input.form-control(name="task_type",type=text,placeholder='Task type',aria-describedby="task-addon-type",value="{{ task.properties.task_type|hide_none }}")
|
||||||
.input-group
|
.input-group
|
||||||
span.input-group-addon#task-addon-description(title='Description') D
|
span.input-group-addon#task-addon-description(title='Description') D
|
||||||
textarea.form-control(name="description",type=text,placeholder='Task description',aria-describedby="task-addon-description") {{ task.description|hide_none }}
|
textarea.form-control(name="description",type=text,placeholder='Task description',aria-describedby="task-addon-description") {{ task.description|hide_none }}
|
||||||
|
Reference in New Issue
Block a user