Commit b4efe44d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Allow change weight from issue page and show it on milestone page

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 5fde067a
...@@ -81,7 +81,10 @@ ...@@ -81,7 +81,10 @@
= link_to 'Browse Issues', namespace_project_issues_path(@milestone.project.namespace, @milestone.project, milestone_title: @milestone.title), class: "btn btn-grouped" = link_to 'Browse Issues', namespace_project_issues_path(@milestone.project.namespace, @milestone.project, milestone_title: @milestone.title), class: "btn btn-grouped"
.oneline .oneline
All issues in this milestone All issues in this milestone.
- total_weight = @issues.sum(:weight)
- unless total_weight.zero?
Total weight of issues #{total_weight}
.row.prepend-top-default .row.prepend-top-default
.col-md-4 .col-md-4
......
...@@ -60,7 +60,8 @@ ...@@ -60,7 +60,8 @@
= icon('magnet') = icon('magnet')
Weight Weight
.col-sm-10 .col-sm-10
= f.number_field :weight, in: Issue::WEIGHT_RANGE, class: 'form-control' = f.select :weight, projects_weight_options, { include_blank: true },
{ class: 'select2 js-select2', data: { placeholder: "Select weight" }}
.form-group .form-group
= f.label :label_ids, "Labels", class: 'control-label' = f.label :label_ids, "Labels", class: 'control-label'
......
...@@ -54,13 +54,22 @@ ...@@ -54,13 +54,22 @@
= f.collection_select :label_ids, issuable.project.labels.all, :id, :name, = f.collection_select :label_ids, issuable.project.labels.all, :id, :name,
{ selected: issuable.label_ids }, multiple: true, class: 'select2 js-select2', data: { placeholder: "Select labels" } { selected: issuable.label_ids }, multiple: true, class: 'select2 js-select2', data: { placeholder: "Select labels" }
- if issuable.respond_to?(:weight) && issuable.weight - if issuable.respond_to?(:weight)
.block .block.weight
.title .title
%label Weight %label Weight
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
.pull-right
= link_to 'Edit', '#', class: 'edit-link'
.value .value
= icon('magnet') - if issuable.weight
= issuable.weight = icon('magnet')
= issuable.weight
- else
.light None
.selectbox
= f.select :weight, projects_weight_options, { include_blank: true },
{ class: 'select2 js-select2', data: { placeholder: "Select weight" }}
.block .block
.title .title
......
...@@ -25,14 +25,14 @@ ActiveRecord::Schema.define(version: 20151210125932) do ...@@ -25,14 +25,14 @@ ActiveRecord::Schema.define(version: 20151210125932) do
end end
create_table "appearances", force: :cascade do |t| create_table "appearances", force: :cascade do |t|
t.string "title", limit: 255 t.string "title"
t.text "description" t.text "description"
t.string "logo", limit: 255 t.string "logo"
t.integer "updated_by" t.integer "updated_by"
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
t.string "dark_logo", limit: 255 t.string "dark_logo"
t.string "light_logo", limit: 255 t.string "light_logo"
end end
create_table "application_settings", force: :cascade do |t| create_table "application_settings", force: :cascade do |t|
...@@ -72,9 +72,9 @@ ActiveRecord::Schema.define(version: 20151210125932) do ...@@ -72,9 +72,9 @@ ActiveRecord::Schema.define(version: 20151210125932) do
end end
create_table "approvers", force: :cascade do |t| create_table "approvers", force: :cascade do |t|
t.integer "target_id", null: false t.integer "target_id", null: false
t.string "target_type", limit: 255 t.string "target_type"
t.integer "user_id", null: false t.integer "user_id", null: false
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
end end
...@@ -388,18 +388,18 @@ ActiveRecord::Schema.define(version: 20151210125932) do ...@@ -388,18 +388,18 @@ ActiveRecord::Schema.define(version: 20151210125932) do
add_index "forked_project_links", ["forked_to_project_id"], name: "index_forked_project_links_on_forked_to_project_id", unique: true, using: :btree add_index "forked_project_links", ["forked_to_project_id"], name: "index_forked_project_links_on_forked_to_project_id", unique: true, using: :btree
create_table "git_hooks", force: :cascade do |t| create_table "git_hooks", force: :cascade do |t|
t.string "force_push_regex", limit: 255 t.string "force_push_regex"
t.string "delete_branch_regex", limit: 255 t.string "delete_branch_regex"
t.string "commit_message_regex", limit: 255 t.string "commit_message_regex"
t.boolean "deny_delete_tag" t.boolean "deny_delete_tag"
t.integer "project_id" t.integer "project_id"
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
t.string "author_email_regex", limit: 255 t.string "author_email_regex"
t.boolean "member_check", default: false, null: false t.boolean "member_check", default: false, null: false
t.string "file_name_regex", limit: 255 t.string "file_name_regex"
t.boolean "is_sample", default: false t.boolean "is_sample", default: false
t.integer "max_file_size", default: 0 t.integer "max_file_size", default: 0
end end
create_table "historical_data", force: :cascade do |t| create_table "historical_data", force: :cascade do |t|
...@@ -484,12 +484,12 @@ ActiveRecord::Schema.define(version: 20151210125932) do ...@@ -484,12 +484,12 @@ ActiveRecord::Schema.define(version: 20151210125932) do
add_index "labels", ["project_id"], name: "index_labels_on_project_id", using: :btree add_index "labels", ["project_id"], name: "index_labels_on_project_id", using: :btree
create_table "ldap_group_links", force: :cascade do |t| create_table "ldap_group_links", force: :cascade do |t|
t.string "cn", limit: 255, null: false t.string "cn", null: false
t.integer "group_access", null: false t.integer "group_access", null: false
t.integer "group_id", null: false t.integer "group_id", null: false
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
t.string "provider", limit: 255 t.string "provider"
end end
create_table "lfs_objects", force: :cascade do |t| create_table "lfs_objects", force: :cascade do |t|
...@@ -745,12 +745,12 @@ ActiveRecord::Schema.define(version: 20151210125932) do ...@@ -745,12 +745,12 @@ ActiveRecord::Schema.define(version: 20151210125932) do
t.integer "mirror_user_id" t.integer "mirror_user_id"
t.text "import_error" t.text "import_error"
t.integer "ci_id" t.integer "ci_id"
t.boolean "builds_enabled", default: true, null: false t.boolean "builds_enabled", default: true, null: false
t.boolean "shared_runners_enabled", default: true, null: false t.boolean "shared_runners_enabled", default: true, null: false
t.string "runners_token" t.string "runners_token"
t.string "build_coverage_regex" t.string "build_coverage_regex"
t.boolean "build_allow_git_fetch", default: true, null: false t.boolean "build_allow_git_fetch", default: true, null: false
t.integer "build_timeout", default: 3600, null: false t.integer "build_timeout", default: 3600, null: false
end end
add_index "projects", ["builds_enabled", "shared_runners_enabled"], name: "index_projects_on_builds_enabled_and_shared_runners_enabled", using: :btree add_index "projects", ["builds_enabled", "shared_runners_enabled"], name: "index_projects_on_builds_enabled_and_shared_runners_enabled", using: :btree
......
...@@ -9,8 +9,8 @@ class Spinach::Features::ProjectIssuesWeight < Spinach::FeatureSteps ...@@ -9,8 +9,8 @@ class Spinach::Features::ProjectIssuesWeight < Spinach::FeatureSteps
step 'I submit new issue "500 error on profile" with weight' do step 'I submit new issue "500 error on profile" with weight' do
fill_in "issue_title", with: "500 error on profile" fill_in "issue_title", with: "500 error on profile"
fill_in "issue_weight", with: 7 select "7", from: "issue_weight"
click_button "Submit new issue" click_button "Submit issue"
end end
step 'I should see issue "500 error on profile" with weight' do step 'I should see issue "500 error on profile" with weight' do
......
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