1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-15 18:10:53 +01:00

(stable) When a user cancels a new inline, clear it from the objective list

Summary: Ref T12733. Currently, creating a new inline and then canceling it leaves a marker in the objective list. Instead, remove the marker.

Test Plan:
  - Created an empty inline, cancelled. Created a non-empty inline, cancelled. No objective marker in either case.
  - Created a new normal inline, objective marker.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12733

Differential Revision: https://secure.phabricator.com/D17979
This commit is contained in:
epriestley 2017-05-20 05:33:59 -07:00
parent 87a4940924
commit aabb791c17
2 changed files with 17 additions and 6 deletions

View file

@ -13,7 +13,7 @@ return array(
'core.pkg.js' => '599698a7',
'darkconsole.pkg.js' => '1f9a31bc',
'differential.pkg.css' => '7d4cfa59',
'differential.pkg.js' => 'fc6a23eb',
'differential.pkg.js' => 'd7e3edd5',
'diffusion.pkg.css' => 'b93d9b8c',
'diffusion.pkg.js' => '84c8f8fd',
'favicon.ico' => '30672e08',
@ -392,7 +392,7 @@ return array(
'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63',
'rsrc/js/application/diff/DiffChangeset.js' => 'cf4e2140',
'rsrc/js/application/diff/DiffChangesetList.js' => 'a716ca27',
'rsrc/js/application/diff/DiffInline.js' => '93cbb03f',
'rsrc/js/application/diff/DiffInline.js' => 'ca0fafde',
'rsrc/js/application/diff/ScrollObjective.js' => '9df4e4e2',
'rsrc/js/application/diff/ScrollObjectiveList.js' => '085dd101',
'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832',
@ -779,7 +779,7 @@ return array(
'phabricator-dashboard-css' => 'fe5b1869',
'phabricator-diff-changeset' => 'cf4e2140',
'phabricator-diff-changeset-list' => 'a716ca27',
'phabricator-diff-inline' => '93cbb03f',
'phabricator-diff-inline' => 'ca0fafde',
'phabricator-drag-and-drop-file-upload' => '58dea2fa',
'phabricator-draggable-list' => 'bea6e7f4',
'phabricator-fatal-config-template-css' => '8f18fa41',
@ -1604,9 +1604,6 @@ return array(
'javelin-stratcom',
'javelin-dom',
),
'93cbb03f' => array(
'javelin-dom',
),
'93d0c9e3' => array(
'javelin-behavior',
'javelin-stratcom',
@ -1979,6 +1976,9 @@ return array(
'phabricator-shaped-request',
'conpherence-thread-manager',
),
'ca0fafde' => array(
'javelin-dom',
),
'caade6f2' => array(
'javelin-behavior',
'javelin-request',

View file

@ -33,6 +33,7 @@ JX.install('DiffInline', {
_isDraft: null,
_isFixed: null,
_isEditing: false,
_isNew: false,
bindToRow: function(row) {
this._row = row;
@ -73,6 +74,7 @@ JX.install('DiffInline', {
this._isGhost = data.isGhost;
this._changesetID = data.changesetID;
this._isNew = false;
this.setInvisible(false);
@ -87,6 +89,7 @@ JX.install('DiffInline', {
this._length = parseInt(data.length, 10);
this._isNewFile = data.isNewFile;
this._changesetID = data.changesetID;
this._isNew = true;
// Insert the comment after any other comments which already appear on
// the same row.
@ -110,6 +113,7 @@ JX.install('DiffInline', {
this._length = inline._length;
this._isNewFile = inline._isNewFile;
this._changesetID = inline._changesetID;
this._isNew = true;
this._replyToCommentPHID = inline._phid;
@ -198,6 +202,13 @@ JX.install('DiffInline', {
return;
}
// If this is a new comment which we aren't editing, don't show anything:
// the use started a comment or reply, then cancelled it.
if (this._isNew && !this._isEditing) {
objective.hide();
return;
}
var changeset = this.getChangeset();
if (!changeset.isVisible()) {
objective.hide();