diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2017-03-06 12:13:39 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2017-03-06 12:13:39 +0000 |
commit | 498351cfacfc09b5a33281838f0f366a6b2961df (patch) | |
tree | 6339b8c98c9eb0e2ac34d7c87c74e02b2631434b /app/views/projects | |
parent | 21d539855c6a174f89cf34a93ecca9eb912288bc (diff) | |
parent | 3b89ebb81c828dec546e32093aeebdeb8a7e1829 (diff) | |
download | gitlab-ce-498351cfacfc09b5a33281838f0f366a6b2961df.tar.gz |
Merge branch '26384-improve-omnibus-mattermost-command-installation-flow' into 'master'
Resolve "Improve Omnibus-Mattermost Command installation flow"
See merge request !9257
Diffstat (limited to 'app/views/projects')
-rw-r--r-- | app/views/projects/mattermosts/_team_selection.html.haml | 13 | ||||
-rw-r--r-- | app/views/projects/mattermosts/new.html.haml | 2 |
2 files changed, 8 insertions, 7 deletions
diff --git a/app/views/projects/mattermosts/_team_selection.html.haml b/app/views/projects/mattermosts/_team_selection.html.haml index a80f9aa4c4a..04bd4e8b683 100644 --- a/app/views/projects/mattermosts/_team_selection.html.haml +++ b/app/views/projects/mattermosts/_team_selection.html.haml @@ -2,16 +2,15 @@ This service will be installed on the Mattermost instance at %strong= link_to Gitlab.config.mattermost.host, Gitlab.config.mattermost.host %hr -= form_for(:mattermost, method: :post, url: namespace_project_mattermost_path(@project.namespace, @project)) do |f| += form_for(:mattermost, method: :post, url: namespace_project_mattermost_path(@project.namespace, @project), html: { class: 'js-requires-input'} ) do |f| %h4 Team %p = @teams.one? ? 'The team' : 'Select the team' where the slash commands will be used in - - selected_id = @teams.one? ? @teams.keys.first : 0 - - options = mattermost_teams_options(@teams) - - options = options_for_select(options, selected_id) - = f.select(:team_id, options, {}, { class: 'form-control', disabled: @teams.one?, selected: selected_id }) - = f.hidden_field(:team_id, value: selected_id) if @teams.one? + - selected_id = @teams.one? ? @teams.first['id'] : nil + - options = options_for_select(mattermost_teams_options(@teams), selected_id) + = f.select(:team_id, options, { include_blank: 'Select team...'}, { class: 'form-control', disabled: @teams.one?, selected: selected_id, required: true }) + = f.hidden_field(:team_id, value: selected_id, required: true) if @teams.one? .help-block - if @teams.one? This is the only available team. @@ -25,7 +24,7 @@ %hr %h4 Command trigger word %p Choose the word that will trigger commands - = f.text_field(:trigger, value: @project.path, class: 'form-control') + = f.text_field(:trigger, value: @project.path, class: 'form-control', required: true) .help-block %p Trigger word must be unique, and can't begin with a slash or contain any spaces. diff --git a/app/views/projects/mattermosts/new.html.haml b/app/views/projects/mattermosts/new.html.haml index 96b1d2aee61..15829a3f143 100644 --- a/app/views/projects/mattermosts/new.html.haml +++ b/app/views/projects/mattermosts/new.html.haml @@ -1,3 +1,5 @@ +- @body_class = 'card-content' + .service-installation .inline.pull-right = custom_icon('mattermost_logo', size: 48) |