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 @@ -217,7 +217,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 @@ -258,7 +257,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
1 change: 0 additions & 1 deletion Parse-Dashboard/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,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>
1 change: 0 additions & 1 deletion Parse-Dashboard/login.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,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>
70 changes: 0 additions & 70 deletions src/dashboard/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ import { setBasePath } from 'lib/AJAX';
// // import createClass from 'create-react-class';
import { Helmet } from 'react-helmet';
import Playground from './Data/Playground/Playground.react';
import axios from 'lib/axios';
import moment from 'moment';
import B4aConnectPage from './B4aConnectPage/B4aConnectPage.react';
// // import EmptyState from 'components/EmptyState/EmptyState.react';
import BlockchainPage from './BlockchainPage/BlockChainPage.react';
Expand Down Expand Up @@ -86,15 +84,6 @@ const AccountSettingsPage = () => (
</AccountView>
);

async function fetchHubUser() {
try {
// eslint-disable-next-line no-undef
return (await axios.get(`${b4aSettings.BACK4APP_API_PATH}/me/hub`, { withCredentials: true })).data;
} catch (err) {
throw err.response && err.response.data && err.response.data.error ? err.response.data.error : err
}
}

const PARSE_DOT_COM_SERVER_INFO = {
features: {
schemas: {
Expand Down Expand Up @@ -132,23 +121,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!');
};

export default class Dashboard extends React.Component {
constructor(props) {
super();
Expand All @@ -167,48 +139,6 @@ export default class Dashboard extends React.Component {

componentDidMount() {
get('/parse-dashboard-config.json').then(({ apps, newFeaturesInLatestVersion = [], user }) => {
fetchHubUser().then(userDetail => {
const now = moment();
const hourDiff = now.diff(userDetail.createdAt, 'hours');
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 ? true : false;
let transactionId = userDetail.id;
if(!isFlow1){
const quarter = monthQuarter[parseInt(now.month() / 3)];
transactionId += `${now.year()}${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 = [];
apps.forEach(app => {
app.serverInfo = { status: 'LOADING' };
Expand Down
4 changes: 2 additions & 2 deletions src/dashboard/Data/Browser/ImportDialog.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class ImportDialog extends React.Component {
icon='down-outline'
iconSize={40}
title='Import data'
subtitle={'You will receive an e-mail once your data is imported'}
subtitle={'You will receive an email once your data is imported'}
confirmText='Import'
cancelText='Cancel'
disabled={!this.valid()}
Expand All @@ -63,7 +63,7 @@ export default class ImportDialog extends React.Component {
onChange={(file) => {this.setState({ file: file });}} />}
/>
{this.state.startedImport ?
<div style={{ padding: 20 }}>We are importing your data. You will be notified by e-mail once it is completed.</div> : null }
<div style={{ padding: 20 }}>We are importing your data. You will be notified by email once it is completed.</div> : null }
{this.state.errorMessage ?
<div style={{ padding: 20, color: '#ff395e' }}>Import Request failed with the following error: "{ this.state.errorMessage }".</div> : null }
</Modal>
Expand Down
4 changes: 2 additions & 2 deletions src/dashboard/Data/Browser/ImportRelationDialog.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default class ImportRelationDialog extends React.Component {
icon='down-outline'
iconSize={40}
title='Import relation data'
subtitle={'You will receive an e-mail once your data is imported'}
subtitle={'You will receive an email once your data is imported'}
confirmText='Import'
cancelText='Cancel'
disabled={!this.valid()}
Expand Down Expand Up @@ -71,7 +71,7 @@ export default class ImportRelationDialog extends React.Component {
onChange={(file) => {this.setState({ file: file });}} />}
/>
{this.state.startedImport ?
<div style={{ padding: 20 }}>We are importing your data. You will be notified by e-mail once it is completed.</div> : null }
<div style={{ padding: 20 }}>We are importing your data. You will be notified by email once it is completed.</div> : null }
{this.state.errorMessage ?
<div style={{ padding: 20, color: '#ff395e' }}>Import Request failed with the following error: "{ this.state.errorMessage }".</div> : null }
</Modal>
Expand Down
3 changes: 1 addition & 2 deletions webpack/base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ module.exports = {
new webpack.DefinePlugin({
'process.env': {
'version' : JSON.stringify(version),
'BACKEND_URL': JSON.stringify(BACK4APP_API_PATH),
'SOLUCX_API_KEY': JSON.stringify(settings.SOLUCX_API_KEY)
'BACKEND_URL': JSON.stringify(BACK4APP_API_PATH)
},
b4aSettings: JSON.stringify(settings)
}),
Expand Down
Loading