1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-10 23:01:04 +01:00

Add an "Unsubmitted" button to the Differential persistent header

Summary: Ref M1476. Same as D18070 but that did most of the magic.

Test Plan: {F4987961}

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D18071
This commit is contained in:
epriestley 2017-06-03 06:31:09 -07:00
parent 48c6ca40c4
commit 863b7ab766
3 changed files with 64 additions and 23 deletions

View file

@ -13,7 +13,7 @@ return array(
'core.pkg.js' => '1475bd91',
'darkconsole.pkg.js' => '1f9a31bc',
'differential.pkg.css' => '1ccbf3a9',
'differential.pkg.js' => 'b453b745',
'differential.pkg.js' => 'b2c4cbfa',
'diffusion.pkg.css' => 'b93d9b8c',
'diffusion.pkg.js' => '84c8f8fd',
'favicon.ico' => '30672e08',
@ -393,8 +393,8 @@ return array(
'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => '408bf173',
'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375',
'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63',
'rsrc/js/application/diff/DiffChangeset.js' => 'fc3919c8',
'rsrc/js/application/diff/DiffChangesetList.js' => 'ffa063d8',
'rsrc/js/application/diff/DiffChangeset.js' => 'ee50a0ec',
'rsrc/js/application/diff/DiffChangesetList.js' => 'b4cf2217',
'rsrc/js/application/diff/DiffInline.js' => '1d17130f',
'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832',
'rsrc/js/application/differential/behavior-comment-preview.js' => '51c5ad07',
@ -772,8 +772,8 @@ return array(
'phabricator-darklog' => 'c8e1ffe3',
'phabricator-darkmessage' => 'c48cccdd',
'phabricator-dashboard-css' => 'fe5b1869',
'phabricator-diff-changeset' => 'fc3919c8',
'phabricator-diff-changeset-list' => 'ffa063d8',
'phabricator-diff-changeset' => 'ee50a0ec',
'phabricator-diff-changeset-list' => 'b4cf2217',
'phabricator-diff-inline' => '1d17130f',
'phabricator-drag-and-drop-file-upload' => '58dea2fa',
'phabricator-draggable-list' => 'bea6e7f4',
@ -1771,6 +1771,10 @@ return array(
'b3e7d692' => array(
'javelin-install',
),
'b4cf2217' => array(
'javelin-install',
'phuix-button-view',
),
'b59e1e96' => array(
'javelin-behavior',
'javelin-stratcom',
@ -2088,6 +2092,17 @@ return array(
'javelin-behavior',
'javelin-uri',
),
'ee50a0ec' => array(
'javelin-dom',
'javelin-util',
'javelin-stratcom',
'javelin-install',
'javelin-workflow',
'javelin-router',
'javelin-behavior-device',
'javelin-vector',
'phabricator-diff-inline',
),
'efe49472' => array(
'javelin-install',
'javelin-util',
@ -2141,17 +2156,6 @@ return array(
'javelin-behavior-device',
'phabricator-keyboard-shortcut',
),
'fc3919c8' => array(
'javelin-dom',
'javelin-util',
'javelin-stratcom',
'javelin-install',
'javelin-workflow',
'javelin-router',
'javelin-behavior-device',
'javelin-vector',
'phabricator-diff-inline',
),
'fc91ab6c' => array(
'javelin-behavior',
'javelin-dom',
@ -2163,10 +2167,6 @@ return array(
'javelin-view-visitor',
'javelin-util',
),
'ffa063d8' => array(
'javelin-install',
'phuix-button-view',
),
),
'packages' => array(
'conpherence.pkg.css' => array(

View file

@ -451,7 +451,8 @@ JX.install('DiffChangeset', {
end: block.items[jj]
},
attributes: {
unsaved: inline.isEditing()
unsaved: inline.isEditing(),
unsubmitted: inline.isDraft()
}
};

View file

@ -113,6 +113,7 @@ JX.install('DiffChangesetList', {
_bannerNode: null,
_unsavedButton: null,
_unsubmittedButton: null,
sleep: function() {
this._asleep = true;
@ -1371,8 +1372,9 @@ JX.install('DiffChangesetList', {
'diff-banner-has-unsubmitted',
!!unsubmitted.length);
var unsaved_button = this._getUnsavedButton();
var pht = this.getTranslations();
var unsaved_button = this._getUnsavedButton();
var unsubmitted_button = this._getUnsubmittedButton();
if (unsaved.length) {
unsaved_button.setText(unsaved.length + ' ' + pht('Unsaved'));
@ -1381,6 +1383,14 @@ JX.install('DiffChangesetList', {
JX.DOM.hide(unsaved_button.getNode());
}
if (unsubmitted.length) {
unsubmitted_button.setText(
unsubmitted.length + ' ' + pht('Unsubmitted'));
JX.DOM.show(unsubmitted_button.getNode());
} else {
JX.DOM.hide(unsubmitted_button.getNode());
}
var path_view = [icon, ' ', changeset.getDisplayPath()];
var buttons_attrs = {
@ -1388,7 +1398,8 @@ JX.install('DiffChangesetList', {
};
var buttons_list = [
unsaved_button.getNode()
unsaved_button.getNode(),
unsubmitted_button.getNode()
];
var buttons_view = JX.$N('div', buttons_attrs, buttons_list);
@ -1418,6 +1429,23 @@ JX.install('DiffChangesetList', {
return this._unsavedButton;
},
_getUnsubmittedButton: function() {
if (!this._unsubmittedButton) {
var button = new JX.PHUIXButtonView()
.setIcon('fa-comment-o')
.setButtonType(JX.PHUIXButtonView.BUTTONTYPE_SIMPLE);
var node = button.getNode();
var onunsubmitted = JX.bind(this, this._onunsubmittedclick);
JX.DOM.listen(node, 'click', null, onunsubmitted);
this._unsubmittedButton = button;
}
return this._unsubmittedButton;
},
_onunsavedclick: function(e) {
e.kill();
@ -1430,6 +1458,18 @@ JX.install('DiffChangesetList', {
this._onjumpkey(1, options);
},
_onunsubmittedclick: function(e) {
e.kill();
var options = {
filter: 'comment',
wrap: true,
attribute: 'unsubmitted'
};
this._onjumpkey(1, options);
},
_getBannerNode: function() {
if (!this._bannerNode) {
var attributes = {