Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sprint 38 to Production #2714

Merged
merged 37 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
7663843
CW-placeholder-for-images Fixed images fetching
MeyerPV Jun 12, 2024
443c0e7
CW-performance-improvements Refactor Components and Improve fetching
MeyerPV Jun 14, 2024
2eff1ac
CW-Direct-Message Remove fetching DMUsers only for opened modal
MeyerPV Jun 17, 2024
6e111ab
CW-Direct-List-Performance Fixed dependency array
MeyerPV Jun 17, 2024
02ea17e
Merge pull request #2701 from daostack/CW-performance-improvement
MeyerPV Jun 17, 2024
81c8f5c
CW-placeholder-images Fixed images preload. Fixed arrow position
MeyerPV Jun 17, 2024
e24710a
Merge pull request #2700 from daostack/CW-placeholder-for-images
MeyerPV Jun 18, 2024
61bebd7
CW-edit-message-performance Optimization of ChatMessage component
MeyerPV Jun 18, 2024
bfdd7a7
Merge pull request #2702 from daostack/CW-edit-message-performance
MeyerPV Jun 18, 2024
8a774de
CW-source-map-enable Added configuration for source map
MeyerPV Jun 19, 2024
f918b8d
CW-source-map-enable
MeyerPV Jun 19, 2024
28ef891
Update manifest.json
elatif2020 Jun 20, 2024
a1c549e
CW-source-map-enable enable source map for tsconfig
MeyerPV Jun 20, 2024
480e860
Merge pull request #2705 from daostack/Update-manifest-file
MeyerPV Jun 20, 2024
b1d8cce
CW-source-map-enable Added dev env
MeyerPV Jun 20, 2024
cb47b3b
CW-source-map-enable Fixed script
MeyerPV Jun 20, 2024
99c31f8
Merge pull request #2704 from daostack/CW-source-map-enable
MeyerPV Jun 21, 2024
25177c7
CW-firebase-quota-exceeded Update firebase settings
MeyerPV Jun 24, 2024
c660618
CW-dev-minification Remove code minify for dev/staging
MeyerPV Jun 24, 2024
0ba8509
CW-firebase-quota-exceeded Added synchonizeTabs
MeyerPV Jun 25, 2024
326b870
Merge pull request #2707 from daostack/CW-dev-minification
MeyerPV Jun 25, 2024
7b9f153
CW-system-crash-react Fixed ReactWithEmoji usage. Added try/catch for…
MeyerPV Jun 26, 2024
af530cd
CW-Infinite-spinner-on-proposal-creation Added condition for end load…
MeyerPV Jun 27, 2024
24c1867
CW-infinite-spinner-on-proposal-creation Refactoring
MeyerPV Jul 1, 2024
95d8d63
CW-system-crash-react Refactoring
MeyerPV Jul 1, 2024
7fc4213
Merge pull request #2709 from daostack/CW-Infinite-spinner-on-proposa…
MeyerPV Jul 1, 2024
b1dde57
Merge pull request #2708 from daostack/CW-system-crash-react
MeyerPV Jul 2, 2024
703fee7
Merge pull request #2706 from daostack/CW-firebase-quota-exceeded
MeyerPV Jul 2, 2024
fd6b3ba
Merge pull request #2710 from daostack/dev
MeyerPV Jul 2, 2024
bcc27b1
CW-mark-as-read-in-space Added function to mark all chats as read for…
MeyerPV Jul 3, 2024
f5ba1e5
CW-mark-as-read-in-space Refactoring
MeyerPV Jul 3, 2024
58b0dea
CW-mark-as-read-in-space Refactoring
MeyerPV Jul 3, 2024
4e38484
CW-mark-as-read-in-space Fix Eslint
MeyerPV Jul 5, 2024
4485c9b
CW-fix-infinite-load-of-users Remove unnecessary dependency
MeyerPV Jul 5, 2024
dfa3f4d
Merge pull request #2712 from daostack/CW-fix-infinite-load-of-users
MeyerPV Jul 8, 2024
35cb14a
Merge pull request #2711 from daostack/CW-mark-as-read-in-space
MeyerPV Jul 8, 2024
98aab31
Merge pull request #2713 from daostack/dev
MeyerPV Jul 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions craco.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
const CracoAlias = require("craco-alias");

