Skip to content

Commit

Permalink
fix(app): localized privacy policy and better Run menu (#1682)
Browse files Browse the repository at this point in the history
  • Loading branch information
sr258 committed Jul 11, 2021
1 parent a1ef70f commit d7823de
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Once you have resolved any conflicts locally you can update the Pull Request wit

### We’re Here To Help

We encourage you to ask for help at any point. You can open issues or chat with us in [Slack](https://join.slack.com/t/lumi-education/shared_invite/enQtMjY0MTM2NjIwNDU0LWU3YzVhZjdkNGFjZGE1YThjNzBiMmJjY2I2ODk2MzAzNDE3YzI0MmFkOTdmZWZhOTBmY2RjOTc3ZmZmOWMxY2U) or reach us via [c@Lumi.education](mailto:c@Lumi.education).
We encourage you to ask for help at any point. You can open issues or chat with us in [Slack](https://join.slack.com/t/lumi-education/shared_invite/enQtMjY0MTM2NjIwNDU0LWU3YzVhZjdkNGFjZGE1YThjNzBiMmJjY2I2ODk2MzAzNDE3YzI0MmFkOTdmZWZhOTBmY2RjOTc3ZmZmOWMxY2U) or reach us via [c@lumi.education](mailto:c@lumi.education).

---

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Lumi has adopted the code of conduct defined by the Contributor Covenant. It can

### Get in touch

[Slack](https://join.slack.com/t/lumi-education/shared_invite/enQtMjY0MTM2NjIwNDU0LWU3YzVhZjdkNGFjZGE1YThjNzBiMmJjY2I2ODk2MzAzNDE3YzI0MmFkOTdmZWZhOTBmY2RjOTc3ZmZmOWMxY2U) or [c@Lumi.education](mailto:c@Lumi.education).
[Slack](https://join.slack.com/t/lumi-education/shared_invite/enQtMjY0MTM2NjIwNDU0LWU3YzVhZjdkNGFjZGE1YThjNzBiMmJjY2I2ODk2MzAzNDE3YzI0MmFkOTdmZWZhOTBmY2RjOTc3ZmZmOWMxY2U) or [c@lumi.education](mailto:c@lumi.education).

## Versioning

Expand Down
2 changes: 1 addition & 1 deletion client/src/state/Settings/SettingsActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function updateSettings(settings: ISettingsState): any {
*/
export function changeSetting(
payload: Partial<ISettingsState>,
save: boolean = false
save: boolean = true
): any {
return async (dispatch: any) => {
try {
Expand Down
4 changes: 2 additions & 2 deletions client/src/views/components/RunSetupDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default function RunSetupDialog(props: IRunSetupDialogProps) {
{t('privacy_policy.title')} [
<a
rel="noreferrer"
href="https://Lumi.education/run/privacy-policy"
href="https://lumi.education/run/privacy-policy"
target="_blank"
>
Link
Expand Down Expand Up @@ -173,7 +173,7 @@ export default function RunSetupDialog(props: IRunSetupDialogProps) {
{t('run.tos.header')} [
<a
rel="noreferrer"
href="https://Lumi.education/run/terms-of-use"
href="https://lumi.education/run/terms-of-use"
target="_blank"
>
Link
Expand Down
9 changes: 4 additions & 5 deletions client/src/views/components/Settings/LinkList.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { useTranslation, getI18n } from 'react-i18next';

import List from '@material-ui/core/List';
import ListItem from '@material-ui/core/ListItem';
Expand All @@ -11,6 +11,7 @@ import PolicyIcon from '@material-ui/icons/Policy';

export default function SettingsLinkList() {
const { t } = useTranslation();
const i18n = getI18n();

return (
<List
Expand All @@ -19,7 +20,7 @@ export default function SettingsLinkList() {
}
>
<a
href="https://www.lumi.education/app/privacy-policy"
href={`https://www.lumi.education/app/privacy-policy?lng=${i18n.language}`}
target="_blank"
rel="noreferrer"
style={{ color: 'inherit', textDecoration: 'inherit' }}
Expand All @@ -30,9 +31,7 @@ export default function SettingsLinkList() {
</ListItemIcon>
<ListItemText
id="switch-list-label-privacy-policy"
primary={
'https://www.Lumi.education/app/privacy-policy'
}
primary={`https://www.lumi.education/app/privacy-policy?lng=${i18n.language}`}
secondary={t('privacy_policy.title')}
/>
</ListItem>
Expand Down
2 changes: 1 addition & 1 deletion locales/lumi/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@
},
"run": {
"label": "Run",
"upload": "Upload"
"upload": "Upload to Lumi Run"
}
},
"notifications": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.8.0-beta.3",
"private": true,
"description": "A tool to create and display interactive content with H5P",
"author": "Lumi Education Jan Philip Schellenberg & Sebastian Rettig GbR <c@Lumi.education>",
"author": "Lumi Education Jan Philip Schellenberg & Sebastian Rettig GbR <c@lumi.education>",
"main": "build/server/main.js",
"dependencies": {
"@lumieducation/h5p-express": "8.1.1",
Expand Down
5 changes: 5 additions & 0 deletions server/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ export function createMainWindow(websocketArg: SocketIO.Server): void {
delayedWebsocketEmitter.resetWebsocketConnection();
});

window.webContents.on('new-window', (e, url) => {
e.preventDefault();
electron.shell.openExternal(url);
});

window.webContents.on('devtools-opened', () => {
window.focus();
setImmediate(() => {
Expand Down
15 changes: 12 additions & 3 deletions server/src/menu/h5peditorMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import editMenu from './editMenu';
import macMenu from './macMenu';
import windowMenu from './windowMenu';
import viewMenu from './viewMenu';
import runMenu from './runMenuItem';
import settings from '../settingsCache';

export default (window: electron.BrowserWindow, websocket: SocketIO.Server) =>
Expand Down Expand Up @@ -81,14 +80,24 @@ export default (window: electron.BrowserWindow, websocket: SocketIO.Server) =>
},
label: i18next.t('lumi:menu.file.export')
},
settings.getSettings().allowPrerelease !== undefined
? {
label: i18next.t('lumi:menu.run.upload'),
click: () => {
websocket.emit('action', {
payload: {},
type: 'UPLOAD_TO_RUN'
});
}
}
: undefined,
{ type: 'separator' } as any,
{
label: i18next.t('lumi:menu.quit'),
role: 'quit'
} as any
]
].filter((e) => e !== undefined)
},
settings.getSettings().allowPrerelease ? runMenu(websocket) : undefined,
editMenu(),
...viewMenu(),
...windowMenu(),
Expand Down
9 changes: 8 additions & 1 deletion server/src/menu/helpMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@ export default function (
},
label: i18next.t('lumi:menu.help.follow_us_on_twitter')
},
// { label: 'Check for Updates...', click: updater },
{
label: i18next.t('lumi:privacy_policy.title'),
click: () => {
electron.shell.openExternal(
`https://www.lumi.education/app/privacy-policy?lng=${i18next.language}`
);
}
},
{ label: i18next.t('lumi:menu.help.about'), role: 'about' }
]
};
Expand Down
21 changes: 0 additions & 21 deletions server/src/menu/runMenuItem.ts

This file was deleted.

6 changes: 2 additions & 4 deletions server/src/routes/settingsRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ export default function (
) => {
try {
if (req.body) {
const settings = await fsExtra.readJSON(
serverConfig.settingsFile
);
const oldSettings = settingsCache.getSettings();

await fsExtra.writeJSON(
serverConfig.settingsFile,
Expand All @@ -53,7 +51,7 @@ export default function (

if (
req.body.language &&
req.body.language !== settings.language
req.body.language !== oldSettings.language
) {
await i18next.loadLanguages(req.body.language);
await i18next.changeLanguage(req.body.language);
Expand Down

0 comments on commit d7823de

Please sign in to comment.