feat: invites (#967)

* stub invite endpoint

* feat: First pass invite UI

* feat: allow removing invite rows

* First pass: sending logic

* fix: label accessibility

* fix: add button submits
incorrect permissions
middleware flow error

* 💚

* Error handling, email filtering, tests

* Flow

* Add Invite to people page
Remove old Tip

* Add copy link to subdomain
This commit is contained in:
Tom Moor
2019-06-24 22:14:59 -07:00
committed by GitHub
parent f406faf08e
commit d5192acabf
21 changed files with 509 additions and 103 deletions

View File

@@ -1,6 +1,6 @@
// @flow
import { Op } from '../sequelize';
import type { Event } from '../events';
import type { DocumentEvent, CollectionEvent, Event } from '../events';
import { Document, Collection, User, NotificationSetting } from '../models';
import mailer from '../mailer';
@@ -16,7 +16,7 @@ export default class Notifications {
}
}
async documentUpdated(event: Event) {
async documentUpdated(event: DocumentEvent) {
// lets not send a notification on every autosave update
if (event.autosave) return;
@@ -71,7 +71,7 @@ export default class Notifications {
});
}
async collectionCreated(event: Event) {
async collectionCreated(event: CollectionEvent) {
const collection = await Collection.findByPk(event.modelId, {
include: [
{

View File

@@ -1,5 +1,5 @@
// @flow
import type { Event } from '../events';
import type { DocumentEvent, IntegrationEvent, Event } from '../events';
import { Document, Integration, Collection, Team } from '../models';
import { presentSlackAttachment } from '../presenters';
@@ -15,7 +15,7 @@ export default class Slack {
}
}
async integrationCreated(event: Event) {
async integrationCreated(event: IntegrationEvent) {
const integration = await Integration.findOne({
where: {
id: event.modelId,
@@ -56,7 +56,7 @@ export default class Slack {
});
}
async documentUpdated(event: Event) {
async documentUpdated(event: DocumentEvent) {
// lets not send a notification on every autosave update
if (event.autosave) return;