Commit 0b2cd167 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents 794a529e 437e9e4f
...@@ -219,7 +219,7 @@ ...@@ -219,7 +219,7 @@
color: $gl-text-color-secondary; color: $gl-text-color-secondary;
} }
.project-tag-list { .project-topic-list {
font-size: $gl-font-size; font-size: $gl-font-size;
font-weight: $gl-font-weight-normal; font-weight: $gl-font-weight-normal;
...@@ -251,7 +251,7 @@ ...@@ -251,7 +251,7 @@
line-height: $gl-font-size-large; line-height: $gl-font-size-large;
} }
.project-tag-list, .project-topic-list,
.project-metadata { .project-metadata {
font-size: $gl-font-size-small; font-size: $gl-font-size-small;
} }
...@@ -273,7 +273,7 @@ ...@@ -273,7 +273,7 @@
} }
.access-request-link, .access-request-link,
.project-tag-list { .project-topic-list {
padding-left: $gl-padding-8; padding-left: $gl-padding-8;
border-left: 1px solid $gl-text-color-secondary; border-left: 1px solid $gl-text-color-secondary;
} }
......
...@@ -13,7 +13,7 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated ...@@ -13,7 +13,7 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
presents :project presents :project
AnchorData = Struct.new(:is_link, :label, :link, :class_modifier, :icon) AnchorData = Struct.new(:is_link, :label, :link, :class_modifier, :icon)
MAX_TAGS_TO_SHOW = 3 MAX_TOPICS_TO_SHOW = 3
def statistic_icon(icon_name = 'plus-square-o') def statistic_icon(icon_name = 'plus-square-o')
sprite_icon(icon_name, size: 16, css_class: 'icon append-right-4') sprite_icon(icon_name, size: 16, css_class: 'icon append-right-4')
...@@ -310,20 +310,20 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated ...@@ -310,20 +310,20 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
end end
end end
def tags_to_show def topics_to_show
project.tag_list.take(MAX_TAGS_TO_SHOW) # rubocop: disable CodeReuse/ActiveRecord project.tag_list.take(MAX_TOPICS_TO_SHOW) # rubocop: disable CodeReuse/ActiveRecord
end end
def count_of_extra_tags_not_shown def count_of_extra_topics_not_shown
if project.tag_list.count > MAX_TAGS_TO_SHOW if project.tag_list.count > MAX_TOPICS_TO_SHOW
project.tag_list.count - MAX_TAGS_TO_SHOW project.tag_list.count - MAX_TOPICS_TO_SHOW
else else
0 0
end end
end end
def has_extra_tags? def has_extra_topics?
count_of_extra_tags_not_shown > 0 count_of_extra_topics_not_shown > 0
end end
private private
......
...@@ -19,12 +19,13 @@ ...@@ -19,12 +19,13 @@
%span.access-request-links.prepend-left-8 %span.access-request-links.prepend-left-8
= render 'shared/members/access_request_links', source: @project = render 'shared/members/access_request_links', source: @project
- if @project.tag_list.present? - if @project.tag_list.present?
%span.project-tag-list.d-inline-flex.prepend-left-8.has-tooltip{ data: { container: 'body' }, title: @project.has_extra_tags? ? @project.tag_list.join(', ') : nil } %span.project-topic-list.d-inline-flex.prepend-left-8.has-tooltip{ data: { container: 'body' }, title: @project.has_extra_topics? ? @project.tag_list.join(', ') : nil }
= sprite_icon('tag', size: 16, css_class: 'icon append-right-4') = sprite_icon('tag', size: 16, css_class: 'icon append-right-4')
= @project.tags_to_show = @project.topics_to_show
- if @project.has_extra_tags? - if @project.has_extra_topics?
= _("+ %{count} more") % { count: @project.count_of_extra_tags_not_shown } = _("+ %{count} more") % { count: @project.count_of_extra_tags_not_shown }
.project-repo-buttons.col-md-12.col-lg-6.d-inline-flex.flex-wrap.justify-content-lg-end .project-repo-buttons.col-md-12.col-lg-6.d-inline-flex.flex-wrap.justify-content-lg-end
- if current_user - if current_user
.d-inline-flex .d-inline-flex
......
...@@ -39,9 +39,9 @@ ...@@ -39,9 +39,9 @@
= render_if_exists 'shared/repository_size_limit_setting', form: f, type: :project = render_if_exists 'shared/repository_size_limit_setting', form: f, type: :project
.form-group .form-group
= f.label :tag_list, "Tags", class: 'label-bold' = f.label :tag_list, "Topics", class: 'label-bold'
= f.text_field :tag_list, value: @project.tag_list.join(', '), maxlength: 2000, class: "form-control" = f.text_field :tag_list, value: @project.tag_list.join(', '), maxlength: 2000, class: "form-control"
%p.form-text.text-muted Separate tags with commas. %p.form-text.text-muted Separate topics with commas.
%fieldset.features %fieldset.features
%h5.prepend-top-0= _("Project avatar") %h5.prepend-top-0= _("Project avatar")
.form-group .form-group
......
---
title: Rename project tags to project topics
merge_request: 24219
author:
type: other
...@@ -14,7 +14,7 @@ functionality of a project. ...@@ -14,7 +14,7 @@ functionality of a project.
### General project settings ### General project settings
Adjust your project's name, description, avatar, [default branch](../repository/branches/index.md#default-branch), and tags: Adjust your project's name, description, avatar, [default branch](../repository/branches/index.md#default-branch), and topics:
![general project settings](img/general_settings.png) ![general project settings](img/general_settings.png)
......
...@@ -9,13 +9,13 @@ describe 'Projects > Settings > User tags a project' do ...@@ -9,13 +9,13 @@ describe 'Projects > Settings > User tags a project' do
visit edit_project_path(project) visit edit_project_path(project)
end end
it 'sets project tags' do it 'sets project topics' do
fill_in 'Tags', with: 'tag1, tag2' fill_in 'Topics', with: 'topic1, topic2'
page.within '.general-settings' do page.within '.general-settings' do
click_button 'Save changes' click_button 'Save changes'
end end
expect(find_field('Tags').value).to eq 'tag1, tag2' expect(find_field('Topics').value).to eq 'topic1, topic2'
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment