-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature/GH-130: Add action item life duration status #132
Merged
nikolaiprivalov
merged 14 commits into
master
from
feature/GH-130-Add-action-item-life-duration-status
Oct 24, 2019
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e66ea00
add times-moved to action items
nikolaiprivalov 111269c
added chevrons
nikolaiprivalov a5ca4e6
add aasm specs
nikolaiprivalov 0b66833
add action_item model specs
nikolaiprivalov e793933
duplicate action item actions and policies and move under api namespace
nikolaiprivalov fd5099a
modify ActionItem react component to accept new props
nikolaiprivalov d734067
create TransitionButton component
nikolaiprivalov f9ec3be
remove leftovers
nikolaiprivalov 74d4036
add api action_items controller specs
nikolaiprivalov c477478
switch off autocomplete for card forms
nikolaiprivalov 9868f77
add stroke to chevrons
nikolaiprivalov 939d17f
restore webpack extract_css property to false
nikolaiprivalov c4b3bb7
code review changes
nikolaiprivalov cbfe797
Update app/javascript/components/ActionItem/ActionItemFooter/index.js
nikolaiprivalov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
.box { margin-bottom: 1.5rem; } | ||
|
||
.green_font {color: hsl(141, 71%, 48%)} | ||
.yellow_font {color: hsl(48, 100%, 67%)} | ||
.red_font {color: hsl(348, 100%, 61%)} | ||
|
||
.green_bg {background-color: hsl(141, 71%, 48%)} | ||
.yellow_bg {background-color: hsl(48, 100%, 67%)} | ||
.red_bg {background-color: hsl(348, 100%, 61%)} |
18 changes: 9 additions & 9 deletions
18
app/javascript/components/ActionItem/ActionItemBody/ActionItemBody.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
textarea { | ||
overflow: hidden; | ||
resize: none; | ||
width: 100%; | ||
font-size: 1rem; | ||
font-weight: 400; | ||
line-height: 1.5; | ||
color: hsl(0, 0%, 29%); | ||
} | ||
textarea { | ||
overflow: hidden; | ||
resize: none; | ||
width: 100%; | ||
font-size: 1rem; | ||
font-weight: 400; | ||
line-height: 1.5; | ||
color: hsl(0, 0%, 29%); | ||
} | ||
|
||
.text { overflow-wrap: break-word; } |
7 changes: 7 additions & 0 deletions
7
app/javascript/components/ActionItem/ActionItemFooter/ActionItemFooter.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.fa-chevron-right { | ||
margin-right: -2px; | ||
margin-left: -2px; | ||
font-size: 16px; | ||
stroke: white; | ||
stroke-width: 10; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
app/javascript/components/ActionItem/TransitionButton/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from "react" | ||
|
||
class TransitionButton extends React.Component { | ||
constructor(props) { | ||
super(props) | ||
this.state = {} | ||
} | ||
|
||
handleClick = () => { | ||
fetch(`/api/${window.location.pathname}/action_items/${this.props.id}/${this.props.action}`, { | ||
method: 'PUT', | ||
headers: { | ||
Accept: 'application/json', | ||
'Content-Type': 'application/json', | ||
'X-CSRF-Token': document.querySelector("meta[name='csrf-token']").getAttribute('content') | ||
} | ||
}).then((result) => { | ||
if (result.status == 200) { | ||
window.location.reload(); | ||
} | ||
else { throw result } | ||
}).catch((error) => { | ||
error.json().then( errorHash => { | ||
console.log(errorHash.error) | ||
}) | ||
}); | ||
} | ||
nikolaiprivalov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
render () { | ||
return ( | ||
<button onClick={() => {this.handleClick()}}> | ||
{this.props.action} | ||
</button> | ||
); | ||
} | ||
} | ||
|
||
export default TransitionButton |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,3 @@ | |
width: 1.5rem; | ||
border-radius: 1rem; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
textarea { | ||
overflow: hidden; | ||
resize: none; | ||
width: 100%; | ||
font-size: 1rem; | ||
font-weight: 400; | ||
line-height: 1.5; | ||
color: hsl(0, 0%, 29%); | ||
} | ||
overflow: hidden; | ||
resize: none; | ||
width: 100%; | ||
font-size: 1rem; | ||
font-weight: 400; | ||
line-height: 1.5; | ||
color: hsl(0, 0%, 29%); | ||
} | ||
|
||
.text { overflow-wrap: break-word; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
хорошая практика - выносить запросы к api в отдельный метод в отдельном файле в папке компонента
например requests.js или что-то подобное, а внутри него него должна быть функция move(), которую уже можно будет вызвать отсюда
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
уже писал об этом, ребята решили сделать это отдельным PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
understood! спасибо за подробное разьяснение по расположению. там где-то 15 таких фетчей. я возьму следующим таском их все разобрать.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
огонь!