This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { Consumer as I18nConsumer } from '@App/I18nContext'; | |
import { i18n } from 'i18next'; | |
import { connect } from 'react-redux'; | |
import AttemptSubmitActionCreator from '@App/RequestData/redux/action-creators/attemptSubmit'; | |
import { IStoreState } from '@Redux/storeGenerator'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('should trigger mutation when submit button clicked', async () => { | |
// NB submit button relies on the redux store having valid data | |
// which is why I set it here | |
set('reduxState', { | |
selectedMeters: [123], | |
selectedMeasurements: ['elec_power_real'], | |
exportParameters: { | |
dateRange: { | |
start: new Date(Date.UTC(2017, 0, 1)), | |
finish: new Date(Date.UTC(2018, 0, 1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SubmitFormFixture extends Component { | |
public displayName = 'SubmitForm'; | |
public render() { | |
return ( | |
<Query query={getAvailableOptions}>{({ loading, error, data }) => ( | |
<Fragment> | |
<span data-result={JSON.stringify({ | |
loading, | |
error, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SubmitFormFixture extends Component { | |
public displayName = 'SubmitForm'; | |
public render() { | |
return ( | |
<Query query={getAvailableOptions}>{() => <SubmitFormComponent />}</Query> | |
); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const updateCache = (cache: any) => { | |
const { availableOptions } = cache.readQuery({ query: getAvailableOptions }); | |
cache.writeQuery({ | |
query: getAvailableOptions, | |
data: { | |
availableOptions: { | |
...availableOptions, | |
submitted: true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
reduxState: { | |
exportParameters: { | |
dateRange: { | |
start: new Date('2018-04-02'), | |
finish: new Date('2019-04-02') | |
} | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sales_order_record = zoho.crm.getRecordById("Sales_Orders",sales_order_id.toLong()); | |
products = sales_order_record.get("Product_Details"); | |
account_id = sales_order_record.get("Account_Name").getJSON("id"); | |
account_record = zoho.crm.getRecordById("Accounts", account_id.toLong()); | |
products_list = products.toJSONList(); | |
products_for_purchase_order = List:Map(); | |
grand_total = 0.0; | |
total_without_tax = 0.0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ORGANISATION_ID = "PORTAL_ID"; | |
AUTH_TOKEN = "AUTH_TOKEN"; | |
custMap = Map(); | |
custMap.put("is_portal_enabled",true); | |
update_resp = zoho.subscriptions.update("Customers", ORGANISATION_ID, customer_id, custMap); | |
addons = list(); | |
internet_addons = Map(); | |
upfront_fee = 0; | |
crm_account_id = application_form.Business_Company_Name_ID; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fileStream = fs.createWriteStream(fileName); | |
const requestOptions = { | |
url: URL, | |
headers: { | |
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36' | |
} | |
}; | |
request(requestOptions).pipe(fileStream); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
products_for_purchase_order = List:Map(); | |
products_for_purchase_order.add({ | |
"Product Id": product_for_purchase_order.get("PRODUCTID"), | |
"Quantity": item_data.get("quantity"), | |
"Product Name": product_for_purchase_order.get("Product Name"), | |
"Unit Price": product_for_purchase_order.get("Unit Price") | |
}); | |
new_purchase_order = { |