Commit 715221d6 authored by Dennis Tang's avatar Dennis Tang Committed by Nick Thomas

Preserve order of project tags list

parent 03e09206
...@@ -111,7 +111,7 @@ class Project < ActiveRecord::Base ...@@ -111,7 +111,7 @@ class Project < ActiveRecord::Base
after_create :ensure_storage_path_exists after_create :ensure_storage_path_exists
after_save :ensure_storage_path_exists, if: :namespace_id_changed? after_save :ensure_storage_path_exists, if: :namespace_id_changed?
acts_as_taggable acts_as_ordered_taggable
attr_accessor :old_path_with_namespace attr_accessor :old_path_with_namespace
attr_accessor :template_name attr_accessor :template_name
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
.form-group .form-group
= f.label :tag_list, "Tags", class: 'label-bold' = f.label :tag_list, "Tags", class: 'label-bold'
= f.text_field :tag_list, value: @project.tag_list.sort.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 tags with commas.
%fieldset.features %fieldset.features
%h5.prepend-top-0= _("Project avatar") %h5.prepend-top-0= _("Project avatar")
......
---
title: Preserve order of project tags list
merge_request: 21897
author:
type: changed
...@@ -9,8 +9,7 @@ describe 'Projects > Settings > User tags a project' do ...@@ -9,8 +9,7 @@ describe 'Projects > Settings > User tags a project' do
visit edit_project_path(project) visit edit_project_path(project)
end end
context 'when a project is archived' do it 'sets project tags' do
it 'unarchives a project' do
fill_in 'Tags', with: 'tag1, tag2' fill_in 'Tags', with: 'tag1, tag2'
page.within '.general-settings' do page.within '.general-settings' do
...@@ -19,5 +18,4 @@ describe 'Projects > Settings > User tags a project' do ...@@ -19,5 +18,4 @@ describe 'Projects > Settings > User tags a project' do
expect(find_field('Tags').value).to eq 'tag1, tag2' expect(find_field('Tags').value).to eq 'tag1, tag2'
end 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