diff --git a/client/src/App/App.styles.scss b/client/src/App/App.styles.scss index b57e94677..ddf87ac42 100644 --- a/client/src/App/App.styles.scss +++ b/client/src/App/App.styles.scss @@ -145,7 +145,7 @@ //Update row highlighting on production board. .ant-table-tbody > tr.ant-table-row:hover > td { - background: #eaeaea !important; + background: #e7f3ff !important; } .job-line-manual { diff --git a/client/src/components/chat-conversation-list/chat-conversation-list.component.jsx b/client/src/components/chat-conversation-list/chat-conversation-list.component.jsx index ffc087ae2..e9afdc83d 100644 --- a/client/src/components/chat-conversation-list/chat-conversation-list.component.jsx +++ b/client/src/components/chat-conversation-list/chat-conversation-list.component.jsx @@ -7,7 +7,12 @@ import { selectSelectedConversation } from "../../redux/messaging/messaging.sele import { TimeAgoFormatter } from "../../utils/DateFormatter"; import PhoneFormatter from "../../utils/PhoneFormatter"; import OwnerNameDisplay from "../owner-name-display/owner-name-display.component"; -import { List as VirtualizedList, AutoSizer } from "react-virtualized"; +import { + List as VirtualizedList, + AutoSizer, + CellMeasurerCache, + CellMeasurer, +} from "react-virtualized"; import "./chat-conversation-list.styles.scss"; @@ -33,48 +38,64 @@ function ChatConversationListComponent({ [] ); - const rowRenderer = ({ index, key, style }) => { + const cache = new CellMeasurerCache({ + fixedWidth: true, + defaultHeight: 60, + }); + + const rowRenderer = ({ index, key, style, parent }) => { const item = conversationList[index]; return ( - setSelectedConversation(item.id)} - className={`chat-list-item ${ - item.id === selectedConversation - ? "chat-list-selected-conversation" - : null - }`} - style={style} + cache={cache} + parent={parent} + columnIndex={0} + rowIndex={index} > -
- {item.label &&
{item.label}
} - {item.job_conversations.length > 0 ? ( -
- {item.job_conversations.map((j, idx) => ( -
- -
- ))} -
- ) : ( - {item.phone_num} - )} -
-
-
- {item.job_conversations.length > 0 - ? item.job_conversations.map((j, idx) => ( - - {j.job.ro_number} - - )) - : null} + setSelectedConversation(item.id)} + className={`chat-list-item ${ + item.id === selectedConversation + ? "chat-list-selected-conversation" + : null + }`} + style={style} + > +
+ {item.label &&
{item.label}
} + {item.job_conversations.length > 0 ? ( +
+ {item.job_conversations.map((j, idx) => ( +
+ +
+ ))} +
+ ) : ( + {item.phone_num} + )}
- {item.updated_at} -
- - +
+
+ {item.job_conversations.length > 0 + ? item.job_conversations.map((j, idx) => ( + + {j.job.ro_number} + + )) + : null} +
+ {item.updated_at} +
+ + + ); }; @@ -86,7 +107,7 @@ function ChatConversationListComponent({ height={height} width={width} rowCount={conversationList.length} - rowHeight={60} + rowHeight={cache.rowHeight} rowRenderer={rowRenderer} onScroll={({ scrollTop, scrollHeight, clientHeight }) => { if (scrollTop + clientHeight === scrollHeight) { diff --git a/client/src/components/chat-conversation-title/chat-conversation-title.component.jsx b/client/src/components/chat-conversation-title/chat-conversation-title.component.jsx index 1503bf46f..9fb9776a3 100644 --- a/client/src/components/chat-conversation-title/chat-conversation-title.component.jsx +++ b/client/src/components/chat-conversation-title/chat-conversation-title.component.jsx @@ -1,14 +1,31 @@ -import { Space } from "antd"; +import { Space, Button, Col } from "antd"; import React from "react"; import PhoneNumberFormatter from "../../utils/PhoneFormatter"; import ChatArchiveButton from "../chat-archive-button/chat-archive-button.component"; import ChatConversationTitleTags from "../chat-conversation-title-tags/chat-conversation-title-tags.component"; import ChatLabelComponent from "../chat-label/chat-label.component"; import ChatTagRoContainer from "../chat-tag-ro/chat-tag-ro.container"; +import { connect } from "react-redux"; +import { setSelectedConversation } from "../../redux/messaging/messaging.actions"; +import { LeftOutlined } from "@ant-design/icons"; -export default function ChatConversationTitle({ conversation }) { +const mapDispatchToProps = (dispatch) => ({ + setSelectedConversation: (conversationId) => + dispatch(setSelectedConversation(conversationId)), +}); + +function ChatConversationTitle({ conversation, setSelectedConversation }) { return ( + + + {conversation && conversation.phone_num} @@ -23,3 +40,5 @@ export default function ChatConversationTitle({ conversation }) { ); } + +export default connect(null, mapDispatchToProps)(ChatConversationTitle); diff --git a/client/src/components/chat-popup/chat-popup.component.jsx b/client/src/components/chat-popup/chat-popup.component.jsx index 1c80d7c4c..45b2a332f 100644 --- a/client/src/components/chat-popup/chat-popup.component.jsx +++ b/client/src/components/chat-popup/chat-popup.component.jsx @@ -112,7 +112,7 @@ export function ChatPopupComponent({ /> - + {loading ? ( ) : ( diff --git a/client/src/components/header/header.component.jsx b/client/src/components/header/header.component.jsx index 1ed3f526d..f0edf82d2 100644 --- a/client/src/components/header/header.component.jsx +++ b/client/src/components/header/header.component.jsx @@ -311,7 +311,9 @@ function Header({ icon={} > }> - {t("menus.header.shop_config")} + + {t("menus.header.shop_config")} + }> {t("menus.header.dashboard")} diff --git a/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx b/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx index b48deb3b5..6e469cb57 100644 --- a/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx +++ b/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx @@ -108,7 +108,12 @@ export function JobsConvertButton({ }, ]} > - { + return option.value.toLowerCase().includes(input.toLowerCase()); + }} + > {bodyshop.md_ins_cos.map((s, i) => ( {s.name} diff --git a/client/src/components/shop-info/shop-info.component.jsx b/client/src/components/shop-info/shop-info.component.jsx index efabb6d5b..8803500ef 100644 --- a/client/src/components/shop-info/shop-info.component.jsx +++ b/client/src/components/shop-info/shop-info.component.jsx @@ -52,7 +52,9 @@ export function ShopInfoComponent({ bodyshop, form, saveLoading }) { - history.push({ search: `?tab=${search.tab}&subtab=${key}` }) + history.push({ + search: `?tab=${search.tab}&subtab=${key}`, + }) } > diff --git a/client/src/pages/shop/shop.page.component.jsx b/client/src/pages/shop/shop.page.component.jsx index 47107be43..de6b267d5 100644 --- a/client/src/pages/shop/shop.page.component.jsx +++ b/client/src/pages/shop/shop.page.component.jsx @@ -40,6 +40,10 @@ export function ShopPage({ bodyshop, setSelectedHeader, setBreadcrumbs }) { ]); }, [t, setSelectedHeader, setBreadcrumbs, bodyshop.shopname]); + useEffect(() => { + if (!search.tab) history.push({ search: "?tab=info" }); + }, [history, search]); + return (