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

OUT-31 form bug fixes #19

Merged
merged 2 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 1 addition & 5 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
/** @type {import('next').NextConfig} */

const withSvgr = require('next-plugin-svgr');
const nextConfig = {
experimental: {
serverActions: true,
},
};
const nextConfig = {};

module.exports = withSvgr(nextConfig);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@radix-ui/react-select": "^2.0.0",
"@vercel/postgres": "^0.5.0",
"copilot-node-sdk": "^0.0.45",
"next": "latest",
"next": "^14.0.4",
"next-plugin-svgr": "^1.1.8",
"prisma": "^5.4.2",
"react": "latest",
Expand Down
16 changes: 1 addition & 15 deletions src/app/components/AutoResponder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,6 @@
setValue('timezone', null, {
shouldValidate: true,
});
setValue('response', null, {
shouldValidate: true,
});
}
if (autoRespond === SettingType.ENABLED) {
setValue('timezone', null, {
Expand All @@ -194,9 +191,6 @@
setValue('selectedDays', null, {
shouldValidate: true,
});
setValue('response', "Thanks for your message. We'll get back to you shortly.", {
shouldValidate: true,
});
}
if (autoRespond === SettingType.OUTSIDE_WORKING_HOURS) {
setValue('timezone', Intl.DateTimeFormat().resolvedOptions().timeZone, {
Expand All @@ -205,17 +199,9 @@
setValue('selectedDays', defaultSelectedDays, {
shouldValidate: true,
});

setValue(
'response',
"Thanks for your message. You've reached us outside our working hours. We'll get back to you within 24 hours.",
{
shouldValidate: true,
},
);
}
}
}, [autoRespond]);

Check warning on line 204 in src/app/components/AutoResponder.tsx

View workflow job for this annotation

GitHub Actions / Run linters

React Hook useEffect has missing dependencies: 'isDirty' and 'setValue'. Either include them or remove the dependency array

const toggleSelectedDay = (day: DAY_VALUE) => {
const selectedDayIndex = selectedDays.fields.findIndex((selectedDay) => selectedDay.day === day);
Expand Down Expand Up @@ -265,7 +251,7 @@
setSaving(true);
await onSave(data);
setSaving(false);
reset({}, { keepValues: true });
reset(data);
setWorkingHoursErrors({});
defaultFormValues.current = data;
};
Expand Down
1 change: 0 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export default async function Page({ searchParams }: { searchParams: SearchParam
const setting = await settingsService.findByUserId(me?.id as string);
const saveSettings = async (data: SettingsData) => {
'use server';

const setting = {
type: data.autoRespond,
message: data.response,
Expand Down
4 changes: 3 additions & 1 deletion src/config/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export default {
const appConfig = {
copilotApiKey: process.env.COPILOT_API_KEY || '',
webhookSigningSecret: process.env.WEBHOOK_SIGNING_SECRET || '',
};

export default appConfig;
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4014,7 +4014,7 @@ next-plugin-svgr@^1.1.8:
"@svgr/webpack" "^8.1.0"
file-loader "^6.2.0"

next@^14.0.2, next@latest:
next@^14.0.2, next@^14.0.4:
version "14.0.4"
resolved "https://registry.yarnpkg.com/next/-/next-14.0.4.tgz#bf00b6f835b20d10a5057838fa2dfced1d0d84dc"
integrity sha512-qbwypnM7327SadwFtxXnQdGiKpkuhaRLE2uq62/nRul9cj9KhQ5LhHmlziTNqUidZotw/Q1I9OjirBROdUJNgA==
Expand Down