mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) Fix WelcomePage to use an explicit action URL, and parse submitted body in time to log it with errors.
Test Plan: Tested manually that "Preflight" error goes away in Safari. Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2644
This commit is contained in:
parent
0b1aa22ad9
commit
ad7be0fd8d
@ -77,7 +77,7 @@ export class WelcomePage extends Disposable {
|
|||||||
|
|
||||||
return form = dom(
|
return form = dom(
|
||||||
'form',
|
'form',
|
||||||
{ method: "post" },
|
{ method: "post", action: location.href },
|
||||||
handleSubmit(),
|
handleSubmit(),
|
||||||
cssLabel('Your full name, as you\'d like it displayed to your collaborators.'),
|
cssLabel('Your full name, as you\'d like it displayed to your collaborators.'),
|
||||||
inputEl = cssInput(
|
inputEl = cssInput(
|
||||||
@ -101,7 +101,7 @@ export class WelcomePage extends Disposable {
|
|||||||
*/
|
*/
|
||||||
private _buildInfoForm(owner: MultiHolder) {
|
private _buildInfoForm(owner: MultiHolder) {
|
||||||
const allFilled = Observable.create(owner, false);
|
const allFilled = Observable.create(owner, false);
|
||||||
return forms.form({method: "post"},
|
return forms.form({method: "post", action: location.href },
|
||||||
handleSubmit(),
|
handleSubmit(),
|
||||||
(elem) => { setTimeout(() => elem.focus(), 0); },
|
(elem) => { setTimeout(() => elem.focus(), 0); },
|
||||||
forms.text('Please help us serve you better by answering a few questions.'),
|
forms.text('Please help us serve you better by answering a few questions.'),
|
||||||
|
@ -972,6 +972,10 @@ export class FlexServer implements GristServer {
|
|||||||
let body: string|undefined;
|
let body: string|undefined;
|
||||||
let permitKey: string|undefined;
|
let permitKey: string|undefined;
|
||||||
try {
|
try {
|
||||||
|
const user = getUser(req);
|
||||||
|
const row = {...req.body, UserID: userId, Name: user.name, Email: user.loginEmail};
|
||||||
|
body = JSON.stringify(mapValues(row, value => [value]));
|
||||||
|
|
||||||
// Take an extra step to translate the special urlId to a docId. This is helpful to
|
// Take an extra step to translate the special urlId to a docId. This is helpful to
|
||||||
// allow the same urlId to be used in production and in test. We need the docId for the
|
// allow the same urlId to be used in production and in test. We need the docId for the
|
||||||
// specialPermit below, which we need to be able to write to this doc.
|
// specialPermit below, which we need to be able to write to this doc.
|
||||||
@ -985,10 +989,6 @@ export class FlexServer implements GristServer {
|
|||||||
throw new Error(`Can't resolve ${urlId}: ${docAuth.error}`);
|
throw new Error(`Can't resolve ${urlId}: ${docAuth.error}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const user = getUser(req);
|
|
||||||
const row = {...req.body, UserID: userId, Name: user.name, Email: user.loginEmail};
|
|
||||||
body = JSON.stringify(mapValues(row, value => [value]));
|
|
||||||
|
|
||||||
permitKey = await this._docWorkerMap.setPermit({docId});
|
permitKey = await this._docWorkerMap.setPermit({docId});
|
||||||
const res = await fetch(await this.getHomeUrlByDocId(docId, `/api/docs/${docId}/tables/Responses/data`), {
|
const res = await fetch(await this.getHomeUrlByDocId(docId, `/api/docs/${docId}/tables/Responses/data`), {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
Loading…
Reference in New Issue
Block a user