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

Rework legal links #199

Merged
merged 2 commits into from
Nov 18, 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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,7 @@ can be found here: [config.example.js](public/config/config.example.js).
| title | The title to show if the logo is not specified. | `"string"` | ``"edumeet"`` |
| randomizeOnBlank | Enable or disable randomize room name when it is blank. | `"boolean"` | ``true`` |
| transcriptionEnabled | Enable or disable transcription. | `"boolean"` | ``true`` |
| imprintUrl | Show a link to an imprint in the edumeet UI, keep blank to not show a link | `"string"` | ``""`` |
| privacyUrl | Show a link to a privacy notice in the edumeet UI, keep blank to not show a link | `"string"` | ``""`` |

---
6 changes: 6 additions & 0 deletions public/config/config.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ var config = {
// Enable or disable transcription.
transcriptionEnabled: true,

// Imprint. If you want to link your imprint, please provide a URL in this variable. If it is empty, no link will be shown.
imprintUrl: '',

// Privacy notice. If you want to link your privacy notices, please provide a URL in this variable. If it is empty, no link will be shown.
privacyUrl: '',

// Client theme. Take a look at mui theme documentation.
theme: {
palette: {
Expand Down
28 changes: 0 additions & 28 deletions src/components/controlbuttons/ImpressumButton.tsx

This file was deleted.

43 changes: 30 additions & 13 deletions src/components/helpdialog/HelpDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Button } from '@mui/material';
import { Button, Box, Link, Typography } from '@mui/material';
import { Close } from '@mui/icons-material';
import { useAppDispatch, useAppSelector } from '../../store/hooks';
import { uiActions } from '../../store/slices/uiSlice';
import { closeLabel } from '../translated/translatedComponents';
import { closeLabel, imprintLabel, privacyLabel } from '../translated/translatedComponents';
import ShortcutKeys from './ShortcutKeys';
import GenericDialog from '../genericdialog/GenericDialog';
import ImpressumButton from '../controlbuttons/ImpressumButton';
import edumeetConfig from '../../utils/edumeetConfig';

const HelpDialog = (): JSX.Element => {
const dispatch = useAppDispatch();
Expand All @@ -17,24 +17,41 @@ const HelpDialog = (): JSX.Element => {
}));
};

const privacyUrl = edumeetConfig.privacyUrl ?? '';
const imprintUrl = edumeetConfig.imprintUrl ?? '';

return (
<GenericDialog
open={ helpOpen }
onClose={ handleCloseHelp }
maxWidth='xs'
content={ <><ShortcutKeys /><ImpressumButton /></> }
content={ <><ShortcutKeys /></> }
actions={
<Button
onClick={ handleCloseHelp }
startIcon={ <Close /> }
variant='contained'
size='small'
>
{ closeLabel() }
</Button>
<Box display="flex" alignItems="center" justifyContent="space-between" width="100%">
<Box display="flex" alignItems="left">
{imprintUrl.trim() !== '' && (
<Link href={imprintUrl} target="_blank" color="inherit" underline="none">
<Typography variant="body2">{ imprintLabel() }</Typography>
</Link>
)}
{privacyUrl.trim() !== '' && (
<Link href={privacyUrl} target="_blank" color="inherit" underline="none" style={{ marginLeft: '16px' }}>
<Typography variant="body2">{ privacyLabel() }</Typography>
</Link>
)}
</Box>
<Button
onClick={ handleCloseHelp }
startIcon={ <Close /> }
variant='contained'
size='small'
>
{ closeLabel() }
</Button>
</Box>
}
/>
);
};

export default HelpDialog;
export default HelpDialog;
10 changes: 10 additions & 0 deletions src/components/translated/translatedComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -772,3 +772,13 @@ export const roomServerConnectionError = (message: string): string => intl.forma
id: 'svc.roomServerConnectionError',
defaultMessage: `Room-server: ${message}`
});

export const imprintLabel = (): string => intl.formatMessage({
id: 'label.imprint',
defaultMessage: 'Imprint'
});

export const privacyLabel = (): string => intl.formatMessage({
id: 'label.privacy',
defaultMessage: 'Privacy'
});
2 changes: 2 additions & 0 deletions src/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"label.fullscreen": "Vollbild",
"label.guest": null,
"label.high": "Hoch (HD)",
"label.imprint": "Impressum",
"label.italic": "kursiv",
"label.join": "Eintreten",
"label.joinBreakoutRoom": null,
Expand All @@ -77,6 +78,7 @@
"label.openSettings": null,
"label.participants": "Teilnehmer",
"label.password": "Passwort",
"label.privacy": "Datenschutz",
"label.promoteAllPeers": "Alle Teilnehmer reinlassen",
"label.recordingInProgress": "Aufnahme läuft...",
"label.removeBreakoutRoom": null,
Expand Down
8 changes: 5 additions & 3 deletions src/utils/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { TFLite } from '../services/effectsService';

