story.ui.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. window.renderCell = function(result, info)
  2. {
  3. if(info.col.name == 'title' && result)
  4. {
  5. const story = info.row.data;
  6. let html = '';
  7. let gradeLabel = '';
  8. const gradeMap = gradeGroup[story.type] || {};
  9. gradeLabel = gradeMap[story.grade];
  10. if(gradeLabel) html += "<span class='label gray-pale rounded-xl clip'>" + gradeLabel + "</span> ";
  11. if(story.color) result[0].props.style = 'color: ' + story.color;
  12. if(html) result.unshift({html});
  13. }
  14. if(info.col.name == 'status' && result)
  15. {
  16. result[0] = {html: `<span class='status-${info.row.data.rawStatus}'>` + info.row.data.status + "</span>"};
  17. }
  18. if(info.col.name == 'assignedTo' && info.row.data.status == 'closed')
  19. {
  20. delete result[0]['props']['data-toggle'];
  21. delete result[0]['props']['href'];
  22. result[0]['props']['className'] += ' disabled';
  23. }
  24. return result;
  25. };
  26. window.firstRendered = false;
  27. window.toggleCheckRows = function(idList)
  28. {
  29. if(!idList?.length || firstRendered) return;
  30. firstRendered = true;
  31. const dtable = zui.DTable.query($('#projectStories'));
  32. dtable.$.toggleCheckRows(idList.split(','), true);
  33. }