MM-31063: Change constants to use CamelCase (#16608)
* MM-31063: Change constants to use CamelCase * store package * change allcaps to camel case (#16615) * New tools.mod Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
8b6ac5f5d2
Коммит
c1dd23a3c8
@@ -27,11 +27,11 @@ func NewAutoChannelCreator(a *app.App, team *model.Team, userId string) *AutoCha
|
||||
team: team,
|
||||
userId: userId,
|
||||
Fuzzy: false,
|
||||
DisplayNameLen: CHANNEL_DISPLAY_NAME_LEN,
|
||||
DisplayNameLen: ChannelDisplayNameLen,
|
||||
DisplayNameCharset: utils.ALPHANUMERIC,
|
||||
NameLen: CHANNEL_NAME_LEN,
|
||||
NameLen: ChannelNameLen,
|
||||
NameCharset: utils.LOWERCASE,
|
||||
ChannelType: CHANNEL_TYPE,
|
||||
ChannelType: ChannelType,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,24 +9,24 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
USER_PASSWORD = "passwd"
|
||||
CHANNEL_TYPE = model.CHANNEL_OPEN
|
||||
BTEST_TEAM_DISPLAY_NAME = "TestTeam"
|
||||
BTEST_TEAM_NAME = "z-z-testdomaina"
|
||||
BTEST_TEAM_EMAIL = "test@nowhere.com"
|
||||
BTEST_TEAM_TYPE = model.TEAM_OPEN
|
||||
BTEST_USER_NAME = "Mr. Testing Tester"
|
||||
BTEST_USER_EMAIL = "success+ttester@simulator.amazonses.com"
|
||||
BTEST_USER_PASSWORD = "passwd"
|
||||
UserPassword = "passwd"
|
||||
ChannelType = model.CHANNEL_OPEN
|
||||
BTestTeamDisplayName = "TestTeam"
|
||||
BTestTeamName = "z-z-testdomaina"
|
||||
BTestTeamEmail = "test@nowhere.com"
|
||||
BTestTeamType = model.TEAM_OPEN
|
||||
BTestUserName = "Mr. Testing Tester"
|
||||
BTestUserEmail = "success+ttester@simulator.amazonses.com"
|
||||
BTestUserPassword = "passwd"
|
||||
)
|
||||
|
||||
var (
|
||||
TEAM_NAME_LEN = utils.Range{Begin: 10, End: 20}
|
||||
TEAM_DOMAIN_NAME_LEN = utils.Range{Begin: 10, End: 20}
|
||||
TEAM_EMAIL_LEN = utils.Range{Begin: 15, End: 30}
|
||||
USER_NAME_LEN = utils.Range{Begin: 5, End: 20}
|
||||
USER_EMAIL_LEN = utils.Range{Begin: 15, End: 30}
|
||||
CHANNEL_DISPLAY_NAME_LEN = utils.Range{Begin: 10, End: 20}
|
||||
CHANNEL_NAME_LEN = utils.Range{Begin: 5, End: 20}
|
||||
TEST_IMAGE_FILENAMES = []string{"test.png", "testjpg.jpg", "testgif.gif"}
|
||||
TeamNameLen = utils.Range{Begin: 10, End: 20}
|
||||
TeamDomainNameLen = utils.Range{Begin: 10, End: 20}
|
||||
TeamEmailLen = utils.Range{Begin: 15, End: 30}
|
||||
UserNameLen = utils.Range{Begin: 5, End: 20}
|
||||
UserEmailLen = utils.Range{Begin: 15, End: 30}
|
||||
ChannelDisplayNameLen = utils.Range{Begin: 10, End: 20}
|
||||
ChannelNameLen = utils.Range{Begin: 5, End: 20}
|
||||
TestImageFileNames = []string{"test.png", "testjpg.jpg", "testgif.gif"}
|
||||
)
|
||||
|
||||
@@ -36,7 +36,7 @@ func CreateTestEnvironmentWithTeams(a *app.App, client *model.Client4, rangeTeam
|
||||
if err != nil {
|
||||
return TestEnvironment{}, err
|
||||
}
|
||||
client.LoginById(randomUser.Id, USER_PASSWORD)
|
||||
client.LoginById(randomUser.Id, UserPassword)
|
||||
teamEnvironment, err := CreateTestEnvironmentInTeam(a, client, team, rangeChannels, rangeUsers, rangePosts, fuzzy)
|
||||
if err != nil {
|
||||
return TestEnvironment{}, err
|
||||
@@ -76,7 +76,7 @@ func CreateTestEnvironmentInTeam(a *app.App, client *model.Client4, team *model.
|
||||
// Have every user join every channel
|
||||
for _, user := range users {
|
||||
for _, channel := range channels {
|
||||
_, resp := client.LoginById(user.Id, USER_PASSWORD)
|
||||
_, resp := client.LoginById(user.Id, UserPassword)
|
||||
if resp.Error != nil {
|
||||
return TeamEnvironment{}, resp.Error
|
||||
}
|
||||
@@ -92,7 +92,7 @@ func CreateTestEnvironmentInTeam(a *app.App, client *model.Client4, team *model.
|
||||
numImages := utils.RandIntFromRange(rangePosts) / 4
|
||||
for j := 0; j < numPosts; j++ {
|
||||
user := users[utils.RandIntFromRange(utils.Range{Begin: 0, End: len(users) - 1})]
|
||||
_, resp := client.LoginById(user.Id, USER_PASSWORD)
|
||||
_, resp := client.LoginById(user.Id, UserPassword)
|
||||
if resp.Error != nil {
|
||||
return TeamEnvironment{}, resp.Error
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ func NewAutoPostCreator(a *app.App, channelid, userid string) *AutoPostCreator {
|
||||
Fuzzy: false,
|
||||
TextLength: utils.Range{Begin: 100, End: 200},
|
||||
HasImage: false,
|
||||
ImageFilenames: TEST_IMAGE_FILENAMES,
|
||||
ImageFilenames: TestImageFileNames,
|
||||
Users: []string{},
|
||||
Mentions: utils.Range{Begin: 0, End: 5},
|
||||
Tags: utils.Range{Begin: 0, End: 7},
|
||||
|
||||
@@ -28,11 +28,11 @@ func NewAutoTeamCreator(client *model.Client4) *AutoTeamCreator {
|
||||
return &AutoTeamCreator{
|
||||
client: client,
|
||||
Fuzzy: false,
|
||||
NameLength: TEAM_NAME_LEN,
|
||||
NameLength: TeamNameLen,
|
||||
NameCharset: utils.LOWERCASE,
|
||||
DomainLength: TEAM_DOMAIN_NAME_LEN,
|
||||
DomainLength: TeamDomainNameLen,
|
||||
DomainCharset: utils.LOWERCASE,
|
||||
EmailLength: TEAM_EMAIL_LEN,
|
||||
EmailLength: TeamEmailLen,
|
||||
EmailCharset: utils.LOWERCASE,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,9 +29,9 @@ func NewAutoUserCreator(a *app.App, client *model.Client4, team *model.Team) *Au
|
||||
app: a,
|
||||
client: client,
|
||||
team: team,
|
||||
EmailLength: USER_EMAIL_LEN,
|
||||
EmailLength: UserEmailLen,
|
||||
EmailCharset: utils.LOWERCASE,
|
||||
NameLength: USER_NAME_LEN,
|
||||
NameLength: UserNameLen,
|
||||
NameCharset: utils.LOWERCASE,
|
||||
Fuzzy: false,
|
||||
}
|
||||
@@ -39,17 +39,17 @@ func NewAutoUserCreator(a *app.App, client *model.Client4, team *model.Team) *Au
|
||||
|
||||
// Basic test team and user so you always know one
|
||||
func CreateBasicUser(a *app.App, client *model.Client4) *model.AppError {
|
||||
found, _ := client.TeamExists(BTEST_TEAM_NAME, "")
|
||||
found, _ := client.TeamExists(BTestTeamName, "")
|
||||
if found {
|
||||
return nil
|
||||
}
|
||||
|
||||
newteam := &model.Team{DisplayName: BTEST_TEAM_DISPLAY_NAME, Name: BTEST_TEAM_NAME, Email: BTEST_TEAM_EMAIL, Type: BTEST_TEAM_TYPE}
|
||||
newteam := &model.Team{DisplayName: BTestTeamDisplayName, Name: BTestTeamName, Email: BTestTeamEmail, Type: BTestTeamType}
|
||||
basicteam, resp := client.CreateTeam(newteam)
|
||||
if resp.Error != nil {
|
||||
return resp.Error
|
||||
}
|
||||
newuser := &model.User{Email: BTEST_USER_EMAIL, Nickname: BTEST_USER_NAME, Password: BTEST_USER_PASSWORD}
|
||||
newuser := &model.User{Email: BTestUserEmail, Nickname: BTestUserName, Password: BTestUserPassword}
|
||||
ruser, resp := client.CreateUser(newuser)
|
||||
if resp.Error != nil {
|
||||
return resp.Error
|
||||
@@ -91,7 +91,7 @@ func (cfg *AutoUserCreator) createRandomUser() (*model.User, error) {
|
||||
user := &model.User{
|
||||
Email: userEmail,
|
||||
Nickname: userName,
|
||||
Password: USER_PASSWORD}
|
||||
Password: UserPassword}
|
||||
|
||||
ruser, resp := cfg.client.CreateUserWithInviteId(user, cfg.team.InviteId)
|
||||
if resp.Error != nil {
|
||||
|
||||
@@ -13,7 +13,7 @@ type AwayProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_AWAY = "away"
|
||||
CmdAway = "away"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -21,12 +21,12 @@ func init() {
|
||||
}
|
||||
|
||||
func (*AwayProvider) GetTrigger() string {
|
||||
return CMD_AWAY
|
||||
return CmdAway
|
||||
}
|
||||
|
||||
func (*AwayProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_AWAY,
|
||||
Trigger: CmdAway,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_away.desc"),
|
||||
DisplayName: T("api.command_away.name"),
|
||||
|
||||
@@ -14,7 +14,7 @@ type HeaderProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_HEADER = "header"
|
||||
CmdHeader = "header"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -22,12 +22,12 @@ func init() {
|
||||
}
|
||||
|
||||
func (*HeaderProvider) GetTrigger() string {
|
||||
return CMD_HEADER
|
||||
return CmdHeader
|
||||
}
|
||||
|
||||
func (*HeaderProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_HEADER,
|
||||
Trigger: CmdHeader,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_channel_header.desc"),
|
||||
AutoCompleteHint: T("api.command_channel_header.hint"),
|
||||
|
||||
@@ -14,7 +14,7 @@ type PurposeProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_PURPOSE = "purpose"
|
||||
CmdPurpose = "purpose"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -22,12 +22,12 @@ func init() {
|
||||
}
|
||||
|
||||
func (*PurposeProvider) GetTrigger() string {
|
||||
return CMD_PURPOSE
|
||||
return CmdPurpose
|
||||
}
|
||||
|
||||
func (*PurposeProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_PURPOSE,
|
||||
Trigger: CmdPurpose,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_channel_purpose.desc"),
|
||||
AutoCompleteHint: T("api.command_channel_purpose.hint"),
|
||||
|
||||
@@ -14,7 +14,7 @@ type RenameProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_RENAME = "rename"
|
||||
CmdRename = "rename"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -22,14 +22,14 @@ func init() {
|
||||
}
|
||||
|
||||
func (*RenameProvider) GetTrigger() string {
|
||||
return CMD_RENAME
|
||||
return CmdRename
|
||||
}
|
||||
|
||||
func (*RenameProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
renameAutocompleteData := model.NewAutocompleteData(CMD_RENAME, T("api.command_channel_rename.hint"), T("api.command_channel_rename.desc"))
|
||||
renameAutocompleteData := model.NewAutocompleteData(CmdRename, T("api.command_channel_rename.hint"), T("api.command_channel_rename.desc"))
|
||||
renameAutocompleteData.AddTextArgument(T("api.command_channel_rename.hint"), "[text]", "")
|
||||
return &model.Command{
|
||||
Trigger: CMD_RENAME,
|
||||
Trigger: CmdRename,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_channel_rename.desc"),
|
||||
AutoCompleteHint: T("api.command_channel_rename.hint"),
|
||||
|
||||
@@ -15,7 +15,7 @@ type CodeProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_CODE = "code"
|
||||
CmdCode = "code"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -23,12 +23,12 @@ func init() {
|
||||
}
|
||||
|
||||
func (*CodeProvider) GetTrigger() string {
|
||||
return CMD_CODE
|
||||
return CmdCode
|
||||
}
|
||||
|
||||
func (*CodeProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_CODE,
|
||||
Trigger: CmdCode,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_code.desc"),
|
||||
AutoCompleteHint: T("api.command_code.hint"),
|
||||
|
||||
@@ -13,7 +13,7 @@ type DndProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_DND = "dnd"
|
||||
CmdDND = "dnd"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -21,12 +21,12 @@ func init() {
|
||||
}
|
||||
|
||||
func (*DndProvider) GetTrigger() string {
|
||||
return CMD_DND
|
||||
return CmdDND
|
||||
}
|
||||
|
||||
func (*DndProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_DND,
|
||||
Trigger: CmdDND,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_dnd.desc"),
|
||||
DisplayName: T("api.command_dnd.name"),
|
||||
|
||||
@@ -20,7 +20,7 @@ type EchoProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_ECHO = "echo"
|
||||
CmdEcho = "echo"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -28,12 +28,12 @@ func init() {
|
||||
}
|
||||
|
||||
func (*EchoProvider) GetTrigger() string {
|
||||
return CMD_ECHO
|
||||
return CmdEcho
|
||||
}
|
||||
|
||||
func (*EchoProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_ECHO,
|
||||
Trigger: CmdEcho,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_echo.desc"),
|
||||
AutoCompleteHint: T("api.command_echo.hint"),
|
||||
|
||||
@@ -18,8 +18,8 @@ type CollapseProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_EXPAND = "expand"
|
||||
CMD_COLLAPSE = "collapse"
|
||||
CmdExpand = "expand"
|
||||
CmdCollapse = "collapse"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -28,16 +28,16 @@ func init() {
|
||||
}
|
||||
|
||||
func (*ExpandProvider) GetTrigger() string {
|
||||
return CMD_EXPAND
|
||||
return CmdExpand
|
||||
}
|
||||
|
||||
func (*CollapseProvider) GetTrigger() string {
|
||||
return CMD_COLLAPSE
|
||||
return CmdCollapse
|
||||
}
|
||||
|
||||
func (*ExpandProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_EXPAND,
|
||||
Trigger: CmdExpand,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_expand.desc"),
|
||||
DisplayName: T("api.command_expand.name"),
|
||||
@@ -46,7 +46,7 @@ func (*ExpandProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Com
|
||||
|
||||
func (*CollapseProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_COLLAPSE,
|
||||
Trigger: CmdCollapse,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_collapse.desc"),
|
||||
DisplayName: T("api.command_collapse.name"),
|
||||
|
||||
@@ -17,7 +17,7 @@ type groupmsgProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_GROUPMSG = "groupmsg"
|
||||
CmdGroupMsg = "groupmsg"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -25,12 +25,12 @@ func init() {
|
||||
}
|
||||
|
||||
func (*groupmsgProvider) GetTrigger() string {
|
||||
return CMD_GROUPMSG
|
||||
return CmdGroupMsg
|
||||
}
|
||||
|
||||
func (*groupmsgProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_GROUPMSG,
|
||||
Trigger: CmdGroupMsg,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_groupmsg.desc"),
|
||||
AutoCompleteHint: T("api.command_groupmsg.hint"),
|
||||
|
||||
@@ -13,7 +13,7 @@ type HelpProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_HELP = "help"
|
||||
CmdHelp = "help"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -21,12 +21,12 @@ func init() {
|
||||
}
|
||||
|
||||
func (h *HelpProvider) GetTrigger() string {
|
||||
return CMD_HELP
|
||||
return CmdHelp
|
||||
}
|
||||
|
||||
func (h *HelpProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_HELP,
|
||||
Trigger: CmdHelp,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_help.desc"),
|
||||
DisplayName: T("api.command_help.name"),
|
||||
|
||||
@@ -17,7 +17,7 @@ type InviteProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_INVITE = "invite"
|
||||
CmdInvite = "invite"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -25,12 +25,12 @@ func init() {
|
||||
}
|
||||
|
||||
func (*InviteProvider) GetTrigger() string {
|
||||
return CMD_INVITE
|
||||
return CmdInvite
|
||||
}
|
||||
|
||||
func (*InviteProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_INVITE,
|
||||
Trigger: CmdInvite,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_invite.desc"),
|
||||
AutoCompleteHint: T("api.command_invite.hint"),
|
||||
|
||||
@@ -16,7 +16,7 @@ type InvitePeopleProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_INVITE_PEOPLE = "invite_people"
|
||||
CmdInvite_PEOPLE = "invite_people"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -24,7 +24,7 @@ func init() {
|
||||
}
|
||||
|
||||
func (*InvitePeopleProvider) GetTrigger() string {
|
||||
return CMD_INVITE_PEOPLE
|
||||
return CmdInvite_PEOPLE
|
||||
}
|
||||
|
||||
func (*InvitePeopleProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
@@ -33,7 +33,7 @@ func (*InvitePeopleProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *mod
|
||||
autoComplete = false
|
||||
}
|
||||
return &model.Command{
|
||||
Trigger: CMD_INVITE_PEOPLE,
|
||||
Trigger: CmdInvite_PEOPLE,
|
||||
AutoComplete: autoComplete,
|
||||
AutoCompleteDesc: T("api.command.invite_people.desc"),
|
||||
AutoCompleteHint: T("api.command.invite_people.hint"),
|
||||
|
||||
@@ -15,7 +15,7 @@ type JoinProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_JOIN = "join"
|
||||
CmdJoin = "join"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -23,12 +23,12 @@ func init() {
|
||||
}
|
||||
|
||||
func (*JoinProvider) GetTrigger() string {
|
||||
return CMD_JOIN
|
||||
return CmdJoin
|
||||
}
|
||||
|
||||
func (*JoinProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_JOIN,
|
||||
Trigger: CmdJoin,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_join.desc"),
|
||||
AutoCompleteHint: T("api.command_join.hint"),
|
||||
|
||||
@@ -13,7 +13,7 @@ type LeaveProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_LEAVE = "leave"
|
||||
CmdLeave = "leave"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -21,12 +21,12 @@ func init() {
|
||||
}
|
||||
|
||||
func (*LeaveProvider) GetTrigger() string {
|
||||
return CMD_LEAVE
|
||||
return CmdLeave
|
||||
}
|
||||
|
||||
func (*LeaveProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_LEAVE,
|
||||
Trigger: CmdLeave,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_leave.desc"),
|
||||
DisplayName: T("api.command_leave.name"),
|
||||
|
||||
@@ -72,7 +72,7 @@ var usage = `Mattermost testing commands to help configure the system
|
||||
`
|
||||
|
||||
const (
|
||||
CMD_TEST = "test"
|
||||
CmdTest = "test"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -91,7 +91,7 @@ func init() {
|
||||
}
|
||||
|
||||
func (*LoadTestProvider) GetTrigger() string {
|
||||
return CMD_TEST
|
||||
return CmdTest
|
||||
}
|
||||
|
||||
func (*LoadTestProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
@@ -99,7 +99,7 @@ func (*LoadTestProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.C
|
||||
return nil
|
||||
}
|
||||
return &model.Command{
|
||||
Trigger: CMD_TEST,
|
||||
Trigger: CmdTest,
|
||||
AutoComplete: false,
|
||||
AutoCompleteDesc: "Debug Load Testing",
|
||||
AutoCompleteHint: "help",
|
||||
@@ -110,7 +110,7 @@ func (*LoadTestProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.C
|
||||
func (lt *LoadTestProvider) DoCommand(a *app.App, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
commandResponse, err := lt.doCommand(a, args, message)
|
||||
if err != nil {
|
||||
mlog.Error("failed command /"+CMD_TEST, mlog.Err(err))
|
||||
mlog.Error("failed command /"+CmdTest, mlog.Err(err))
|
||||
}
|
||||
|
||||
return commandResponse
|
||||
@@ -213,7 +213,7 @@ func (*LoadTestProvider) SetupCommand(a *app.App, args *model.CommandArgs, messa
|
||||
if err := CreateBasicUser(a, client); err != nil {
|
||||
return &model.CommandResponse{Text: "Failed to create testing environment", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}, err
|
||||
}
|
||||
_, resp := client.Login(BTEST_USER_EMAIL, BTEST_USER_PASSWORD)
|
||||
_, resp := client.Login(BTestUserEmail, BTestUserPassword)
|
||||
if resp.Error != nil {
|
||||
return &model.CommandResponse{Text: "Failed to create testing environment", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}, resp.Error
|
||||
}
|
||||
@@ -232,7 +232,7 @@ func (*LoadTestProvider) SetupCommand(a *app.App, args *model.CommandArgs, messa
|
||||
mlog.Info("Testing environment created")
|
||||
for i := 0; i < len(environment.Teams); i++ {
|
||||
mlog.Info("Team Created: " + environment.Teams[i].Name)
|
||||
mlog.Info("\t User to login: " + environment.Environments[i].Users[0].Email + ", " + USER_PASSWORD)
|
||||
mlog.Info("\t User to login: " + environment.Environments[i].Users[0].Email + ", " + UserPassword)
|
||||
}
|
||||
} else {
|
||||
team, err := a.Srv().Store.Team().Get(args.TeamId)
|
||||
|
||||
@@ -13,7 +13,7 @@ type LogoutProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_LOGOUT = "logout"
|
||||
CmdLogout = "logout"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -21,12 +21,12 @@ func init() {
|
||||
}
|
||||
|
||||
func (*LogoutProvider) GetTrigger() string {
|
||||
return CMD_LOGOUT
|
||||
return CmdLogout
|
||||
}
|
||||
|
||||
func (*LogoutProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_LOGOUT,
|
||||
Trigger: CmdLogout,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_logout.desc"),
|
||||
AutoCompleteHint: "",
|
||||
|
||||
@@ -13,7 +13,7 @@ type MeProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_ME = "me"
|
||||
CmdMe = "me"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -21,12 +21,12 @@ func init() {
|
||||
}
|
||||
|
||||
func (*MeProvider) GetTrigger() string {
|
||||
return CMD_ME
|
||||
return CmdMe
|
||||
}
|
||||
|
||||
func (*MeProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_ME,
|
||||
Trigger: CmdMe,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_me.desc"),
|
||||
AutoCompleteHint: T("api.command_me.hint"),
|
||||
|
||||
@@ -18,7 +18,7 @@ type msgProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_MSG = "msg"
|
||||
CmdMsg = "msg"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -26,12 +26,12 @@ func init() {
|
||||
}
|
||||
|
||||
func (*msgProvider) GetTrigger() string {
|
||||
return CMD_MSG
|
||||
return CmdMsg
|
||||
}
|
||||
|
||||
func (*msgProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_MSG,
|
||||
Trigger: CmdMsg,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_msg.desc"),
|
||||
AutoCompleteHint: T("api.command_msg.hint"),
|
||||
|
||||
@@ -15,7 +15,7 @@ type MuteProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_MUTE = "mute"
|
||||
CmdMute = "mute"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -23,12 +23,12 @@ func init() {
|
||||
}
|
||||
|
||||
func (*MuteProvider) GetTrigger() string {
|
||||
return CMD_MUTE
|
||||
return CmdMute
|
||||
}
|
||||
|
||||
func (*MuteProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_MUTE,
|
||||
Trigger: CmdMute,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_mute.desc"),
|
||||
AutoCompleteHint: T("api.command_mute.hint"),
|
||||
|
||||
@@ -13,7 +13,7 @@ type OfflineProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_OFFLINE = "offline"
|
||||
CmdOffline = "offline"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -21,12 +21,12 @@ func init() {
|
||||
}
|
||||
|
||||
func (*OfflineProvider) GetTrigger() string {
|
||||
return CMD_OFFLINE
|
||||
return CmdOffline
|
||||
}
|
||||
|
||||
func (*OfflineProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_OFFLINE,
|
||||
Trigger: CmdOffline,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_offline.desc"),
|
||||
DisplayName: T("api.command_offline.name"),
|
||||
|
||||
@@ -13,7 +13,7 @@ type OnlineProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_ONLINE = "online"
|
||||
CmdOnline = "online"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -21,12 +21,12 @@ func init() {
|
||||
}
|
||||
|
||||
func (*OnlineProvider) GetTrigger() string {
|
||||
return CMD_ONLINE
|
||||
return CmdOnline
|
||||
}
|
||||
|
||||
func (*OnlineProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_ONLINE,
|
||||
Trigger: CmdOnline,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_online.desc"),
|
||||
DisplayName: T("api.command_online.name"),
|
||||
|
||||
@@ -14,7 +14,7 @@ type OpenProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_OPEN = "open"
|
||||
CmdOpen = "open"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -22,12 +22,12 @@ func init() {
|
||||
}
|
||||
|
||||
func (open *OpenProvider) GetTrigger() string {
|
||||
return CMD_OPEN
|
||||
return CmdOpen
|
||||
}
|
||||
|
||||
func (open *OpenProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
cmd := open.JoinProvider.GetCommand(a, T)
|
||||
cmd.Trigger = CMD_OPEN
|
||||
cmd.Trigger = CmdOpen
|
||||
cmd.DisplayName = T("api.command_open.name")
|
||||
return cmd
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ type KickProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_REMOVE = "remove"
|
||||
CMD_KICK = "kick"
|
||||
CmdRemove = "remove"
|
||||
CmdKick = "kick"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -30,16 +30,16 @@ func init() {
|
||||
}
|
||||
|
||||
func (*RemoveProvider) GetTrigger() string {
|
||||
return CMD_REMOVE
|
||||
return CmdRemove
|
||||
}
|
||||
|
||||
func (*KickProvider) GetTrigger() string {
|
||||
return CMD_KICK
|
||||
return CmdKick
|
||||
}
|
||||
|
||||
func (*RemoveProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_REMOVE,
|
||||
Trigger: CmdRemove,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_remove.desc"),
|
||||
AutoCompleteHint: T("api.command_remove.hint"),
|
||||
@@ -49,7 +49,7 @@ func (*RemoveProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Com
|
||||
|
||||
func (*KickProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_KICK,
|
||||
Trigger: CmdKick,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_remove.desc"),
|
||||
AutoCompleteHint: T("api.command_remove.hint"),
|
||||
|
||||
@@ -13,7 +13,7 @@ type SearchProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_SEARCH = "search"
|
||||
CmdSearch = "search"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -21,12 +21,12 @@ func init() {
|
||||
}
|
||||
|
||||
func (search *SearchProvider) GetTrigger() string {
|
||||
return CMD_SEARCH
|
||||
return CmdSearch
|
||||
}
|
||||
|
||||
func (search *SearchProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_SEARCH,
|
||||
Trigger: CmdSearch,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_search.desc"),
|
||||
AutoCompleteHint: T("api.command_search.hint"),
|
||||
|
||||
@@ -13,7 +13,7 @@ type SettingsProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_SETTINGS = "settings"
|
||||
CmdSettings = "settings"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -21,12 +21,12 @@ func init() {
|
||||
}
|
||||
|
||||
func (settings *SettingsProvider) GetTrigger() string {
|
||||
return CMD_SETTINGS
|
||||
return CmdSettings
|
||||
}
|
||||
|
||||
func (settings *SettingsProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_SETTINGS,
|
||||
Trigger: CmdSettings,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_settings.desc"),
|
||||
AutoCompleteHint: "",
|
||||
|
||||
@@ -13,7 +13,7 @@ type ShortcutsProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_SHORTCUTS = "shortcuts"
|
||||
CmdShortcuts = "shortcuts"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -21,12 +21,12 @@ func init() {
|
||||
}
|
||||
|
||||
func (*ShortcutsProvider) GetTrigger() string {
|
||||
return CMD_SHORTCUTS
|
||||
return CmdShortcuts
|
||||
}
|
||||
|
||||
func (*ShortcutsProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_SHORTCUTS,
|
||||
Trigger: CmdShortcuts,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_shortcuts.desc"),
|
||||
AutoCompleteHint: "",
|
||||
|
||||
@@ -13,7 +13,7 @@ type ShrugProvider struct {
|
||||
}
|
||||
|
||||
const (
|
||||
CMD_SHRUG = "shrug"
|
||||
CmdShrug = "shrug"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -21,12 +21,12 @@ func init() {
|
||||
}
|
||||
|
||||
func (*ShrugProvider) GetTrigger() string {
|
||||
return CMD_SHRUG
|
||||
return CmdShrug
|
||||
}
|
||||
|
||||
func (*ShrugProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CMD_SHRUG,
|
||||
Trigger: CmdShrug,
|
||||
AutoComplete: true,
|
||||
AutoCompleteDesc: T("api.command_shrug.desc"),
|
||||
AutoCompleteHint: T("api.command_shrug.hint"),
|
||||
|
||||
Ссылка в новой задаче
Block a user