This repository has been archived by the owner on Oct 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Slack Bot #2632
Merged
Merged
Slack Bot #2632
Changes from 56 commits
Commits
Show all changes
89 commits
Select commit
Hold shift + click to select a range
9aecdf8
Fix Slack permission scopes
mxstbr e064237
console.log -> console.error
mxstbr d2d162d
Refactor importSlack UI settings pane
mxstbr e4117e3
Fix invitation mutation
mxstbr 6f24bd5
Im a dummy
mxstbr adc243a
Move slackImportQueue.add from db query
mxstbr 2c405d7
Lazily import members from Slack
mxstbr 8510218
Store Slack scope with slackImports record
mxstbr 27b3a53
Fix copy on Slack integration
mxstbr a87d18d
Change Slack scope to not include admin permissions
mxstbr f7d7d65
Send new threads in a community to Slack
mxstbr 8dbcdff
Fix danger warnings
brianlovin b615558
Eslint cleanup
brianlovin 5f304cd
Merge branch 'alpha' of https://github.com/withspectrum/spectrum into…
brianlovin 610155a
Move files from old iris
brianlovin 7adfa58
Merge alpha and fix conflicts
brianlovin eeadaef
Refactor front end components to set it up for reusability in many co…
brianlovin 94f75c4
Update api graphql types for community slack settings
brianlovin 0a9d8c1
Update community settings db type
brianlovin 89e199f
Refactor graphql queries and mutations for slack settings
brianlovin bdfd504
Add new worker queues for slack invitations
brianlovin 74840e7
Update the way slack auth routing saves records in api
brianlovin a399dc2
Add slack settings query resolver to community
brianlovin 6f31aef
Add community settings model functions in api
brianlovin 14803e6
Add mutation to api to send slack invitations
brianlovin cc65095
Add athena queue to handle sending slack invites
brianlovin 6ecb80a
Implements new slack settings resolver for communities
brianlovin 3e8305a
Adds client components to get channel list from slack
brianlovin 4d247d0
Adds graphql queries for slack channel list
brianlovin 7249157
Schema type updates for slack settings
brianlovin 262103b
Simplifies community slack settings resolver
brianlovin 14ae9c1
Adds first channel slack settings resolver
brianlovin 68bd273
Adds api request to slack for channel list
brianlovin 38c434b
Scope updates
brianlovin 7e28120
Add channel slack settings resolver def
brianlovin 2a97b3c
Experimental isAuthed directive resolver to remove redundant auth checks
brianlovin f587107
Add components to manage individual channel slack bot settings
brianlovin 667cb8e
Update dbchannelsettings type
brianlovin 0f10716
Add graphql queries and mutations to manage single channel slack bot …
brianlovin 6759783
Add consistent permission check utils for channel resolvers
brianlovin b01d251
Add new channelSettings type and resolvers
brianlovin f995c49
Add mutation resolver to update channel slack bot settings
brianlovin 3dc3ba7
Delete unused mutation resolver file
brianlovin ca2a7d4
Clean up remaining api channel resolvers based on new permission util…
brianlovin 90fdfb5
Set slackChannelId to null instead of no length string
brianlovin 423729a
Update slack notification send logic and formatting
brianlovin 0ab4920
Allow cross posting to private channels on slack
brianlovin ecab032
Adds smart error handling to reset slack connection without losing ch…
brianlovin 00b3baf
Clean up console logs
brianlovin 342f005
More console cleanup
brianlovin ac96407
Eslint cleanup, remove old slack import component
brianlovin e930a21
Fix onboarding state for slack component
brianlovin 64e3dde
Implement slack bot controls into channel settings
brianlovin 937fd5f
Fix a bug that causes channel list to crash after creating a new channel
brianlovin 1377ee9
Clean up styling to make channel slack bot management more clear
brianlovin 52a866b
Fix flow issues
brianlovin d2c416b
Add migration to remove all stored member data
brianlovin 2bd603d
Fix permission check in user can create channel
brianlovin ac54fcb
More consistent threadCreated event type
brianlovin 6973607
Proposal for moving permissions to user context fields
brianlovin 3d9be60
Refactor context to only call permissions function once
brianlovin a6cef25
Refactor permissions naming and logic to be more clear
brianlovin 2e31239
Community mods can administer channels
brianlovin a33baa8
Add slack icons
brianlovin 8d5affc
Merge branch 'alpha' of github.com:withspectrum/spectrum into slack-bot
brianlovin 3273164
Polish up ui, copy, implement icon
brianlovin 0f63210
Fix permissions for moderator managing slack team
brianlovin 8df305f
Fix file name
brianlovin 2276f46
Dont prettier long functions, breaks tests
brianlovin cbe12ff
Merge branch 'slack-bot' of github.com:withspectrum/spectrum into sla…
brianlovin 4b2ef51
Update packages to attempt to fix directives
brianlovin d22588b
Attempt to fix direct resolver
brianlovin 19bc315
Attempt to fix tests
brianlovin 3f2c24f
Swap isauthed directive for resolver wrapping function
brianlovin a1ebd8d
Fix test suite with new permission functions and updates snapshots
brianlovin a7f631c
ESLint
brianlovin c835d03
Fix e2e tests
brianlovin c077ce8
Merge branch 'alpha' of github.com:withspectrum/spectrum into slack-bot
brianlovin 53b47dc
Remove console
brianlovin ffc8408
Remove console
brianlovin 901ff5c
Move permission logic out of context construction
brianlovin fd05e6e
Fix resolvers to use new permission checks
brianlovin 1f7b86d
Fix tests context construction
brianlovin 6b3852e
Fix small bug in caching with channel creation
brianlovin 871560d
Simplify type for context user
brianlovin 5743014
Add tests for querying channel slack settings
brianlovin d8fdedb
Adds tests for querying slacksettings, fixes some client fallback ren…
brianlovin cf1632d
botConnection => botLinks
brianlovin 466b5e9
Remove console
brianlovin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// @flow | ||
import isAuthed from './isAuthed'; | ||
|
||
export default { | ||
isAuthed, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// @flow | ||
import UserError from '../utils/UserError'; | ||
import type { GraphQLContext } from '../'; | ||
|
||
export default (next: Function, _: any, __: any, { user }: GraphQLContext) => { | ||
if (user && user.id) return next(); | ||
throw new UserError(`You must be signed in to do this`); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just make this
eventType: 'threadCreated'
? Then you don't have to do that awkward switch further below to matchthreadCreated
toTHREAD_CREATED
, that seems pretty unnecessary.