Added time ago formatter + schema changes for BOD-198
This commit is contained in:
@@ -7,7 +7,7 @@ import { Button, notification, Table, Input } from "antd";
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||||
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
import { TimeAgoFormatter } from "../../utils/DateFormatter";
|
||||||
import { alphaSort } from "../../utils/sorters";
|
import { alphaSort } from "../../utils/sorters";
|
||||||
import OwnerFindModalContainer from "../owner-find-modal/owner-find-modal.container";
|
import OwnerFindModalContainer from "../owner-find-modal/owner-find-modal.container";
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ export default function JobsAvailableComponent({
|
|||||||
sortOrder:
|
sortOrder:
|
||||||
state.sortedInfo.columnKey === "updated_at" && state.sortedInfo.order,
|
state.sortedInfo.columnKey === "updated_at" && state.sortedInfo.order,
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<DateTimeFormatter>{record.updated_at}</DateTimeFormatter>
|
<TimeAgoFormatter>{record.updated_at}</TimeAgoFormatter>
|
||||||
),
|
),
|
||||||
//width: "12%",
|
//width: "12%",
|
||||||
//ellipsis: true
|
//ellipsis: true
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { Button, notification, Table, Input } from "antd";
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||||
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
import { TimeAgoFormatter } from "../../utils/DateFormatter";
|
||||||
import { alphaSort } from "../../utils/sorters";
|
import { alphaSort } from "../../utils/sorters";
|
||||||
import JobsFindModalContainer from "../jobs-find-modal/jobs-find-modal.container";
|
import JobsFindModalContainer from "../jobs-find-modal/jobs-find-modal.container";
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ export default function JobsAvailableSupplementComponent({
|
|||||||
sortOrder:
|
sortOrder:
|
||||||
state.sortedInfo.columnKey === "updated_at" && state.sortedInfo.order,
|
state.sortedInfo.columnKey === "updated_at" && state.sortedInfo.order,
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<DateTimeFormatter>{record.updated_at}</DateTimeFormatter>
|
<TimeAgoFormatter>{record.updated_at}</TimeAgoFormatter>
|
||||||
),
|
),
|
||||||
//width: "12%",
|
//width: "12%",
|
||||||
//ellipsis: true
|
//ellipsis: true
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ export function* isUserAuthenticated() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(yield auth.currentUser.getIdToken(true));
|
||||||
|
|
||||||
LogRocket.identify(user.email);
|
LogRocket.identify(user.email);
|
||||||
yield put(
|
yield put(
|
||||||
signInSuccess({
|
signInSuccess({
|
||||||
|
|||||||
@@ -1,14 +1,24 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
import moment from "moment";
|
||||||
import Moment from "react-moment";
|
import Moment from "react-moment";
|
||||||
|
import { Tooltip } from "antd";
|
||||||
|
|
||||||
export function DateFormatter(props) {
|
export function DateFormatter(props) {
|
||||||
return props.children ? (
|
return props.children ? (
|
||||||
<Moment format="MM/DD/YYYY ">{props.children}</Moment>
|
<Moment format="MM/DD/YYYY ">{props.children}</Moment>
|
||||||
) : null;
|
) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function DateTimeFormatter(props) {
|
export function DateTimeFormatter(props) {
|
||||||
return props.children ? (
|
return props.children ? (
|
||||||
<Moment format="MM/DD/YYYY @ HH:mm">{props.children}</Moment>
|
<Moment format="MM/DD/YYYY @ HH:mm">{props.children}</Moment>
|
||||||
) : null;
|
) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function TimeAgoFormatter(props) {
|
||||||
|
const m = moment(props.children);
|
||||||
|
return props.children ? (
|
||||||
|
<Tooltip placement="top" title={m.format("MM/DD/YYY hh:mm A")}>
|
||||||
|
{m.fromNow()}
|
||||||
|
</Tooltip>
|
||||||
|
) : null;
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
- args:
|
||||||
|
cascade: false
|
||||||
|
read_only: false
|
||||||
|
sql: alter table "public"."available_jobs" drop constraint "available_jobs_clm_no_bodyshopid_key";
|
||||||
|
type: run_sql
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
- args:
|
||||||
|
cascade: false
|
||||||
|
read_only: false
|
||||||
|
sql: alter table "public"."available_jobs" add constraint "available_jobs_clm_no_bodyshopid_key"
|
||||||
|
unique ("clm_no", "bodyshopid");
|
||||||
|
type: run_sql
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
- args:
|
||||||
|
role: user
|
||||||
|
table:
|
||||||
|
name: available_jobs
|
||||||
|
schema: public
|
||||||
|
type: drop_update_permission
|
||||||
|
- args:
|
||||||
|
permission:
|
||||||
|
columns: []
|
||||||
|
filter:
|
||||||
|
bodyshop:
|
||||||
|
associations:
|
||||||
|
_and:
|
||||||
|
- user:
|
||||||
|
authid:
|
||||||
|
_eq: X-Hasura-User-Id
|
||||||
|
- active:
|
||||||
|
_eq: true
|
||||||
|
set: {}
|
||||||
|
role: user
|
||||||
|
table:
|
||||||
|
name: available_jobs
|
||||||
|
schema: public
|
||||||
|
type: create_update_permission
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
- args:
|
||||||
|
role: user
|
||||||
|
table:
|
||||||
|
name: available_jobs
|
||||||
|
schema: public
|
||||||
|
type: drop_update_permission
|
||||||
|
- args:
|
||||||
|
permission:
|
||||||
|
columns:
|
||||||
|
- cieca_id
|
||||||
|
- clm_amt
|
||||||
|
- est_data
|
||||||
|
- issupplement
|
||||||
|
- ownr_name
|
||||||
|
- source_system
|
||||||
|
- supplement_number
|
||||||
|
- uploaded_by
|
||||||
|
- vehicle_info
|
||||||
|
filter:
|
||||||
|
bodyshop:
|
||||||
|
associations:
|
||||||
|
_and:
|
||||||
|
- user:
|
||||||
|
authid:
|
||||||
|
_eq: X-Hasura-User-Id
|
||||||
|
- active:
|
||||||
|
_eq: true
|
||||||
|
set: {}
|
||||||
|
role: user
|
||||||
|
table:
|
||||||
|
name: available_jobs
|
||||||
|
schema: public
|
||||||
|
type: create_update_permission
|
||||||
@@ -316,7 +316,16 @@ tables:
|
|||||||
update_permissions:
|
update_permissions:
|
||||||
- role: user
|
- role: user
|
||||||
permission:
|
permission:
|
||||||
columns: []
|
columns:
|
||||||
|
- cieca_id
|
||||||
|
- clm_amt
|
||||||
|
- est_data
|
||||||
|
- issupplement
|
||||||
|
- ownr_name
|
||||||
|
- source_system
|
||||||
|
- supplement_number
|
||||||
|
- uploaded_by
|
||||||
|
- vehicle_info
|
||||||
filter:
|
filter:
|
||||||
bodyshop:
|
bodyshop:
|
||||||
associations:
|
associations:
|
||||||
|
|||||||
Reference in New Issue
Block a user