Skip to content

Commit

Permalink
Update All chats screen with latest design #6407
Browse files Browse the repository at this point in the history
- Removed analytics used for IA test
  • Loading branch information
gileluard committed Jul 25, 2022
1 parent c77a527 commit d89e441
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 89 deletions.
3 changes: 0 additions & 3 deletions Riot/Modules/Analytics/AnalyticsScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ import AnalyticsEvents
case spaceMembers
case spaceExploreRooms
case dialpad
case editLayout

/// The screen name reported to the AnalyticsEvent.
var screenName: AnalyticsEvent.MobileScreen.ScreenName {
Expand Down Expand Up @@ -143,8 +142,6 @@ import AnalyticsEvents
return .SpaceExploreRooms
case .dialpad:
return .Dialpad
case .editLayout:
return .EditLayout
}
}
}
69 changes: 0 additions & 69 deletions Riot/Modules/Analytics/AnalyticsUIElement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,6 @@ import AnalyticsEvents
case threadListFilterItem
case spacePanelSelectedSpace
case spacePanelSwitchSpace
case editLayoutFavouritesFilterSelected
case editLayoutFavouritesFilterUnselected
case editLayoutFavouritesSectionSelected
case editLayoutFavouritesSectionUnselected
case editLayoutPeopleFilterSelected
case editLayoutPeopleFilterUnselected
case editLayoutRecentsSectionSelected
case editLayoutRecentsSectionUnselected
case editLayoutRoomsFilterSelected
case editLayoutRoomsFilterUnselected
case editLayoutUnreadsFilterSelected
case editLayoutUnreadsFilterUnselected
case allChatAllOptionActivated
case allChatAllSpacesActivated
case allChatFavouritesOptionActivated
case allChatFavouritesOptionDeactivated
case allChatPeopleOptionActivated
case allChatPeopleOptionDeactivated
case allChatPinnedSpaceActivated
case allChatRoomsOptionActivated
case allChatRoomsOptionDeactivated
case allChatUnreadsOptionActivated
case allChatUnreadsOptionDeactivated

/// The element name reported to the AnalyticsEvent.
var name: AnalyticsEvent.Interaction.Name {
Expand All @@ -63,52 +40,6 @@ import AnalyticsEvents
return .SpacePanelSelectedSpace
case .spacePanelSwitchSpace:
return .SpacePanelSwitchSpace
case .editLayoutFavouritesFilterSelected:
return .EditLayoutFavouritesFilterSelected
case .editLayoutFavouritesFilterUnselected:
return .EditLayoutFavouritesFilterUnselected
case .editLayoutFavouritesSectionSelected:
return .EditLayoutFavouritesSectionSelected
case .editLayoutFavouritesSectionUnselected:
return .EditLayoutFavouritesSectionUnselected
case .editLayoutPeopleFilterSelected:
return .EditLayoutPeopleFilterSelected
case .editLayoutPeopleFilterUnselected:
return .EditLayoutPeopleFilterUnselected
case .editLayoutRecentsSectionSelected:
return .EditLayoutRecentsSectionSelected
case .editLayoutRecentsSectionUnselected:
return .EditLayoutRecentsSectionUnselected
case .editLayoutRoomsFilterSelected:
return .EditLayoutRoomsFilterSelected
case .editLayoutRoomsFilterUnselected:
return .EditLayoutRoomsFilterUnselected
case .editLayoutUnreadsFilterSelected:
return .EditLayoutUnreadsFilterSelected
case .editLayoutUnreadsFilterUnselected:
return .EditLayoutUnreadsFilterUnselected
case .allChatAllOptionActivated:
return .AllChatAllOptionActivated
case .allChatAllSpacesActivated:
return .AllChatAllSpacesActivated
case .allChatFavouritesOptionActivated:
return .AllChatFavouritesOptionActivated
case .allChatFavouritesOptionDeactivated:
return .AllChatFavouritesOptionDeactivated
case .allChatPeopleOptionActivated:
return .AllChatPeopleOptionActivated
case .allChatPeopleOptionDeactivated:
return .AllChatPeopleOptionDeactivated
case .allChatPinnedSpaceActivated:
return .AllChatPinnedSpaceActivated
case .allChatRoomsOptionActivated:
return .AllChatRoomsOptionActivated
case .allChatRoomsOptionDeactivated:
return .AllChatRoomsOptionDeactivated
case .allChatUnreadsOptionActivated:
return .AllChatUnreadsOptionActivated
case .allChatUnreadsOptionDeactivated:
return .AllChatUnreadsOptionDeactivated
}
}
}
18 changes: 1 addition & 17 deletions Riot/Modules/Home/AllChats/AllChatsFilterOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,34 +35,18 @@ import UIKit

filterOptionListView.options = filterOptions
filterOptionListView.selectedOptionType = AllChatsLayoutSettingsManager.shared.allChatLayoutSettings.activeFilters
filterOptionListView.selectionChanged = { [weak self] filter in
filterOptionListView.selectionChanged = { filter in
guard filter != .all else {
Analytics.shared.trackInteraction(.allChatAllOptionActivated)
AllChatsLayoutSettingsManager.shared.allChatLayoutSettings.activeFilters = []
return
}

self?.trackSelectionChangeFor(filter)
AllChatsLayoutSettingsManager.shared.allChatLayoutSettings.activeFilters = filter
}

return filterOptionListView
}

private func trackSelectionChangeFor(_ optionType: AllChatsLayoutFilterType) {
switch optionType {
case .favourites:
Analytics.shared.trackInteraction(.allChatFavouritesOptionActivated)
case .people:
Analytics.shared.trackInteraction(.allChatPeopleOptionActivated)
case .rooms:
Analytics.shared.trackInteraction(.allChatRoomsOptionActivated)
case .unreads:
Analytics.shared.trackInteraction(.allChatUnreadsOptionActivated)
default: break
}
}

var optionsCount: Int {
return options.count
}
Expand Down

0 comments on commit d89e441

Please sign in to comment.