diff --git a/app/extensions/brave/locales/en-US/preferences.properties b/app/extensions/brave/locales/en-US/preferences.properties index 4b62dfd54da..300b6508a79 100644 --- a/app/extensions/brave/locales/en-US/preferences.properties +++ b/app/extensions/brave/locales/en-US/preferences.properties @@ -51,6 +51,7 @@ viewPaymentHistory=View Payment History… paymentHistoryTitle=Your Payment History paymentHistoryFooterText=Your next payment contribution is {{reconcileDate}}. paymentHistoryOKText=OK +hideExcluded=hide excluded sites bravePayments=Brave Payments beta=beta contributionDate=Contribution Date @@ -112,6 +113,7 @@ views=Views timeSpent=Time Spent include=Include percentage=% +remove=Remove bravery=Bravery hintsTitle=Helpful hints hint0=The Bravery panel allows you to turn HTTPS Everywhere on or off. HTTPS Everywhere automatically changes your HTTP traffic to HTTPS for supported sites to keep you more secure. diff --git a/app/index.js b/app/index.js index 5b338482da2..10c632045bd 100644 --- a/app/index.js +++ b/app/index.js @@ -676,11 +676,9 @@ app.on('ready', () => { ], options: { persist: false, - frameOrigin: origin, advancedText: locale.translation('notificationPasswordSettings'), advancedLink: 'about:passwords' }, - frameOrigin: origin, message }) } diff --git a/docs/state.md b/docs/state.md index 1678cfd60a3..22af3b4d883 100644 --- a/docs/state.md +++ b/docs/state.md @@ -223,6 +223,7 @@ AppStore 'advanced.torrent-viewer-enabled': boolean, // Whether to render magnet links in the browser 'advanced.smooth-scroll-enabled': boolean, // false if smooth scrolling should be explicitly disabled 'advanced.send-crash-reports': boolean, // true or undefined if crash reports should be sent + 'advanced.hide-excluded-sites': boolean, // Whether to hide excluded sites in the payments list 'shutdown.clear-history': boolean, // true to clear history on shutdown 'shutdown.clear-downloads': boolean, // true to clear downloads on shutdown 'shutdown.clear-cache': boolean, // true to clear cache on shutdown diff --git a/js/about/preferences.js b/js/about/preferences.js index 15d9d7d074b..4bd378b0528 100644 --- a/js/about/preferences.js +++ b/js/about/preferences.js @@ -249,6 +249,10 @@ class LedgerTable extends ImmutableComponent { return true } + banSite (hostPattern) { + aboutActions.changeSiteSetting(hostPattern, 'ledgerPaymentsShown', false) + } + getRow (synopsis) { if (!synopsis || !synopsis.get || !this.shouldShow(synopsis)) { return [] @@ -264,6 +268,10 @@ class LedgerTable extends ImmutableComponent { const defaultSiteSetting = true return [ + { + html:
, + value: '' + }, rank, { html:
{verified ? this.getVerifiedIcon() : null}{faviconURL ? {site} : }{site}
, @@ -287,11 +295,18 @@ class LedgerTable extends ImmutableComponent { return null } return
+
+ +
this.enabledForSite(item) ? '' : 'paymentsDisabled').toJS() @@ -304,7 +319,12 @@ class LedgerTable extends ImmutableComponent { location: entry.get('publisherURL') } }).toJS()} - rows={this.synopsis.map((synopsis) => this.getRow(synopsis)).toJS()} /> + rows={this.synopsis.filter((synopsis) => { + return !getSetting(settings.HIDE_EXCLUDED_SITES, this.props.settings) || this.enabledForSite(synopsis) + }).map((synopsis) => { + return this.getRow(synopsis) + }).toJS()} + />
} } @@ -976,6 +996,8 @@ class PaymentsTab extends ImmutableComponent { get tableContent () { // TODO: This should be sortable. #2497 return } diff --git a/js/constants/appConfig.js b/js/constants/appConfig.js index 6a8b6a9c8dd..a3e414a619c 100644 --- a/js/constants/appConfig.js +++ b/js/constants/appConfig.js @@ -153,6 +153,7 @@ module.exports = { 'advanced.smooth-scroll-enabled': false, 'advanced.send-crash-reports': true, 'advanced.send-usage-statistics': false, + 'advanced.hide-excluded-sites': false, 'advanced.minimum-visit-time': 8, 'advanced.minimum-visits': 5, 'advanced.minimum-percentage': false, diff --git a/js/constants/settings.js b/js/constants/settings.js index 0ea4b94facf..54e9e1a1403 100644 --- a/js/constants/settings.js +++ b/js/constants/settings.js @@ -59,6 +59,7 @@ const settings = { SEND_CRASH_REPORTS: 'advanced.send-crash-reports', SEND_USAGE_STATISTICS: 'advanced.send-usage-statistics', ADBLOCK_CUSTOM_RULES: 'adblock.customRules', + HIDE_EXCLUDED_SITES: 'advanced.hide-excluded-sites', MINIMUM_VISIT_TIME: 'advanced.minimum-visit-time', MINIMUM_VISITS: 'advanced.minimum-visits', MINIMUM_PERCENTAGE: 'advanced.minimum-percentage', diff --git a/less/about/history.less b/less/about/history.less index 68b729151a7..3921612d235 100644 --- a/less/about/history.less +++ b/less/about/history.less @@ -50,6 +50,12 @@ .domain { font-size: 11pt; } + + td { + &:nth-of-type(2) { + width: 60%; + } + } } } } diff --git a/less/about/preferences.less b/less/about/preferences.less index 8769b8edfd0..1afe4823433 100644 --- a/less/about/preferences.less +++ b/less/about/preferences.less @@ -455,7 +455,6 @@ table.sortableTable { } .paymentsContainer { - @walletTableData: 235px + 30px; // .walletBar td (min-width + padding) @barMargin: 15px 0 30px; @fontSize: 14.5px; // .form-control @@ -472,14 +471,37 @@ table.sortableTable { } } + tr { + th, + td { + padding: 0 15px; + } + } + + .neverShowSiteIcon { + font-size: 20px; + text-align: center; + + .fa { + visibility: hidden; + } + + &:hover { + .fa { + visibility: visible; + } + } + } + th { color: @darkGray; font-weight: 600; } - .sort { - text-align: left; - } +.hideExcludedSites { + text-align: right; + margin: 10px 75px; +} .modal { .dialog { @@ -1174,6 +1196,11 @@ table.sortableTable { } } + .sort { + width: 100%; + text-align: left; + } + .ledgerTable { tr { height: 26px; diff --git a/less/sortableTable.less b/less/sortableTable.less index 0aae418b3bd..fa32313e2e9 100644 --- a/less/sortableTable.less +++ b/less/sortableTable.less @@ -60,12 +60,9 @@ table.sortableTable { td { color: @mediumGray; -webkit-font-smoothing: antialiased; + position: relative; width: auto; - &:nth-of-type(2) { - width: 60%; - } - input[type='range'] { background: transparent; -webkit-appearance: none; diff --git a/test/components/ledgerPanelTest.js b/test/components/ledgerPanelTest.js index 6642a8dee84..471acbd6d63 100644 --- a/test/components/ledgerPanelTest.js +++ b/test/components/ledgerPanelTest.js @@ -1,7 +1,7 @@ /* global describe, it, beforeEach, before */ const Brave = require('../lib/brave') -const {urlInput, advancedSettings, addFundsButton, paymentsStatus, paymentsWelcomePage, paymentsTab, walletSwitch, ledgerTable} = require('../lib/selectors') +const {urlInput, advancedSettings, addFundsButton, paymentsStatus, paymentsWelcomePage, paymentsTab, walletSwitch, siteSettingItem, ledgerTable} = require('../lib/selectors') const assert = require('assert') const prefsUrl = 'about:preferences' @@ -206,8 +206,8 @@ describe('synopsis', function () { .click(paymentsTab) .waitForVisible('[data-l10n-id="publisher"]') .click('[data-l10n-id="publisher"]') - .waitForVisible(ledgerTable + ' .switchBackground') - .click(ledgerTable + ' .switchBackground') + .waitForVisible(siteSettingItem + ' .switchBackground') + .click(siteSettingItem + ' .switchBackground') .windowByUrl(Brave.browserWindowUrl) .waitUntil(function () { return this.getAppState().then((val) => { diff --git a/test/lib/selectors.js b/test/lib/selectors.js index 6ac91bc0f65..b984251ec00 100644 --- a/test/lib/selectors.js +++ b/test/lib/selectors.js @@ -61,6 +61,7 @@ module.exports = { advancedSettings: '.advancedSettings', fundsSelectBox: '.fundsSelectBox', paymentsStatus: '.walletStatus', + siteSettingItem: '.siteSettingItem', ledgerTable: '.ledgerTable', bitcoinDashboard: '.bitcoinDashboard', modalCloseButton: 'button.close',