Skip to content

Commit

Permalink
Merge pull request #71 from kaishuu0123/master
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
kaishuu0123 authored Jan 14, 2020
2 parents 14539de + 7c9e000 commit fcfd360
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 29 deletions.
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## How to contribute to Re:Backlogs

#### **Did you find a bug?**

* **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/kaishuu0123/rebacklogs/issues).

* If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/kaishuu0123/rebacklogs/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible.

#### **Did you write a patch that fixes a bug?**

* Open a new GitHub pull request with the patch.

* Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.

Thanks! :sparkles: :sparkles: :sparkles:
2 changes: 1 addition & 1 deletion README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ bundle exec rails db:create db:migrate

```
# 他のウインドウでコマンドを実行
bin/webpack-devserver
bin/webpack-dev-server
# メインウインドウでコマンドを実行
bin/rails s
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ bundle exec rails db:create db:migrate

```
# another window
bin/webpack-devserver
bin/webpack-dev-server
# main window
bin/rails s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ def new
end

def create
@groups = Group.all

@group = Group.new(group_params)

respond_to do |format|
if @group.save
format.html { redirect_to application_settings_group_managements_path, notice: 'Group was successfully created.' }
format.json { render :show, status: :ok, location: @group }
else
format.html { render :edit }
format.html { render :index }
format.json { render json: @group.errors, status: :unprocessable_entity }
end
end
Expand All @@ -46,11 +48,17 @@ def destroy
end

def add_user
@group.users << User.find(group_params[:user_id])
user = User.find_by(id: group_params[:user_id])
if user.present?
@group.users << user

respond_to do |format|
format.html { redirect_to application_settings_group_management_path(@group), notice: 'Group was successfully updated.' }
format.json { render :show, status: :ok, location: @group }
respond_to do |format|
format.html { redirect_to application_settings_group_management_path(@group), notice: 'Group was successfully updated.' }
format.json { render :show, status: :ok, location: @group }
end
else
@addable_users = User.where.not(id: @group.users)
render :show
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/projects_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ProjectsController < ApplicationController
PROJECT_PER_PAGE = 25

def index
@projects = @projects.search_by_keyword(params[:keywords]).page(params[:page]).per(PROJECT_PER_PAGE)
@projects = @projects.order(updated_at: :desc).search_by_keyword(params[:keywords]).page(params[:page]).per(PROJECT_PER_PAGE)
# 自分が属している自身のプロジェクトがない場合には作成を促すメッセージを表示するためのフラグ
@is_not_exits_own_project = @projects.all? { |project| project.is_public && !project.users.include?(current_user) }
end
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/sprints_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ class SprintsController < ApplicationController
]

def index
@sprints = Sprint.opening.where(project: params[:project_id])
@sprints = Sprint.opening.order(:created_at).where(project: params[:project_id])
@stories_in_backlogs = Story.where(project: params[:project_id], sprint: nil).order(:sort_order)
end

def closed_sprints
@sprints = Sprint.closed.where(project: params[:project_id])
@sprints = Sprint.closed.order(:created_at).where(project: params[:project_id])
end

def show
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,7 @@ export default {
},
mounted() {
this.projectId = this.$route.meta.projectId
this.getGroups({
projectId: this.projectId
})
this.getGroupsByName('').then(groups => { this.matchedGroups = groups })
},
computed: {
...mapState('GroupManagements', {
Expand Down Expand Up @@ -112,7 +109,6 @@ export default {
})
},
...mapActions('GroupManagements', {
getGroups: 'getGroups',
addGroup: 'addGroup',
deleteGroup: 'deleteGroup',
getGroupsByName: 'getGroupsByName'
Expand Down
2 changes: 2 additions & 0 deletions app/models/group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class Group < ApplicationRecord
has_many :group_projects, dependent: :destroy
has_many :projects, through: :group_projects

validates :name, presence: true

accepts_nested_attributes_for :group_users

def group_image_url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<%= simple_form_for @group, url: application_settings_group_managements_path do |f| %>
<% if @group.errors.any? %>
<div id="error_explanation">
<h2><%= t('errors.messages.not_saved.other', count: group.errors.count, resource: 'Group') %></h2>
<h2><%= t('errors.messages.not_saved.other', count: @group.errors.count, resource: 'Group') %></h2>

<ul>
<% @group.errors.full_messages.each do |message| %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div class="card-body">
<%= simple_form_for @group, url: application_settings_group_managements_add_user_path(@group) do |f| %>
<div class="form-group">
<select name="group[user_id]" class="selectpicker w-100" data-live-search="true" title="Select Group ...">
<select name="group[user_id]" class="selectpicker w-100" data-live-search="true" title="Select User ...">
<% @addable_users.each do |user| %>
<option
value="<%= user.id %>"
Expand Down
4 changes: 2 additions & 2 deletions app/views/commons/_sidebar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@

<!-- Nav Item -->
<li class="nav-item">
<%= link_to project_closed_sprints_path(project), class: "nav-link" do %>
<%= link_to closed_sprints_project_path(project), class: "nav-link" do %>
<i class="fas fa-border-none"></i>
<span><%= t('.closed_sprints', default: 'Closed Sprints') %></span></a>
<% end %>
</li>

<!-- Nav Item - Tables -->
<li class="nav-item">
<a class="nav-link" href="<%= project_settings_path(project) %>">
<a class="nav-link" href="<%= settings_project_path(project) %>">
<i class="fas fa-fw fa-wrench"></i>
<span><%= t('.settings', default: 'Settings') %></span></a>
</li>
Expand Down
21 changes: 11 additions & 10 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,19 @@
resources :tasks, controller: :tickets, type: Task, constraints: { format: :json } do
resources :comments
end
end

get '/projects/:id/closed_sprints', to: 'projects#closed_sprints', as: 'project_closed_sprints'
get '/projects/:id/settings', to: 'projects#settings', as: 'project_settings'
member do
get 'closed_sprints'
get 'settings'

get '/projects/:id/users', to: 'projects#users'
get '/projects/:id/groups', to: 'projects#groups'
get '/projects/:id/project_tags', to: 'projects#project_tags'
get 'users'
get 'groups'
get 'project_tags'

post '/projects/:id/add_group', to: 'projects#add_group'
delete '/projects/:id/delete_group/:group_id', to: 'projects#delete_group'
delete '/projects/:id/delete_image', to: 'projects#delete_image'
post 'add_group'
delete 'delete_group/:group_id', action: 'delete_group'
delete 'delete_image'
end
end

get '/groups_by_name', to: 'groups#search_by_name'

Expand Down

0 comments on commit fcfd360

Please sign in to comment.