(core) Ask the user some questions after they sign up and set their name.

Summary:
- Add a /welcome/info endpoint, to serve a page after /welcome/user
- Add a new forms module to factor out the styles that feel more natural for a web form.
- Simplify form submission using JSON with a BaseAPI helper.
- The POST submission to /welcome/info gets added to a Grist doc, using a
  specialPermit grant to gain access. A failure (e.g. missing doc) is logged
  but does not affect the user.

Test Plan: Added a test case.

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D2640
This commit is contained in:
Dmitry S
2020-10-15 17:51:30 -04:00
parent 5247521cb8
commit 0b1aa22ad9
6 changed files with 292 additions and 61 deletions

View File

@@ -37,6 +37,12 @@ export class BaseAPI {
};
}
// Make a JSON request to the given URL, and read the esponse as JSON. Handles errors, and
// counts pending requests in the same way as BaseAPI methods do.
public static requestJson(url: string, init: RequestInit = {}): Promise<unknown> {
return new BaseAPI().requestJson(url, init);
}
private static _numPendingRequests: number = 0;
protected fetch: typeof fetch;

View File

@@ -14,7 +14,7 @@ export type IDocPage = number | 'new' | 'code';
export const HomePage = StringUnion('all', 'workspace', 'trash');
export type IHomePage = typeof HomePage.type;
export const WelcomePage = StringUnion('user', 'teams');
export const WelcomePage = StringUnion('user', 'info', 'teams');
export type WelcomePage = typeof WelcomePage.type;
// Overall UI style. "full" is normal, "light" is a single page focused, panels hidden experience.