Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
67fde388
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
67fde388
编写于
11月 21, 2016
作者:
Z
Z.J. van de Weg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve the mattermost help box
Also added tests, and moved the slack test to a better location.
上级
e74e53ae
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
58 addition
and
13 deletion
+58
-13
app/models/project_services/mattermost_slash_commands_service.rb
...els/project_services/mattermost_slash_commands_service.rb
+0
-7
app/views/projects/services/mattermost_slash_commands/_help.html.haml
...ojects/services/mattermost_slash_commands/_help.html.haml
+6
-6
changelogs/unreleased/zj-mattermost-command-help-message.yml
changelogs/unreleased/zj-mattermost-command-help-message.yml
+4
-0
spec/features/projects/services/mattermost_slash_command_spec.rb
...atures/projects/services/mattermost_slash_command_spec.rb
+48
-0
spec/features/projects/services/slack_service_spec.rb
spec/features/projects/services/slack_service_spec.rb
+0
-0
未找到文件。
app/models/project_services/mattermost_slash_commands_service.rb
浏览文件 @
67fde388
...
...
@@ -19,13 +19,6 @@ class MattermostSlashCommandsService < ChatService
'mattermost_slash_commands'
end
def
help
"This service allows you to use slash commands with your Mattermost installation.<br/>
To setup this Service you need to create a new <b>Slash commands</b> in your Mattermost integration panel.<br/>
<br/>
Create integration with URL
#{
service_trigger_url
(
self
)
}
and enter the token below."
end
def
fields
[
{
type:
'text'
,
name:
'token'
,
placeholder:
''
}
...
...
app/views/projects/services/mattermost_
command
/_help.html.haml
→
app/views/projects/services/mattermost_
slash_commands
/_help.html.haml
浏览文件 @
67fde388
-
pretty_path_with_namespace
=
"
#{
@project
?
@project
.
namespace
.
name
:
'namespace'
}
/
#{
@project
?
@project
.
name
:
'name'
}
"
-
run_actions_text
=
"
Run action on the GitLab
project:
#{
pretty_path_with_namespace
}
"
-
run_actions_text
=
"
Perform common operations on this
project:
#{
pretty_path_with_namespace
}
"
.well
%p
...
...
@@ -15,7 +15,7 @@
%li
1.
=
link_to
'Enable custom slash commands'
,
'https://docs.mattermost.com/developer/slash-commands.html#enabling-custom-commands'
on your Mattermost installation
.
on your Mattermost installation
%li
2.
=
link_to
'Add a slash command'
,
'https://docs.mattermost.com/developer/slash-commands.html#set-up-a-custom-command'
...
...
@@ -44,9 +44,9 @@
%p
Fill in the word that works best for your team.
%p
Suggestions:
%code
=
@project
?
@project
.
name
:
'project_name
'
%code
=
@project
?
@project
.
namespace
.
name
:
'namespace_name'
%code
=
@project
?
@project
.
name_with_namespace
:
'namespace_name/project_name'
%code
=
'gitlab
'
%code
=
@project
.
path
# Path contains no spaces, but dashes
%code
=
@project
.
path_with_namespace
.form-group
=
label_tag
:request_url
,
'Request URL'
,
class:
'col-sm-2 col-xs-12 control-label'
...
...
@@ -69,7 +69,7 @@
.form-group
=
label_tag
:response_icon
,
'Response icon'
,
class:
'col-sm-2 col-xs-12 control-label'
.col-sm-10.col-xs-12.input-group
=
text_field_tag
:response_icon
,
asset_
path
(
'gitlab_logo.png'
),
class:
'form-control input-sm'
,
readonly:
'readonly'
=
text_field_tag
:response_icon
,
asset_
url
(
'gitlab_logo.png'
),
class:
'form-control input-sm'
,
readonly:
'readonly'
.input-group-btn
=
clipboard_button
(
clipboard_target:
'#response_icon'
)
...
...
changelogs/unreleased/zj-mattermost-command-help-message.yml
0 → 100644
浏览文件 @
67fde388
---
title
:
Add help message for configuring Mattermost slash commands
merge_request
:
7558
author
:
spec/features/projects/services/mattermost_slash_command_spec.rb
0 → 100644
浏览文件 @
67fde388
require
'spec_helper'
feature
'Setup Mattermost slash commands'
,
feature:
true
do
include
WaitForAjax
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:service
)
{
project
.
create_mattermost_slash_commands_service
}
before
do
project
.
team
<<
[
user
,
:master
]
login_as
(
user
)
end
describe
'user visites the mattermost slash command config page'
,
js:
true
do
it
'shows a help message'
do
visit
edit_namespace_project_service_path
(
project
.
namespace
,
project
,
service
)
wait_for_ajax
expect
(
page
).
to
have_content
(
"This service allows GitLab users to perform common"
)
end
end
describe
'saving a token'
do
let
(
:token
)
{
(
'a'
..
'z'
).
to_a
.
join
}
it
'shows the token after saving'
do
visit
edit_namespace_project_service_path
(
project
.
namespace
,
project
,
service
)
fill_in
'service_token'
,
with:
token
click_on
'Save'
value
=
find_field
(
'service_token'
).
value
expect
(
value
).
to
eq
(
token
)
end
end
describe
'the trigger url'
do
it
'shows the correct url'
do
visit
edit_namespace_project_service_path
(
project
.
namespace
,
project
,
service
)
value
=
find_field
(
'request_url'
).
value
expect
(
value
).
to
match
(
"api/v3/projects/
#{
project
.
id
}
/services/mattermost_slash_commands/trigger"
)
end
end
end
spec/features/projects/s
lack_service
/slack_service_spec.rb
→
spec/features/projects/s
ervices
/slack_service_spec.rb
浏览文件 @
67fde388
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录