From 7f1ed242d889271887e72ea212e68f9dca3240aa Mon Sep 17 00:00:00 2001 From: neopostmodern Date: Sat, 19 Nov 2022 22:42:33 +0100 Subject: [PATCH] feat: user data-export self-service, closes #47 - more or less plain JSON dump - simple link from user page - relies on being authenticated in browser --- client/src/renderer/containers/UserPage.tsx | 17 +++++++--- server/lib/restApi.js | 35 ++++++++++++++++++++- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/client/src/renderer/containers/UserPage.tsx b/client/src/renderer/containers/UserPage.tsx index 435bbbad..41e2543e 100644 --- a/client/src/renderer/containers/UserPage.tsx +++ b/client/src/renderer/containers/UserPage.tsx @@ -1,8 +1,10 @@ import { useQuery } from '@apollo/client'; +import { Launch } from '@mui/icons-material'; import { Button, Link, Typography } from '@mui/material'; import gql from 'graphql-tag'; import { FC } from 'react'; import { useDispatch } from 'react-redux'; +import styled from 'styled-components'; import { requestLogout } from '../actions/userInterface'; import ErrorSnackbar from '../components/ErrorSnackbar'; import Gap from '../components/Gap'; @@ -25,6 +27,10 @@ const USER_QUERY = gql` } `; +const LinkButton = styled(Button)` + text-decoration: none; +` as typeof Button; + const UserPage: FC = () => { const dispatch = useDispatch(); const userQuery = useDataState( @@ -37,13 +43,16 @@ const UserPage: FC = () => { - +