-
Notifications
You must be signed in to change notification settings - Fork 326
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
Fix level filters #711
Fix level filters #711
Conversation
I created new Level model because last year's audienceCategory is not not match for this year's response name.
import androidx.room.ColumnInfo | ||
import io.github.droidkaigi.confsched2020.data.db.entity.LevelEntity | ||
|
||
internal data class LevelEntityImpl ( |
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.
🚫 | Unexpected spacing before “(“ |
@@ -0,0 +1,13 @@ | |||
package io.github.droidkaigi.confsched2020.data.db.internal.entity.mapper | |||
|
|||
import io.github.droidkaigi.confsched2020.data.db.entity.LevelEntity |
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.
🚫 | Unused import |
@@ -97,7 +99,7 @@ data class SpeechSession( | |||
override val isFavorited: Boolean, | |||
val speakers: List<Speaker>, | |||
val message: LocaledString? | |||
) : Session(id, title, desc, dayNumber, startTime, endTime, room, isFavorited), AndroidParcel { | |||
) : Session(id, title, desc, dayNumber, startTime, endTime, room, isFavorited, levels), AndroidParcel { |
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.
🚫 | Exceeded max line length (100) (cannot be auto-corrected) |
val sessionType: SessionType, | ||
override val isFavorited: Boolean | ||
) : Session(id, title, desc, dayNumber, startTime, endTime, room, isFavorited), AndroidParcel { | ||
) : Session(id, title, desc, dayNumber, startTime, endTime, room, isFavorited, levels), AndroidParcel { |
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.
🚫 | Exceeded max line length (100) (cannot be auto-corrected) |
filterItem = setOf(AudienceCategory.BEGINNERS, AudienceCategory.UNSPECIFIED), | ||
isForBeginners = false, | ||
Param.forLevels( | ||
title = "filter has Beginners and Intermediate passes Intermediate and Advanced session", |
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.
🚫 | Exceeded max line length (100) (cannot be auto-corrected) |
アプリ内で実態にあった名前を変えるのはいいと思います!!👍👍
👍👍👍👍 マイグレーションについてですが、現在マイグレーションが必要になると自動的にDBが破棄される設定になっています!スキーマのバージョンだけ上がっていれば大丈夫です! |
スキーマのバージョンを上げておりませんので,変更します |
👍👍👍
|
@nashcft |
I think we have to create a cache with jvmTest dependencies when caching all of the other structures. |
package io.github.droidkaigi.confsched2020.model | ||
|
||
enum class Level(val rawValue: LocaledString) { | ||
BEGINNER(LocaledString("初級", "Beginner")), |
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.
I think it is better to have a string such as "BEGINNER" as a property. Level(val id :String, val rawValue: LocaledString)
This is because this class is caused by the change of API response. The property name can be id. 👀
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.
I see.
I agree with you. I will fix it!
Thanks! Almost LGTM! |
@clockvoid |
It's better to have a cache, but after the merge. 👍 |
No issue was reported. Cool! Generated by 🚫 Danger |
Your apk has been deployed to https://deploygate.com/distributions/a6778c80b527cb2ca5b5bdc7db3a9bdd2418dacc. Anyone can try your changes via the link. Generated by 🚫 Danger |
@takahirom |
It's a problem that the test doesn't run, but on another branch, we seem to have a problem with CI testing. 👀 ( #671 ) |
I see. Thanks for the information 🙏 |
Issue
Overview (Required)
日本語でこの変更を行った理由と私の思いについて書かせてください.
まず,AudienceCategoryという名前は去年のものだと思いますが,今年はLevelということで,視聴者のレベルではなく,セッションそのもののレベルであり,これは,セッションそのものの特性を指していることから,すべてのAudienceCategoryと名のついたものをLevelという名前に変えさせていただきました.
その際,iOS側のクラスの名前も変わってしまうことになります(なるはずですよね?)が,iOSではまだフィルターは実装されておらず,変更の効く範囲だと思いますので,このようにさせていただきました.
また,セッションのエンティティに
levels
という要素が加わったことにより,キャッシュのデータベースが変更されました.この事により,アプリのストレージをクリアしないとアップデート時に機能しなくなりますが,マイグレーションの処理は書いていません.理由としては,このアプリはまだPlayStoreに上がっておらず,開発段階であり,開発者の皆さまがアプリを再インストールすることで使えるようになるならば,スピード感を優先してマイグレーションはつけなくて良いと判断したためです.最後に,テストについてです.今回私がいじったのは
model
モジュールですが,このモジュールのjvmTest
モジュールはなぜかテストとして認識されていませんでした.model/build.gradle
を見ると,jvm()
の記述がなかったため,それを追加することによりjvmTest
が動くようにしました.また,FilterTestに関しましては,今回の変更ですべてのパターンを調べると18通りとなり,非常に記述が長くなってしまうため,最小限ですべてのパターンを調べることができているように記述したつもりです.Links
Screenshot