added firebase analytics
This commit is contained in:
@@ -5477,6 +5477,27 @@
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>total</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>unq_seq</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
"react-barcode": "^1.4.0",
|
||||
"react-big-calendar": "^0.24.1",
|
||||
"react-dom": "^16.13.1",
|
||||
"react-ga": "^2.7.0",
|
||||
"react-grid-gallery": "^0.5.5",
|
||||
"react-grid-layout": "^0.18.3",
|
||||
"react-html-email": "^3.0.0",
|
||||
|
||||
@@ -11,9 +11,9 @@ import AllocationsBulkAssignmentContainer from "../allocations-bulk-assignment/a
|
||||
import AllocationsEmployeeLabelContainer from "../allocations-employee-label/allocations-employee-label.container";
|
||||
import PartsOrderModalContainer from "../parts-order-modal/parts-order-modal.container";
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
setPartsOrderContext: context =>
|
||||
dispatch(setModalContext({ context: context, modal: "partsOrder" }))
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
setPartsOrderContext: (context) =>
|
||||
dispatch(setModalContext({ context: context, modal: "partsOrder" })),
|
||||
});
|
||||
|
||||
export function JobLinesComponent({
|
||||
@@ -25,10 +25,10 @@ export function JobLinesComponent({
|
||||
selectedLines,
|
||||
setSelectedLines,
|
||||
jobId,
|
||||
setJobLineEditContext
|
||||
setJobLineEditContext,
|
||||
}) {
|
||||
const [state, setState] = useState({
|
||||
sortedInfo: {}
|
||||
sortedInfo: {},
|
||||
});
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -44,7 +44,7 @@ export function JobLinesComponent({
|
||||
state.sortedInfo.columnKey === "unq_seq" && state.sortedInfo.order,
|
||||
//ellipsis: true,
|
||||
editable: true,
|
||||
width: 75
|
||||
width: 75,
|
||||
},
|
||||
{
|
||||
title: t("joblines.fields.line_desc"),
|
||||
@@ -55,7 +55,6 @@ export function JobLinesComponent({
|
||||
state.sortedInfo.columnKey === "line_desc" && state.sortedInfo.order,
|
||||
ellipsis: true,
|
||||
editable: true,
|
||||
width: "20%"
|
||||
},
|
||||
{
|
||||
title: t("joblines.fields.oem_partno"),
|
||||
@@ -70,12 +69,12 @@ export function JobLinesComponent({
|
||||
state.sortedInfo.columnKey === "oem_partno" && state.sortedInfo.order,
|
||||
ellipsis: true,
|
||||
editable: true,
|
||||
width: "10%",
|
||||
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
{record.oem_partno ? record.oem_partno : record.op_code_desc}
|
||||
</span>
|
||||
)
|
||||
),
|
||||
},
|
||||
{
|
||||
title: t("joblines.fields.part_type"),
|
||||
@@ -86,7 +85,6 @@ export function JobLinesComponent({
|
||||
state.sortedInfo.columnKey === "part_type" && state.sortedInfo.order,
|
||||
ellipsis: true,
|
||||
editable: true,
|
||||
width: "7%"
|
||||
},
|
||||
{
|
||||
title: t("joblines.fields.line_ind"),
|
||||
@@ -94,20 +92,7 @@ export function JobLinesComponent({
|
||||
key: "line_ind",
|
||||
sorter: (a, b) => alphaSort(a.line_ind, b.line_ind),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "line_ind" && state.sortedInfo.order
|
||||
},
|
||||
{
|
||||
title: t("joblines.fields.db_price"),
|
||||
dataIndex: "db_price",
|
||||
key: "db_price",
|
||||
sorter: (a, b) => a.db_price - b.db_price,
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "db_price" && state.sortedInfo.order,
|
||||
ellipsis: true,
|
||||
width: "8%",
|
||||
render: (text, record) => (
|
||||
<CurrencyFormatter>{record.db_price}</CurrencyFormatter>
|
||||
)
|
||||
state.sortedInfo.columnKey === "line_ind" && state.sortedInfo.order,
|
||||
},
|
||||
{
|
||||
title: t("joblines.fields.act_price"),
|
||||
@@ -117,10 +102,31 @@ export function JobLinesComponent({
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "act_price" && state.sortedInfo.order,
|
||||
ellipsis: true,
|
||||
width: "8%",
|
||||
|
||||
render: (text, record) => (
|
||||
<CurrencyFormatter>{record.act_price}</CurrencyFormatter>
|
||||
)
|
||||
),
|
||||
},
|
||||
{
|
||||
title: t("joblines.fields.part_qty"),
|
||||
dataIndex: "part_qty",
|
||||
key: "part_qty",
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: t("joblines.fields.total"),
|
||||
dataIndex: "total",
|
||||
key: "total",
|
||||
sorter: (a, b) => a.act_price * a.part_qty - b.act_price * b.part_qty,
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "act_price" && state.sortedInfo.order,
|
||||
ellipsis: true,
|
||||
|
||||
render: (text, record) => (
|
||||
<CurrencyFormatter>
|
||||
{record.act_price * record.part_qty}
|
||||
</CurrencyFormatter>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: t("joblines.fields.mod_lb_hrs"),
|
||||
@@ -128,7 +134,7 @@ export function JobLinesComponent({
|
||||
key: "mod_lb_hrs",
|
||||
sorter: (a, b) => a.mod_lb_hrs - b.mod_lb_hrs,
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "mod_lb_hrs" && state.sortedInfo.order
|
||||
state.sortedInfo.columnKey === "mod_lb_hrs" && state.sortedInfo.order,
|
||||
},
|
||||
{
|
||||
title: t("joblines.fields.status"),
|
||||
@@ -136,13 +142,13 @@ export function JobLinesComponent({
|
||||
key: "status",
|
||||
sorter: (a, b) => alphaSort(a.status, b.status),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "status" && state.sortedInfo.order
|
||||
state.sortedInfo.columnKey === "status" && state.sortedInfo.order,
|
||||
},
|
||||
{
|
||||
title: t("allocations.fields.employee"),
|
||||
dataIndex: "employee",
|
||||
key: "employee",
|
||||
width: "10%",
|
||||
|
||||
sorter: (a, b) =>
|
||||
alphaSort(
|
||||
a.allocations[0] &&
|
||||
@@ -157,7 +163,7 @@ export function JobLinesComponent({
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
{record.allocations && record.allocations.length > 0
|
||||
? record.allocations.map(item => (
|
||||
? record.allocations.map((item) => (
|
||||
<AllocationsEmployeeLabelContainer
|
||||
key={item.id}
|
||||
refetch={refetch}
|
||||
@@ -172,7 +178,7 @@ export function JobLinesComponent({
|
||||
hours={record.mod_lb_hrs}
|
||||
/>
|
||||
</span>
|
||||
)
|
||||
),
|
||||
},
|
||||
{
|
||||
title: t("general.labels.actions"),
|
||||
@@ -184,32 +190,21 @@ export function JobLinesComponent({
|
||||
onClick={() => {
|
||||
setJobLineEditContext({
|
||||
actions: { refetch: refetch },
|
||||
context: record
|
||||
context: record,
|
||||
});
|
||||
}}
|
||||
>
|
||||
{t("general.actions.edit")}
|
||||
</Button>
|
||||
</span>
|
||||
)
|
||||
}
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
const handleTableChange = (pagination, filters, sorter) => {
|
||||
setState({ ...state, filteredInfo: filters, sortedInfo: sorter });
|
||||
};
|
||||
|
||||
const formItemLayout = {
|
||||
labelCol: {
|
||||
xs: { span: 12 },
|
||||
sm: { span: 5 }
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 12 }
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<PartsOrderModalContainer />
|
||||
@@ -219,7 +214,7 @@ export function JobLinesComponent({
|
||||
<div>
|
||||
<Input.Search
|
||||
placeholder={t("general.labels.search")}
|
||||
onChange={e => {
|
||||
onChange={(e) => {
|
||||
e.preventDefault();
|
||||
setSearchText(e.target.value);
|
||||
}}
|
||||
@@ -231,8 +226,8 @@ export function JobLinesComponent({
|
||||
actions: { refetch: refetch },
|
||||
context: {
|
||||
jobId: jobId,
|
||||
linesToOrder: selectedLines
|
||||
}
|
||||
linesToOrder: selectedLines,
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
@@ -246,7 +241,7 @@ export function JobLinesComponent({
|
||||
onClick={() => {
|
||||
setJobLineEditContext({
|
||||
actions: { refetch: refetch },
|
||||
context: { jobid: jobId }
|
||||
context: { jobid: jobId },
|
||||
});
|
||||
}}
|
||||
>
|
||||
@@ -255,13 +250,12 @@ export function JobLinesComponent({
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
{...formItemLayout}
|
||||
loading={loading}
|
||||
size="small"
|
||||
expandedRowRender={record => (
|
||||
expandedRowRender={(record) => (
|
||||
<div style={{ margin: 0 }}>
|
||||
<strong>{t("parts_orders.labels.orderhistory")}</strong>
|
||||
{record.parts_order_lines.map(item => (
|
||||
{record.parts_order_lines.map((item) => (
|
||||
<div key={item.id}>
|
||||
{`${item.parts_order.order_number || ""} from `}
|
||||
<Link to={`/manage/shop/vendors/${item.parts_order.vendor.id}`}>
|
||||
@@ -279,9 +273,9 @@ export function JobLinesComponent({
|
||||
setSelectedLines(selectedRows);
|
||||
},
|
||||
onSelect: (record, selected, selectedRows, nativeEvent) =>
|
||||
setSelectedLines(selectedRows)
|
||||
setSelectedLines(selectedRows),
|
||||
}}
|
||||
columns={columns.map(item => ({ ...item }))}
|
||||
columns={columns.map((item) => ({ ...item }))}
|
||||
rowKey="id"
|
||||
dataSource={jobLines}
|
||||
onChange={handleTableChange}
|
||||
|
||||
@@ -2,28 +2,30 @@ import firebase from "firebase/app";
|
||||
import "firebase/firestore";
|
||||
import "firebase/auth";
|
||||
import "firebase/database";
|
||||
import "firebase/analytics";
|
||||
|
||||
const config = JSON.parse(process.env.REACT_APP_FIREBASE_CONFIG);
|
||||
firebase.initializeApp(config);
|
||||
|
||||
export const auth = firebase.auth();
|
||||
export const firestore = firebase.firestore();
|
||||
export const analytics = firebase.analytics();
|
||||
|
||||
export default firebase;
|
||||
|
||||
export const getCurrentUser = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const unsubscribe = auth.onAuthStateChanged(userAuth => {
|
||||
const unsubscribe = auth.onAuthStateChanged((userAuth) => {
|
||||
unsubscribe();
|
||||
resolve(userAuth);
|
||||
}, reject);
|
||||
});
|
||||
};
|
||||
|
||||
export const updateCurrentUser = userDetails => {
|
||||
export const updateCurrentUser = (userDetails) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const unsubscribe = auth.onAuthStateChanged(userAuth => {
|
||||
console.log("userDetails", userDetails);
|
||||
userAuth.updateProfile(userDetails).then(r => {
|
||||
const unsubscribe = auth.onAuthStateChanged((userAuth) => {
|
||||
userAuth.updateProfile(userDetails).then((r) => {
|
||||
unsubscribe();
|
||||
resolve(userAuth);
|
||||
});
|
||||
|
||||
@@ -1,11 +1,23 @@
|
||||
import React from "react";
|
||||
import DashboardGridComponent from "../../components/dashboard-grid/dashboard-grid.component";
|
||||
import Test from "../../components/_test/test.component";
|
||||
import { analytics } from "../../firebase/firebase.utils";
|
||||
|
||||
export default function ManageRootPageComponent() {
|
||||
//const client = useApolloClient();
|
||||
return (
|
||||
<div>
|
||||
<Test />
|
||||
<button
|
||||
onClick={() => {
|
||||
analytics.logEvent("start_game", {
|
||||
level: "10",
|
||||
difficulty: "expert",
|
||||
});
|
||||
}}
|
||||
>
|
||||
Click me to start an event
|
||||
</button>
|
||||
<DashboardGridComponent />
|
||||
{
|
||||
// <SendEmailButton
|
||||
|
||||
@@ -385,6 +385,7 @@
|
||||
"part_qty": "Quantity",
|
||||
"part_type": "Part Type",
|
||||
"status": "Status",
|
||||
"total": "Total",
|
||||
"unq_seq": "Seq #"
|
||||
},
|
||||
"labels": {
|
||||
|
||||
@@ -385,6 +385,7 @@
|
||||
"part_qty": "",
|
||||
"part_type": "Tipo de parte",
|
||||
"status": "Estado",
|
||||
"total": "",
|
||||
"unq_seq": "Seq #"
|
||||
},
|
||||
"labels": {
|
||||
|
||||
@@ -385,6 +385,7 @@
|
||||
"part_qty": "",
|
||||
"part_type": "Type de pièce",
|
||||
"status": "Statut",
|
||||
"total": "",
|
||||
"unq_seq": "Seq #"
|
||||
},
|
||||
"labels": {
|
||||
|
||||
@@ -11178,6 +11178,11 @@ react-error-overlay@^6.0.7:
|
||||
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.7.tgz#1dcfb459ab671d53f660a991513cb2f0a0553108"
|
||||
integrity sha512-TAv1KJFh3RhqxNvhzxj6LeT5NWklP6rDr2a0jaTfsZ5wSZWHOGeqQyejUp3xxLfPt2UpyJEcVQB/zyPcmonNFA==
|
||||
|
||||
react-ga@^2.7.0:
|
||||
version "2.7.0"
|
||||
resolved "https://registry.yarnpkg.com/react-ga/-/react-ga-2.7.0.tgz#24328f157f31e8cffbf4de74a3396536679d8d7c"
|
||||
integrity sha512-AjC7UOZMvygrWTc2hKxTDvlMXEtbmA0IgJjmkhgmQQ3RkXrWR11xEagLGFGaNyaPnmg24oaIiaNPnEoftUhfXA==
|
||||
|
||||
react-grid-gallery@^0.5.5:
|
||||
version "0.5.5"
|
||||
resolved "https://registry.yarnpkg.com/react-grid-gallery/-/react-grid-gallery-0.5.5.tgz#1b3f3c23a190834e587ab613c96d53ec3af4f0a2"
|
||||
|
||||
Reference in New Issue
Block a user