Merge pull request #393 from jfurrow/bug/fix-torrent-detail-display

Fix torrent detail displays
This commit is contained in:
John Furrow
2017-07-01 21:40:13 -07:00
committed by GitHub
9 changed files with 88 additions and 85 deletions
@@ -46,13 +46,13 @@ const expandedTorrentSectionContent = {
const expandedTorrentDetailsToHide = ['downTotal'];
const expandedValueTransformers = {
peers: torrent => torrent.connectedPeers,
seeds: torrent => torrent.connectedSeeds
peers: torrent => torrent.peersConnected,
seeds: torrent => torrent.seedsConnected
};
const expandedSecondaryValueTransformers = {
peers: torrent => torrent.totalPeers,
seeds: torrent => torrent.totalSeeds,
peers: torrent => torrent.peersTotal,
seeds: torrent => torrent.seedsTotal,
percentComplete: torrent => torrent.bytesDone
};
@@ -51,7 +51,6 @@ const icons = {
comment: <CommentIcon />,
eta: <ClockIcon />,
sizeBytes: <DiskIcon />,
freeDiskSpace: <DiskIcon />,
downRate: <DownloadThickIcon />,
basePath: <FolderClosedSolid />,
hash: <HashIcon />,
@@ -63,9 +62,9 @@ const icons = {
peers: <PeersIcon />,
ratio: <RatioIcon />,
seeds: <SeedsIcon />,
trackers: <RadarIcon />,
uploadRate: <UploadThickIcon />,
uploadTotal: <UploadThickIcon />
trackerURIs: <RadarIcon />,
upRate: <UploadThickIcon />,
upTotal: <UploadThickIcon />
};
const transformers = {
@@ -73,7 +72,6 @@ const transformers = {
dateCreated: dateRenderer,
downRate: speedRenderer,
downTotal: sizeRenderer,
freeDiskSpace: sizeRenderer,
ignoreScheduler: booleanRenderer,
isPrivate: booleanRenderer,
percentComplete: (percent, size) => {
@@ -55,10 +55,6 @@ const torrentProperties = {
id: 'torrents.properties.creation.date',
defaultMessage: 'Creation Date'
},
freeDiskSpace: {
id: 'torrents.properties.free.disk.space',
defaultMessage: 'Free Disk Space'
},
basePath: {
id: 'torrents.properties.base.path',
defaultMessage: 'Base Path'
@@ -39,7 +39,6 @@ class SettingsStoreClass extends BaseStore {
{id: 'seeds', visible: true},
{id: 'dateAdded', visible: true},
{id: 'dateCreated', visible: false},
{id: 'freeDiskSpace', visible: false},
{id: 'basePath', visible: false},
{id: 'comment', visible: false},
{id: 'hash', visible: false},
@@ -99,34 +99,6 @@ $torrent-details--tags--foreground: #1a2028;
margin-right: 0;
}
}
.is-actively-downloading & {
.torrent-details {
&__sub-heading {
&__tertiary {
&--download {
color: $blue;
.icon {
fill: $blue;
}
}
&--upload {
color: $green;
.icon {
fill: $green;
}
}
}
}
}
}
}
&__header {
+41 -10
View File
@@ -213,6 +213,23 @@ $more-info--border: $textbox-repeater--button--border;
}
}
}
.torrent-details {
&__sub-heading {
&__tertiary {
&--download {
color: $blue;
.icon {
fill: $blue;
}
}
}
}
}
}
}
@@ -230,6 +247,23 @@ $more-info--border: $textbox-repeater--button--border;
}
}
}
.torrent-details {
&__sub-heading {
&__tertiary {
&--upload {
color: $green;
.icon {
fill: $green;
}
}
}
}
}
}
}
@@ -385,19 +419,16 @@ $more-info--border: $textbox-repeater--button--border;
&--is-downloading {
&.torrent {
&--actively {
&--is-active {
.torrent {
.torrent {
&__detail {
&__detail {
&--eta {
margin-right: 10px;
opacity: 1;
width: auto;
}
&--eta {
margin-right: 10px;
opacity: 1;
width: auto;
}
}
}
+28 -28
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+11 -4
View File
@@ -23,6 +23,8 @@ const changedKeys = {
trackers: 'trackerURIs'
};
const removedKeys = ['freeDiskSpace'];
/**
* Check settings for old torrent propery keys. If the old keys exist and have
* been assigned values, then check that the new key doesn't also exist. When
@@ -43,8 +45,8 @@ const transformLegacyKeys = settings => {
}
if (settings.torrentDetails) {
settings.torrentDetails = settings.torrentDetails.map(
(detailItem, index) => {
settings.torrentDetails = settings.torrentDetails.reduce(
(accumulator, detailItem, index) => {
if (
detailItem.id in changedKeys
&& !(settings.torrentDetails.some(subDetailItem => {
@@ -54,8 +56,13 @@ const transformLegacyKeys = settings => {
detailItem.id = changedKeys[detailItem.id];
}
return detailItem;
}
if (!removedKeys.includes(detailItem.id)) {
accumulator.push(detailItem);
}
return accumulator;
},
[]
);
}