New onboarding document

This commit is contained in:
Jori Lallo
2017-11-26 21:51:06 -08:00
parent d206ba0173
commit a6584714c3
3 changed files with 53 additions and 5 deletions

View File

@@ -7,6 +7,7 @@ import { asyncLock } from '../redis';
import events from '../events';
import Document from './Document';
import Event from './Event';
import { welcomeMessage } from '../utils/onboarding';
// $FlowIssue invalid flow-typed
slug.defaults.mode = 'rfc3986';
@@ -57,8 +58,8 @@ const Collection = sequelize.define(
userId: collection.creatorId,
lastModifiedById: collection.creatorId,
createdById: collection.creatorId,
title: 'Introduction',
text: '# Introduction\n\nLets get started...',
title: 'Welcome to Outline',
text: welcomeMessage(collection.id),
});
collection.documentStructure = [document.toJSON()];
} else {

View File

@@ -32,14 +32,13 @@ Team.associate = models => {
};
Team.prototype.createFirstCollection = async function(userId) {
const atlas = await Collection.create({
name: this.name,
return await Collection.create({
name: 'General',
description: 'Your first Collection',
type: 'atlas',
teamId: this.id,
creatorId: userId,
});
return atlas;
};
Team.prototype.addAdmin = async function(user: User) {