* align doing project and execution in one row in product kanban.
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
#kanbanList .kanban-lane-col[data-type="doingProject"] {overflow: visible; max-height: none!important; box-shadow: 2px 0 0 #fff;}
|
||||
#kanbanList .kanban-lane-col[data-type="doingProject"] + .kanban-lane-col {border-left: none;}
|
||||
#kanbanList .kanban-lane-col[data-type="doingProject"] > .kanban-lane-items {padding: 0;}
|
||||
#kanbanList .project-row {position: relative; width: 200%; width: calc(200% + 2px); box-shadow: 0 2px 0 #fff;}
|
||||
#kanbanList .project-row + .project-row {margin-top: 2px;}
|
||||
#kanbanList .project-row > .project-col {float: left; width: 50%; padding: 10px;}
|
||||
#kanbanList .project-row > .project-col + .project-col {padding: 10px 9px 10px 11px;}
|
||||
#kanbanList .project-row > .execution-item {position: absolute!important; left: 100%; top: 0}
|
||||
|
||||
+50
-13
@@ -57,23 +57,30 @@ function processKanbanData(key, programsData)
|
||||
if(!project || !project.id) return;
|
||||
var projectItem = $.extend({}, project, {id: 'project-' + projectID, _id: projectID});
|
||||
items.doingProject.push(projectItem);
|
||||
|
||||
var execution = latestExecutions[projectID];
|
||||
if(!execution || !execution.id) return;
|
||||
projectItem.execution = $.extend({}, execution, {id: 'execution-' + execution.id, _id: execution.id});
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* doing execution */
|
||||
items.doingExecution = [];
|
||||
var productProjects = projectProduct[productID];
|
||||
if(productProjects)
|
||||
{
|
||||
$.each(productProjects, function(projectID)
|
||||
{
|
||||
var execution = latestExecutions[projectID];
|
||||
if(!execution || !execution.id) return;
|
||||
var executionItem = $.extend({}, execution, {id: 'execution-' + execution.id, _id: execution.id});
|
||||
items.doingExecution.push(executionItem);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/* doing execution */
|
||||
items.doingExecution = [];
|
||||
var productProjects = projectProduct[productID];
|
||||
if(productProjects)
|
||||
{
|
||||
$.each(productProjects, function(projectID)
|
||||
{
|
||||
var execution = latestExecutions[projectID];
|
||||
if(!execution || !execution.id) return;
|
||||
var executionItem = $.extend({}, execution, {id: 'execution-' + execution.id, _id: execution.id});
|
||||
items.doingExecution.push(executionItem);
|
||||
});
|
||||
}
|
||||
|
||||
/* normal release */
|
||||
items.normalRelease = [];
|
||||
@@ -99,8 +106,38 @@ function processKanbanData(key, programsData)
|
||||
return {id: kanbanId, columns: columns, lanes: lanes};
|
||||
}
|
||||
|
||||
/**
|
||||
* Render project item
|
||||
* @param {Object} item Project item object
|
||||
* @param {JQuery} $item Kanban item element
|
||||
* @param {Object} col Column object
|
||||
* @returns {JQuery} $item Kanban item element
|
||||
*/
|
||||
function renderDoingProjectItem(item, $item)
|
||||
{
|
||||
console.log('renderDoingProjectItem', item);
|
||||
$item.removeClass('kanban-item').addClass('project-row clearfix').empty();
|
||||
|
||||
var $projectCol = $('<div class="project-col"></div>').appendTo($item);
|
||||
var $projectItem = $('<div class="kanban-item project-item"></div>').appendTo($projectCol);
|
||||
renderProjectItem(item, $projectItem);
|
||||
|
||||
var $executionCol = $('<div class="project-col"></div>').appendTo($item);
|
||||
if(item.execution)
|
||||
{
|
||||
var $executionItem = $('<div class="kanban-item execution-item"></div>').appendTo($executionCol);
|
||||
renderExecutionItem(item, $executionItem);
|
||||
}
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
|
||||
$(function()
|
||||
{
|
||||
/* Add custom renderer for doing project */
|
||||
addColumnRenderer('doingProject', renderDoingProjectItem);
|
||||
|
||||
/* Init all kanbans */
|
||||
$.each(kanbanList, function(key, programsData)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user