Editor embeds (#680)
- [x] Make deleting an embed easier - [x] Add document level ability to disable embeds - [x] Add team level ability to disable embeds - [x] GitHub - [x] Numeracy - [x] Mode Analytics - [x] Figma - [x] Airtable - [x] Vimeo - [x] RealtimeBoard - [x] Loom - [x] Lucidcharts - [x] Framer - [x] InVision - [x] Typeform - [x] Marvel - [x] Spotify - [x] Codepen - [x] Trello
This commit is contained in:
@@ -11,7 +11,7 @@ const { authorize } = policy;
|
||||
const router = new Router();
|
||||
|
||||
router.post('team.update', auth(), async ctx => {
|
||||
const { name, avatarUrl, subdomain, sharing } = ctx.body;
|
||||
const { name, avatarUrl, subdomain, sharing, documentEmbeds } = ctx.body;
|
||||
const endpoint = publicS3Endpoint();
|
||||
|
||||
const user = ctx.state.user;
|
||||
@@ -24,6 +24,7 @@ router.post('team.update', auth(), async ctx => {
|
||||
|
||||
if (name) team.name = name;
|
||||
if (sharing !== undefined) team.sharing = sharing;
|
||||
if (documentEmbeds !== undefined) team.documentEmbeds = documentEmbeds;
|
||||
if (avatarUrl && avatarUrl.startsWith(`${endpoint}/uploads/${user.id}`)) {
|
||||
team.avatarUrl = avatarUrl;
|
||||
}
|
||||
|
||||
12
server/migrations/20181215192422-document-embeds.js
Normal file
12
server/migrations/20181215192422-document-embeds.js
Normal file
@@ -0,0 +1,12 @@
|
||||
module.exports = {
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.addColumn('teams', 'documentEmbeds', {
|
||||
type: Sequelize.BOOLEAN,
|
||||
allowNull: false,
|
||||
defaultValue: true
|
||||
});
|
||||
},
|
||||
down: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.removeColumn('teams', 'documentEmbeds');
|
||||
}
|
||||
}
|
||||
@@ -44,6 +44,11 @@ const Team = sequelize.define(
|
||||
googleId: { type: DataTypes.STRING, allowNull: true },
|
||||
avatarUrl: { type: DataTypes.STRING, allowNull: true },
|
||||
sharing: { type: DataTypes.BOOLEAN, allowNull: false, defaultValue: true },
|
||||
documentEmbeds: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
allowNull: false,
|
||||
defaultValue: true,
|
||||
},
|
||||
slackData: DataTypes.JSONB,
|
||||
},
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@ function present(ctx: Object, team: Team) {
|
||||
slackConnected: !!team.slackId,
|
||||
googleConnected: !!team.googleId,
|
||||
sharing: team.sharing,
|
||||
documentEmbeds: team.documentEmbeds,
|
||||
subdomain: team.subdomain,
|
||||
url: team.url,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user