diff --git a/MobileApp/src/components/MarkdownContent.tsx b/MobileApp/src/components/MarkdownContent.tsx index f730ca5178..21ab53c8d4 100644 --- a/MobileApp/src/components/MarkdownContent.tsx +++ b/MobileApp/src/components/MarkdownContent.tsx @@ -21,69 +21,70 @@ export default function MarkdownContent({ ? theme.colors.textSecondary : theme.colors.textPrimary; - const markdownStyles = StyleSheet.create({ - body: { - color: textColor, - margin: 0, - padding: 0, - fontSize: isSecondary ? 13 : 14, - lineHeight: 22, - }, - text: { - color: textColor, - fontSize: isSecondary ? 13 : 14, - lineHeight: 22, - }, - paragraph: { - marginTop: 0, - marginBottom: 8, - color: textColor, - }, - strong: { - color: textColor, - fontWeight: "700", - }, - em: { - color: textColor, - fontStyle: "italic", - }, - link: { - color: theme.colors.actionPrimary, - textDecorationLine: "underline", - }, - bullet_list: { - marginTop: 0, - marginBottom: 8, - }, - ordered_list: { - marginTop: 0, - marginBottom: 8, - }, - list_item: { - color: textColor, - marginBottom: 4, - }, - fence: { - backgroundColor: theme.colors.backgroundSecondary, - color: textColor, - borderRadius: 8, - padding: 10, - marginBottom: 8, - }, - code_inline: { - backgroundColor: theme.colors.backgroundSecondary, - color: textColor, - borderRadius: 4, - paddingHorizontal: 6, - paddingVertical: 2, - }, - blockquote: { - borderLeftWidth: 3, - borderLeftColor: theme.colors.borderDefault, - paddingLeft: 10, - marginBottom: 8, - }, - }); + const markdownStyles: ReturnType = + StyleSheet.create({ + body: { + color: textColor, + margin: 0, + padding: 0, + fontSize: isSecondary ? 13 : 14, + lineHeight: 22, + }, + text: { + color: textColor, + fontSize: isSecondary ? 13 : 14, + lineHeight: 22, + }, + paragraph: { + marginTop: 0, + marginBottom: 8, + color: textColor, + }, + strong: { + color: textColor, + fontWeight: "700", + }, + em: { + color: textColor, + fontStyle: "italic", + }, + link: { + color: theme.colors.actionPrimary, + textDecorationLine: "underline", + }, + bullet_list: { + marginTop: 0, + marginBottom: 8, + }, + ordered_list: { + marginTop: 0, + marginBottom: 8, + }, + list_item: { + color: textColor, + marginBottom: 4, + }, + fence: { + backgroundColor: theme.colors.backgroundSecondary, + color: textColor, + borderRadius: 8, + padding: 10, + marginBottom: 8, + }, + code_inline: { + backgroundColor: theme.colors.backgroundSecondary, + color: textColor, + borderRadius: 4, + paddingHorizontal: 6, + paddingVertical: 2, + }, + blockquote: { + borderLeftWidth: 3, + borderLeftColor: theme.colors.borderDefault, + paddingLeft: 10, + marginBottom: 8, + }, + }); return ( { - assignments.push({ - projectId: project._id, - projectName: project.name, - policyId: getEntityId(rule.onCallDutyPolicy), - policyName: rule.onCallDutyPolicy?.name ?? "Unknown policy", - escalationRuleName: - rule.onCallDutyPolicyEscalationRule?.name ?? "Unknown rule", - assignmentType: "user", - assignmentDetail: "You are directly assigned", - }); - }); + response.escalationRulesByUser.forEach( + (rule: OnCallDutyEscalationRuleUserItem) => { + assignments.push({ + projectId: project._id, + projectName: project.name, + policyId: getEntityId(rule.onCallDutyPolicy), + policyName: rule.onCallDutyPolicy?.name ?? "Unknown policy", + escalationRuleName: + rule.onCallDutyPolicyEscalationRule?.name ?? "Unknown rule", + assignmentType: "user", + assignmentDetail: "You are directly assigned", + }); + }, + ); - response.escalationRulesByTeam.forEach((rule) => { - assignments.push({ - projectId: project._id, - projectName: project.name, - policyId: getEntityId(rule.onCallDutyPolicy), - policyName: rule.onCallDutyPolicy?.name ?? "Unknown policy", - escalationRuleName: - rule.onCallDutyPolicyEscalationRule?.name ?? "Unknown rule", - assignmentType: "team", - assignmentDetail: `Via team: ${rule.team?.name ?? "Unknown"}`, - }); - }); + response.escalationRulesByTeam.forEach( + (rule: OnCallDutyEscalationRuleTeamItem) => { + assignments.push({ + projectId: project._id, + projectName: project.name, + policyId: getEntityId(rule.onCallDutyPolicy), + policyName: rule.onCallDutyPolicy?.name ?? "Unknown policy", + escalationRuleName: + rule.onCallDutyPolicyEscalationRule?.name ?? "Unknown rule", + assignmentType: "team", + assignmentDetail: `Via team: ${rule.team?.name ?? "Unknown"}`, + }); + }, + ); - response.escalationRulesBySchedule.forEach((rule) => { - assignments.push({ - projectId: project._id, - projectName: project.name, - policyId: getEntityId(rule.onCallDutyPolicy), - policyName: rule.onCallDutyPolicy?.name ?? "Unknown policy", - escalationRuleName: - rule.onCallDutyPolicyEscalationRule?.name ?? "Unknown rule", - assignmentType: "schedule", - assignmentDetail: `Via schedule: ${rule.onCallDutyPolicySchedule?.name ?? "Unknown"}`, - }); - }); + response.escalationRulesBySchedule.forEach( + (rule: OnCallDutyEscalationRuleScheduleItem) => { + assignments.push({ + projectId: project._id, + projectName: project.name, + policyId: getEntityId(rule.onCallDutyPolicy), + policyName: rule.onCallDutyPolicy?.name ?? "Unknown policy", + escalationRuleName: + rule.onCallDutyPolicyEscalationRule?.name ?? "Unknown rule", + assignmentType: "schedule", + assignmentDetail: `Via schedule: ${rule.onCallDutyPolicySchedule?.name ?? "Unknown"}`, + }); + }, + ); return assignments; } diff --git a/eslint.config.js b/eslint.config.js index a85ab006ab..a016c70d49 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -233,7 +233,8 @@ export default tseslint.config( module: true, __dirname: true, exports: true, - "NodeJS": true + "NodeJS": true, + "PromiseSettledResult": true }, parserOptions: { projectService: true,