-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NEW] Action buttons registry (#446)
* Create manager for button registry * Refactor definitions * Add the configuration extend * Add regiter buttons permission * Fix styles and add appId prop to button interface * Add activation bridge method for new buttons * New types * Refactor gulpfile * Add new interaction event * Fix gulpfile * Fix error when app doesn't exist * A few refactors * Rename label property and remove icon
- Loading branch information
Showing
29 changed files
with
335 additions
and
179 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { IUIActionButtonDescriptor } from '../ui'; | ||
|
||
export interface IUIExtend { | ||
registerButton(button: IUIActionButtonDescriptor): void; | ||
} |
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 |
---|---|---|
@@ -1,103 +1,47 @@ | ||
import { IApiExtend } from './IApiExtend'; | ||
import { IAppAccessors } from './IAppAccessors'; | ||
import { IAppInstallationContext } from './IAppInstallationContext'; | ||
import { IAppUninstallationContext } from './IAppUninstallationContext'; | ||
import { ICloudWorkspaceRead } from './ICloudWorkspaceRead'; | ||
import { IConfigurationExtend } from './IConfigurationExtend'; | ||
import { IConfigurationModify } from './IConfigurationModify'; | ||
import { IDiscussionBuilder } from './IDiscussionBuilder'; | ||
import { IEnvironmentalVariableRead } from './IEnvironmentalVariableRead'; | ||
import { IEnvironmentRead } from './IEnvironmentRead'; | ||
import { IExternalComponentsExtend } from './IExternalComponentsExtend'; | ||
import { HttpStatusCode, IHttp, IHttpExtend, IHttpPreRequestHandler, IHttpPreResponseHandler, IHttpRequest, IHttpResponse, RequestMethod } from './IHttp'; | ||
import { ILivechatCreator } from './ILivechatCreator'; | ||
import { ILivechatMessageBuilder } from './ILivechatMessageBuilder'; | ||
import { ILivechatRead } from './ILivechatRead'; | ||
import { ILivechatUpdater } from './ILivechatUpdater'; | ||
import { ILogEntry, LogMessageSeverity } from './ILogEntry'; | ||
import { ILogger } from './ILogger'; | ||
import { IMessageBuilder } from './IMessageBuilder'; | ||
import { IMessageExtender } from './IMessageExtender'; | ||
import { IMessageRead } from './IMessageRead'; | ||
import { IModify } from './IModify'; | ||
import { IModifyCreator } from './IModifyCreator'; | ||
import { IModifyDeleter } from './IModifyDeleter'; | ||
import { IModifyExtender } from './IModifyExtender'; | ||
import { IModifyUpdater } from './IModifyUpdater'; | ||
import { INotifier } from './INotifier'; | ||
import { IPersistence } from './IPersistence'; | ||
import { IPersistenceRead } from './IPersistenceRead'; | ||
import { IRead } from './IRead'; | ||
import { IRoomBuilder } from './IRoomBuilder'; | ||
import { IRoomExtender } from './IRoomExtender'; | ||
import { IRoomRead } from './IRoomRead'; | ||
import { ISchedulerExtend } from './ISchedulerExtend'; | ||
import { ISchedulerModify } from './ISchedulerModify'; | ||
import { IServerSettingRead } from './IServerSettingRead'; | ||
import { IServerSettingsModify } from './IServerSettingsModify'; | ||
import { ISettingRead } from './ISettingRead'; | ||
import { ISettingsExtend } from './ISettingsExtend'; | ||
import { ISlashCommandsExtend } from './ISlashCommandsExtend'; | ||
import { ISlashCommandsModify } from './ISlashCommandsModify'; | ||
import { IUIController } from './IUIController'; | ||
import { IUploadCreator } from './IUploadCreator'; | ||
import { IUploadRead } from './IUploadRead'; | ||
import { IUserBuilder } from './IUserBuilder'; | ||
import { IUserRead } from './IUserRead'; | ||
|
||
export { | ||
HttpStatusCode, | ||
IAppAccessors, | ||
IAppUninstallationContext, | ||
IAppInstallationContext, | ||
ICloudWorkspaceRead, | ||
IConfigurationExtend, | ||
IConfigurationModify, | ||
IDiscussionBuilder, | ||
IEnvironmentalVariableRead, | ||
IEnvironmentRead, | ||
IExternalComponentsExtend, | ||
IHttp, | ||
IHttpExtend, | ||
IHttpPreRequestHandler, | ||
IHttpPreResponseHandler, | ||
IHttpRequest, | ||
IHttpResponse, | ||
ILivechatCreator, | ||
ILivechatMessageBuilder, | ||
ILivechatRead, | ||
ILivechatUpdater, | ||
ILogEntry, | ||
ILogger, | ||
IMessageBuilder, | ||
IMessageExtender, | ||
IMessageRead, | ||
IModify, | ||
IModifyCreator, | ||
IModifyDeleter, | ||
IModifyExtender, | ||
IModifyUpdater, | ||
INotifier, | ||
IPersistence, | ||
IPersistenceRead, | ||
IRead, | ||
IRoomBuilder, | ||
IRoomExtender, | ||
IRoomRead, | ||
IServerSettingRead, | ||
IServerSettingsModify, | ||
ISettingRead, | ||
ISettingsExtend, | ||
ISlashCommandsExtend, | ||
ISlashCommandsModify, | ||
IUIController, | ||
IUploadRead, | ||
IUploadCreator, | ||
IUserBuilder, | ||
IUserRead, | ||
LogMessageSeverity, | ||
RequestMethod, | ||
IApiExtend, | ||
ISchedulerModify, | ||
ISchedulerExtend, | ||
}; | ||
export * from './IApiExtend'; | ||
export * from './IAppAccessors'; | ||
export * from './IAppInstallationContext'; | ||
export * from './IAppUninstallationContext'; | ||
export * from './ICloudWorkspaceRead'; | ||
export * from './IConfigurationExtend'; | ||
export * from './IConfigurationModify'; | ||
export * from './IDiscussionBuilder'; | ||
export * from './IEnvironmentalVariableRead'; | ||
export * from './IEnvironmentRead'; | ||
export * from './IExternalComponentsExtend'; | ||
export * from './IHttp'; | ||
export * from './ILivechatCreator'; | ||
export * from './ILivechatMessageBuilder'; | ||
export * from './ILivechatRead'; | ||
export * from './ILivechatUpdater'; | ||
export * from './ILogEntry'; | ||
export * from './ILogger'; | ||
export * from './IMessageBuilder'; | ||
export * from './IMessageExtender'; | ||
export * from './IMessageRead'; | ||
export * from './IModify'; | ||
export * from './IModifyCreator'; | ||
export * from './IModifyDeleter'; | ||
export * from './IModifyExtender'; | ||
export * from './IModifyUpdater'; | ||
export * from './INotifier'; | ||
export * from './IPersistence'; | ||
export * from './IPersistenceRead'; | ||
export * from './IRead'; | ||
export * from './IRoomBuilder'; | ||
export * from './IRoomExtender'; | ||
export * from './IRoomRead'; | ||
export * from './ISchedulerExtend'; | ||
export * from './ISchedulerModify'; | ||
export * from './IServerSettingRead'; | ||
export * from './IServerSettingsModify'; | ||
export * from './ISettingRead'; | ||
export * from './ISettingsExtend'; | ||
export * from './ISlashCommandsExtend'; | ||
export * from './ISlashCommandsModify'; | ||
export * from './IUIController'; | ||
export * from './IUIExtend'; | ||
export * from './IUploadCreator'; | ||
export * from './IUploadRead'; | ||
export * from './IUserBuilder'; | ||
export * from './IUserRead'; |
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
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,40 @@ | ||
import { UIActionButtonContext } from './UIActionButtonContext'; | ||
|
||
export enum RoomTypeFilter { | ||
PUBLIC_CHANNEL = 'public_channel', | ||
PRIVATE_CHANNEL = 'private_channel', | ||
PUBLIC_TEAM = 'public_team', | ||
PRIVATE_TEAM = 'private_team', | ||
PUBLIC_DISCUSSION = 'public_discussion', | ||
PRIVATE_DISCUSSION = 'private_discussion', | ||
DIRECT = 'direct', | ||
DIRECT_MULTIPLE = 'direct_multiple', | ||
LIVE_CHAT = 'livechat', | ||
} | ||
|
||
export enum MessageActionContext { | ||
MESSAGE = 'message', | ||
MESSAGE_MOBILE = 'message-mobile', | ||
THREADS = 'threads', | ||
STARRED = 'starred', | ||
} | ||
|
||
export interface IUIActionButtonDescriptor { | ||
actionId: string; | ||
labelI18n: string; | ||
context: UIActionButtonContext; | ||
when?: { | ||
roomTypes?: Array<RoomTypeFilter>; | ||
messageActionContext?: Array<MessageActionContext>; | ||
// How do we provide suggestions for permissions? | ||
hasOnePermission?: Array<string>; | ||
hasAllPermissions?: Array<string>; | ||
// How do we provide suggestions for roles? | ||
hasOneRole?: Array<string>; | ||
hasAllRoles?: Array<string>; | ||
}; | ||
} | ||
|
||
export interface IUIActionButton extends IUIActionButtonDescriptor { | ||
appId: string; | ||
} |
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,5 @@ | ||
export enum UIActionButtonContext { | ||
MESSAGE_ACTION = 'messageAction', | ||
ROOM_ACTION = 'roomAction', | ||
MESSAGE_BOX_ACTION = 'messageBoxAction', | ||
} |
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,2 @@ | ||
export * from './IUIActionButtonDescriptor'; | ||
export * from './UIActionButtonContext'; |
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
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.