Compare commits
1 Commits
feature/IO
...
feature/IO
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8243aa2b3 |
@@ -26,6 +26,7 @@ import ProductionListColumnComment from "../production-list-columns/production-l
|
|||||||
import ProductionListColumnProductionNote from "../production-list-columns/production-list-columns.productionnote.component";
|
import ProductionListColumnProductionNote from "../production-list-columns/production-list-columns.productionnote.component";
|
||||||
import VehicleVinDisplay from "../vehicle-vin-display/vehicle-vin-display.component";
|
import VehicleVinDisplay from "../vehicle-vin-display/vehicle-vin-display.component";
|
||||||
import "./jobs-detail-header.styles.scss";
|
import "./jobs-detail-header.styles.scss";
|
||||||
|
import moment from "moment";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
jobRO: selectJobReadOnly,
|
jobRO: selectJobReadOnly,
|
||||||
@@ -93,7 +94,9 @@ export function JobsDetailHeader({ job, bodyshop, disabled }) {
|
|||||||
{job.status === bodyshop.md_ro_statuses.default_scheduled &&
|
{job.status === bodyshop.md_ro_statuses.default_scheduled &&
|
||||||
job.scheduled_in ? (
|
job.scheduled_in ? (
|
||||||
<Tag>
|
<Tag>
|
||||||
<DateTimeFormatter>{job.scheduled_in}</DateTimeFormatter>
|
<Link to={`/manage/schedule?date=${moment(job.scheduled_in).format('YYYY-MM-DD')}`}>
|
||||||
|
<DateTimeFormatter>{job.scheduled_in}</DateTimeFormatter>
|
||||||
|
</Link>
|
||||||
</Tag>
|
</Tag>
|
||||||
) : null}
|
) : null}
|
||||||
</Space>
|
</Space>
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ import { getAuth, updatePassword, updateProfile } from "firebase/auth";
|
|||||||
import { getFirestore } from "firebase/firestore";
|
import { getFirestore } from "firebase/firestore";
|
||||||
import { getMessaging, getToken, onMessage } from "firebase/messaging";
|
import { getMessaging, getToken, onMessage } from "firebase/messaging";
|
||||||
import { store } from "../redux/store";
|
import { store } from "../redux/store";
|
||||||
import axios from "axios";
|
|
||||||
import { checkBeta } from "../utils/handleBeta";
|
|
||||||
|
|
||||||
const config = JSON.parse(process.env.REACT_APP_FIREBASE_CONFIG);
|
const config = JSON.parse(process.env.REACT_APP_FIREBASE_CONFIG);
|
||||||
initializeApp(config);
|
initializeApp(config);
|
||||||
@@ -88,18 +86,6 @@ export const logImEXEvent = (eventName, additionalParams, stateProp = null) => {
|
|||||||
null,
|
null,
|
||||||
...additionalParams,
|
...additionalParams,
|
||||||
};
|
};
|
||||||
axios.post("/ioevent", {
|
|
||||||
useremail:
|
|
||||||
(state.user && state.user.currentUser && state.user.currentUser.email) ||
|
|
||||||
null,
|
|
||||||
bodyshopid:
|
|
||||||
(state.user && state.user.bodyshop && state.user.bodyshop.id) || null,
|
|
||||||
operationName: eventName,
|
|
||||||
variables: additionalParams,
|
|
||||||
dbevent: false,
|
|
||||||
env: checkBeta() ? "beta" : "master",
|
|
||||||
});
|
|
||||||
|
|
||||||
// console.log(
|
// console.log(
|
||||||
// "%c[Analytics]",
|
// "%c[Analytics]",
|
||||||
// "background-color: green ;font-weight:bold;",
|
// "background-color: green ;font-weight:bold;",
|
||||||
|
|||||||
@@ -4200,7 +4200,7 @@
|
|||||||
interval_sec: 10
|
interval_sec: 10
|
||||||
num_retries: 0
|
num_retries: 0
|
||||||
timeout_sec: 60
|
timeout_sec: 60
|
||||||
webhook: https://worktest.home.irony.online
|
webhook_from_env: HASURA_API_URL
|
||||||
headers:
|
headers:
|
||||||
- name: event-secret
|
- name: event-secret
|
||||||
value_from_env: EVENT_SECRET
|
value_from_env: EVENT_SECRET
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
-- Could not auto-generate a down migration.
|
|
||||||
-- Please write an appropriate down migration for the SQL below:
|
|
||||||
-- alter table "public"."ioevents" add column "useremail" text
|
|
||||||
-- not null;
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
alter table "public"."ioevents" add column "useremail" text;
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
-- Could not auto-generate a down migration.
|
|
||||||
-- Please write an appropriate down migration for the SQL below:
|
|
||||||
-- alter table "public"."ioevents" add column "bodyshopid" uuid
|
|
||||||
-- null;
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
alter table "public"."ioevents" add column "bodyshopid" uuid
|
|
||||||
null;
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
alter table "public"."ioevents" alter column "useremail" set not null;
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
alter table "public"."ioevents" alter column "useremail" drop not null;
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
-- Could not auto-generate a down migration.
|
|
||||||
-- Please write an appropriate down migration for the SQL below:
|
|
||||||
-- alter table "public"."ioevents" add column "env" text
|
|
||||||
-- null;
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
alter table "public"."ioevents" add column "env" text
|
|
||||||
null;
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
DROP INDEX IF EXISTS "public"."ioevents_useremail";
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
CREATE INDEX "ioevents_useremail" on
|
|
||||||
"public"."ioevents" using btree ("useremail");
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
alter table "public"."ioevents" drop constraint "ioevents_useremail_fkey";
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
alter table "public"."ioevents"
|
|
||||||
add constraint "ioevents_useremail_fkey"
|
|
||||||
foreign key ("useremail")
|
|
||||||
references "public"."users"
|
|
||||||
("email") on update set null on delete set null;
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
alter table "public"."ioevents" drop constraint "ioevents_bodyshopid_fkey";
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
alter table "public"."ioevents"
|
|
||||||
add constraint "ioevents_bodyshopid_fkey"
|
|
||||||
foreign key ("bodyshopid")
|
|
||||||
references "public"."bodyshops"
|
|
||||||
("id") on update set null on delete set null;
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
DROP INDEX IF EXISTS "public"."idx_audit_trail_type";
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
CREATE INDEX "idx_audit_trail_type" on
|
|
||||||
"public"."audit_trail" using btree ("type");
|
|
||||||
@@ -11,40 +11,27 @@ require("dotenv").config({
|
|||||||
});
|
});
|
||||||
|
|
||||||
exports.default = async (req, res) => {
|
exports.default = async (req, res) => {
|
||||||
const {
|
const { operationName, time, dbevent, user, imexshopid } = req.body;
|
||||||
useremail,
|
|
||||||
bodyshopid,
|
|
||||||
operationName,
|
|
||||||
variables,
|
|
||||||
env,
|
|
||||||
time,
|
|
||||||
dbevent,
|
|
||||||
user,
|
|
||||||
} = req.body;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await client.request(queries.INSERT_IOEVENT, {
|
// await client.request(queries.INSERT_IOEVENT, {
|
||||||
event: {
|
// event: {
|
||||||
operationname: operationName,
|
// operationname: operationName,
|
||||||
time,
|
// time,
|
||||||
dbevent,
|
// dbevent,
|
||||||
env,
|
// },
|
||||||
variables,
|
// });
|
||||||
bodyshopid,
|
console.log("IOEVENT", operationName, time, dbevent, user, imexshopid);
|
||||||
useremail,
|
logger.log("ioevent", "trace", user, null, {
|
||||||
},
|
imexshopid,
|
||||||
});
|
operationName,
|
||||||
res.sendStatus(200);
|
|
||||||
} catch (error) {
|
|
||||||
logger.log("ioevent-error", "trace", user, null, {
|
|
||||||
operationname: operationName,
|
|
||||||
time,
|
time,
|
||||||
dbevent,
|
dbevent,
|
||||||
env,
|
|
||||||
variables,
|
|
||||||
bodyshopid,
|
|
||||||
useremail,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
res.sendStatus(200);
|
res.sendStatus(200);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("error", error);
|
||||||
|
res.status(400).send(error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user