From 77e009f31663be6838c95330701fe14888eba4a6 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Wed, 30 Oct 2024 11:19:46 -0700 Subject: [PATCH 1/5] IO-3012 Remove Sort from SB Timeticket Query Signed-off-by: Allan Carr --- client/src/graphql/timetickets.queries.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/client/src/graphql/timetickets.queries.js b/client/src/graphql/timetickets.queries.js index f56976e2b..ba7cf60fc 100644 --- a/client/src/graphql/timetickets.queries.js +++ b/client/src/graphql/timetickets.queries.js @@ -145,7 +145,6 @@ export const QUERY_TIME_TICKETS_IN_RANGE_SB = gql` ) { timetickets( where: { date: { _gte: $start, _lte: $end }, cost_center: { _neq: "timetickets.labels.shift" } } - order_by: { date: desc_nulls_first } ) { actualhrs ciecacode @@ -180,7 +179,6 @@ export const QUERY_TIME_TICKETS_IN_RANGE_SB = gql` } fixedperiod: timetickets( where: { date: { _gte: $fixedStart, _lte: $fixedEnd }, cost_center: { _neq: "timetickets.labels.shift" } } - order_by: { date: desc_nulls_first } ) { actualhrs ciecacode From 2ab4615642921ea568e8627e65fb4dd9319c96c6 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Wed, 30 Oct 2024 12:48:27 -0700 Subject: [PATCH 2/5] IO-3009 Clear Dates Signed-off-by: Allan Carr --- .../form-date-time-picker.component.jsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx b/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx index 707dfbdf8..0ef0faf80 100644 --- a/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx +++ b/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx @@ -2,11 +2,11 @@ import { DatePicker } from "antd"; import PropTypes from "prop-types"; import React, { useCallback, useState } from "react"; import { useTranslation } from "react-i18next"; -import dayjs from "../../utils/day"; -import { fuzzyMatchDate } from "./formats.js"; +import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { selectBodyshop } from "../../redux/user/user.selectors.js"; -import { connect } from "react-redux"; +import dayjs from "../../utils/day"; +import { fuzzyMatchDate } from "./formats.js"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop @@ -28,7 +28,6 @@ const DateTimePicker = ({ const handleChange = useCallback( (newDate) => { - if (!newDate) return; if (onChange) { onChange(bodyshop?.timezone ? dayjs(newDate).tz(bodyshop.timezone, true) : newDate); } From 830f6c0eea49a2d5615e0b437168a974b0794345 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 31 Oct 2024 10:48:40 -0700 Subject: [PATCH 3/5] IO-3014 TimeTicket UI Sort Signed-off-by: Allan Carr --- .../time-ticket-list/time-ticket-list.component.jsx | 2 +- client/src/graphql/timetickets.queries.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/client/src/components/time-ticket-list/time-ticket-list.component.jsx b/client/src/components/time-ticket-list/time-ticket-list.component.jsx index f8da959c9..668cdb106 100644 --- a/client/src/components/time-ticket-list/time-ticket-list.component.jsx +++ b/client/src/components/time-ticket-list/time-ticket-list.component.jsx @@ -39,7 +39,7 @@ export function TimeTicketList({ extra }) { const [state, setState] = useState({ - sortedInfo: {}, + sortedInfo: { columnKey: 'date', order: 'descend' }, filteredInfo: { text: "" } }); diff --git a/client/src/graphql/timetickets.queries.js b/client/src/graphql/timetickets.queries.js index f56976e2b..b21e47f56 100644 --- a/client/src/graphql/timetickets.queries.js +++ b/client/src/graphql/timetickets.queries.js @@ -26,7 +26,7 @@ export const QUERY_TICKETS_BY_JOBID = gql` export const QUERY_TIME_TICKETS_IN_RANGE = gql` query QUERY_TIME_TICKETS_IN_RANGE($start: date!, $end: date!) { - timetickets(where: { date: { _gte: $start, _lte: $end } }, order_by: { date: desc_nulls_first }) { + timetickets(where: { date: { _gte: $start, _lte: $end } }) { actualhrs ciecacode clockoff @@ -69,7 +69,6 @@ export const QUERY_TIME_TICKETS_TECHNICIAN_IN_RANGE = gql` ) { timetickets( where: { date: { _gte: $start, _lte: $end }, employeeid: { _eq: $employeeid } } - order_by: { date: desc_nulls_first } ) { actualhrs ciecacode @@ -101,7 +100,6 @@ export const QUERY_TIME_TICKETS_TECHNICIAN_IN_RANGE = gql` } fixedperiod: timetickets( where: { date: { _gte: $fixedStart, _lte: $fixedEnd }, employeeid: { _eq: $employeeid } } - order_by: { date: desc_nulls_first } ) { actualhrs ciecacode From ae020b651e54566e043d905e75906b641d58f6ee Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 31 Oct 2024 10:56:05 -0700 Subject: [PATCH 4/5] IO-3014 Further Query Refinements for T/T Signed-off-by: Allan Carr --- client/src/graphql/timetickets.queries.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/src/graphql/timetickets.queries.js b/client/src/graphql/timetickets.queries.js index b21e47f56..c5707a2e4 100644 --- a/client/src/graphql/timetickets.queries.js +++ b/client/src/graphql/timetickets.queries.js @@ -2,7 +2,7 @@ import { gql } from "@apollo/client"; export const QUERY_TICKETS_BY_JOBID = gql` query QUERY_TICKETS_BY_JOBID($jobid: uuid!) { - timetickets(where: { jobid: { _eq: $jobid } }, order_by: { date: desc_nulls_first }) { + timetickets(where: { jobid: { _eq: $jobid } }) { actualhrs cost_center ciecacode @@ -333,7 +333,6 @@ export const UPDATE_TIME_TICKETS = gql` export const QUERY_ACTIVE_TIME_TICKETS = gql` query QUERY_ACTIVE_TIME_TICKETS($employeeId: uuid) { timetickets( - order_by: { date: desc_nulls_first } where: { _and: { clockoff: { _is_null: true } From 01c55d627719ec78d6dd7d88ac6495a146f51f90 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 31 Oct 2024 11:04:05 -0700 Subject: [PATCH 5/5] IO-3014 Change Polling Intervals Signed-off-by: Allan Carr --- client/src/components/chat-popup/chat-popup.component.jsx | 2 +- .../scoreboard-display/scoreboard-display.component.jsx | 6 +++--- .../scoreboard-timetickets.component.jsx | 4 ++-- .../scoreboard-timetickets.component.jsx | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/client/src/components/chat-popup/chat-popup.component.jsx b/client/src/components/chat-popup/chat-popup.component.jsx index c608f8b11..d557ad91d 100644 --- a/client/src/components/chat-popup/chat-popup.component.jsx +++ b/client/src/components/chat-popup/chat-popup.component.jsx @@ -45,7 +45,7 @@ export function ChatPopupComponent({ chatVisible, selectedConversation, toggleCh if (fcmToken) { setpollInterval(0); } else { - setpollInterval(60000); + setpollInterval(90000); } }, [fcmToken]); diff --git a/client/src/components/scoreboard-display/scoreboard-display.component.jsx b/client/src/components/scoreboard-display/scoreboard-display.component.jsx index c74cecdc0..5a4e6fe72 100644 --- a/client/src/components/scoreboard-display/scoreboard-display.component.jsx +++ b/client/src/components/scoreboard-display/scoreboard-display.component.jsx @@ -4,12 +4,12 @@ import ScoreboardChart from "../scoreboard-chart/scoreboard-chart.component"; import ScoreboardLastDays from "../scoreboard-last-days/scoreboard-last-days.component"; import ScoreboardTargetsTable from "../scoreboard-targets-table/scoreboard-targets-table.component"; +import { useApolloClient, useQuery } from "@apollo/client"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; +import { GET_BLOCKED_DAYS, QUERY_SCOREBOARD } from "../../graphql/scoreboard.queries"; import { selectBodyshop } from "../../redux/user/user.selectors"; import dayjs from "../../utils/day"; -import { useApolloClient, useQuery } from "@apollo/client"; -import { GET_BLOCKED_DAYS, QUERY_SCOREBOARD } from "../../graphql/scoreboard.queries"; const mapStateToProps = createStructuredSelector({ //currentUser: selectCurrentUser @@ -26,7 +26,7 @@ export function ScoreboardDisplayComponent({ bodyshop }) { start: dayjs().startOf("month"), end: dayjs().endOf("month") }, - pollInterval: 60000 + pollInterval: 60000*5 }); const { data } = scoreboardSubscription; diff --git a/client/src/components/scoreboard-timetickets-stats/scoreboard-timetickets.component.jsx b/client/src/components/scoreboard-timetickets-stats/scoreboard-timetickets.component.jsx index 489467740..07e77d479 100644 --- a/client/src/components/scoreboard-timetickets-stats/scoreboard-timetickets.component.jsx +++ b/client/src/components/scoreboard-timetickets-stats/scoreboard-timetickets.component.jsx @@ -1,13 +1,13 @@ import { useQuery } from "@apollo/client"; import { Col, Row } from "antd"; import _ from "lodash"; -import dayjs from "../../utils/day"; import React, { useMemo } from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { QUERY_TIME_TICKETS_IN_RANGE_SB } from "../../graphql/timetickets.queries"; import { selectBodyshop } from "../../redux/user/user.selectors"; +import dayjs from "../../utils/day"; import AlertComponent from "../alert/alert.component"; import LoadingSpinner from "../loading-spinner/loading-spinner.component"; import * as Utils from "../scoreboard-targets-table/scoreboard-targets-table.util"; @@ -86,7 +86,7 @@ export function ScoreboardTimeTicketsStats({ bodyshop }) { }, fetchPolicy: "network-only", nextFetchPolicy: "network-only", - pollInterval: 60000, + pollInterval: 60000*5, skip: !fixedPeriods }); diff --git a/client/src/components/scoreboard-timetickets/scoreboard-timetickets.component.jsx b/client/src/components/scoreboard-timetickets/scoreboard-timetickets.component.jsx index 2587cb74e..fb970be5d 100644 --- a/client/src/components/scoreboard-timetickets/scoreboard-timetickets.component.jsx +++ b/client/src/components/scoreboard-timetickets/scoreboard-timetickets.component.jsx @@ -1,11 +1,11 @@ import { useQuery } from "@apollo/client"; import { Col, Row } from "antd"; import _ from "lodash"; -import dayjs from "../../utils/day"; import queryString from "query-string"; import React, { useMemo } from "react"; import { useLocation } from "react-router-dom"; import { QUERY_TIME_TICKETS_IN_RANGE_SB } from "../../graphql/timetickets.queries"; +import dayjs from "../../utils/day"; import AlertComponent from "../alert/alert.component"; import LoadingSpinner from "../loading-spinner/loading-spinner.component"; import * as Utils from "../scoreboard-targets-table/scoreboard-targets-table.util"; @@ -68,7 +68,7 @@ export default function ScoreboardTimeTickets() { }, fetchPolicy: "network-only", nextFetchPolicy: "network-only", - pollInterval: 60000, + pollInterval: 60000*5, skip: !fixedPeriods });