feat: Update ComplianceRuleType enum values for consistency and clarity

This commit is contained in:
Simon Larsen
2025-09-23 13:19:49 +01:00
parent 9d04975759
commit 18389a0c31
4 changed files with 22 additions and 22 deletions

View File

@@ -214,16 +214,16 @@ export default class TeamComplianceService {
ruleType: ComplianceRuleType,
): Promise<{ compliant: boolean; reason: string }> {
switch (ruleType) {
case ComplianceRuleType.HasNotificationEmail:
case ComplianceRuleType.HasNotificationEmailMethod:
return await this.checkHasNotificationEmail(userId, projectId);
case ComplianceRuleType.HasNotificationSMS:
case ComplianceRuleType.HasNotificationSMSMethod:
return await this.checkHasNotificationSMS(userId, projectId);
case ComplianceRuleType.HasNotificationCall:
case ComplianceRuleType.HasNotificationCallMethod:
return await this.checkHasNotificationCall(userId, projectId);
case ComplianceRuleType.HasNotificationPush:
case ComplianceRuleType.HasNotificationPushMethod:
return await this.checkHasNotificationPush(userId, projectId);
case ComplianceRuleType.HasIncidentOnCallRules:

View File

@@ -1,10 +1,10 @@
enum ComplianceRuleType {
HasNotificationEmail = "Has at least one email for notifications",
HasNotificationSMS = "Has at least one phone number for SMS notifications",
HasNotificationCall = "Has at least one phone number for call notifications",
HasNotificationPush = "Has at least one push notification device",
HasIncidentOnCallRules = "Has incident on-call rules set",
HasAlertOnCallRules = "Has alert on-call rules set",
HasNotificationEmailMethod = "HasNotificationEmailMethod",
HasNotificationSMSMethod = "HasNotificationSMSMethod",
HasNotificationCallMethod = "HasNotificationCallMethod",
HasNotificationPushMethod = "HasNotificationPushMethod",
HasIncidentOnCallRules = "HasIncidentOnCallRules",
HasAlertOnCallRules = "HasAlertOnCallRules",
}
export default ComplianceRuleType;

View File

@@ -86,10 +86,10 @@ const TeamComplianceStatusTable: FunctionComponent<ComponentProps> = (
ruleType: string,
): string => {
const labels: Record<string, string> = {
HasNotificationEmail: "Email Notification",
HasNotificationSMS: "SMS Notification",
HasNotificationCall: "Call Notification",
HasNotificationPush: "Push Notification",
HasNotificationEmailMethod: "Email Notification",
HasNotificationSMSMethod: "SMS Notification",
HasNotificationCallMethod: "Call Notification",
HasNotificationPushMethod: "Push Notification",
HasIncidentOnCallRules: "Incident On-Call Rules",
HasAlertOnCallRules: "Alert On-Call Rules",
};

View File

@@ -444,19 +444,19 @@ const TeamView: FunctionComponent<PageComponentProps> = (
required: true,
dropdownOptions: [
{
value: ComplianceRuleType.HasNotificationEmail,
value: ComplianceRuleType.HasNotificationEmailMethod,
label: "Email Notification Required",
},
{
value: ComplianceRuleType.HasNotificationSMS,
value: ComplianceRuleType.HasNotificationSMSMethod,
label: "SMS Notification Required",
},
{
value: ComplianceRuleType.HasNotificationCall,
value: ComplianceRuleType.HasNotificationCallMethod,
label: "Call Notification Required",
},
{
value: ComplianceRuleType.HasNotificationPush,
value: ComplianceRuleType.HasNotificationPushMethod,
label: "Push Notification Required",
},
{
@@ -507,13 +507,13 @@ const TeamView: FunctionComponent<PageComponentProps> = (
type: FieldType.Text,
getElement: (item: TeamComplianceSetting): ReactElement => {
const ruleTypeLabels: Record<string, string> = {
[ComplianceRuleType.HasNotificationEmail]:
[ComplianceRuleType.HasNotificationEmailMethod]:
"Email Notification Method Required for Users",
[ComplianceRuleType.HasNotificationSMS]:
[ComplianceRuleType.HasNotificationSMSMethod]:
"SMS Notification Method Required for Users",
[ComplianceRuleType.HasNotificationCall]:
[ComplianceRuleType.HasNotificationCallMethod]:
"Call Notification Method Required for Users",
[ComplianceRuleType.HasNotificationPush]:
[ComplianceRuleType.HasNotificationPushMethod]:
"Push Notification Method Required for Users",
[ComplianceRuleType.HasIncidentOnCallRules]:
"Incident On-Call Rules Required for Users",