1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 14:00:56 +01:00

Show "objectives" UI only if prototypes are enabled

Summary: See D17955.

Test Plan: Loaded a revision, no longer saw annotations with prototypes off. Still saw annotations with prototypes on.

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D17983
This commit is contained in:
epriestley 2017-05-20 07:18:34 -07:00
parent 6945e80fee
commit bdecff7d67
4 changed files with 32 additions and 19 deletions

View file

@ -13,7 +13,7 @@ return array(
'core.pkg.js' => 'e822b496', 'core.pkg.js' => 'e822b496',
'darkconsole.pkg.js' => '1f9a31bc', 'darkconsole.pkg.js' => '1f9a31bc',
'differential.pkg.css' => '4d7dd14e', 'differential.pkg.css' => '4d7dd14e',
'differential.pkg.js' => '6d05ad4c', 'differential.pkg.js' => '0dfe037d',
'diffusion.pkg.css' => 'b93d9b8c', 'diffusion.pkg.css' => 'b93d9b8c',
'diffusion.pkg.js' => '84c8f8fd', 'diffusion.pkg.js' => '84c8f8fd',
'favicon.ico' => '30672e08', 'favicon.ico' => '30672e08',
@ -391,14 +391,14 @@ return array(
'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375', 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375',
'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63', 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63',
'rsrc/js/application/diff/DiffChangeset.js' => 'cf4e2140', 'rsrc/js/application/diff/DiffChangeset.js' => 'cf4e2140',
'rsrc/js/application/diff/DiffChangesetList.js' => '541206ba', 'rsrc/js/application/diff/DiffChangesetList.js' => 'a716ca27',
'rsrc/js/application/diff/DiffInline.js' => '77e14b60', 'rsrc/js/application/diff/DiffInline.js' => '77e14b60',
'rsrc/js/application/diff/ScrollObjective.js' => '0eee7a00', 'rsrc/js/application/diff/ScrollObjective.js' => '0eee7a00',
'rsrc/js/application/diff/ScrollObjectiveList.js' => '1ca4d9db', 'rsrc/js/application/diff/ScrollObjectiveList.js' => '1ca4d9db',
'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832', 'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832',
'rsrc/js/application/differential/behavior-comment-preview.js' => '51c5ad07', 'rsrc/js/application/differential/behavior-comment-preview.js' => '51c5ad07',
'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1', 'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1',
'rsrc/js/application/differential/behavior-populate.js' => '5e41c819', 'rsrc/js/application/differential/behavior-populate.js' => '1de8bf63',
'rsrc/js/application/differential/behavior-user-select.js' => 'a8d8459d', 'rsrc/js/application/differential/behavior-user-select.js' => 'a8d8459d',
'rsrc/js/application/diffusion/DiffusionLocateFileSource.js' => 'c93358e3', 'rsrc/js/application/diffusion/DiffusionLocateFileSource.js' => 'c93358e3',
'rsrc/js/application/diffusion/behavior-audit-preview.js' => 'd835b03a', 'rsrc/js/application/diffusion/behavior-audit-preview.js' => 'd835b03a',
@ -620,7 +620,7 @@ return array(
'javelin-behavior-diff-preview-link' => '051c7832', 'javelin-behavior-diff-preview-link' => '051c7832',
'javelin-behavior-differential-diff-radios' => 'e1ff79b1', 'javelin-behavior-differential-diff-radios' => 'e1ff79b1',
'javelin-behavior-differential-feedback-preview' => '51c5ad07', 'javelin-behavior-differential-feedback-preview' => '51c5ad07',
'javelin-behavior-differential-populate' => '5e41c819', 'javelin-behavior-differential-populate' => '1de8bf63',
'javelin-behavior-differential-user-select' => 'a8d8459d', 'javelin-behavior-differential-user-select' => 'a8d8459d',
'javelin-behavior-diffusion-browse-file' => '054a0f0b', 'javelin-behavior-diffusion-browse-file' => '054a0f0b',
'javelin-behavior-diffusion-commit-branches' => 'bdaf4d04', 'javelin-behavior-diffusion-commit-branches' => 'bdaf4d04',
@ -778,7 +778,7 @@ return array(
'phabricator-darkmessage' => 'c48cccdd', 'phabricator-darkmessage' => 'c48cccdd',
'phabricator-dashboard-css' => 'fe5b1869', 'phabricator-dashboard-css' => 'fe5b1869',
'phabricator-diff-changeset' => 'cf4e2140', 'phabricator-diff-changeset' => 'cf4e2140',
'phabricator-diff-changeset-list' => '541206ba', 'phabricator-diff-changeset-list' => 'a716ca27',
'phabricator-diff-inline' => '77e14b60', 'phabricator-diff-inline' => '77e14b60',
'phabricator-drag-and-drop-file-upload' => '58dea2fa', 'phabricator-drag-and-drop-file-upload' => '58dea2fa',
'phabricator-draggable-list' => 'bea6e7f4', 'phabricator-draggable-list' => 'bea6e7f4',
@ -1042,6 +1042,14 @@ return array(
'javelin-workflow', 'javelin-workflow',
'phabricator-scroll-objective', 'phabricator-scroll-objective',
), ),
'1de8bf63' => array(
'javelin-behavior',
'javelin-dom',
'javelin-stratcom',
'phabricator-tooltip',
'phabricator-diff-changeset-list',
'phabricator-diff-changeset',
),
'1def2711' => array( '1def2711' => array(
'javelin-install', 'javelin-install',
'javelin-dom', 'javelin-dom',
@ -1316,10 +1324,6 @@ return array(
'5294060f' => array( '5294060f' => array(
'phui-theme-css', 'phui-theme-css',
), ),
'541206ba' => array(
'javelin-install',
'phabricator-scroll-objective-list',
),
'54774a28' => array( '54774a28' => array(
'phui-inline-comment-view-css', 'phui-inline-comment-view-css',
), ),
@ -1378,14 +1382,6 @@ return array(
'phabricator-phtize', 'phabricator-phtize',
'javelin-dom', 'javelin-dom',
), ),
'5e41c819' => array(
'javelin-behavior',
'javelin-dom',
'javelin-stratcom',
'phabricator-tooltip',
'phabricator-diff-changeset-list',
'phabricator-diff-changeset',
),
'5e9f347c' => array( '5e9f347c' => array(
'javelin-behavior', 'javelin-behavior',
'multirow-row-manager', 'multirow-row-manager',
@ -1730,6 +1726,10 @@ return array(
'javelin-stratcom', 'javelin-stratcom',
'javelin-dom', 'javelin-dom',
), ),
'a716ca27' => array(
'javelin-install',
'phabricator-scroll-objective-list',
),
'a80d0378' => array( 'a80d0378' => array(
'javelin-behavior', 'javelin-behavior',
'javelin-stratcom', 'javelin-stratcom',

View file

@ -203,11 +203,15 @@ final class DifferentialChangesetListView extends AphrontView {
$this->requireResource('aphront-tooltip-css'); $this->requireResource('aphront-tooltip-css');
$show_objectives =
PhabricatorEnv::getEnvConfig('phabricator.show-prototypes');
$this->initBehavior( $this->initBehavior(
'differential-populate', 'differential-populate',
array( array(
'changesetViewIDs' => $ids, 'changesetViewIDs' => $ids,
'inlineURI' => $this->inlineURI, 'inlineURI' => $this->inlineURI,
'showObjectives' => $show_objectives,
'pht' => array( 'pht' => array(
'Open in Editor' => pht('Open in Editor'), 'Open in Editor' => pht('Open in Editor'),
'Show All Context' => pht('Show All Context'), 'Show All Context' => pht('Show All Context'),

View file

@ -120,6 +120,7 @@ JX.install('DiffChangesetList', {
_rangeTarget: null, _rangeTarget: null,
_bannerNode: null, _bannerNode: null,
_showObjectives: false,
sleep: function() { sleep: function() {
this._asleep = true; this._asleep = true;
@ -137,7 +138,9 @@ JX.install('DiffChangesetList', {
this._redrawFocus(); this._redrawFocus();
this._redrawSelection(); this._redrawSelection();
this._objectives.show(); if (this._showObjectives) {
this._objectives.show();
}
if (this._initialized) { if (this._initialized) {
return; return;
@ -195,6 +198,11 @@ JX.install('DiffChangesetList', {
this._installKey('q', label, this._onkeyhide); this._installKey('q', label, this._onkeyhide);
}, },
setShowObjectives: function(show) {
this._showObjectives = show;
return this;
},
isAsleep: function() { isAsleep: function() {
return this._asleep; return this._asleep;
}, },

View file

@ -60,7 +60,8 @@ JX.behavior('differential-populate', function(config, statics) {
var changeset_list = new JX.DiffChangesetList() var changeset_list = new JX.DiffChangesetList()
.setTranslations(JX.phtize(config.pht)) .setTranslations(JX.phtize(config.pht))
.setInlineURI(config.inlineURI); .setInlineURI(config.inlineURI)
.setShowObjectives(config.showObjectives);
// Install and activate the current page. // Install and activate the current page.
var page_id = JX.Quicksand.getCurrentPageID(); var page_id = JX.Quicksand.getCurrentPageID();