export const defaultEdumeetConfig: EdumeetConfig = {
managementUrl: undefined,
impressumUrl: '/privacy/privacy.html',
p2penabled: false,
loginEnabled: false,
developmentPort: 8443,
Expand Down Expand Up @@ -92,12 +91,13 @@ export const defaultEdumeetConfig: EdumeetConfig = {
sideContentItemDarkColor: 'rgba(150, 150, 150, 0.4)',
sideContainerBackgroundColor: 'rgba(255, 255, 255, 0.7)',
},
reduxLoggingEnabled: false
reduxLoggingEnabled: false,
imprintUrl: '',
privacyUrl: ''
};

export interface EdumeetConfig {
managementUrl?: string;
impressumUrl: string;
p2penabled: boolean;
loginEnabled: boolean;
developmentPort: number;
Expand Down Expand Up @@ -133,6 +133,8 @@ export interface EdumeetConfig {
transcriptionEnabled: boolean;
theme: ThemeOptions;
reduxLoggingEnabled: boolean;
imprintUrl: string;
privacyUrl: string;
}

export interface HTMLMediaElementWithSink extends HTMLMediaElement {
Expand Down
40 changes: 29 additions & 11 deletions src/views/join/Join.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useEffect } from 'react';
import { Button } from '@mui/material';
import { Button, Box, Link, Typography } from '@mui/material';
import TextInputField from '../../components/textinputfield/TextInputField';
import { useAppDispatch, useAppSelector, useNotifier } from '../../store/hooks';
import { joinLabel, yourNameLabel } from '../../components/translated/translatedComponents';
import { joinLabel, yourNameLabel, imprintLabel, privacyLabel } from '../../components/translated/translatedComponents';
import { AccountCircle } from '@mui/icons-material';
import MediaPreview from '../../components/mediapreview/MediaPreview';
import AudioInputChooser from '../../components/devicechooser/AudioInputChooser';
Expand All @@ -18,9 +18,11 @@
import AudioOutputChooser from '../../components/devicechooser/AudioOutputChooser';
import { canSelectAudioOutput } from '../../store/selectors';
import TestAudioOutputButton from '../../components/audiooutputtest/AudioOutputTest';
import edumeetConfig from '../../utils/edumeetConfig';
import ImpressumButton from '../../components/controlbuttons/ImpressumButton';

Check warning on line 22 in src/views/join/Join.tsx

View workflow job for this annotation

GitHub Actions / build (18.x)

'ImpressumButton' is defined but never used

Check failure on line 22 in src/views/join/Join.tsx

View workflow job for this annotation

GitHub Actions / build (18.x)

'ImpressumButton' is defined but never used
import MicVolume from '../../components/volume/MicVolume';


Check warning on line 25 in src/views/join/Join.tsx

View workflow job for this annotation

GitHub Actions / build (18.x)

More than 1 blank line not allowed
interface JoinProps {
roomId: string;
}
Expand Down Expand Up @@ -62,6 +64,9 @@
}
}, []);

const privacyUrl = edumeetConfig.privacyUrl ?? '';
const imprintUrl = edumeetConfig.imprintUrl ?? '';

return (
<GenericDialog
title={ <PrecallTitle /> }
Expand All @@ -87,15 +92,28 @@
</>
}
actions={
<><ImpressumButton /><Button
onClick={handleJoin}
variant='contained'
disabled={!displayName || joinInProgress || mediaLoading}
size='small'
>
{joinLabel()}
</Button></>

<Box display="flex" alignItems="center" justifyContent="space-between" width="100%">
<Box display="flex" alignItems="left">
{imprintUrl.trim() !== '' && (
<Link href={imprintUrl} target="_blank" color="inherit" underline="none">
<Typography variant="body2">{ imprintLabel() }</Typography>
</Link>
)}
{privacyUrl.trim() !== '' && (
<Link href={privacyUrl} target="_blank" color="inherit" underline="none" style={{ marginLeft: '16px' }}>
<Typography variant="body2">{ privacyLabel() }</Typography>
</Link>
)}
</Box>
<Button
onClick={handleJoin}
variant='contained'
disabled={!displayName || joinInProgress || mediaLoading}
size='small'
>
{ joinLabel() }
</Button>
</Box>
}
/>
);
Expand Down
25 changes: 20 additions & 5 deletions src/views/landingpage/LandingPage.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { Button, Container } from '@mui/material';
import { Button, Container, Box, Link, Typography } from '@mui/material';
import randomString from 'random-string';
import TextInputField from '../../components/textinputfield/TextInputField';
import { joinLabel, roomNameLabel } from '../../components/translated/translatedComponents';
import { joinLabel, roomNameLabel, imprintLabel, privacyLabel } from '../../components/translated/translatedComponents';
import GenericDialog from '../../components/genericdialog/GenericDialog';
import StyledBackground from '../../components/StyledBackground';
import PrecallTitle from '../../components/precalltitle/PrecallTitle';
import { QRCode } from 'react-qrcode-logo';
import ImpressumButton from '../../components/controlbuttons/ImpressumButton';
import edumeetConfig from '../../utils/edumeetConfig';

