Commit ff88eb58 authored by epriestley's avatar epriestley
Browse files

Show change information in file icons in the filetree

Summary: Ref T13516. Restores "deleted"/"added" information to the tree icons.

Test Plan: {F7375145}

Maniphest Tasks: T13516

Differential Revision: https://secure.phabricator.com/D21156
parent 9550ae69
......@@ -9,10 +9,10 @@ return array(
'names' => array(
'conpherence.pkg.css' => '3c8a0668',
'conpherence.pkg.js' => '020aebcf',
'core.pkg.css' => '4d5d0922',
'core.pkg.css' => 'dd5f04a3',
'core.pkg.js' => '544bc792',
'differential.pkg.css' => 'cb99cd21',
'differential.pkg.js' => 'b3589d05',
'differential.pkg.js' => 'b1ef535d',
'diffusion.pkg.css' => '42c75c37',
'diffusion.pkg.js' => 'a98c0bf7',
'maniphest.pkg.css' => '35995d6d',
......@@ -119,7 +119,7 @@ return array(
'rsrc/css/diviner/diviner-shared.css' => '4bd263b0',
'rsrc/css/font/font-awesome.css' => '3883938a',
'rsrc/css/font/font-lato.css' => '23631304',
'rsrc/css/font/phui-font-icon-base.css' => 'd7994e06',
'rsrc/css/font/phui-font-icon-base.css' => '303c9b87',
'rsrc/css/layout/phabricator-source-code-view.css' => '03d7ac28',
'rsrc/css/phui/button/phui-button-bar.css' => 'a4aa75c4',
'rsrc/css/phui/button/phui-button-simple.css' => '1ff278aa',
......@@ -378,7 +378,7 @@ return array(
'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => 'a2ab19be',
'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '1e413dc9',
'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => '0116d3e8',
'rsrc/js/application/diff/DiffChangeset.js' => '2a3101b1',
'rsrc/js/application/diff/DiffChangeset.js' => 'd089ffb1',
'rsrc/js/application/diff/DiffChangesetList.js' => '57035863',
'rsrc/js/application/diff/DiffInline.js' => '16e97ebc',
'rsrc/js/application/diff/DiffPathView.js' => '5f70ad12',
......@@ -775,7 +775,7 @@ return array(
'phabricator-darklog' => '3b869402',
'phabricator-darkmessage' => '26cd4b73',
'phabricator-dashboard-css' => '5a205b9d',
'phabricator-diff-changeset' => '2a3101b1',
'phabricator-diff-changeset' => 'd089ffb1',
'phabricator-diff-changeset-list' => '57035863',
'phabricator-diff-inline' => '16e97ebc',
'phabricator-diff-path-view' => '5f70ad12',
......@@ -842,7 +842,7 @@ return array(
'phui-document-view-css' => '52b748a5',
'phui-document-view-pro-css' => 'b9613a10',
'phui-feed-story-css' => 'a0c05029',
'phui-font-icon-base-css' => 'd7994e06',
'phui-font-icon-base-css' => '303c9b87',
'phui-fontkit-css' => '1ec937e5',
'phui-form-css' => '1f177cb7',
'phui-form-view-css' => '01b796c0',
......@@ -1155,18 +1155,6 @@ return array(
'javelin-stratcom',
'javelin-behavior',
),
'2a3101b1' => array(
'javelin-dom',
'javelin-util',
'javelin-stratcom',
'javelin-install',
'javelin-workflow',
'javelin-router',
'javelin-behavior-device',
'javelin-vector',
'phabricator-diff-inline',
'phabricator-diff-path-view',
),
'2a8b62d9' => array(
'multirow-row-manager',
'javelin-install',
......@@ -2093,6 +2081,18 @@ return array(
'javelin-dom',
'javelin-stratcom',
),
'd089ffb1' => array(
'javelin-dom',
'javelin-util',
'javelin-stratcom',
'javelin-install',
'javelin-workflow',
'javelin-router',
'javelin-behavior-device',
'javelin-vector',
'phabricator-diff-inline',
'phabricator-diff-path-view',
),
'd12d214f' => array(
'javelin-install',
'javelin-dom',
......
......@@ -240,6 +240,9 @@ final class CelerityDefaultPostprocessor
'document.border' => '#dedee1',
'delete-color' => '#c0392b',
'create-color' => '#139543',
);
}
......
......@@ -17,6 +17,9 @@ final class CelerityRedGreenPostprocessor
'new-bright' => 'rgba(152, 207, 235, .35)',
'old-background' => 'rgba(250, 212, 175, .3)',
'old-bright' => 'rgba(250, 212, 175, .55)',
'delete-color' => '#e67e22',
'create-color' => '#2980b9',
);
}
......
......@@ -259,48 +259,68 @@ final class DifferentialChangeset
}
public function newFileTreeIcon() {
$file_type = $this->getFileType();
$change_type = $this->getChangeType();
$icon = $this->getPathIconIcon();
$color = $this->getPathIconColor();
return id(new PHUIIconView())
->setIcon("{$icon} {$color}");
}
public function getPathIconIcon() {
return idx($this->getPathIconDetails(), 'icon');
}
public function getPathIconColor() {
return idx($this->getPathIconDetails(), 'color');
}
private function getPathIconDetails() {
$change_icons = array(
DifferentialChangeType::TYPE_DELETE => 'fa-file-o',
DifferentialChangeType::TYPE_DELETE => array(
'icon' => 'fa-times',
'color' => 'delete-color',
),
DifferentialChangeType::TYPE_ADD => array(
'icon' => 'fa-plus',
'color' => 'create-color',
),
DifferentialChangeType::TYPE_MOVE_AWAY => array(
'icon' => 'fa-circle-o',
'color' => 'grey',
),
DifferentialChangeType::TYPE_MULTICOPY => array(
'icon' => 'fa-circle-o',
'color' => 'grey',
),
DifferentialChangeType::TYPE_MOVE_HERE => array(
'icon' => 'fa-plus-circle',
'color' => 'create-color',
),
DifferentialChangeType::TYPE_COPY_HERE => array(
'icon' => 'fa-plus-circle',
'color' => 'create-color',
),
);
$change_type = $this->getChangeType();
if (isset($change_icons[$change_type])) {
$icon = $change_icons[$change_type];
} else {
$icon = DifferentialChangeType::getIconForFileType($file_type);
return $change_icons[$change_type];
}
$change_colors = array(
DifferentialChangeType::TYPE_ADD => 'green',
DifferentialChangeType::TYPE_DELETE => 'red',
DifferentialChangeType::TYPE_MOVE_AWAY => 'orange',
DifferentialChangeType::TYPE_MOVE_HERE => 'orange',
DifferentialChangeType::TYPE_COPY_HERE => 'orange',
DifferentialChangeType::TYPE_MULTICOPY => 'orange',
);
$color = idx($change_colors, $change_type, 'bluetext');
return id(new PHUIIconView())
->setIcon($icon.' '.$color);
}
public function getFileTreeClass() {
switch ($this->getChangeType()) {
case DifferentialChangeType::TYPE_ADD:
return 'filetree-added';
case DifferentialChangeType::TYPE_DELETE:
return 'filetree-deleted';
case DifferentialChangeType::TYPE_MOVE_AWAY:
case DifferentialChangeType::TYPE_MOVE_HERE:
case DifferentialChangeType::TYPE_COPY_HERE:
case DifferentialChangeType::TYPE_MULTICOPY:
return 'filetree-movecopy';
if ($this->isGeneratedChangeset()) {
return array(
'icon' => 'fa-cogs',
'color' => 'grey',
);
}
return null;
$file_type = $this->getFileType();
$icon = DifferentialChangeType::getIconForFileType($file_type);
return array(
'icon' => $icon,
'color' => 'bluetext',
);
}
public function setChangesetMetadata($key, $value) {
......
......@@ -195,6 +195,9 @@ final class DifferentialChangesetDetailView extends AphrontView {
'icon' => $display_icon,
'pathParts' => $path_parts,
'pathIconIcon' => $changeset->getPathIconIcon(),
'pathIconColor' => $changeset->getPathIconColor(),
'editorURI' => $this->getEditorURI(),
'editorConfigureURI' => $this->getEditorConfigureURI(),
......
......@@ -116,6 +116,11 @@
.phui-icon-view.red {
color: {$red};
}
.phui-icon-view.delete-color {
color: {$delete-color};
}
.phui-icon-view.orange {
color: {$orange};
}
......@@ -125,6 +130,11 @@
.phui-icon-view.green {
color: {$green}
}
.phui-icon-view.create-color {
color: {$create-color};
}
.phui-icon-view.blue {
color: {$blue};
}
......
......@@ -35,6 +35,9 @@ JX.install('DiffChangeset', {
this._editorURI = data.editorURI;
this._editorConfigureURI = data.editorConfigureURI;
this._pathIconIcon = data.pathIconIcon;
this._pathIconColor = data.pathIconColor;
this._inlines = [];
if (data.changesetState) {
......@@ -72,6 +75,9 @@ JX.install('DiffChangeset', {
_editorConfigureURI: null,
_pathView: null,
_pathIconIcon: null,
_pathIconColor: null,
getEditorURI: function() {
return this._editorURI;
},
......@@ -897,7 +903,8 @@ JX.install('DiffChangeset', {
.setPath(this._pathParts);
view.getIcon()
.setIcon(this.getIcon());
.setIcon(this._pathIconIcon)
.setColor(this._pathIconColor);
this._pathView = view;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment