Skip to content

Commit

Permalink
Release v4.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinejaussoin authored Oct 24, 2021
1 parent bc8a27c commit ada1bc6
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ This will run a demo version, which you can turn into a fully licenced version b

## Versions History

### Version 4.9.1 (unreleased)
### Version 4.10.0

- Add better GDPR compliance, with the right to be forgotten: allows a user to delete all of their data
- Add the ability for users to signal if they are done with their posts, to help the moderator
Expand Down
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@retrospected/backend",
"version": "4.9.1",
"version": "4.10.0",
"license": "GNU GPLv3",
"private": true,
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions backend/src/db/actions/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ async function deleteVisits(
if (hardDelete) {
await manager.query('delete from visitors where "usersId" = $1', [user.id]);
} else {
await manager.query('update visitors set usersId = $1 where usersId = $2', [
anon.user.id,
user.id,
]);
await manager.query(
'update visitors set "usersId" = $1 where "usersId" = $2',
[anon.user.id, user.id]
);
}
}

Expand Down
2 changes: 1 addition & 1 deletion common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@retrospected/common",
"version": "4.9.1",
"version": "4.10.0",
"license": "GNU GPLv3",
"private": true,
"main": "dist/src/index.js",
Expand Down
2 changes: 2 additions & 0 deletions common/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,11 @@ export type TrackingEvent =
| 'game/session/reset'
| 'game/session/disconnect'
| 'game/session/unexpected-disconnection'
| 'game/session/user-ready'
| 'game/post/giphy/open'
| 'game/post/giphy/choose'
| 'game/post/giphy/toggle'
| 'account/gdpr/delete-account'
| 'game/post/extra-menu/open'
| 'trial/start'
| 'trial/modal/cancel'
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docs",
"version": "4.9.1",
"version": "4.10.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@retrospected/frontend",
"version": "4.9.1",
"version": "4.10.0",
"license": "GNU GPLv3",
"private": true,
"dependencies": {
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,11 @@ export async function deleteSession(sessionId: string): Promise<boolean> {
export async function deleteAccount(
options: DeleteAccountPayload
): Promise<boolean> {
return await fetchDelete(`/api/me`, options);
try {
return await fetchDelete(`/api/me`, options);
} catch (err) {
return false;
}
}

export async function getGiphyUrl(giphyId: string): Promise<string | null> {
Expand Down
21 changes: 17 additions & 4 deletions frontend/src/views/account/delete/DeleteModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ import { deleteAccount, logout } from '../../../api';
import UserContext from '../../../auth/Context';
import { useHistory } from 'react-router';
import { useConfirm } from 'material-ui-confirm';
import { useSnackbar } from 'notistack';
import useTranslations from '../../../translations';
import { trackEvent } from '../../../track';

type DeleteModalProps = {
onClose: () => void;
Expand All @@ -35,6 +37,7 @@ export function DeleteModal({ onClose }: DeleteModalProps) {
const [deletePosts, setDeletePosts] = useState(false);
const [deleteVotes, setDeleteVotes] = useState(false);
const { setUser } = useContext(UserContext);
const { enqueueSnackbar } = useSnackbar();
const user = useUser();
const { push } = useHistory();
const confirm = useConfirm();
Expand All @@ -61,10 +64,19 @@ export function DeleteModal({ onClose }: DeleteModalProps) {
confirmationButtonProps: { color: 'error', variant: 'contained' },
})
.then(async () => {
await deleteAccount(payload);
logout();
setUser(null);
push('/');
trackEvent('account/gdpr/delete-account');
const success = await deleteAccount(payload);
if (success) {
logout();
setUser(null);
push('/');
} else {
enqueueSnackbar(
'Deleting your account failed. Please contact support: [email protected]',
{ variant: 'error' }
);
onClose();
}
})
.catch(() => {
onClose();
Expand All @@ -79,6 +91,7 @@ export function DeleteModal({ onClose }: DeleteModalProps) {
confirm,
onClose,
translations,
enqueueSnackbar,
]);

if (!user) {
Expand Down
10 changes: 8 additions & 2 deletions frontend/src/views/game/Participants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import useSession from './useSession';
import styled from '@emotion/styled';
import useUser from '../../auth/useUser';
import useTranslation from '../../translations/useTranslations';
import { useCallback } from 'react';
import { trackEvent } from '../../track';

type ParticipantsProps = {
onReady: () => void;
Expand All @@ -25,6 +27,10 @@ function Participants({ onReady }: ParticipantsProps) {
const { PostBoard: translations } = useTranslation();
const isUserReady = !!user && !!session && session.ready.includes(user.id);
const fullScreen = useMediaQuery('(min-width:600px)');
const handleReady = useCallback(() => {
trackEvent('game/session/user-ready');
onReady();
}, [onReady]);
return (
<Container>
<AvatarGroup
Expand Down Expand Up @@ -55,7 +61,7 @@ function Participants({ onReady }: ParticipantsProps) {
})}
</AvatarGroup>
{user && !fullScreen ? (
<IconButton onClick={onReady}>
<IconButton onClick={handleReady}>
{isUserReady ? (
<Create htmlColor={colors.orange[500]} />
) : (
Expand All @@ -65,7 +71,7 @@ function Participants({ onReady }: ParticipantsProps) {
) : null}
{user && fullScreen ? (
<Button
onClick={onReady}
onClick={handleReady}
variant="outlined"
endIcon={
isUserReady ? (
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "retrospected",
"version": "4.9.1",
"version": "4.10.0",
"description": "An agile retrospective board - Powering www.retrospected.com",
"private": true,
"workspaces": [
Expand Down

0 comments on commit ada1bc6

Please sign in to comment.