Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewards rebase #53

Merged
merged 79 commits into from May 10, 2018
Merged
Changes from 1 commit
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
72cb75f
Initial commit. Code works on staging with some temp workarounds
Apr 23, 2018
443f6c4
Removing temporary code.
Apr 23, 2018
64a945a
hot dog
trickpattyFH20 Mar 27, 2018
888c8b1
init circle
trickpattyFH20 Mar 29, 2018
7884800
react hot dog
trickpattyFH20 Mar 29, 2018
eac594c
rewards hot dog ui
trickpattyFH20 Mar 30, 2018
7358f88
close circle
trickpattyFH20 Mar 30, 2018
4c6004b
routing and offer card
trickpattyFH20 Apr 2, 2018
8b45dad
reward card layout
trickpattyFH20 Apr 2, 2018
06474ca
more offer card styles
trickpattyFH20 Apr 2, 2018
8feb2f6
card footer + copy feedback + styling
trickpattyFH20 Apr 3, 2018
c325bb9
more styles
trickpattyFH20 Apr 3, 2018
a6381f5
remove purple test style
trickpattyFH20 Apr 4, 2018
eeea57a
test rewards postmessage
trickpattyFH20 Apr 4, 2018
830aee8
one reward at a time for hot dog and offer card
trickpattyFH20 Apr 5, 2018
df4ea54
header + footer + styles
trickpattyFH20 Apr 9, 2018
d11ba1c
react shadow
trickpattyFH20 Apr 13, 2018
169fff4
define MainView first
trickpattyFH20 Apr 13, 2018
44ddfc6
lint
trickpattyFH20 Apr 16, 2018
4084715
add onmessage
trickpattyFH20 Apr 16, 2018
0521a73
fix selector and close button
trickpattyFH20 Apr 16, 2018
603e73f
iframe fallback
trickpattyFH20 Apr 17, 2018
2029ba2
fix ff beta logo
trickpattyFH20 Apr 17, 2018
2efba4c
data csp compatible images + class for index + text styles
trickpattyFH20 Apr 18, 2018
88b0621
disable rewards notification
trickpattyFH20 Apr 18, 2018
52ae822
fix shadow FOUC
trickpattyFH20 Apr 18, 2018
b55f20d
click outside settings
trickpattyFH20 Apr 18, 2018
ef81951
settings styles
trickpattyFH20 Apr 20, 2018
8049a56
settings actions
trickpattyFH20 Apr 23, 2018
27b8d4f
show ghostery pizza offer
trickpattyFH20 Apr 24, 2018
0613ab9
fix event listener reward reference
trickpattyFH20 Apr 26, 2018
52de54f
setConfiguration - for DEBUG only
Apr 27, 2018
632744e
Changing the way browser-core is loaded.
Apr 27, 2018
dff2831
handle signal
trickpattyFH20 Apr 30, 2018
99537a1
mark offer read + delete offer
trickpattyFH20 Apr 30, 2018
c23fe6f
new signals
trickpattyFH20 Apr 30, 2018
85002e5
refactor to sendSignal
trickpattyFH20 May 1, 2018
7ef9f23
Create ToggleSlider component. Use it in Setup flow.
IAmThePan Apr 11, 2018
c9c69ac
GH-409 Update Rewards view: rewards list, toggle on/off, reducers, fa…
IAmThePan Apr 16, 2018
2083be0
GH-409 Update Rewards view: reward details.
IAmThePan Apr 18, 2018
e2351b6
hot dog
trickpattyFH20 Mar 27, 2018
7301085
Integrate panel rewards with background I
IAmThePan Apr 26, 2018
dfb6317
Integrate panel rewards with background II. Fix linting errors
IAmThePan Apr 30, 2018
74b6611
Integrate panel rewards with Background III. Messages for read, remov…
IAmThePan Apr 30, 2018
574f679
Fix signal bug for content-script rewards
IAmThePan May 1, 2018
45094be
panel reward signals
trickpattyFH20 May 1, 2018
b771879
reward prompt flow
trickpattyFH20 May 1, 2018
456e54d
Finalize design for Rewards Panel
IAmThePan May 2, 2018
7d923da
clean rewards
trickpattyFH20 May 2, 2018
b4f87fe
rewards conf handling
trickpattyFH20 May 3, 2018
8272b01
update browser-core package and lock
trickpattyFH20 May 3, 2018
4bf063e
Add translations to Rewards Panel
IAmThePan May 3, 2018
f0aa355
Fix for Ghostery side enabling of offers
May 3, 2018
332f79f
styles. expiration. terms tt
trickpattyFH20 May 3, 2018
7dbd42f
enable offers by default
trickpattyFH20 May 3, 2018
455bc0e
start button styles
trickpattyFH20 May 3, 2018
3ed2459
Begin tests for the rewards panel
IAmThePan May 3, 2018
a3f202c
More and updated tests for Rewards Panel
IAmThePan May 3, 2018
a6f1441
Fix linting errors
IAmThePan May 3, 2018
a904612
signals
trickpattyFH20 May 4, 2018
9640606
Add more signals, fix linting errors, fix bug
IAmThePan May 4, 2018
417f461
Removing offers from ABTest
May 7, 2018
2815dca
style adjustments
trickpattyFH20 May 7, 2018
d87c7c9
GH-1051 fix null reward check
trickpattyFH20 May 8, 2018
48b38fd
GH-1055 fix - define onload evt first
trickpattyFH20 May 8, 2018
e294c78
button singleton + seen reward on offer card shown
trickpattyFH20 May 9, 2018
afb2dc4
typo
trickpattyFH20 May 9, 2018
7fb6652
Removing enable_offers_abtest.
May 9, 2018
83e7b78
Extra blanks
May 9, 2018
3976965
Removing checkbox for EDGE and CLIQZ unconditionally.
May 9, 2018
07983d0
Restore default manifest state.
May 9, 2018
bb2ee65
Update Rewards copy and add styling to non-happy-path Rewards panel
IAmThePan May 10, 2018
771c910
Update test snapshots
IAmThePan May 10, 2018
86111a3
Update package-lock file
IAmThePan May 10, 2018
86cc883
Minor copy change
IAmThePan May 10, 2018
63afa92
GH-1066 Fix text overflow on rewards panel
IAmThePan May 10, 2018
c25119b
Update snapshots for Reward Detail unit tests
IAmThePan May 10, 2018
afc04fc
documentation and svg cleanup
christophertino May 10, 2018
88229ed
Merge branch 'develop' into rewards-rebase
christophertino May 10, 2018
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Next
Initial commit. Code works on staging with some temp workarounds
  • Loading branch information
