Commit d77cf4f0 authored by Kamil Trzciński's avatar Kamil Trzciński

Fix after FE review

- Make name unique
- Make description to be as much as 255 characters longs
- Make the list paginated and ordered
parent b7732d93
...@@ -9,6 +9,8 @@ class Projects::FeatureFlagsController < Projects::ApplicationController ...@@ -9,6 +9,8 @@ class Projects::FeatureFlagsController < Projects::ApplicationController
def index def index
@feature_flags = project.operations_feature_flags @feature_flags = project.operations_feature_flags
.order(:name)
.page(params[:page]).per(30)
end end
def new def new
...@@ -59,6 +61,6 @@ class Projects::FeatureFlagsController < Projects::ApplicationController ...@@ -59,6 +61,6 @@ class Projects::FeatureFlagsController < Projects::ApplicationController
def update_params def update_params
params.require(:operations_feature_flag) params.require(:operations_feature_flag)
.permit(:description, :active) .permit(:name, :description, :active)
end end
end end
...@@ -12,6 +12,7 @@ module Operations ...@@ -12,6 +12,7 @@ module Operations
with: Gitlab::Regex.feature_flag_regex, with: Gitlab::Regex.feature_flag_regex,
message: Gitlab::Regex.feature_flag_regex_message message: Gitlab::Regex.feature_flag_regex_message
} }
validates :description, length: 0..1000 validates :name, uniqueness: { scope: :project_id }
validates :description, length: 0..255
end end
end end
...@@ -35,3 +35,5 @@ ...@@ -35,3 +35,5 @@
target: "#delete-feature-flag-modal-#{feature_flag.id}" }, target: "#delete-feature-flag-modal-#{feature_flag.id}" },
title: _('Delete') } title: _('Delete') }
= sprite_icon('remove', size: 16) = sprite_icon('remove', size: 16)
= paginate @feature_flags, theme: "gitlab"
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