mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Add support for auto-copying docs on signup
Summary: The new "copyDoc" query parameter on the login page sets a short-lived cookie, which is then read when welcoming a new user to copy that document to their Home workspace, and redirect to it. Currently, only templates and bare forks set this parameter. A new API endpoint for copying a document to a workspace was also added. Test Plan: Browser tests. Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D3992
This commit is contained in:
@@ -81,10 +81,10 @@ export class AccountWidget extends Disposable {
|
||||
private _buildUseThisTemplateButton() {
|
||||
return cssUseThisTemplateButton(t('Use This Template'),
|
||||
dom.attr('href', use => {
|
||||
// Keep the redirect param of the login/signup URL fresh.
|
||||
use(urlState().state);
|
||||
return getLoginOrSignupUrl();
|
||||
const {doc: srcDocId} = use(urlState().state);
|
||||
return getLoginOrSignupUrl({srcDocId});
|
||||
}),
|
||||
dom.on('click', () => { this._docPageModel?.clearUnsavedChanges(); }),
|
||||
testId('dm-account-use-this-template'),
|
||||
);
|
||||
}
|
||||
@@ -109,7 +109,7 @@ export class AccountWidget extends Disposable {
|
||||
t("Toggle Mobile Mode"),
|
||||
cssCheckmark('Tick', dom.show(viewport.viewportEnabled)),
|
||||
testId('usermenu-toggle-mobile'),
|
||||
);
|
||||
);
|
||||
|
||||
if (!user) {
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user