Skip to content

Commit

Permalink
Add FXIOS-9832 - Password Generator Feature Flag (#21590)
Browse files Browse the repository at this point in the history
* Feature Flag Added

* Addressed comments

---------

Co-authored-by: Daniel Dervishi <[email protected]>
  • Loading branch information
DanielDervishi and Daniel Dervishi authored Aug 23, 2024
1 parent cb1436b commit da61142
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions firefox-ios/Client/FeatureFlags/NimbusFlaggableFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ enum NimbusFeatureFlagID: String, CaseIterable {
case microsurvey
case nativeErrorPage
case nightMode
case passwordGenerator
case preferSwitchToOpenTabOverDuplicate
case reduxSearchSettings
case closeRemoteTabs
Expand Down Expand Up @@ -91,6 +92,7 @@ struct NimbusFlaggableFeature: HasNimbusSearchBar {
.menuRefactor,
.nativeErrorPage,
.nightMode,
.passwordGenerator,
.preferSwitchToOpenTabOverDuplicate,
.reduxSearchSettings,
.reportSiteIssue,
Expand Down
7 changes: 7 additions & 0 deletions firefox-ios/Client/Nimbus/NimbusFeatureFlagLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ final class NimbusFeatureFlagLayer {
case .nightMode:
return checkNightModeFeature(from: nimbus)

case .passwordGenerator:
return checkPasswordGeneratorFeature(from: nimbus)

case .preferSwitchToOpenTabOverDuplicate:
return checkPreferSwitchToOpenTabOverDuplicate(from: nimbus)

Expand Down Expand Up @@ -247,6 +250,10 @@ final class NimbusFeatureFlagLayer {
return config.productAds
}

private func checkPasswordGeneratorFeature(from nimbus: FxNimbus) -> Bool {
return nimbus.features.passwordGeneratorFeature.value().enabled
}

private func checkProductBackInStockFakespotFeature(from nimbus: FxNimbus) -> Bool {
let config = nimbus.features.shopping2023.value()

Expand Down
17 changes: 17 additions & 0 deletions firefox-ios/nimbus-features/passwordGeneratorFeature.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# The configuration for the passwordGeneratorFeature feature
features:
password-generator-feature:
description: Password Generator Feature
variables:
enabled:
description: If true, the password generator feature is enabled
type: Boolean
default: false
defaults:
- channel: beta
value:
enabled: false
- channel: developer
value:
enabled: false

1 change: 1 addition & 0 deletions firefox-ios/nimbus.fml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ include:
- nimbus-features/nativeErrorPageFeature.yaml
- nimbus-features/nightModeFeature.yaml
- nimbus-features/onboardingFrameworkFeature.yaml
- nimbus-features/passwordGeneratorFeature.yaml
- nimbus-features/reduxSearchSettingsFeature.yaml
- nimbus-features/remoteTabManagement.yaml
- nimbus-features/searchFeature.yaml
Expand Down

0 comments on commit da61142

Please sign in to comment.