Skip to content

Commit

Permalink
Merge branch 'mixpanel' into devops/main
Browse files Browse the repository at this point in the history
  • Loading branch information
BEW111 committed Oct 1, 2024
2 parents 33e6eeb + 612a105 commit ff12e3f
Show file tree
Hide file tree
Showing 10 changed files with 6,023 additions and 6,031 deletions.
7 changes: 1 addition & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ module.exports = {
// Add overriden rules here
'no-console': 'off',
'@typescript-eslint/no-unused-vars': ['warn'],
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
},
],
'import/no-extraneous-dependencies': 2,
'prettier/prettier': ['error', { endOfLine: 'auto' }],
},
};
11 changes: 1 addition & 10 deletions client/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,7 @@ module.exports = {
'@typescript-eslint/no-unused-vars': ['warn'],
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'prettier/prettier': ['error', { endOfLine: 'auto' }],
'import/extensions': [
2,
'always',
{
js: 'never',
jsx: 'never',
ts: 'always',
tsx: 'always',
},
],
'import/extensions': [0, { tsx: 'always' }, { ts: 'always' }],
},
env: {
browser: true,
Expand Down
13 changes: 7 additions & 6 deletions client/src/components/buttons/InviteUserButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { postData } from '../../util/api.tsx';

function InviteUserButton() {
const [open, setOpen] = useState(false);
const [email, setEmail] = useState('');
const [emails, setEmails] = useState('');
const [error, setError] = useState('');
const [loading, setLoading] = useState(false);

Expand All @@ -27,11 +27,11 @@ function InviteUserButton() {

const handleInvite = async () => {
setLoading(true);
postData('admin/invite', { email }).then((res) => {
postData('admin/invite', { emails }).then((res) => {
if (res.error) {
setError(res.error.message);
} else {
setAlert(`${email} successfully invited!`, AlertType.SUCCESS);
setAlert(`${emails} successfully invited!`, AlertType.SUCCESS);
setOpen(false);
}
setLoading(false);
Expand All @@ -40,7 +40,7 @@ function InviteUserButton() {

const updateEmail = (event: React.ChangeEvent<HTMLInputElement>) => {
setError('');
setEmail(event.target.value);
setEmails(event.target.value);
};

return (
Expand All @@ -51,13 +51,14 @@ function InviteUserButton() {
<Dialog open={open} onClose={handleClose}>
<DialogContent>
<DialogContentText>
Please enter the email address of the user you would like to invite.
Please enter one or more email addresses separated by commas. (ex.
a@gmail.com, b@outlook.com)
</DialogContentText>
<TextField
autoFocus
margin="dense"
id="name"
label="Email Address"
label="Email Addresses"
type="email"
fullWidth
variant="standard"
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ services:
- "4000:4000"
env_file: ./server/.env
environment:
- FRONTEND_URL=http://localhost:3000
- FRONTEND_URL=http://localhost:3000
51 changes: 18 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"dependencies": {
"@reduxjs/toolkit": "^1.8.1",
"@sendgrid/mail": "^7.7.0",
"@types/mixpanel-browser": "^2.49.0",
"bcrypt": "^5.0.1",
"connect-mongo": "^4.6.0",
"cookie-parser": "^1.4.6",
Expand All @@ -26,6 +27,7 @@
"express-session": "^1.17.2",
"googleapis": "^108.0.0",
"jsonwebtoken": "^8.5.1",
"mixpanel": "^0.18.0",
"mongodb-memory-server": "^8.2.0",
"mongoose": "^6.1.10",
"passport": "^0.6.0",
Expand Down
9 changes: 9 additions & 0 deletions server/src/config/configMixpanel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Mixpanel from 'mixpanel';

const token = process.env.MIXPANEL_TOKEN || 'DEFAULT_TOKEN';
const mixpanel = Mixpanel.init(token);

console.log('Mixpanel initialized with token:', token);
console.log('Mixpanel:', mixpanel.people);

export default mixpanel;
Loading

0 comments on commit ff12e3f

Please sign in to comment.