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

Refactored Code: Removed redundant window.androidIntract, added GetBotList and SocketComponents, implemented expired bot logic #126

Merged
merged 5 commits into from
Jul 19, 2023

Conversation

Rishit30G
Copy link
Collaborator

@Rishit30G Rishit30G commented Jul 11, 2023

@vercel
Copy link

vercel bot commented Jul 11, 2023

@Rishit30G is attempting to deploy a commit to the Samagra Team on Vercel.

A member of the Team first needs to authorize it.

@gitguardian
Copy link

gitguardian bot commented Jul 11, 2023

⚠️ GitGuardian has uncovered 24 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id Secret Commit Filename
- Generic High Entropy Secret 5128e13 apps/uci/web/.env.sample View secret
- Generic High Entropy Secret 5128e13 apps/uci/web/.env.sample View secret
- Generic High Entropy Secret 5128e13 apps/uci/web/src/utils/set-local-storage.ts View secret
- Generic High Entropy Secret 5128e13 apps/uci/web/src/utils/set-local-storage.ts View secret
- Generic High Entropy Secret 5128e13 apps/uci/web/src/utils/set-local-storage.ts View secret
- Generic High Entropy Secret 5128e13 apps/uci/web/src/utils/set-local-storage.ts View secret
- Generic High Entropy Secret 78b3e37 apps/uci/web/.env.sample View secret
- Generic High Entropy Secret 78b3e37 apps/uci/web/.env.sample View secret
- Generic High Entropy Secret 9342ad7 apps/uci/web/src/utils/set-local-storage.ts View secret
- Generic High Entropy Secret 9342ad7 apps/uci/web/src/utils/set-local-storage.ts View secret
- Generic High Entropy Secret 9342ad7 apps/uci/web/src/utils/set-local-storage.ts View secret
- Generic High Entropy Secret 9342ad7 apps/uci/web/src/utils/set-local-storage.ts View secret
- Generic High Entropy Secret 9342ad7 apps/uci/web/src/utils/set-local-storage.ts View secret
- Generic High Entropy Secret 9342ad7 apps/uci/web/src/utils/set-local-storage.ts View secret
- Generic High Entropy Secret 9342ad7 apps/uci/web/src/utils/set-local-storage.ts View secret
- Generic High Entropy Secret 826409e apps/uci/web/.env.sample View secret
- Generic High Entropy Secret 826409e apps/uci/web/.env.sample View secret
- Generic High Entropy Secret 826409e apps/uci/web/src/utils/set-local-storage.ts View secret
- Generic High Entropy Secret 826409e apps/uci/web/src/utils/set-local-storage.ts View secret
- Generic High Entropy Secret 826409e apps/uci/web/src/utils/set-local-storage.ts View secret
- Generic High Entropy Secret 826409e apps/uci/web/src/utils/set-local-storage.ts View secret
- Generic High Entropy Secret 826409e apps/uci/web/src/utils/set-local-storage.ts View secret
- Generic High Entropy Secret 826409e apps/uci/web/src/utils/set-local-storage.ts View secret
- Generic High Entropy Secret 826409e apps/uci/web/src/utils/set-local-storage.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change the file name to this format -> get-bot-list.tsx

import moment from "moment";
import { useEffect } from "react";
import { toast } from "react-hot-toast";

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move the types to type folder and use the following naming convention for the types file -> [component-name].d.ts

