Update configuration settings and improve notifications

This commit updates the configuration settings and improves the notification functionality by filtering out duplicate notifications. It also includes changes to feature flag data types and removed dependencies in `package.json`, alongside updates to `pnpm-lock.yaml`.
This commit is contained in:
giancarlo
2024-05-01 12:13:19 +07:00
parent 057286d2a8
commit 9baee90eec
11 changed files with 7609 additions and 6005 deletions

View File

@@ -15,11 +15,5 @@
"@playwright/test": "^1.43.1",
"@types/node": "^20.12.7",
"node-html-parser": "^6.1.13"
},
"dependencies": {
"@tanstack/react-table": "^8.16.0",
"next": "14.2.3",
"tailwind-merge": "^2.3.0",
"zod": "^3.23.5"
}
}

View File

@@ -29,6 +29,7 @@ type AccountModel = {
export function TeamAccountLayoutSidebar(props: {
account: string;
accountId: string;
accounts: AccountModel[];
collapsed: boolean;
user: User;
@@ -40,6 +41,7 @@ export function TeamAccountLayoutSidebar(props: {
collapsed={collapsed}
setCollapsed={setCollapsed}
account={props.account}
accountId={props.accountId}
accounts={props.accounts}
user={props.user}
/>
@@ -50,6 +52,7 @@ export function TeamAccountLayoutSidebar(props: {
function SidebarContainer(props: {
account: string;
accountId: string;
accounts: AccountModel[];
collapsed: boolean;
setCollapsed: (collapsed: boolean) => void;
@@ -61,7 +64,9 @@ function SidebarContainer(props: {
return (
<>
<SidebarContent className={'h-16 justify-center'}>
<div className={'flex max-w-full items-center space-x-2'}>
<div
className={'flex max-w-full items-center justify-between space-x-4'}
>
<TeamAccountAccountsSelector
selectedAccount={account}
accounts={accounts}
@@ -69,7 +74,7 @@ function SidebarContainer(props: {
<TeamAccountNotifications
userId={props.user.id}
accountId={account}
accountId={props.accountId}
/>
</div>
</SidebarContent>

View File

@@ -50,10 +50,10 @@ export function TeamAccountNavigationMenu(props: {
<div className={'flex justify-end space-x-2.5'}>
<TeamAccountAccountsSelector
selectedAccount={account.id}
selectedAccount={account.slug}
accounts={accounts.map((account) => ({
label: account.name,
value: account.id,
value: account.slug,
image: account.picture_url,
}))}
/>

View File

@@ -46,6 +46,7 @@ function TeamWorkspaceLayout({
<TeamAccountLayoutSidebar
collapsed={false}
account={params.account}
accountId={data.account.id}
accounts={accounts}
user={data.user}
/>

View File

@@ -42,18 +42,14 @@ const FeatureFlagsSchema = z.object({
description: `If set to user, use the user's preferred language. If set to application, use the application's default language.`,
})
.default('application'),
enableNotifications: z
.boolean({
description: 'Enable notifications functionality',
required_error: 'Provide the variable NEXT_PUBLIC_ENABLE_NOTIFICATIONS',
})
.default(true),
realtimeNotifications: z
.boolean({
description: 'Enable realtime for the notifications functionality',
required_error: 'Provide the variable NEXT_PUBLIC_REALTIME_NOTIFICATIONS',
})
.default(true),
enableNotifications: z.boolean({
description: 'Enable notifications functionality',
required_error: 'Provide the variable NEXT_PUBLIC_ENABLE_NOTIFICATIONS',
}),
realtimeNotifications: z.boolean({
description: 'Enable realtime for the notifications functionality',
required_error: 'Provide the variable NEXT_PUBLIC_REALTIME_NOTIFICATIONS',
}),
});
const featuresFlagConfig = FeatureFlagsSchema.parse({