diff --git a/classifier/js/app.js b/classifier/js/app.js index f3ebfe9..5612465 100644 --- a/classifier/js/app.js +++ b/classifier/js/app.js @@ -145,6 +145,7 @@ hideCompliantLabel: document.getElementById('hideCompliantLabel'), classifyFilters: document.getElementById('classifyFilters'), showUnassignedCheckbox: document.getElementById('showUnassignedCheckbox'), + showPartialCheckbox: document.getElementById('showPartialCheckbox'), showAssignedCheckbox: document.getElementById('showAssignedCheckbox'), showExcludedCheckbox: document.getElementById('showExcludedCheckbox'), showEmptyCheckbox: document.getElementById('showEmptyCheckbox'), @@ -354,13 +355,14 @@ if (app.modules.tree && app.modules.tree.setShowFilters) { app.modules.tree.setShowFilters({ unassigned: app.dom.showUnassignedCheckbox.checked, + partial: app.dom.showPartialCheckbox.checked, assigned: app.dom.showAssignedCheckbox.checked, excluded: app.dom.showExcludedCheckbox.checked, empty: app.dom.showEmptyCheckbox.checked, }); } } - [app.dom.showUnassignedCheckbox, app.dom.showAssignedCheckbox, app.dom.showExcludedCheckbox, app.dom.showEmptyCheckbox] + [app.dom.showUnassignedCheckbox, app.dom.showPartialCheckbox, app.dom.showAssignedCheckbox, app.dom.showExcludedCheckbox, app.dom.showEmptyCheckbox] .forEach(function (cb) { if (cb) cb.addEventListener('change', pushClassifyFilters); }); // Collapse tree button diff --git a/classifier/js/tree.js b/classifier/js/tree.js index b2a37e7..2c90106 100644 --- a/classifier/js/tree.js +++ b/classifier/js/tree.js @@ -41,29 +41,35 @@ // excluded — and three "Show …" toggles control which buckets are visible // (so unchecking Assigned+Excluded leaves only what's left to do). A folder // whose whole scanned subtree is filtered away is itself hidden. - var showFilters = { unassigned: true, assigned: true, excluded: true }; + var showFilters = { unassigned: true, partial: true, assigned: true, excluded: true }; var showEmpty = true; // show folders that contain no files function setShowFilters(f) { showFilters = { unassigned: f.unassigned !== false, + partial: f.partial !== false, assigned: f.assigned !== false, excluded: f.excluded !== false, }; showEmpty = f.empty !== false; render(); } - function allFiltersOn() { return showFilters.unassigned && showFilters.assigned && showFilters.excluded; } + function allFiltersOn() { return showFilters.unassigned && showFilters.partial && showFilters.assigned && showFilters.excluded; } function activeAxis() { var tt = window.app.modules.targetTree; return (tt && tt.activeAxis) ? tt.activeAxis() : 'tracking'; } - // Bucket a file relative to the active axis: 'excluded' | 'assigned' | 'unassigned'. + // Bucket a file relative to the active axis: + // 'excluded' | 'assigned' (on this axis) | 'partial' (assigned on the OTHER + // axis only — the to-do for this tab) | 'unassigned' (neither axis). function fileCategory(file) { var c = window.app.modules.classify; var a = c.getAssignment(c.srcKeyForFile(file)); if (a && a.excluded) return 'excluded'; - var assigned = a && (activeAxis() === 'transmittal' ? a.transmittalNodeId : a.trackingNodeId); - return assigned ? 'assigned' : 'unassigned'; + var onTransmittal = activeAxis() === 'transmittal'; + var here = a && (onTransmittal ? a.transmittalNodeId : a.trackingNodeId); + if (here) return 'assigned'; + var other = a && (onTransmittal ? a.trackingNodeId : a.transmittalNodeId); + return other ? 'partial' : 'unassigned'; } function classifyAllows(file) { return !classifyOn() || !!showFilters[fileCategory(file)]; } @@ -142,9 +148,9 @@ } function updateFilterCounts() { if (!classifyOn()) return; - var n = { unassigned: 0, assigned: 0, excluded: 0 }; + var n = { unassigned: 0, partial: 0, assigned: 0, excluded: 0 }; allClassifyFiles().forEach(function (f) { n[fileCategory(f)]++; }); - ['unassigned', 'assigned', 'excluded'].forEach(function (k) { + ['unassigned', 'partial', 'assigned', 'excluded'].forEach(function (k) { var el = document.getElementById('show' + k.charAt(0).toUpperCase() + k.slice(1) + 'Count'); if (el) el.textContent = '(' + n[k] + ')'; }); diff --git a/classifier/template.html b/classifier/template.html index f5c63a8..b093d74 100644 --- a/classifier/template.html +++ b/classifier/template.html @@ -65,11 +65,15 @@