const LandingPage = (): JSX.Element => {
Expand All @@ -17,6 +16,9 @@ const LandingPage = (): JSX.Element => {
const [ roomId, setRoomId ] = useState(randomizeOnBlank ? randomString({ length: 8 }).toLowerCase() : '');
const onClicked = () => navigate(`/${roomId}`);

const privacyUrl = edumeetConfig.privacyUrl ?? '';
const imprintUrl = edumeetConfig.imprintUrl ?? '';

return (
<StyledBackground>
<GenericDialog
Expand All @@ -36,15 +38,28 @@ const LandingPage = (): JSX.Element => {

}
actions={
<><ImpressumButton />
<Box display="flex" alignItems="center" justifyContent="space-between" width="100%">
<Box display="flex" alignItems="left">
{imprintUrl.trim() !== '' && (
<Link href={imprintUrl} target="_blank" color="inherit" underline="none">
<Typography variant="body2">{ imprintLabel() }</Typography>
</Link>
)}
{privacyUrl.trim() !== '' && (
<Link href={privacyUrl} target="_blank" color="inherit" underline="none" style={{ marginLeft: '16px' }}>
<Typography variant="body2">{ privacyLabel() }</Typography>
</Link>
)}
</Box>
<Button
onClick={onClicked}
variant='contained'
disabled={!roomId}
size='small'
>
{ joinLabel()}
</Button></>
</Button>
</Box>
}
/>

Expand Down
27 changes: 24 additions & 3 deletions src/views/lobby/Lobby.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { AccountCircle } from '@mui/icons-material';
import { Box, Link, Typography } from '@mui/material';
import { useState } from 'react';
import AudioInputChooser from '../../components/devicechooser/AudioInputChooser';
import VideoInputChooser from '../../components/devicechooser/VideoInputChooser';
import MediaPreview from '../../components/mediapreview/MediaPreview';
import GenericDialog from '../../components/genericdialog/GenericDialog';
import TextInputField from '../../components/textinputfield/TextInputField';
import { roomLockedLabel, yourNameLabel } from '../../components/translated/translatedComponents';
import { roomLockedLabel, yourNameLabel, imprintLabel, privacyLabel } from '../../components/translated/translatedComponents';
import { setDisplayName } from '../../store/actions/meActions';
import {
useAppDispatch,
Expand All @@ -17,6 +18,7 @@ import { ChooserDiv } from '../../components/devicechooser/DeviceChooser';
import AudioOutputChooser from '../../components/devicechooser/AudioOutputChooser';
import { canSelectAudioOutput } from '../../store/selectors';
import TestAudioOutputButton from '../../components/audiooutputtest/AudioOutputTest';
import edumeetConfig from '../../utils/edumeetConfig';

const Lobby = (): React.JSX.Element => {
useNotifier();
Expand All @@ -32,6 +34,9 @@ const Lobby = (): React.JSX.Element => {
));
};

const privacyUrl = edumeetConfig.privacyUrl ?? '';
const imprintUrl = edumeetConfig.imprintUrl ?? '';

return (
<GenericDialog
title={ <PrecallTitle /> }
Expand All @@ -53,9 +58,25 @@ const Lobby = (): React.JSX.Element => {
</ChooserDiv>
</>
}
actions={roomLockedLabel()}
actions={
<Box display="flex" flexDirection="column" alignItems="center" justifyContent="space-between" width="100%">
{roomLockedLabel()}
<Box display="flex" alignItems="left">
{imprintUrl.trim() !== '' && (
<Link href={imprintUrl} target="_blank" color="inherit" underline="none">
<Typography variant="body2">{ imprintLabel() }</Typography>
</Link>
)}
{privacyUrl.trim() !== '' && (
<Link href={privacyUrl} target="_blank" color="inherit" underline="none" style={{ marginLeft: '16px' }}>
<Typography variant="body2">{ privacyLabel() }</Typography>
</Link>
)}
</Box>
</Box>
}
/>
);
};

export default Lobby;
export default Lobby;
Loading
Loading