Desktop support (#4484)

* Remove home link on desktop app

* Spellcheck, installation toasts, background styling, …

* Add email,slack, auth support

* More desktop style tweaks

* Move redirect to client

* cleanup

* Record desktop usage

* docs

* fix: Selection state in search input when double clicking header
This commit is contained in:
Tom Moor
2022-11-27 15:07:48 -08:00
committed by GitHub
parent ea9680c3d7
commit cc333637dd
38 changed files with 492 additions and 83 deletions

View File

@@ -1,4 +1,5 @@
import * as React from "react";
import { Client } from "@shared/types";
import env from "@server/env";
import logger from "@server/logging/Logger";
import BaseEmail from "./BaseEmail";
@@ -14,6 +15,7 @@ type Props = {
to: string;
token: string;
teamUrl: string;
client: Client;
};
/**
@@ -28,20 +30,20 @@ export default class SigninEmail extends BaseEmail<Props> {
return "Heres your link to signin to Outline.";
}
protected renderAsText({ token, teamUrl }: Props): string {
protected renderAsText({ token, teamUrl, client }: Props): string {
return `
Use the link below to signin to Outline:
${this.signinLink(token)}
${this.signinLink(token, client)}
If your magic link expired you can request a new one from your teams
signin page at: ${teamUrl}
`;
}
protected render({ token, teamUrl }: Props) {
protected render({ token, client, teamUrl }: Props) {
if (env.ENVIRONMENT === "development") {
logger.debug("email", `Sign-In link: ${this.signinLink(token)}`);
logger.debug("email", `Sign-In link: ${this.signinLink(token, client)}`);
}
return (
@@ -53,7 +55,7 @@ signin page at: ${teamUrl}
<p>Click the button below to sign in to Outline.</p>
<EmptySpace height={10} />
<p>
<Button href={this.signinLink(token)}>Sign In</Button>
<Button href={this.signinLink(token, client)}>Sign In</Button>
</p>
<EmptySpace height={10} />
<p>
@@ -67,7 +69,7 @@ signin page at: ${teamUrl}
);
}
private signinLink(token: string): string {
return `${env.URL}/auth/email.callback?token=${token}`;
private signinLink(token: string, client: Client): string {
return `${env.URL}/auth/email.callback?token=${token}&client=${client}`;
}
}