Skip to content

Commit

Permalink
[fix] #290 GA 필터 선택 항목 전체 부분 수정
Browse files Browse the repository at this point in the history
- 필터 선택 항목 전체 부분에서 명칭 외에 함께 측정되던 불필요한 값(idx 등) 제거
  • Loading branch information
Haeeul committed Jan 23, 2024
1 parent 34987cd commit 6d51f06
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ class FilterFragment : Fragment() {
reqFilterGa("apply_brand", brandViewModel.getSelectedBrands())
reqFilterGa("apply_bonding", keywordViewModel.getSelectedKeywords())

Log.d("명_계열",seriesViewModel.getSelectedSeries().map { it.name }.toString())
Log.d("명_브랜드",brandViewModel.getSelectedBrands().map { it.name }.toString())
Log.d("명_키워드",keywordViewModel.getSelectedKeywords().map { it.name }.toString())
Log.d("GA 필터 - 계열", seriesViewModel.getSelectedSeries().map { it.name }.toString())
Log.d("GA 필터 - 브랜드", brandViewModel.getSelectedBrands().map { it.name }.toString())
Log.d("GA 필터 - 키워드", keywordViewModel.getSelectedKeywords().map { it.name }.toString())
}
binding.toolbarFilter.toolbarBtn.setOnSafeClickListener {
closeSelfWithAnimation()
Expand Down Expand Up @@ -212,7 +212,10 @@ class FilterFragment : Fragment() {
val filterInfoPList = seriesViewModel.getSelectedSeries() +
brandViewModel.getSelectedBrands() +
keywordViewModel.getSelectedKeywords()
firebaseAnalytics.setOneParamClickEvent("kind_of_filter", "kind_of_filter_name", filterInfoPList.toString())
val filterInfoNameList = seriesViewModel.getSelectedSeriesName()+
brandViewModel.getSelectedBrandsName() +
keywordViewModel.getSelectedKeywordsName()
firebaseAnalytics.setOneParamClickEvent("kind_of_filter", "kind_of_filter_name", filterInfoNameList)
return SendFilter(
filterInfoPList.toMutableList(),
mutableMapOf() // TODO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ class FilterBrandViewModel(
return selectedBrandList.map { FilterInfoP(it.brandIdx, it.name, FilterType.Brand) }
}

fun getSelectedBrandsName() : String{
return selectedBrandList.map { it.name }.toString()
}

fun clearSelectedList() {
selectedBrandList.clear()
_selectedCount.value = selectedBrandList.size
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import com.scentsnote.android.data.vo.request.FilterInfoP
import com.scentsnote.android.data.vo.request.FilterType
import com.scentsnote.android.data.vo.response.KeywordInfo
import com.scentsnote.android.utils.extension.removeKeyword
import com.scentsnote.android.utils.extension.resetBrand
import com.scentsnote.android.utils.extension.resetKeyword
import kotlinx.coroutines.launch
import retrofit2.HttpException
Expand Down Expand Up @@ -65,6 +64,10 @@ class FilterKeywordViewModel(
return selectedKeywordList.map { FilterInfoP(it.keywordIdx, it.name, FilterType.Keyword) }
}

fun getSelectedKeywordsName(): String{
return selectedKeywordList.map { it.name }.toString()
}

fun removeFromSelectedList(filterInfoP: FilterInfoP) {
selectedKeywordList.removeKeyword(KeywordInfo(filterInfoP.name, filterInfoP.idx))
_selectedCount.value = selectedKeywordList.size
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ class FilterSeriesViewModel(
// todo: all type은 전체 담도록
return selectedSeriesList.map { FilterInfoP(it.index, it.name, FilterType.Ingredient) }
}

fun getSelectedSeriesName(): String{
return selectedSeriesList.map { it.name }.toString()
}

fun removeFromSelectedList(filterInfoP: FilterInfoP) {
selectedSeriesList.removeSeries(
Expand Down

0 comments on commit 6d51f06

Please sign in to comment.