generated from pagevamp/copilot-custom-app-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 1
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
OUT-46 Integrate APIs #11
Merged
Changes from 2 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
0bf24d9
data plotting of table
aatbip de90790
data plotting of table
aatbip 3236564
integrated custom field access and save apis
aatbip f0b535f
fix custom field access issues
aatbip 77c70f6
added client api
aatbip 9460e0a
added manage page
aatbip 38d9b69
added history popup
aatbip ff7c3b1
added sorting feature
aatbip 3b763f3
added searching feature
aatbip 5c884ec
added searching for all fields
aatbip ef9cfdc
added chip color variations
aatbip 3a5e5b0
fix bug
aatbip 5804da2
added empty state fallback
aatbip abdf684
fix bug
aatbip c45c6ac
fix design issues
aatbip 692d55c
fix design issues
aatbip f3e7e65
adds tooltip on disabled field
aatbip 7e1f923
removed image if company image icon is not present
aatbip 795574b
fix bugs
aatbip 1e57eb9
added enums for ProfileLinks
aatbip ea24ab7
added enums for Permissions
aatbip d0ed649
removed unnecessary if/else comparisions
aatbip 06f2a26
adds server action
aatbip c0e3213
fix issue with server action
aatbip 8ebda6a
fix issue with server action
aatbip abb68f7
added token and portalId
aatbip 361cb7e
stringified in client component
aatbip b6d7909
stringified in client component
aatbip 414bff3
reverted from server action for now
aatbip File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,31 +5,32 @@ import { Box, Stack, Typography } from '@mui/material'; | |
import { Switch } from '@/components/switch/Switch'; | ||
import { useAppState } from '@/hooks/useAppState'; | ||
import { arraysHaveSameElements } from '@/utils/arrayHaveSameElements'; | ||
import { ProfileLinks } from '@/types/settings'; | ||
|
||
export const Sidebar = () => { | ||
const appState = useAppState(); | ||
|
||
const handleMutableSettings = (selected: boolean, type: string) => { | ||
if (!selected) { | ||
if (type === 'profile_settings') { | ||
if (type === ProfileLinks.ProfileSetting) { | ||
const newSettings = appState?.mutableSettings.filter((el: string) => el !== type); | ||
appState?.setAppState((prev) => ({ ...prev, mutableSettings: newSettings })); | ||
} | ||
if (type === 'payment_method') { | ||
if (type === ProfileLinks.PaymentMethod) { | ||
const newSettings = appState?.mutableSettings.filter((el: string) => el !== type); | ||
appState?.setAppState((prev) => ({ ...prev, mutableSettings: newSettings })); | ||
} | ||
} | ||
if (selected) { | ||
if (type === 'profile_settings') { | ||
if (type === ProfileLinks.ProfileSetting) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. d0ed649 commit resolves this @sajjanstha |
||
appState?.setAppState((prev) => ({ | ||
...prev, | ||
mutableSettings: appState?.mutableSettings.includes(type) | ||
? appState?.mutableSettings | ||
: [...appState?.mutableSettings, type], | ||
})); | ||
} | ||
if (type === 'payment_method') { | ||
if (type === ProfileLinks.PaymentMethod) { | ||
appState?.setAppState((prev) => ({ | ||
...prev, | ||
mutableSettings: appState?.mutableSettings.includes(type) | ||
|
@@ -81,19 +82,19 @@ export const Sidebar = () => { | |
<Stack direction="row" justifyContent="space-between" p="12px 0px 6px 0px"> | ||
<Typography variant="bodyMd">General profile settings</Typography> | ||
<Switch | ||
selected={appState?.mutableSettings.includes('profile_settings')} | ||
selected={appState?.mutableSettings.includes(ProfileLinks.ProfileSetting)} | ||
getValue={(selected) => { | ||
handleMutableSettings(selected, 'profile_settings'); | ||
handleMutableSettings(selected, ProfileLinks.ProfileSetting); | ||
}} | ||
/> | ||
</Stack> | ||
|
||
<Stack direction="row" justifyContent="space-between" p="6px 0px"> | ||
<Typography variant="bodyMd">Manage payment method</Typography> | ||
<Switch | ||
selected={appState?.mutableSettings.includes('payment_method')} | ||
selected={appState?.mutableSettings.includes(ProfileLinks.PaymentMethod)} | ||
getValue={(selected) => { | ||
handleMutableSettings(selected, 'payment_method'); | ||
handleMutableSettings(selected, ProfileLinks.PaymentMethod); | ||
}} | ||
/> | ||
</Stack> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the underlying logic for both these conditions are same, why the type check at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
d0ed649 commit removes unnecessary if/else comparision @sajjanstha