-
-
Notifications
You must be signed in to change notification settings - Fork 498
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introducing template-tag feature flag
- Loading branch information
Showing
6 changed files
with
51 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import GuideMakerApp from 'guidemaker/controllers/application'; | ||
|
||
export default class ApplicationController extends GuideMakerApp { | ||
queryParams = ['feature_flags']; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import GuideMakerApp from 'guidemaker/routes/application'; | ||
import { service } from '@ember/service'; | ||
|
||
const FEATURES = { | ||
'template-tag': false, | ||
}; | ||
|
||
export default class ApplicationRoute extends GuideMakerApp { | ||
@service features; | ||
|
||
model(params, ...rest) { | ||
let { feature_flags } = params; | ||
let overrides = Object.fromEntries( | ||
feature_flags?.split(',').map((flag) => [flag, true]) ?? [] | ||
); | ||
this.features.setupFeatures(Object.assign({}, FEATURES, overrides)); | ||
return super.model(params, ...rest); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.