Skip to content

Commit

Permalink
Merge pull request #47 from kaishuu0123/master
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
kaishuu0123 authored Dec 12, 2019
2 parents aefc645 + 4aee55c commit 6611c53
Show file tree
Hide file tree
Showing 13 changed files with 186 additions and 53 deletions.
7 changes: 5 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ruby '2.5.3'
gem 'rails', '~> 6.0.0'
# Use Puma as the app server
# Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server for Ruby/Rack applications (http://puma.io)
gem 'puma', '~> 3.11'
gem 'puma', '~> 3.12'
# Use SCSS for stylesheets
# Sass adapter for the Rails asset pipeline. (https://github.com/rails/sass-rails)
gem 'sass-rails', '~> 5'
Expand Down Expand Up @@ -62,6 +62,9 @@ group :development do
gem 'annotate_gem', require: false
# Annotates Rails Models, routes, fixtures, and others based on the database schema. (https://github.com/ctran/annotate_models)
gem 'annotate', require: false

# Preview email in the default browser instead of sending it.
gem 'letter_opener_web'
end

group :production do
Expand Down Expand Up @@ -116,4 +119,4 @@ gem 'omniauth-twitter', '~> 1.4'
gem 'omniauth-github', '~> 1.3'
gem 'omniauth-google-oauth2', '~> 0.8'

gem 'config'
gem 'config'
13 changes: 11 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ GEM
activesupport (>= 4.2.0)
jwt (2.2.1)
kramdown (1.17.0)
launchy (2.4.3)
addressable (~> 2.3)
letter_opener (1.7.0)
launchy (~> 2.2)
letter_opener_web (1.3.4)
actionmailer (>= 3.2)
letter_opener (~> 1.0)
railties (>= 3.2)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
Expand Down Expand Up @@ -208,7 +216,7 @@ GEM
coderay (~> 1.1.0)
method_source (~> 0.9.0)
public_suffix (4.0.1)
puma (3.12.1)
puma (3.12.2)
rack (2.0.7)
rack-proxy (0.6.5)
rack
Expand Down Expand Up @@ -360,6 +368,7 @@ DEPENDENCIES
identicon
initial_avatar
jbuilder (~> 2.7)
letter_opener_web
listen (>= 3.0.5, < 3.2)
omniauth (~> 1.9)
omniauth-github (~> 1.3)
Expand All @@ -368,7 +377,7 @@ DEPENDENCIES
paper_trail (~> 10.3.0)
pg (~> 1.1)
pry
puma (~> 3.11)
puma (~> 3.12)
rails (~> 6.0.0)
rails-i18n (~> 6.0.0)
rails-settings-cached (~> 2.0)
Expand Down
1 change: 1 addition & 0 deletions app/controllers/tickets_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def create

