-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(alarm): Make AlarmNamingStrategy customizable (#316)
Making the AlarmNamingStrategy configurable. My team wants to add the disambiguator to the alarm dedupe string. This requires custom logic for generating the deduplication string, which is why we want to be able to override this class's functionality. _By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license_
- Loading branch information
1 parent
cb2bca9
commit 9002122
Showing
6 changed files
with
164 additions
and
16 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
export interface AlarmNamingInput { | ||
readonly alarmNameSuffix: string; | ||
readonly alarmNameOverride?: string; | ||
readonly alarmDedupeStringSuffix?: string; | ||
readonly dedupeStringOverride?: string; | ||
readonly disambiguator?: string; | ||
} | ||
|
||
/** | ||
* Strategy used to name alarms, their widgets, and their dedupe strings. | ||
*/ | ||
export interface IAlarmNamingStrategy { | ||
/** | ||
* How to generate the name of an alarm. | ||
* | ||
* @param props AlarmNamingInput | ||
*/ | ||
getName(props: AlarmNamingInput): string; | ||
|
||
/** | ||
* How to generate the label for the alarm displayed on a widget. | ||
* | ||
* @param props AlarmNamingInput | ||
*/ | ||
getWidgetLabel(props: AlarmNamingInput): string; | ||
|
||
/** | ||
* How to generate the deduplication string for an alarm. | ||
*/ | ||
getDedupeString(props: AlarmNamingInput): string | undefined; | ||
} |
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