Changed job searching function BOD-311

This commit is contained in:
Patrick Fic
2020-10-05 10:16:07 -07:00
parent d9fd31a639
commit 44572ee2d0
7 changed files with 83 additions and 7 deletions

View File

@@ -0,0 +1,29 @@
import React, { useEffect } from "react";
export default function JiraSupportComponent() {
useEffect(() => {
const script = document.createElement("script");
script.src = "https://jsd-widget.atlassian.com/assets/embed.js";
// script.attributes.setNamedItem({ "data-jsd-embedded": true });
// script.attributes.setNamedItem({
// "data-key": "d69bb65c-1dd3-483f-b109-66a970d03f44",
// });
// script.attributes.setNamedItem({
// "data-base-url": "https://jsd-widget.atlassian.com",
// });
// script["data-jsd-embedded"] = true;
// script["data-key"] = "d69bb65c-1dd3-483f-b109-66a970d03f44";
// script["data-base-url"] = "https://jsd-widget.atlassian.com";
script.async = true;
document.body.appendChild(script);
return () => {
document.body.removeChild(script);
};
}, []);
return <div>JIra</div>;
}

View File

@@ -16,8 +16,8 @@ export default function JobReconciliationTotals({
}) {
const [errors, setErrors] = useState([]);
const { t } = useTranslation();
const [selectedBillLines, setSelectedBillLines] = billLineState;
const [selectedJobLines, setSelectedJobLines] = jobLineState;
const selectedBillLines = billLineState[0];
const selectedJobLines = jobLineState[0];
const totals = useMemo(() => {
const jlLookup = _.keyBy(selectedJobLines, (i) => i);

View File

@@ -2,7 +2,10 @@ import gql from "graphql-tag";
export const QUERY_ALL_ACTIVE_JOBS = gql`
query QUERY_ALL_ACTIVE_JOBS($statuses: [String!]!) {
jobs(where: { status: { _in: $statuses } }) {
jobs(
where: { status: { _in: $statuses } }
order_by: { est_number: desc }
) {
ownr_fn
ownr_ln
ownr_ph1
@@ -1108,7 +1111,7 @@ export const QUERY_ALL_JOBS_PAGINATED = gql`
$search: String
$offset: Int
$limit: Int
$order: [jobs_order_by!]!
$order: [jobs_order_by!]
) {
search_jobs(
args: { search: $search }

View File

@@ -32,7 +32,7 @@ export function AllJobs({ setBreadcrumbs, setSelectedHeader }) {
search: search || "",
offset: page ? (page - 1) * 25 : 0,
limit: 25,
order: [
order: sortcolumn && [
{
[sortcolumn || "est_number"]: sortorder
? sortorder === "descend"

View File

@@ -15,12 +15,13 @@ import FcmNotification from "../../components/fcm-notification/fcm-notification.
//import FooterComponent from "../../components/footer/footer.component";
//Component Imports
import HeaderContainer from "../../components/header/header.container";
import JiraSupportComponent from "../../components/jira-support-widget/jira-support-widget.component";
import LoadingSpinner from "../../components/loading-spinner/loading-spinner.component";
import PrintCenterModalContainer from "../../components/print-center-modal/print-center-modal.container";
import TestComponent from "../../components/_test/test.component";
import { QUERY_STRIPE_ID } from "../../graphql/bodyshop.queries";
import { selectInstanceConflict } from "../../redux/user/user.selectors";
import "./manage.page.styles.scss";
import TestComponent from "../../components/_test/test.component";
const ManageRootPage = lazy(() =>
import("../manage-root/manage-root.page.container")
@@ -365,12 +366,14 @@ export function Manage({ match, conflict }) {
)}
</ErrorBoundary>
<ChatAffixContainer />
<BackTop />
<div style={{ textAlign: "center", margin: "1rem 0rem" }}>
<div>{`ImEX Online V.${process.env.NODE_ENV}-${process.env.REACT_APP_GIT_SHA}`}</div>
<div>
&copy; 2019 - {new Date().getFullYear()} Snapt Software Inc.{" "}
&copy; 2019 - {new Date().getFullYear()} Snapt Software Inc.
</div>
<JiraSupportComponent />
</div>
</Content>
</Layout>

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,40 @@
- args:
cascade: true
read_only: false
sql: |-
CREATE OR REPLACE FUNCTION public.search_jobs(search text) RETURNS SETOF jobs LANGUAGE plpgsql STABLE AS $function$ BEGIN if search = '' then return query
select *
from jobs j;
else return query
SELECT *
FROM jobs j2
WHERE ro_number ILIKE '%' || search || '%'
OR (cast(est_number as text)) ILIKE '%' || search || '%'
or ownr_fn ILIKE '%' || search || '%'
or ownr_ln ILIKE '%' || search || '%'
or ownr_co_nm ILIKE '%' || search || '%'
or clm_no ILIKE '%' || search || '%'
or v_make_desc ILIKE '%' || search || '%'
or v_model_desc ILIKE '%' || search || '%'
OR plate_no ILIKE '%' || search || '%'
ORDER BY ro_number ILIKE '%' || search || '%'
OR NULL,
(cast(est_number as text)) ILIKE '%' || search || '%'
OR NULL,
ownr_ln ILIKE '%' || search || '%'
OR null,
ownr_co_nm ILIKE '%' || search || '%'
OR NULL,
ownr_fn ILIKE '%' || search || '%'
OR NULL,
clm_no ILIKE '%' || search || '%'
OR NULL,
v_make_desc ILIKE '%' || search || '%'
OR NULL,
v_model_desc ILIKE '%' || search || '%'
OR NULL,
plate_no ILIKE '%' || search || '%'
OR NULL;
end if;
END $function$;
type: run_sql