respond_to do |format|
if @ticket.save
@ticket.update row_order_position: :first
format.json { render :show, status: :ok, location: [@ticket.project, @ticket] }
else
format.json { render json: @ticket.errors, status: :unprocessable_entity }
Expand Down
19 changes: 17 additions & 2 deletions app/javascript/components/backlogs/BacklogsCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
:emptyInsertThreshold="40"
:data-sprint-id="null"
@end="dragEnd">
<StoryListItem :story="story" v-for="story in stories" :key="story.id" :data-story-id="story.id" />
<StoryListItem :story="story" v-for="story in searchStoryByKeyword(stories)" :key="story.id" :data-story-id="story.id" />
<li v-if="stories.length == 0" class="list-group-item rb-alert-primary px-3 py-2">
<div class="d-flex align-items-center">
<i class="fas fa-info-circle mr-1"></i> {{ $t('message.storyDoesNotExists') }}
Expand All @@ -39,7 +39,8 @@ export default {
name: 'BacklogsCard',
props: {
projectId: String,
stories: Array
stories: Array,
searchKeyword: String,
},
components: {
StoryListItem,
Expand Down Expand Up @@ -83,6 +84,20 @@ export default {
storyId, storyId
})
},
searchStoryByKeyword(stories) {
return stories.filter(story => {
return this.searchKeyword.toLowerCase()
.split(/\s+/)
.map(query => {
return (
story.ticket_number_with_ticket_prefix.toLowerCase().indexOf(query) > -1
|| story.title.toLowerCase().indexOf(query) > -1
|| story.tags.some(tag => tag.name.toLowerCase().indexOf(query) > -1)
)
})
.every(result => result === true)
});
},
...mapActions([
'createSprint',
'updateStoryByDrag'
Expand Down
19 changes: 17 additions & 2 deletions app/javascript/components/backlogs/SprintCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
:emptyInsertThreshold="40"
:data-sprint-id="sprint.id"
@end="dragEnd">
<StoryListItem v-for="story in sprint.stories" :key="story.id" :story="story" :data-story-id="story.id" />
<StoryListItem v-for="story in searchStoryByKeyword(sprint.stories)" :key="story.id" :story="story" :data-story-id="story.id" />
<li v-if="sprint.stories.length == 0" class="list-group-item rb-alert-primary px-3 py-2">
<div class="d-flex align-items-center">
<i class="fas fa-info-circle mr-1"></i> {{ $t('message.storyDoesNotExistsInSprint') }}
Expand Down Expand Up @@ -109,7 +109,8 @@ export default {
},
props: {
sprint: Object,
projectId: String
projectId: String,
searchKeyword: String,
},
mounted () {
this.dirtySprint = this.sprint
Expand Down Expand Up @@ -205,6 +206,20 @@ export default {
storyId: storyId
})
},
searchStoryByKeyword(stories) {
return stories.filter(story => {
return this.searchKeyword.toLowerCase()
.split(/\s+/)
.map(query => {
return (
story.ticket_number_with_ticket_prefix.toLowerCase().indexOf(query) > -1
|| story.title.toLowerCase().indexOf(query) > -1
|| (story.tags && story.tags.some(tag => tag.name.toLowerCase().indexOf(query) > -1))
)
})
.every(result => result === true)
});
},
...mapActions({
updateSprint: 'updateSprint',
updateStoryByDrag: 'updateStoryByDrag',
Expand Down
6 changes: 4 additions & 2 deletions app/javascript/i18n/globals.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"horizontal": "Horizontal",
"task": "Task",
"tag": "Tags",
"unassigned": "Unassigned"
"unassigned": "Unassigned",
"search": "Search by keyword"
},
"ticket": {
"title": "Title",
Expand Down Expand Up @@ -138,7 +139,8 @@
"horizontal": "水平",
"task": "タスク",
"tag": "タグ",
"unassigned": "未アサイン"
"unassigned": "未アサイン",
"search": "キーワード検索"
},
"ticket": {
"title": "タイトル",
Expand Down
40 changes: 26 additions & 14 deletions app/javascript/pages/BacklogsPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,38 @@
<div class="d-flex w-100 align-items-center justify-content-between mb-2">
<h1 class="h4 mb-0 text-gray-700">{{ $t('title.masterBacklogs')}}</h1>
<div class="d-flex align-items-center">
<span class="h6 mb-0 mr-2">{{ $t('title.layout') }}: </span>
<b-form-radio-group
id="layout-radios"
v-model="layout"
:options="layoutOptions"
buttons
button-variant="outline-secondary"
size="sm"
name="radio-btn-outline"
></b-form-radio-group>
<div class="d-flex align-items-center mr-2">
<b-form-input
id="searchInput"
v-model="searchKeyword"
type="text"
size="sm"
:placeholder="$t('title.search')"
></b-form-input>
</div>
<div class="d-flex align-items-center">
<span class="h6 mb-0 mr-2">{{ $t('title.layout') }}: </span>
<b-form-radio-group
id="layout-radios"
v-model="layout"
:options="layoutOptions"
buttons
button-variant="outline-secondary"
size="sm"
name="radio-btn-outline"
></b-form-radio-group>
</div>
</div>
</div>
</div>

<div class="row" v-if="layout === 'HORIZONTAL'">
<div class="row flex-row flex-sm-nowrap w-100 rb-overflow-x" >
<div class="col-6">
<BacklogsCard :stories='storiesInBacklogs' :projectId='projectId' />
<BacklogsCard :stories='storiesInBacklogs' :projectId='projectId' :searchKeyword="searchKeyword" />
</div>
<div v-for="sprint in sprints" :key="sprint.id" class="col-6">
<SprintCard class="mb-3" :sprint="sprint" :projectId="projectId" />
<SprintCard class="mb-3" :sprint="sprint" :projectId="projectId" :searchKeyword="searchKeyword" />
</div>
<div v-if="sprints.length <= 0" class="col-6">
<div class="rb-alert-primary mt-2 p-3 border rounded rb-border-dotted">
Expand All @@ -42,15 +53,15 @@
</div>
<div class="row" v-else>
<div v-if="sprints.length > 0" class="col-6">
<SprintCard class="mb-3" v-for="sprint in sprints" :key="sprint.id" :sprint="sprint" :projectId="projectId" />
<SprintCard class="mb-3" v-for="sprint in sprints" :key="sprint.id" :sprint="sprint" :projectId="projectId" :searchKeyword="searchKeyword" />
</div>
<div v-else class="col-6">
<div class="w-100 rb-alert-primary mt-2 p-3 border rounded rb-border-dotted">
<p class="m-0"><i class="fas fa-info-circle mr-1"></i> {{ $t('message.sprintDoesNotExists')}} </p>
</div>
</div>
<div class="col-6">
<BacklogsCard :stories='storiesInBacklogs' :projectId='projectId' />
<BacklogsCard :stories='storiesInBacklogs' :projectId='projectId' :searchKeyword="searchKeyword" />
</div>
</div>

Expand Down Expand Up @@ -78,6 +89,7 @@ export default {
projectId: null,
newStory: false,
layout: 'DEFAULT',
searchKeyword: '',
layoutOptions: [
{
text: this.$t('title.default'),
Expand Down
53 changes: 45 additions & 8 deletions app/javascript/pages/KanbanPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,28 @@
loader="dots"></loading>

<div class="row mb-2 bg-light sticky-top">
<nav class="navbar px-1 py-0 navbar-light">
<nav class="navbar navbar-expand-md px-1 py-0 navbar-light w-100">
<a class="navbar-brand text-gray-700" href="#">{{ sprintTitle }}</a>
<ul class="navbar-nav">
<li class="nav-item">
<a :href="`/projects/${projectId}`" class="nav-link"><i class="fas fa-angle-double-left"></i> {{ $t('action.backToBacklogs') }}</a>
</li>
</ul>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="fas fa-bars"></span>
</button>

<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a :href="`/projects/${projectId}`" class="nav-link"><i class="fas fa-angle-double-left"></i> {{ $t('action.backToBacklogs') }}</a>
</li>
</ul>
<div>
<b-form-input
id="searchInput"
v-model="searchKeyword"
type="text"
size="sm"
:placeholder="$t('title.search')"
></b-form-input>
</div>
</div>
</nav>
</div>
<div class="row">
Expand All @@ -27,7 +42,7 @@
</th>
</tr>
</thead>
<tbody v-for="story in stories" :key="story.id">
<tbody v-for="story in searchStoryAndTaskByKeyword(stories)" :key="story.id">
<tr>
<td :colspan="statusesLength" class="border-bottom-0">
<div class="d-flex align-items-center">
Expand Down Expand Up @@ -128,7 +143,8 @@ export default {
projectId: null,
sprintId: null,
sprintTitle: null,
newTask: false
newTask: false,
searchKeyword: ''
}
},
mounted() {
Expand Down Expand Up @@ -255,6 +271,27 @@ export default {
color: this.idealTextColor(color)
}
},
searchStoryAndTaskByKeyword(stories) {
return stories.filter(story => {
return this.searchKeyword.toLowerCase()
.split(/\s+/)
.map(query => {
return (
story.ticket_number_with_ticket_prefix.toLowerCase().indexOf(query) > -1
|| story.title.toLowerCase().indexOf(query) > -1
|| (story.tags && story.tags.some(tag => tag.name.toLowerCase().indexOf(query) > -1))
|| story.tasks.some((task) => {
return (
task.ticket_number_with_ticket_prefix.toLowerCase().indexOf(query) > -1
|| task.title.toLowerCase().indexOf(query) > -1
|| (task.assignee && task.assignee.username.toLowerCase().indexOf(query) > -1)
)
})
)
})
.every(result => result === true)
});
},
...mapMutations({
setSprintId: 'SET_SPRINT_ID',
setProjectId: 'SET_PROJECT_ID'
Expand Down
56 changes: 36 additions & 20 deletions app/views/devise/passwords/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,25 +1,41 @@
<h2>Change your password</h2>
<div class="container">
<div class="row justify-content-center">
<div class="card o-hidden border-0 shadow-lg my-5 col-lg-6">
<div class="card-body p-0">
<div class="row">
<div class="col-lg-12">
<div class="p-5">
<h2 class="text-center"><%= t('.change_your_password', default: 'Change your password') %></h2>

<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
<%= f.hidden_field :reset_password_token %>
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
<%= f.hidden_field :reset_password_token %>

<div class="field">
<%= f.label :password, "New password" %><br />
<% if @minimum_password_length %>
<em>(<%= @minimum_password_length %> characters minimum)</em><br />
<% end %>
<%= f.password_field :password, autofocus: true, autocomplete: "new-password" %>
</div>
<div class="form-group">
<%= f.label :password, t('.new_password', default: 'New password') %><br />
<%= f.password_field :password, autofocus: true, autocomplete: "new-password", class: 'form-control' %>
<% if @minimum_password_length %>
<em><%= t('devise.shared.minimum_password_length', count: @minimum_password_length, default: "(#{@minimum_password_length} characters minimum)") %></em><br />
<% end %>
</div>

<div class="field">
<%= f.label :password_confirmation, "Confirm new password" %><br />
<%= f.password_field :password_confirmation, autocomplete: "new-password" %>
</div>
<div class="form-group">
<%= f.label :password_confirmation, t('.confirm_new_password', default: 'Confirm new password') %><br />
<%= f.password_field :password_confirmation, autocomplete: "new-password", class: 'form-control' %>
</div>

<div class="actions">
<%= f.submit "Change my password" %>
</div>
<% end %>
<div class="actions">
<%= f.submit t('.change_my_password', default: 'Change my password'), class: "btn btn-primary btn-user btn-block" %>
</div>
<% end %>

<%= render "devise/shared/links" %>
<div class="text-center">
<%= render "devise/shared/links" %>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
Loading

0 comments on commit 6611c53

Please sign in to comment.