mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Show a welcome card when a user opens an example for the first time.
Summary: - The card includes an image, a brief description, and a link to the tutorial. - The left panel includes a link to the tutorial, and a button to reopen card. - Card is collapsed and expanded with a little animation. - Add a seenExamples pref for whether an example has been seen. - Store the pref in localStorage for anon user. Separately, added clearing of prefs of test users between tests, to avoid tests affecting unrelated tests. Test Plan: Added a browser test. Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2602
This commit is contained in:
@@ -336,6 +336,21 @@ export class HomeDBManager extends EventEmitter {
|
||||
throw new Error(`Cannot testGetId(${name})`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear all user preferences associated with the given email addresses.
|
||||
* For use in tests.
|
||||
*/
|
||||
public async testClearUserPrefs(emails: string[]) {
|
||||
return await this._connection.transaction(async manager => {
|
||||
for (const email of emails) {
|
||||
const user = await this.getUserByLogin(email, undefined, manager);
|
||||
if (user) {
|
||||
await manager.delete(Pref, {userId: user.id});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public getUserByKey(apiKey: string): Promise<User|undefined> {
|
||||
return User.findOne({apiKey});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user