-
Notifications
You must be signed in to change notification settings - Fork 71
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
sadがついた日報にコメントを書いて『確認OKにする』ボタンを押した際に『今日の気分は「sad」ですが、コメント無しで確認しますか?』が表示されないようにした #4239
Merged
+59
−37
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
32ad7a6
「確認OKにする」ボタンのときにはポップアップを出さないようにした
Aseiide 483fb11
不要な分岐を削除
Aseiide 92bf2cb
テストを修正
Aseiide 1a36893
不要のため削除
Aseiide 01e0bdb
mixinを使って共通化
Aseiide 6b8fe35
./bin/lint
Aseiide 8df3684
checkMixinをcheckableにリネーム
Aseiide 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
export default { | ||
methods: { | ||
check(checkableType, checkableId, url, method, token) { | ||
const params = { | ||
checkable_type: checkableType, | ||
checkable_id: checkableId | ||
} | ||
|
||
fetch(url, { | ||
method: method, | ||
headers: { | ||
'Content-Type': 'application/json; charset=utf-8', | ||
'X-Requested-With': 'XMLHttpRequest', | ||
'X-CSRF-Token': token | ||
}, | ||
credentials: 'same-origin', | ||
redirect: 'manual', | ||
body: JSON.stringify(params) | ||
}) | ||
.then(() => { | ||
this.$store.dispatch('setCheckable', { | ||
checkableId: checkableId, | ||
checkableType: checkableType | ||
}) | ||
}) | ||
.catch((error) => { | ||
console.warn(error) | ||
}) | ||
} | ||
} | ||
} |
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
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.
これってなぜこの方法から、自前でPOSTする方法に変更したんでしょう?
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.
「確認OKにする」ボタンには、「日報を確認」する機能が必要で、ポップアップは必要ない。
「日報を確認」ボタンには、「日報を確認」する機能と、ポップアップの両方必要。
「日報を確認」するというメソッド(機能)は
check.vue
に存在し、comments.vue
からは呼べないと思いました。なぜなら、親子関係にないためです。
なので、「日報を確認」する機能に該当する部分(変更後コードの
comments.vue L138~L164
)をcheck.vue
から移植して自前でPOSTするようにしました。自分では思いつかなかったのですが、
comments.vue
からcheck.vue
のcheckメソッド
を呼ぶ方法がございましたら、実装のヒントや方針などご教示いただけますと幸いです。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.
@Aseiide なるほどですね〜
Checkする処理は同じだと思うのでcomponentからmixinを使って共通化するのはいかがでしょうか〜
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.
@komagata
なるほど、そういう方法があるのですね。
mixin調べてやってみます。