module.exports = {
webpack: {
configure: (webpackConfig, { env, paths }) => {
const reactAppEnv = process.env.REACT_APP_ENV;
if (reactAppEnv === "dev" || reactAppEnv === "stage") {
webpackConfig.optimization.minimize = false;
webpackConfig.devtool = "source-map";
} else {
webpackConfig.devtool = false;
}
return webpackConfig;
},
},
style: {
css: {
loaderOptions: () => ({
Expand Down
6 changes: 3 additions & 3 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "Common.io",
"name": "Common.io",
"icons": [
{
"src": "favicon.ico",
Expand Down Expand Up @@ -38,7 +38,7 @@
"sizes": "512x512"
}
],
"start_url": ".",
"start_url": "./inbox",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
Expand Down
5 changes: 3 additions & 2 deletions src/pages/OldCommon/hooks/useCommonMembers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useCallback, useEffect, useRef, useState } from "react";
import { useCallback, useRef, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { CommonService, Logger, UserService } from "@/services";
import { store } from "@/shared/appConfig";
Expand All @@ -9,6 +9,7 @@ import {
selectCommonMembersStateByCommonId,
selectUserStates,
} from "@/store/states";
import { useDeepCompareEffect } from "react-use";

interface Options {
commonId?: string;
Expand Down Expand Up @@ -93,7 +94,7 @@ export const useCommonMembers = ({ commonId }: Options): Return => {
[dispatch, commonId],
);

useEffect(() => {
useDeepCompareEffect(() => {
const commonMembers = commonMembersState.data;

if (!commonMembers) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,59 +50,6 @@
align-items: flex-end;
}

.messageInput {
width: 100%;
min-height: 2.625rem;
line-height: 1.5rem;
border-radius: 1.25rem;
background-color: var(--secondary-background);
border: 0.0625rem solid var(--gentle-stroke);
outline: none;
resize: none;
font-size: 0.875rem;
color: var(--primary-text);
box-sizing: border-box;
text-align: left;
display: flex;
flex-direction: column;
justify-content: center;
word-break: break-word;
padding: 0.125rem 2.5rem 0.125rem 0.75rem;
margin: 0.3rem 0;
overflow-x: hidden;
min-height: 2.625rem !important;
}

.messageInputRtl {
padding: 0.125rem 2.5rem 0.125rem 0.75rem;
}

.messageInputEmpty {
padding-left: 0.75rem;
overflow-x: hidden;
}

.addFilesIcon {
margin-bottom: 0.8rem;
margin-right: 0.5rem;
height: 1.5rem;
color: var(--primary-text);
}

.sendIcon {
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 0.8rem;
border: none;
outline: none;
background: transparent;

&:disabled {
cursor: not-allowed;
opacity: 0.5;
}
}
$phone-breakpoint: 415px;

.container {
Expand Down
104 changes: 23 additions & 81 deletions src/pages/common/components/ChatComponent/ChatComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ import {
LastSeenEntity,
QueryParamKey,
} from "@/shared/constants";
import { FILES_ACCEPTED_EXTENSIONS } from "@/shared/constants";
import { HotKeys } from "@/shared/constants/keyboardKeys";
import { ChatMessageToUserDiscussionMessageConverter } from "@/shared/converters";
import {
useZoomDisabling,
useImageSizeCheck,
useQueryParams,
} from "@/shared/hooks";
import { ArrowInCircleIcon, PlusIcon, SendIcon } from "@/shared/icons";
import { ArrowInCircleIcon } from "@/shared/icons";
import { LinkPreviewData } from "@/shared/interfaces";
import { CreateDiscussionMessageDto } from "@/shared/interfaces/api/discussionMessages";
import {
Expand All @@ -47,24 +46,16 @@ import {
UserDiscussionMessage,
} from "@/shared/models";
import {
BaseTextEditor,
TextEditorValue,
getMentionTags,
parseStringToTextEditorValue,
ButtonIcon,
checkIsTextEditorValueEmpty,
TextEditorSize,
removeTextEditorEmptyEndLinesValues,
countTextEditorEmojiElements,
} from "@/shared/ui-kit";
import { checkUncheckedItemsInTextEditorValue } from "@/shared/ui-kit/TextEditor/utils";
import { InternalLinkData, notEmpty } from "@/shared/utils";
import {
emptyFunction,
getUserName,
hasPermission,
isMobile,
} from "@/shared/utils";
import { getUserName, hasPermission, isMobile } from "@/shared/utils";
import {
cacheActions,
chatActions,
Expand All @@ -80,6 +71,7 @@ import {
MessageReply,
ChatFilePreview,
MessageInfoWithDateList,
ChatInput,
} from "./components";
import { checkIsLastSeenInPreviousDay } from "./components/ChatContent/utils";
import { useChatChannelChatAdapter, useDiscussionChatAdapter } from "./hooks";
Expand Down Expand Up @@ -336,8 +328,6 @@ export default function ChatComponent({
return messagesWithInfo;
}, [messages]);

// const dateListWith

const [newMessages, setMessages] = useState<
CreateDiscussionMessageDtoWithFilesPreview[]
>([]);
Expand Down Expand Up @@ -761,73 +751,6 @@ export default function ChatComponent({
};
}, []);

const renderChatInput = (): ReactNode => {
if (shouldHideChatInput) {
return null;
}
if (!isChatChannel) {
const chatInputEl = renderChatInputOuter?.();

if (chatInputEl || chatInputEl === null) {
return chatInputEl;
}
}
if (!isAuthorized) {
return null;
}

return (
<>
<ButtonIcon
className={styles.addFilesIcon}
onClick={() => {
document.getElementById("file")?.click();
}}
>
<PlusIcon />
</ButtonIcon>
<input
id="file"
type="file"
onChange={uploadFiles}
style={{ display: "none" }}
multiple
accept={FILES_ACCEPTED_EXTENSIONS}
/>
<BaseTextEditor
inputContainerRef={inputContainerRef}
size={TextEditorSize.Auto}
editorRef={editorRef}
className={classNames(styles.messageInput, {
[styles.messageInputEmpty]: checkIsTextEditorValueEmpty(message),
})}
classNameRtl={styles.messageInputRtl}
elementStyles={{
emoji: classNames({
[styles.singleEmojiText]: emojiCount.isSingleEmoji,
[styles.multipleEmojiText]: emojiCount.isMultipleEmoji,
}),
}}
value={message}
onChange={setMessage}
placeholder="Message"
onKeyDown={onEnterKeyDown}
users={users}
shouldReinitializeEditor={shouldReinitializeEditor}
onClearFinished={onClearFinished}
scrollSelectionIntoView={emptyFunction}
/>
<button
className={styles.sendIcon}
onClick={sendChatMessage}
disabled={!canSendMessage}
>
<SendIcon />
</button>
</>
);
};

const { y } = useScroll(chatContainerRef);
const isScrolledToTop = Boolean(chatContainerRef.current && Math.abs(y) > 20);

Expand Down Expand Up @@ -924,7 +847,26 @@ export default function ChatComponent({
[styles.chatInputWrapperMultiLine]: isMultiLineInput,
})}
>
{renderChatInput()}
<ChatInput
onClearFinished={onClearFinished}
shouldReinitializeEditor={shouldReinitializeEditor}
users={users}
onEnterKeyDown={onEnterKeyDown}
emojiCount={emojiCount}
setMessage={setMessage}
message={message}
uploadFiles={uploadFiles}
isAuthorized={isAuthorized}
renderChatInputOuter={
renderChatInputOuter as () => React.ReactElement
}
isChatChannel={isChatChannel}
shouldHideChatInput={shouldHideChatInput}
sendChatMessage={sendChatMessage}
canSendMessage={Boolean(canSendMessage)}
inputContainerRef={inputContainerRef}
editorRef={editorRef}
/>
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
@import "../../../../../../constants.scss";
@import "../../../../../../styles/sizes";

.messageInput {
width: 100%;
min-height: 2.625rem;
line-height: 1.5rem;
border-radius: 1.25rem;
background-color: var(--secondary-background);
border: 0.0625rem solid var(--gentle-stroke);
outline: none;
resize: none;
font-size: 0.875rem;
color: var(--primary-text);
box-sizing: border-box;
text-align: left;
display: flex;
flex-direction: column;
justify-content: center;
word-break: break-word;
padding: 0.125rem 2.5rem 0.125rem 0.75rem;
margin: 0.3rem 0;
overflow-x: hidden;
min-height: 2.625rem !important;
}

.messageInputRtl {
padding: 0.125rem 2.5rem 0.125rem 0.75rem;
}

.messageInputEmpty {
padding-left: 0.75rem;
overflow-x: hidden;
}

.addFilesIcon {
margin-bottom: 0.8rem;
margin-right: 0.5rem;
height: 1.5rem;
color: var(--primary-text);
}

.sendIcon {
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 0.8rem;
border: none;
outline: none;
background: transparent;

&:disabled {
cursor: not-allowed;
opacity: 0.5;
}
}
$phone-breakpoint: 415px;

.singleEmojiText {
font-size: $xlarge;
line-height: 2.8125rem;
}

.multipleEmojiText {
font-size: $large;
line-height: 2.125rem;
}

.singleEmojiText {
font-size: $xlarge;
}

.multipleEmojiText {
font-size: $large;
}
Loading
Loading