Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,28 @@ extension BlogDetailsViewController {
}
return blog.supports(.themeBrowsing) || blog.supports(.menus)
}

@objc func shouldAddSharingRow() -> Bool {
guard JetpackFeaturesRemovalCoordinator.jetpackFeaturesEnabled() else {
return false
}
return blog.supports(.sharing)
}

@objc func shouldAddPeopleRow() -> Bool {
guard JetpackFeaturesRemovalCoordinator.jetpackFeaturesEnabled() else {
return false
}
return blog.supports(.people)
}

@objc func shouldAddPluginsRow() -> Bool {
return blog.supports(.pluginManagement)
}

@objc func shouldAddDomainRegistrationRow() -> Bool {
return FeatureFlag.domains.enabled
&& AppConfiguration.allowsDomainRegistration
&& blog.supports(.domains)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ - (BlogDetailsSection *)configurationSectionViewModel
__weak __typeof(self) weakSelf = self;
NSMutableArray *rows = [NSMutableArray array];

if ([self.blog supports:BlogFeatureSharing]) {
if ([self shouldAddSharingRow]) {
BlogDetailsRow *row = [[BlogDetailsRow alloc] initWithTitle:NSLocalizedString(@"Sharing", @"Noun. Title. Links to a blog's sharing options.")
image:[UIImage gridiconOfType:GridiconTypeShare]
callback:^{
Expand All @@ -980,15 +980,15 @@ - (BlogDetailsSection *)configurationSectionViewModel
[rows addObject:row];
}

if ([self.blog supports:BlogFeaturePeople]) {
if ([self shouldAddPeopleRow]) {
[rows addObject:[[BlogDetailsRow alloc] initWithTitle:NSLocalizedString(@"People", @"Noun. Title. Links to the people management feature.")
image:[UIImage gridiconOfType:GridiconTypeUser]
callback:^{
[weakSelf showPeople];
}]];
}

if ([self.blog supports:BlogFeaturePluginManagement]) {
if ([self shouldAddPluginsRow]) {
[rows addObject:[[BlogDetailsRow alloc] initWithTitle:NSLocalizedString(@"Plugins", @"Noun. Title. Links to the plugin management feature.")
image:[UIImage gridiconOfType:GridiconTypePlugins]
callback:^{
Expand All @@ -1006,7 +1006,7 @@ - (BlogDetailsSection *)configurationSectionViewModel

[rows addObject:row];

if ([self shouldShowDomainRegistration]) {
if ([self shouldAddDomainRegistrationRow]) {
BlogDetailsRow *domainsRow = [[BlogDetailsRow alloc] initWithTitle:NSLocalizedString(@"Domains", @"Noun. Title. Links to the Domains screen.")
identifier:BlogDetailsSettingsCellIdentifier
accessibilityIdentifier:@"Domains Row"
Expand Down Expand Up @@ -1400,7 +1400,7 @@ - (void)preloadMetadata

- (void)preloadDomains
{
if (![self shouldShowDomainRegistration]) {
if (![self shouldAddDomainRegistrationRow]) {
return;
}

Expand All @@ -1409,13 +1409,6 @@ - (void)preloadDomains
failure:nil];
}

- (BOOL)shouldShowDomainRegistration
{
return [Feature enabled:FeatureFlagDomains]
&& [AppConfiguration allowsDomainRegistration]
&& [self.blog supports:BlogFeatureDomains];
}

- (void)scrollToElement:(QuickStartTourElement) element
{
int sectionCount = 0;
Expand Down