Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
b71b0acd
Commit
b71b0acd
authored
Jan 19, 2017
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'zj-fix-admin-templates' into 'master'
Fix Slash command templates Closes #26042 See merge request !8320
parents
d3f26be6
df99883d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
101 additions
and
73 deletions
+101
-73
app/views/projects/services/mattermost_slash_commands/_help.html.haml
...ojects/services/mattermost_slash_commands/_help.html.haml
+2
-2
app/views/projects/services/slack_slash_commands/_help.html.haml
...ws/projects/services/slack_slash_commands/_help.html.haml
+73
-71
spec/controllers/admin/services_controller_spec.rb
spec/controllers/admin/services_controller_spec.rb
+26
-0
No files found.
app/views/projects/services/mattermost_slash_commands/_help.html.haml
View file @
b71b0acd
...
@@ -8,8 +8,8 @@
...
@@ -8,8 +8,8 @@
by entering
by entering
%code
/
<
command_trigger_word
>
help
%code
/
<
command_trigger_word
>
help
-
unless
enabled
-
unless
enabled
||
@service
.
template?
=
render
'projects/services/mattermost_slash_commands/detailed_help'
,
subject:
@service
=
render
'projects/services/mattermost_slash_commands/detailed_help'
,
subject:
@service
-
if
enabled
-
if
enabled
&&
!
@service
.
template?
=
render
'projects/services/mattermost_slash_commands/installation_info'
,
subject:
@service
=
render
'projects/services/mattermost_slash_commands/installation_info'
,
subject:
@service
app/views/projects/services/slack_slash_commands/_help.html.haml
View file @
b71b0acd
-
run_actions_text
=
"Perform common operations on this project:
#{
@project
.
name_with_namespace
}
"
-
pretty_name
=
defined?
(
@project
)
?
@project
.
name_with_namespace
:
"namespace / path"
-
run_actions_text
=
"Perform common operations on this project:
#{
pretty_name
}
"
.well
.well
This service allows GitLab users to perform common operations on this
This service allows GitLab users to perform common operations on this
...
@@ -9,85 +10,86 @@
...
@@ -9,85 +10,86 @@
%code
/
<
command
>
help
%code
/
<
command
>
help
%br
%br
%br
%br
To setup this service:
-
unless
@service
.
template?
%ul
.list-unstyled
To setup this service:
%li
%ul
.list-unstyled
1.
%li
=
link_to
'Add a slash command'
,
'https://my.slack.com/services/new/slash-commands'
1.
in your Slack team with these options:
=
link_to
'Add a slash command'
,
'https://my.slack.com/services/new/slash-commands'
in your Slack team with these options:
%hr
%hr
.help-form
.help-form
.form-group
.form-group
=
label_tag
nil
,
'Command'
,
class:
'col-sm-2 col-xs-12 control-label'
=
label_tag
nil
,
'Command'
,
class:
'col-sm-2 col-xs-12 control-label'
.col-sm-10.col-xs-12.text-block
.col-sm-10.col-xs-12.text-block
%p
Fill in the word that works best for your team.
%p
Fill in the word that works best for your team.
%p
%p
Suggestions:
Suggestions:
%code
=
'gitlab'
%code
=
'gitlab'
%code
=
@project
.
path
# Path contains no spaces, but dashes
%code
=
@project
.
path
# Path contains no spaces, but dashes
%code
=
@project
.
path_with_namespace
%code
=
@project
.
path_with_namespace
.form-group
.form-group
=
label_tag
:url
,
'URL'
,
class:
'col-sm-2 col-xs-12 control-label'
=
label_tag
:url
,
'URL'
,
class:
'col-sm-2 col-xs-12 control-label'
.col-sm-10.col-xs-12.input-group
.col-sm-10.col-xs-12.input-group
=
text_field_tag
:url
,
service_trigger_url
(
subject
),
class:
'form-control input-sm'
,
readonly:
'readonly'
=
text_field_tag
:url
,
service_trigger_url
(
subject
),
class:
'form-control input-sm'
,
readonly:
'readonly'
.input-group-btn
.input-group-btn
=
clipboard_button
(
clipboard_target:
'#url'
)
=
clipboard_button
(
clipboard_target:
'#url'
)
.form-group
.form-group
=
label_tag
nil
,
'Method'
,
class:
'col-sm-2 col-xs-12 control-label'
=
label_tag
nil
,
'Method'
,
class:
'col-sm-2 col-xs-12 control-label'
.col-sm-10.col-xs-12.text-block
POST
.col-sm-10.col-xs-12.text-block
POST
.form-group
.form-group
=
label_tag
:customize_name
,
'Customize name'
,
class:
'col-sm-2 col-xs-12 control-label'
=
label_tag
:customize_name
,
'Customize name'
,
class:
'col-sm-2 col-xs-12 control-label'
.col-sm-10.col-xs-12.input-group
.col-sm-10.col-xs-12.input-group
=
text_field_tag
:customize_name
,
'GitLab'
,
class:
'form-control input-sm'
,
readonly:
'readonly'
=
text_field_tag
:customize_name
,
'GitLab'
,
class:
'form-control input-sm'
,
readonly:
'readonly'
.input-group-btn
.input-group-btn
=
clipboard_button
(
clipboard_target:
'#customize_name'
)
=
clipboard_button
(
clipboard_target:
'#customize_name'
)
.form-group
.form-group
=
label_tag
nil
,
'Customize icon'
,
class:
'col-sm-2 col-xs-12 control-label'
=
label_tag
nil
,
'Customize icon'
,
class:
'col-sm-2 col-xs-12 control-label'
.col-sm-10.col-xs-12.text-block
.col-sm-10.col-xs-12.text-block
=
image_tag
(
asset_url
(
'slash-command-logo.png'
),
width:
36
,
height:
36
)
=
image_tag
(
asset_url
(
'slash-command-logo.png'
),
width:
36
,
height:
36
)
=
link_to
(
'Download image'
,
asset_url
(
'gitlab_logo.png'
),
class:
'btn btn-sm'
,
target:
'_blank'
)
=
link_to
(
'Download image'
,
asset_url
(
'gitlab_logo.png'
),
class:
'btn btn-sm'
,
target:
'_blank'
)
.form-group
.form-group
=
label_tag
nil
,
'Autocomplete'
,
class:
'col-sm-2 col-xs-12 control-label'
=
label_tag
nil
,
'Autocomplete'
,
class:
'col-sm-2 col-xs-12 control-label'
.col-sm-10.col-xs-12.text-block
Show this command in the autocomplete list
.col-sm-10.col-xs-12.text-block
Show this command in the autocomplete list
.form-group
.form-group
=
label_tag
:autocomplete_description
,
'Autocomplete description'
,
class:
'col-sm-2 col-xs-12 control-label'
=
label_tag
:autocomplete_description
,
'Autocomplete description'
,
class:
'col-sm-2 col-xs-12 control-label'
.col-sm-10.col-xs-12.input-group
.col-sm-10.col-xs-12.input-group
=
text_field_tag
:autocomplete_description
,
run_actions_text
,
class:
'form-control input-sm'
,
readonly:
'readonly'
=
text_field_tag
:autocomplete_description
,
run_actions_text
,
class:
'form-control input-sm'
,
readonly:
'readonly'
.input-group-btn
.input-group-btn
=
clipboard_button
(
clipboard_target:
'#autocomplete_description'
)
=
clipboard_button
(
clipboard_target:
'#autocomplete_description'
)
.form-group
.form-group
=
label_tag
:autocomplete_usage_hint
,
'Autocomplete usage hint'
,
class:
'col-sm-2 col-xs-12 control-label'
=
label_tag
:autocomplete_usage_hint
,
'Autocomplete usage hint'
,
class:
'col-sm-2 col-xs-12 control-label'
.col-sm-10.col-xs-12.input-group
.col-sm-10.col-xs-12.input-group
=
text_field_tag
:autocomplete_usage_hint
,
'[help]'
,
class:
'form-control input-sm'
,
readonly:
'readonly'
=
text_field_tag
:autocomplete_usage_hint
,
'[help]'
,
class:
'form-control input-sm'
,
readonly:
'readonly'
.input-group-btn
.input-group-btn
=
clipboard_button
(
clipboard_target:
'#autocomplete_usage_hint'
)
=
clipboard_button
(
clipboard_target:
'#autocomplete_usage_hint'
)
.form-group
.form-group
=
label_tag
:descriptive_label
,
'Descriptive label'
,
class:
'col-sm-2 col-xs-12 control-label'
=
label_tag
:descriptive_label
,
'Descriptive label'
,
class:
'col-sm-2 col-xs-12 control-label'
.col-sm-10.col-xs-12.input-group
.col-sm-10.col-xs-12.input-group
=
text_field_tag
:descriptive_label
,
'Perform common operations on GitLab project'
,
class:
'form-control input-sm'
,
readonly:
'readonly'
=
text_field_tag
:descriptive_label
,
'Perform common operations on GitLab project'
,
class:
'form-control input-sm'
,
readonly:
'readonly'
.input-group-btn
.input-group-btn
=
clipboard_button
(
clipboard_target:
'#descriptive_label'
)
=
clipboard_button
(
clipboard_target:
'#descriptive_label'
)
%hr
%hr
%ul
.list-unstyled
%ul
.list-unstyled
%li
%li
2. Paste the
2. Paste the
%strong
Token
%strong
Token
into the field below
into the field below
%li
%li
3. Select the
3. Select the
%strong
Active
%strong
Active
checkbox, press
checkbox, press
%strong
Save changes
%strong
Save changes
and start using GitLab inside Slack!
and start using GitLab inside Slack!
spec/controllers/admin/services_controller_spec.rb
0 → 100644
View file @
b71b0acd
require
'spec_helper'
describe
Admin
::
ServicesController
do
let
(
:admin
)
{
create
(
:admin
)
}
before
{
sign_in
(
admin
)
}
describe
'GET #edit'
do
let!
(
:project
)
{
create
(
:empty_project
)
}
Service
.
available_services_names
.
each
do
|
service_name
|
context
"
#{
service_name
}
"
do
let!
(
:service
)
do
service_template
=
service_name
.
concat
(
"_service"
).
camelize
.
constantize
service_template
.
where
(
template:
true
).
first_or_create
end
it
'successfully displays the template'
do
get
:edit
,
id:
service
.
id
expect
(
response
).
to
have_http_status
(
200
)
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment