Skip to content

Commit

Permalink
Merge pull request #2170 from ProjectSidewalk/1817-Audit-Add-LabelTyp…
Browse files Browse the repository at this point in the history
…e-and-TempId

Fixes #1817 : updated Notes and Temporary_Label_Id columns
  • Loading branch information
misaugstad authored Sep 16, 2020
2 parents 5b36f81 + 433a88f commit b38c995
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions public/javascripts/SVLabel/src/SVLabel/Tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ function Tracker () {
};

this._isDeleteLabelAction = function (action) {
return action.indexOf("RemoveLabel") >= 0;
};

this._isClickLabelDeleteAction = function (action) {
return action.indexOf("Click_LabelDelete") >= 0;
};

Expand Down Expand Up @@ -194,7 +198,7 @@ function Tracker () {
notes['auditTaskId'] = labelProperties.audit_task_id;
}

} else if (self._isDeleteLabelAction(action)){
} else if (self._isClickLabelDeleteAction(action)){
var labelProperties = svl.canvas.getCurrentLabel().getProperties();
currentLabel = labelProperties.temporary_label_id;
updatedLabels.push(currentLabel);
Expand All @@ -210,7 +214,6 @@ function Tracker () {

var item = self.create(action, notes, extraData);
actions.push(item);

var contextMenuLabel = true;

if(self._isFinishLabelingAction(action) && (notes['labelType'] === 'NoSidewalk' || notes['labelType'] === 'Occlusion')){
Expand All @@ -226,6 +229,7 @@ function Tracker () {
if (actions.length > 200 && !self._isCanvasInteraction(action) && !self._isContextMenuAction(action)) {
self.submitForm();
}

return this;
};

Expand Down
2 changes: 1 addition & 1 deletion public/javascripts/SVLabel/src/SVLabel/canvas/Canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ function Canvas(ribbon) {
*/
function labelDeleteIconClick() {
if (!status.disableLabelDelete) {
svl.tracker.push('Click_LabelDelete');
svl.tracker.push('Click_LabelDelete', {labelType: self.getCurrentLabel().getProperty('labelType')});
var currLabel = self.getCurrentLabel();
if (!currLabel) {
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ function LabelContainer($) {
*/
this.removeLabel = function (label) {
if (!label) { return false; }
svl.tracker.push('RemoveLabel', {labelId: label.getProperty('labelId')});
svl.tracker.push('RemoveLabel', {labelType: label.getProperty('labelType')});
svl.labelCounter.decrement(label.getProperty("labelType"));
label.remove();

Expand Down

0 comments on commit b38c995

Please sign in to comment.