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
def index
@feature_flags = project.operations_feature_flags
.order(:name)
.page(params[:page]).per(30)
end
def new
......@@ -59,6 +61,6 @@ class Projects::FeatureFlagsController < Projects::ApplicationController
def update_params
params.require(:operations_feature_flag)
.permit(:description, :active)
.permit(:name, :description, :active)
end
end
......@@ -12,6 +12,7 @@ module Operations
with: Gitlab::Regex.feature_flag_regex,
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
......@@ -35,3 +35,5 @@
target: "#delete-feature-flag-modal-#{feature_flag.id}" },
title: _('Delete') }
= 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