Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Parse-Dashboard/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ module.exports = function(config, options) {
<!--Start of Zopim Live Chat Script-->
<script async>/*<![CDATA[*/top.location.href && (window.zEmbed || function (e, t) { var n, o, d, i, s, a = [], r = document.createElement("iframe"); window.zEmbed = function () { a.push(arguments) }, window.zE = window.zE || window.zEmbed, r.src = "javascript:false", r.title = "", r.role = "presentation", (r.frameElement || r).style.cssText = "display: none", d = document.getElementsByTagName("script"), d = d[d.length - 1], d.parentNode.insertBefore(r, d), i = r.contentWindow, s = i.document; try { o = s } catch (e) { n = document.domain, r.src = 'javascript:var d=document.open();d.domain="' + n + '";void(0);', o = s } o.open()._l = function () { var e = this.createElement("script"); n && (this.domain = n), e.id = "js-iframe-async", e.src = "https://assets.zendesk.com/embeddable_framework/main.js", this.t = +new Date, this.zendeskHost = "back4app.zendesk.com", this.zEQueue = a, this.body.appendChild(e) }, o.write('<body onload="document._l();">'), o.close() }());/*]]>*/</script>
<!--End of Zopim Live Chat Script-->
<script src="https://survey.solucx.com.br/widget.js"></script>
</body>
</html>
`);
Expand Down Expand Up @@ -264,7 +263,6 @@ module.exports = function(config, options) {
<!--Start of Zopim Live Chat Script-->
<script async>/*<![CDATA[*/top.location.href && (window.zEmbed || function (e, t) { var n, o, d, i, s, a = [], r = document.createElement("iframe"); window.zEmbed = function () { a.push(arguments) }, window.zE = window.zE || window.zEmbed, r.src = "javascript:false", r.title = "", r.role = "presentation", (r.frameElement || r).style.cssText = "display: none", d = document.getElementsByTagName("script"), d = d[d.length - 1], d.parentNode.insertBefore(r, d), i = r.contentWindow, s = i.document; try { o = s } catch (e) { n = document.domain, r.src = 'javascript:var d=document.open();d.domain="' + n + '";void(0);', o = s } o.open()._l = function () { var e = this.createElement("script"); n && (this.domain = n), e.id = "js-iframe-async", e.src = "https://assets.zendesk.com/embeddable_framework/main.js", this.t = +new Date, this.zendeskHost = "back4app.zendesk.com", this.zEQueue = a, this.body.appendChild(e) }, o.write('<body onload="document._l();">'), o.close() }());/*]]>*/</script>
<!--End of Zopim Live Chat Script-->
<script src="https://survey.solucx.com.br/widget.js"></script>
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-W79Z9T" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
</body>
</html>
Expand Down
1 change: 0 additions & 1 deletion Parse-Dashboard/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
</script>
<script src="https://assets.zendesk.com/embeddable_framework/main.js" data-ze-csp="true" async defer></script>
<!--End of Zopim Live Chat Script-->
<script src="https://survey.solucx.com.br/widget.js"></script>
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-W79Z9T" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
</body>
</html>
1 change: 0 additions & 1 deletion Parse-Dashboard/login.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@
</script>
<script src="https://assets.zendesk.com/embeddable_framework/main.js" data-ze-csp="true" async defer></script>
<!--End of Zopim Live Chat Script-->
<script src="https://survey.solucx.com.br/widget.js"></script>
</body>
</html>
58 changes: 0 additions & 58 deletions src/dashboard/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,23 +139,6 @@ const PARSE_DOT_COM_SERVER_INFO = {
status: 'SUCCESS',
}

// const monthQuarter = {
// '0': 'Q1',
// '1': 'Q2',
// '2': 'Q3',
// '3': 'Q4'
// };

const waitForScriptToLoad = async conditionFn => {
for (let i = 1; i <= 20; i++) {
if (conditionFn()) {
return;
}
await new Promise(resolve => setTimeout(resolve, i * 50));
}
throw new Error('Script not loaded yet!');
};

const preloadMap = {
cloudCode: () => import('./Data/CloudCode/B4ACloudCode.react'),
graphqlConsole: () => import('./Data/ApiConsole/GraphQLConsole.react'),
Expand Down Expand Up @@ -226,47 +209,6 @@ class Dashboard extends React.Component {
fetchHubUser().then(userDetail => {
user.createdAt = userDetail.createdAt;
user.verification = userDetail.verification;
const now = new Date();
const createdAt = new Date(userDetail.createdAt);
const hourDiff = Math.floor((now - createdAt) / (1000 * 60 * 60));
if (hourDiff === 0) {
return;
}
if (userDetail.disableSolucxForm) {
return;
}
// Flow1 are users who signed up less than 30 days ago (720 hours)
const isFlow1 = hourDiff <= 720;
let transactionId = userDetail.id;
if (!isFlow1) {
const monthQuarter = ['Q1', 'Q2', 'Q3', 'Q4'];
const quarter = monthQuarter[Math.floor(now.getMonth() / 3)];
transactionId += `${now.getFullYear()}${quarter}`;
}
const options = {
transaction_id: transactionId,
store_id: isFlow1 ? '1001' : '1002',
name: userDetail.username,
email: userDetail.username,
journey: isFlow1 ? 'csat-back4app' : 'nps-back4app',
};
const retryInterval = isFlow1 ? 5 : 45;
const collectInterval = isFlow1 ? 30 : 90;
options.param_requestdata = encodeURIComponent(JSON.stringify({
userDetail,
options,
localStorage: localStorage.getItem('solucxWidgetLog-' + userDetail.username)
}));
// eslint-disable-next-line no-undef
waitForScriptToLoad(() => typeof createSoluCXWidget === 'function').then(() => {
// eslint-disable-next-line no-undef
createSoluCXWidget(
process.env.SOLUCX_API_KEY,
'bottomBoxLeft',
options,
{ collectInterval, retryAttempts: 1, retryInterval }
);
}).catch(err => console.log(err));
});

const stateApps = [];
Expand Down
1 change: 0 additions & 1 deletion src/lib/back4app2.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const back4app2 = {
id
username
createdAt
disableSolucxForm
avatar
}
}
Expand Down
1 change: 0 additions & 1 deletion webpack/base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ module.exports = {
'process.env': {
'version' : JSON.stringify(version),
'BACKEND_URL': JSON.stringify(BACK4APP_API_PATH),
'SOLUCX_API_KEY': JSON.stringify(settings.SOLUCX_API_KEY),
'BUILD_TIMESTAMP': JSON.stringify(new Date().toISOString()),
},
b4aSettings: JSON.stringify(settings)
Expand Down
Loading