interface GetBotItemProp{
setUsers: React.Dispatch<React.SetStateAction<any>>;
setCurrentUser: React.Dispatch<React.SetStateAction<any>>;
setLoading: React.Dispatch<React.SetStateAction<boolean>>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since all the types are same so you can define a separate type for this and re use it

@@ -16,15 +17,21 @@ interface chatItemProps {
isBlank?: boolean;
}


const ChatItem: React.FC<chatItemProps> = ({ active, name, phoneNumber, user, isBlank }) => {
const history = useRouter();
const context = useContext(AppContext);

const fontColorToggle = useColorModeValue(styles.darkFontColor, styles.lightFontColor);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use useMemo for calculated variables

const ChatItem: React.FC<chatItemProps> = ({ active, name, phoneNumber, user, isBlank }) => {
const history = useRouter();
const context = useContext(AppContext);

const fontColorToggle = useColorModeValue(styles.darkFontColor, styles.lightFontColor);

const expiredItem = user?.endDate!== undefined && user.endDate < moment().format() && user?.status === 'ENABLED';


const onChangingCurrentUserHandler = useCallback(() => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try to short the function name

// setLocalStorage();
// }, []);
useEffect(() => {
const hasLocalStorageBeenSet = localStorage.getItem('localStorageSet');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try to use some good naming conventions like isLocalStorageAvailable

geeky-abhishek pushed a commit that referenced this pull request Jul 16, 2023
* to be edited

* Update .env.sample

* Update set-local-storage.ts

* fix: enhancement done for #126
@geeky-abhishek geeky-abhishek changed the base branch from master to c4gt-development July 19, 2023 07:51
@geeky-abhishek geeky-abhishek merged commit eda9955 into samagra-comms:c4gt-development Jul 19, 2023
Rishit30G added a commit that referenced this pull request Aug 11, 2023
* Updated branch  (#129)

* to be edited

* Update .env.sample

* Update set-local-storage.ts

* fix: enhancement done for #126

* Refactored Code: Removed redundant window.androidIntract, added GetBotList and SocketComponents, implemented expired bot logic (#126)

* to be edited

* Update .env.sample

* Update set-local-storage.ts

* fix: enhancement done for #126

* style: layout modified to look similar like whatsapp (#132)

* Config for components
* env sample
* removed unnecessary config
* ui changes

* chore: revert ui changes

* Revert "style: layout modified to look similar like whatsapp (#132)" (#134)

This reverts commit fcbb545.

* chore: base setup

* refactor: added socket class  (#136)

* feat: added class for socket

* refactor: created socket

* chore: new socket class tested

* feat: using deployed socket package, added suppressHydrationWarning for extensions giving warning

* feat: added logger, setup store using createAsyncThunk

* change: reverted few changes

---------

Co-authored-by: Tushar Banik <[email protected]>
Co-authored-by: Saiyan Abhishek <[email protected]>
Rishit30G added a commit that referenced this pull request Aug 11, 2023
* Updated branch  (#129)

* to be edited

* Update .env.sample

* Update set-local-storage.ts

* fix: enhancement done for #126

* Refactored Code: Removed redundant window.androidIntract, added GetBotList and SocketComponents, implemented expired bot logic (#126)

* to be edited

* Update .env.sample

* Update set-local-storage.ts

* fix: enhancement done for #126

* style: layout modified to look similar like whatsapp (#132)

* Config for components
* env sample
* removed unnecessary config
* ui changes

* chore: revert ui changes

* Revert "style: layout modified to look similar like whatsapp (#132)" (#134)

This reverts commit fcbb545.

* chore: base setup

* refactor: added socket class  (#136)

* feat: added class for socket

* refactor: created socket

* chore: new socket class tested

* feat: using deployed socket package, added suppressHydrationWarning for extensions giving warning

* feat: added logger, setup store using createAsyncThunk

* change: reverted few changes

* feat: bot's displayed from store

---------

Co-authored-by: Tushar Banik <[email protected]>
Co-authored-by: Saiyan Abhishek <[email protected]>
Rishit30G added a commit that referenced this pull request Aug 14, 2023
* Updated branch  (#129)

* to be edited

* Update .env.sample

* Update set-local-storage.ts

* fix: enhancement done for #126

* Refactored Code: Removed redundant window.androidIntract, added GetBotList and SocketComponents, implemented expired bot logic (#126)

* to be edited

* Update .env.sample

* Update set-local-storage.ts

* fix: enhancement done for #126

* style: layout modified to look similar like whatsapp (#132)

* Config for components
* env sample
* removed unnecessary config
* ui changes

* chore: revert ui changes

* Revert "style: layout modified to look similar like whatsapp (#132)" (#134)

This reverts commit fcbb545.

* UI Changes

* changes

* changes

* changes

* config for all components and pages

* remove local storage

* styled component for starredchatitem

* styled component for chatItem and global theme

* dark mode UI

* dark and light theme

---------

Co-authored-by: Rishit Gupta <[email protected]>
Co-authored-by: Saiyan Abhishek <[email protected]>
Tushar98644 added a commit that referenced this pull request Aug 17, 2023
* UI Changes

* changes

* changes

* changes

* config for all components and pages

* remove local storage

* styled component for starredchatitem

* styled component for chatItem and global theme

* dark mode UI

* feat: setup createAsyncThunk,  added logger  (#140)

* Updated branch  (#129)

* to be edited

* Update .env.sample

* Update set-local-storage.ts

* fix: enhancement done for #126

* Refactored Code: Removed redundant window.androidIntract, added GetBotList and SocketComponents, implemented expired bot logic (#126)

* to be edited

* Update .env.sample

* Update set-local-storage.ts

* fix: enhancement done for #126

* style: layout modified to look similar like whatsapp (#132)

* Config for components
* env sample
* removed unnecessary config
* ui changes

* chore: revert ui changes

* Revert "style: layout modified to look similar like whatsapp (#132)" (#134)

This reverts commit fcbb545.

* chore: base setup

* refactor: added socket class  (#136)

* feat: added class for socket

* refactor: created socket

* chore: new socket class tested

* feat: using deployed socket package, added suppressHydrationWarning for extensions giving warning

* feat: added logger, setup store using createAsyncThunk

* change: reverted few changes

---------

Co-authored-by: Tushar Banik <[email protected]>
Co-authored-by: Saiyan Abhishek <[email protected]>

* Bot's displayed using store  (#142)

* Updated branch  (#129)

* to be edited

* Update .env.sample

* Update set-local-storage.ts

* fix: enhancement done for #126

* Refactored Code: Removed redundant window.androidIntract, added GetBotList and SocketComponents, implemented expired bot logic (#126)

* to be edited

* Update .env.sample

* Update set-local-storage.ts

* fix: enhancement done for #126

* style: layout modified to look similar like whatsapp (#132)

* Config for components
* env sample
* removed unnecessary config
* ui changes

* chore: revert ui changes

* Revert "style: layout modified to look similar like whatsapp (#132)" (#134)

This reverts commit fcbb545.

* chore: base setup

* refactor: added socket class  (#136)

* feat: added class for socket

* refactor: created socket

* chore: new socket class tested

* feat: using deployed socket package, added suppressHydrationWarning for extensions giving warning

* feat: added logger, setup store using createAsyncThunk

* change: reverted few changes

* feat: bot's displayed from store

---------

Co-authored-by: Tushar Banik <[email protected]>
Co-authored-by: Saiyan Abhishek <[email protected]>

* dark and light theme

* eslint and husky setup

* eslint and husky setup

---------

Co-authored-by: Rishit Gupta <[email protected]>
Co-authored-by: Saiyan Abhishek <[email protected]>
geeky-abhishek added a commit that referenced this pull request Sep 7, 2023
* Updated branch  (#129)

* to be edited

* Update .env.sample

* Update set-local-storage.ts

* fix: enhancement done for #126

* Refactored Code: Removed redundant window.androidIntract, added GetBotList and SocketComponents, implemented expired bot logic (#126)

* to be edited

* Update .env.sample

* Update set-local-storage.ts

* fix: enhancement done for #126

* style: layout modified to look similar like whatsapp (#132)

* Config for components
* env sample
* removed unnecessary config
* ui changes

* chore: revert ui changes

* Revert "style: layout modified to look similar like whatsapp (#132)" (#134)

This reverts commit fcbb545.

* Eslint and husky setup (#144)

* UI Changes

* changes

* changes

* changes

* config for all components and pages

* remove local storage

* styled component for starredchatitem

* styled component for chatItem and global theme

* dark mode UI

* feat: setup createAsyncThunk,  added logger  (#140)

* Updated branch  (#129)

* to be edited

* Update .env.sample

* Update set-local-storage.ts

* fix: enhancement done for #126

* Refactored Code: Removed redundant window.androidIntract, added GetBotList and SocketComponents, implemented expired bot logic (#126)

* to be edited

* Update .env.sample

* Update set-local-storage.ts

* fix: enhancement done for #126

* style: layout modified to look similar like whatsapp (#132)

* Config for components
* env sample
* removed unnecessary config
* ui changes

* chore: revert ui changes

* Revert "style: layout modified to look similar like whatsapp (#132)" (#134)

This reverts commit fcbb545.

* chore: base setup

* refactor: added socket class  (#136)

* feat: added class for socket

* refactor: created socket

* chore: new socket class tested

* feat: using deployed socket package, added suppressHydrationWarning for extensions giving warning

* feat: added logger, setup store using createAsyncThunk

* change: reverted few changes

---------

Co-authored-by: Tushar Banik <[email protected]>
Co-authored-by: Saiyan Abhishek <[email protected]>

* Bot's displayed using store  (#142)

* Updated branch  (#129)

* to be edited

* Update .env.sample

* Update set-local-storage.ts

* fix: enhancement done for #126

* Refactored Code: Removed redundant window.androidIntract, added GetBotList and SocketComponents, implemented expired bot logic (#126)

* to be edited

* Update .env.sample

* Update set-local-storage.ts

* fix: enhancement done for #126

* style: layout modified to look similar like whatsapp (#132)

* Config for components
* env sample
* removed unnecessary config
* ui changes

* chore: revert ui changes

* Revert "style: layout modified to look similar like whatsapp (#132)" (#134)

This reverts commit fcbb545.

* chore: base setup

* refactor: added socket class  (#136)

* feat: added class for socket

* refactor: created socket

* chore: new socket class tested

* feat: using deployed socket package, added suppressHydrationWarning for extensions giving warning

* feat: added logger, setup store using createAsyncThunk

* change: reverted few changes

* feat: bot's displayed from store

---------

Co-authored-by: Tushar Banik <[email protected]>
Co-authored-by: Saiyan Abhishek <[email protected]>

* dark and light theme

* eslint and husky setup

---------

Co-authored-by: Rishit Gupta <[email protected]>
Co-authored-by: Saiyan Abhishek <[email protected]>

* conflicts and localstorage for dark-mode

* fix: old changes merged

* env sample and styled-components

* Refactor Home using styled-components

* dockerfile

* C4gt socket package (#146)

* fix: socket connection fix

* Update next.config.js

* fix: sorted botList, Unexpected JSON error resolved, starred message now visible, updated redux,  converstation working

* Major UI changes

* StarredChats UI fixed

* Tab view UI

* Fullscreen Loader

* changes in bot image

* Chat-message ui fix

* Added unit test cases for socket  and search functionality

* Refactoring Message Itema and fullscreen Loader with styled-components

* Configuration changes

* fix: currentUser now fetched from redux

* textInput config

* Voice-to-text

* VoiceIcon animation,no response text and ui fixes

* Added lerna for watch mode,impelmented config for urls

* Added lerna for watch mode,impelmented config for urls

* ThemeProvider and Styledcompoents Reafactoring

* Update README.md

* fix: useSelcetor optimized, hardcoded auth fixed, LogIn and OTP partially functional

---------

Co-authored-by: Tushar Banik <[email protected]>
Co-authored-by: Saiyan Abhishek <[email protected]>
Co-authored-by: Tushar98644 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactored ContextProvider, Filter Bots, Removed redundant code
2 participants