Skip to content

Commit

Permalink
iOS-1733 Core | Remove toggles
Browse files Browse the repository at this point in the history
iOS-1733 Core | Remove toggles
  • Loading branch information
mgolovko committed Sep 19, 2023
2 parents 708472f + 68fc1f1 commit b371579
Show file tree
Hide file tree
Showing 37 changed files with 87 additions and 490 deletions.
8 changes: 0 additions & 8 deletions Anytype.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,6 @@
2AC906CC29B61A9700209E39 /* RecentWidgetInternalViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AC906CB29B61A9700209E39 /* RecentWidgetInternalViewModel.swift */; };
2AC906CE29B61B1F00209E39 /* RecentTreeWidgetModuleAssembly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AC906CD29B61B1F00209E39 /* RecentTreeWidgetModuleAssembly.swift */; };
2AC906D029B61DAC00209E39 /* SetsWidgetInternalViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AC906CF29B61DAC00209E39 /* SetsWidgetInternalViewModel.swift */; };
2AC906D229B61E0800209E39 /* SetsTreeWidgetModuleAssembly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AC906D129B61E0800209E39 /* SetsTreeWidgetModuleAssembly.swift */; };
2AC906D829B6233700209E39 /* ListWidgetViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AC906D729B6233700209E39 /* ListWidgetViewModel.swift */; };
2AC906DC29B6276A00209E39 /* ListWidgetModuleAssembly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AC906DB29B6276A00209E39 /* ListWidgetModuleAssembly.swift */; };
2AC906DF29B6289A00209E39 /* RecentListWidgetModuleAssembly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AC906DD29B6289A00209E39 /* RecentListWidgetModuleAssembly.swift */; };
Expand Down Expand Up @@ -678,7 +677,6 @@
2AFB54692869989D004F7458 /* ObjectType+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AFB54682869989D004F7458 /* ObjectType+Extensions.swift */; };
2AFCEB3729C89A7B00841E13 /* CollectionsWidgetInternalViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AFCEB3629C89A7B00841E13 /* CollectionsWidgetInternalViewModel.swift */; };
2AFCEB3929C8A25900841E13 /* CollectionsSubscriptionService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AFCEB3829C8A25900841E13 /* CollectionsSubscriptionService.swift */; };
2AFCEB3B29C8A61800841E13 /* CollectionsTreeWidgetModuleAssembly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AFCEB3A29C8A61800841E13 /* CollectionsTreeWidgetModuleAssembly.swift */; };
2AFCEB3D29C8A67700841E13 /* CollectionsListWidgetModuleAssembly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AFCEB3C29C8A67700841E13 /* CollectionsListWidgetModuleAssembly.swift */; };
2AFCEB3F29C8A76900841E13 /* WidgetObjectListCollectionsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AFCEB3E29C8A76900841E13 /* WidgetObjectListCollectionsViewModel.swift */; };
2AFCEB4329CC808D00841E13 /* HomeWidgetsRecentStateManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AFCEB4229CC808D00841E13 /* HomeWidgetsRecentStateManager.swift */; };
Expand Down Expand Up @@ -2117,7 +2115,6 @@
2AC906CB29B61A9700209E39 /* RecentWidgetInternalViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecentWidgetInternalViewModel.swift; sourceTree = "<group>"; };
2AC906CD29B61B1F00209E39 /* RecentTreeWidgetModuleAssembly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecentTreeWidgetModuleAssembly.swift; sourceTree = "<group>"; };
2AC906CF29B61DAC00209E39 /* SetsWidgetInternalViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SetsWidgetInternalViewModel.swift; sourceTree = "<group>"; };
2AC906D129B61E0800209E39 /* SetsTreeWidgetModuleAssembly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SetsTreeWidgetModuleAssembly.swift; sourceTree = "<group>"; };
2AC906D729B6233700209E39 /* ListWidgetViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListWidgetViewModel.swift; sourceTree = "<group>"; };
2AC906DB29B6276A00209E39 /* ListWidgetModuleAssembly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListWidgetModuleAssembly.swift; sourceTree = "<group>"; };
2AC906DD29B6289A00209E39 /* RecentListWidgetModuleAssembly.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RecentListWidgetModuleAssembly.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2230,7 +2227,6 @@
2AFB54682869989D004F7458 /* ObjectType+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ObjectType+Extensions.swift"; sourceTree = "<group>"; };
2AFCEB3629C89A7B00841E13 /* CollectionsWidgetInternalViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectionsWidgetInternalViewModel.swift; sourceTree = "<group>"; };
2AFCEB3829C8A25900841E13 /* CollectionsSubscriptionService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectionsSubscriptionService.swift; sourceTree = "<group>"; };
2AFCEB3A29C8A61800841E13 /* CollectionsTreeWidgetModuleAssembly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectionsTreeWidgetModuleAssembly.swift; sourceTree = "<group>"; };
2AFCEB3C29C8A67700841E13 /* CollectionsListWidgetModuleAssembly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectionsListWidgetModuleAssembly.swift; sourceTree = "<group>"; };
2AFCEB3E29C8A76900841E13 /* WidgetObjectListCollectionsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetObjectListCollectionsViewModel.swift; sourceTree = "<group>"; };
2AFCEB4229CC808D00841E13 /* HomeWidgetsRecentStateManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeWidgetsRecentStateManager.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -5577,8 +5573,6 @@
2AF4C3DF295D837C00FD7153 /* ObjectTreeWidgetModuleAssembly.swift */,
2AC906C929B609FB00209E39 /* FavoriteTreeWidgetModuleAssembly.swift */,
2AC906CD29B61B1F00209E39 /* RecentTreeWidgetModuleAssembly.swift */,
2AC906D129B61E0800209E39 /* SetsTreeWidgetModuleAssembly.swift */,
2AFCEB3A29C8A61800841E13 /* CollectionsTreeWidgetModuleAssembly.swift */,
);
path = Specific;
sourceTree = "<group>";
Expand Down Expand Up @@ -10194,7 +10188,6 @@
1211AF6627F338EC00BACB88 /* AnytypeImageDownloader.swift in Sources */,
3D1CEC2827F38A38000D36BA /* AccountStatus.swift in Sources */,
2AA8108A29A66854007DD64B /* View+DragAndDrop.swift in Sources */,
2AC906D229B61E0800209E39 /* SetsTreeWidgetModuleAssembly.swift in Sources */,
2AF4260129AF3A6000753B17 /* SettingsAppearanceViewModel.swift in Sources */,
2EDC2AFD2A125C6A0065E009 /* JoinFlowStep.swift in Sources */,
12B691D227F4CB5D00A0C336 /* ImageGuideline.swift in Sources */,
Expand Down Expand Up @@ -10629,7 +10622,6 @@
EAFDEFBF26381E22001B07E4 /* UITextView+Convenience.swift in Sources */,
12887F26274B94A600228330 /* DetailsServiceProtocol.swift in Sources */,
C9F44C7F27E351400078E709 /* TextBlockLeadingViewBuilder.swift in Sources */,
2AFCEB3B29C8A61800841E13 /* CollectionsTreeWidgetModuleAssembly.swift in Sources */,
2A28D050297FCFE400E55E15 /* WidgetContainerView.swift in Sources */,
53FF7CB526FCCDE800A5A592 /* ObjectActionRow.swift in Sources */,
2A1F946E2978208F00E25782 /* ListWidgetView.swift in Sources */,
Expand Down
4 changes: 2 additions & 2 deletions Anytype/Sources/Models/Relations/RelationsBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ private extension RelationsBuilder {

return Relation.Object.Option(
id: objectDetail.id,
icon: FeatureFlags.deleteObjectPlaceholder ? objectDetail.objectIconImage: objectDetail.objectIconImageWithPlaceholder,
icon: objectDetail.objectIconImage,
title: objectDetail.title,
type: objectDetail.objectType.name,
isArchived: objectDetail.isArchived,
Expand Down Expand Up @@ -477,7 +477,7 @@ private extension RelationsBuilder {
let objectOptions: [Relation.File.Option] = objectDetails.map { objectDetail in
return Relation.File.Option(
id: objectDetail.id,
icon: FeatureFlags.deleteObjectPlaceholder ? objectDetail.objectIconImage : objectDetail.objectIconImageWithPlaceholder,
icon: objectDetail.objectIconImage,
title: objectDetail.title,
editorScreenData: objectDetail.editorScreenData()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ protocol WidgetsSubmoduleDIProtocol {
func favoriteTreeWidgetModuleAssembly() -> HomeWidgetCommonAssemblyProtocol
func recentEditTreeWidgetModuleAssembly() -> HomeWidgetCommonAssemblyProtocol
func recentOpenTreeWidgetModuleAssembly() -> HomeWidgetCommonAssemblyProtocol
// Delete with compactListWidget toggle
func setsTreeWidgetModuleAssembly() -> HomeWidgetCommonAssemblyProtocol
func collectionsTreeWidgetModuleAssembly() -> HomeWidgetCommonAssemblyProtocol
// MARK: - List
func listWidgetModuleAssembly() -> ListWidgetModuleAssemblyProtocol
func setListWidgetModuleAssembly() -> HomeWidgetCommonAssemblyProtocol
Expand Down Expand Up @@ -70,14 +67,6 @@ final class WidgetsSubmoduleDI: WidgetsSubmoduleDIProtocol {
widgetAssembly: recentOpenTreeWidgetModuleAssembly(),
output: widgetOutput
),
setsTreeWidgetProviderAssembly: HomeWidgetCommonProviderAssembly(
widgetAssembly: setsTreeWidgetModuleAssembly(),
output: widgetOutput
),
collectionsTreeWidgetProviderAssembly: HomeWidgetCommonProviderAssembly(
widgetAssembly: collectionsTreeWidgetModuleAssembly(),
output: widgetOutput
),
setListWidgetProviderAssembly: HomeWidgetCommonProviderAssembly(
widgetAssembly: setListWidgetModuleAssembly(),
output: widgetOutput
Expand Down Expand Up @@ -160,14 +149,6 @@ final class WidgetsSubmoduleDI: WidgetsSubmoduleDIProtocol {
return RecentTreeWidgetModuleAssembly(type: .recentOpen, serviceLocator: serviceLocator, widgetsSubmoduleDI: self)
}

func setsTreeWidgetModuleAssembly() -> HomeWidgetCommonAssemblyProtocol {
return SetsTreeWidgetModuleAssembly(serviceLocator: serviceLocator, widgetsSubmoduleDI: self)
}

func collectionsTreeWidgetModuleAssembly() -> HomeWidgetCommonAssemblyProtocol {
return CollectionsTreeWidgetModuleAssembly(serviceLocator: serviceLocator, widgetsSubmoduleDI: self)
}

// MARK: - List

func listWidgetModuleAssembly() -> ListWidgetModuleAssemblyProtocol {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,10 @@ struct StandardButton: View {

@ViewBuilder
private func progressView(config: StandardButtonConfig.Style) -> some View {
if FeatureFlags.superNewButtonLoadingState {
if inProgress {
DotsView()
.foregroundColor(config.textColor)
.frame(width: style.config.loadingIndicatorSize.width, height: style.config.loadingIndicatorSize.height)
}
} else {
if inProgress {
ProgressView()
.progressViewStyle(CircularProgressViewStyle(tint: config.textColor ?? .black))
}
if inProgress {
DotsView()
.foregroundColor(config.textColor)
.frame(width: style.config.loadingIndicatorSize.width, height: style.config.loadingIndicatorSize.height)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@ struct RelationObjectsRowView: View {

var body: some View {
HStack(alignment: .center, spacing: 0) {
if FeatureFlags.deleteObjectPlaceholder {
icon
} else {
legacyIcon
Spacer.fixedWidth(12)
}
icon
text
Spacer()
}
Expand All @@ -23,19 +18,6 @@ struct RelationObjectsRowView: View {
}
}

@ViewBuilder
private var legacyIcon: some View {
if let icon = object.icon {
Group {
if object.isDeleted {
Image(asset: .ghost).resizable().frame(width: 28, height: 28)
} else {
IconView(icon: icon)
}
}.frame(width: 48, height: 48)
}
}

@ViewBuilder
private var icon: some View {
if object.isDeleted {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,12 @@ struct ObjectRelationView: View {
private func objectView(option: Relation.Object.Option) -> some View {
HStack(spacing: style.objectRelationStyle.hSpaсingObject) {

if FeatureFlags.deleteObjectPlaceholder {
if let icon = option.icon, shouldShowIcon(icon: icon) {
IconView(icon: icon)
.frame(
width: style.objectRelationStyle.size.width,
height: style.objectRelationStyle.size.height
)
}
} else {
if let icon = option.icon, shouldShowIconLegacy(icon: icon) {
IconView(icon: icon)
.frame(
width: style.objectRelationStyle.size.width,
height: style.objectRelationStyle.size.height
)
}
if let icon = option.icon, shouldShowIcon(icon: icon) {
IconView(icon: icon)
.frame(
width: style.objectRelationStyle.size.width,
height: style.objectRelationStyle.size.height
)
}

AnytypeText(
Expand Down Expand Up @@ -94,19 +84,6 @@ struct ObjectRelationView: View {
return style.fontColor
}
}

// Delete with FeatureFlags.deleteObjectPlaceholder
private func shouldShowIconLegacy(icon: Icon) -> Bool {
if case .object(.placeholder) = icon {
return false
}
switch style {
case .regular, .set, .filter, .setCollection, .kanbanHeader:
return true
case .featuredRelationBlock(let settings):
return settings.showIcon
}
}

private func shouldShowIcon(icon: Icon) -> Bool {
switch style {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,13 @@ private extension ObjectRelationViewUIKit {
}

func setupIconViewIfNeeded() {

if FeatureFlags.deleteObjectPlaceholder {
guard let icon = option.icon else {
iconView.isHidden = true
return
}

iconView.icon = icon
iconView.isHidden = false
} else {
guard let icon = option.icon, shouldShowIcon(icon: icon) else {
iconView.isHidden = true
return
}

iconView.icon = icon
iconView.isHidden = false
guard let icon = option.icon else {
iconView.isHidden = true
return
}

iconView.icon = icon
iconView.isHidden = false
}

func setupTitleLabel() {
Expand Down Expand Up @@ -89,15 +78,4 @@ private extension ObjectRelationViewUIKit {
return relationStyle.uiKitFontColor
}
}

// Delete with FeatureFlags.deleteObjectPlaceholder
func shouldShowIcon(icon: Icon) -> Bool {
switch icon {
case .object(.placeholder):
return false
default:
return true
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct LinkToObjectSearchData: SearchDataProtocol {
self.description = details.description
self.callout = details.objectType.name
self.typeId = details.objectType.id
self.iconImage = FeatureFlags.deleteObjectPlaceholder ? details.objectIconImage : details.objectIconImageWithPlaceholder
self.iconImage = details.objectIconImage
self.editorScreenData = details.editorScreenData()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ extension ObjectSearchData {
}

var iconImage: Icon? {
FeatureFlags.deleteObjectPlaceholder ? details.objectIconImage : details.objectIconImageWithPlaceholder
details.objectIconImage
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ struct SearchCell<SearchData: SearchDataProtocol>: View {
Spacer()
}
.frame(height: 68)
.if(FeatureFlags.deleteObjectPlaceholder, transform: {
$0.newDivider()
})
.newDivider()
.padding(.horizontal, 16)
}

Expand Down Expand Up @@ -49,9 +47,6 @@ struct SearchCell<SearchData: SearchDataProtocol>: View {
}

Spacer()
if !FeatureFlags.deleteObjectPlaceholder {
AnytypeDivider()
}
}
}

Expand Down
Loading

0 comments on commit b371579

Please sign in to comment.