Serge Zarembsky authored and IAmThePan committed May 10, 2018
commit 72cb75ff6268e6c42e4bf44104c26d94dbcbf70e
@@ -21,6 +21,8 @@
import _ from 'underscore';
import moment from 'moment/min/moment-with-locales.min';
import CLIQZ from 'browser-core';
//TODO REMOVE WHEN PACKAGE ISEADY
import * as CliqzPrefs from 'browser-core/build/platform/prefs';
// object classes
import Button from './classes/BrowserButton';
import Events from './classes/EventHandlers';
@@ -57,11 +59,12 @@ const { sendMessage } = utils;
const { onMessage } = chrome.runtime;
// simple consts
const {
GHOSTERY_DOMAIN, CDN_SUB_DOMAIN, BROWSER_INFO, IS_CLIQZ
GHOSTERY_DOMAIN, CDN_SUB_DOMAIN, BROWSER_INFO, IS_CLIQZ, DEBUG
} = globals;
const IS_EDGE = (BROWSER_INFO.name === 'edge');
const VERSION_CHECK_URL = `https://${CDN_SUB_DOMAIN}.ghostery.com/update/version`;
const OFFERS_HANDLER_ID = 'ghostery';
const REAL_ESTATE_ID = 'ghostery';
const onBeforeRequest = events.onBeforeRequest.bind(events);
const onHeadersReceived = events.onHeadersReceived.bind(events);

@@ -87,7 +90,22 @@ function setCliqzModuleEnabled(module, enabled) {
cliqz.disableModule(module.name);
return Promise.resolve();
}
/**
* Register/unregister real estate with Offers core module.
* @memberOf Background
* @param {Object} offersModule offers module
* @param {Boolean} register true - register, false - unregister
*/

function registerWithOffers(offersModule, register) {
if (!offersModule.isEnabled) {
return Promise.resolve();
}
return offersModule.action(register ? 'registerRealEstate' : 'unregisterRealEstate', { realEstateID: REAL_ESTATE_ID })
.catch((e) => {
log(`FAILED TO ${register ? 'REGISTER' : 'UNREGISTER'} REAL ESTATE WITH OFFERS CORE`);
});
}
/**
* Check and fetch (if needed) a new tracker library every 12 hours
* @memberOf Background
@@ -789,9 +807,12 @@ function initializeDispatcher() {
});
dispatcher.on('conf.save.enable_offers', (enableOffers) => {
if (!IS_EDGE && !IS_CLIQZ) {
setCliqzModuleEnabled(offers, enableOffers);
if (enableOffers) {
setCliqzModuleEnabled(offers, enableOffers);
}
} else {
setCliqzModuleEnabled(offers, false);
registerWithOffers(offers, false);
}
});
dispatcher.on('conf.save.enable_anti_tracking', (enableAntitracking) => {
@@ -1013,10 +1034,30 @@ adblocker.on('enabled', () => {
offers.on('enabled', () => {
offers.isReady().then(() => {
log('IN OFFERS ON ENABLED', offers, messageCenter);
setCliqzModuleEnabled(messageCenter, true);
// TODO REPLCE WITH COMMENTED SECTION WHEN PACKAGE IS READY
CliqzPrefs.setPref('config_location', 'de');
CliqzPrefs.setPref('triggers-root', 'ghostery-root');
CliqzPrefs.setPref('triggersBE', 'http://offers-api-stage.clyqz.com:81');
CliqzPrefs.setPref('showConsoleLogs', true);
// CliqzPrefs.setPref('offers2FeatureEnabled', true);
CliqzPrefs.setPref('offersLogsEnabled', true);
CliqzPrefs.setPref('offersDevFlag', true);
CliqzPrefs.setPref('offersTelemetryFreq', "10");

// offers.action('setConfiguration', {
// config_location: 'de',
// triggersBE: DEBUG ? 'http://offers-api-stage.clyqz.com:81' : 'https://offers-api.cliqz.com',
// showConsoleLogs: (DEBUG === true),
// offersLogsEnabled: (DEBUG === true),
// offersDevFlag: (DEBUG === true),
// offersTelemetryFreq: DEBUG ? '10' : ''
// })
registerWithOffers(offers, true)
.then(() => {
setCliqzModuleEnabled(messageCenter, true);
});
});
});
/**
});/**
* Set listener for 'enabled' event for Offers module.
* It registers message handler for messages with the offers.
* This handler adds incoming message data to the array of
ProTip! Use n and p to navigate between commits in a pull request.