From 7ddf3ef3b4f5c2d40c84f58081ae7a78c1460c39 Mon Sep 17 00:00:00 2001 From: yacut Date: Sun, 18 Apr 2021 05:03:39 +0200 Subject: [PATCH] add app config and refactor card for iLert Signed-off-by: yacut --- app-config.yaml | 8 ++++++++ .../src/components/ILertCard/ILertCardOnCall.tsx | 13 +++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/app-config.yaml b/app-config.yaml index 309fa28234..03097069e6 100644 --- a/app-config.yaml +++ b/app-config.yaml @@ -82,6 +82,14 @@ proxy: Authorization: $env: SENTRY_TOKEN + '/ilert': + target: https://api.ilert.com + allowedMethods: ['GET', 'POST', 'PUT'] + allowedHeaders: ['Authorization'] + headers: + Authorization: + $env: ILERT_AUTH_HEADER + organization: name: My Company diff --git a/plugins/ilert/src/components/ILertCard/ILertCardOnCall.tsx b/plugins/ilert/src/components/ILertCard/ILertCardOnCall.tsx index 9c347eeddc..8f28790375 100644 --- a/plugins/ilert/src/components/ILertCard/ILertCardOnCall.tsx +++ b/plugins/ilert/src/components/ILertCard/ILertCardOnCall.tsx @@ -55,11 +55,10 @@ export const ILertCardOnCall = ({ const repeatInfo = () => { if ( - !onCalls || - !onCalls.length || - !onCalls[onCalls.length - 1].escalationPolicy || - !onCalls[onCalls.length - 1].escalationPolicy.repeating || - !onCalls[onCalls.length - 1].escalationPolicy.frequency + !alertSource || + !alertSource.escalationPolicy || + !alertSource.escalationPolicy.repeating || + !alertSource.escalationPolicy.frequency ) { return null; } @@ -76,9 +75,7 @@ export const ILertCardOnCall = ({ color="textSecondary" className={classes.repeatText} > - {`Repeat ${ - onCalls[onCalls.length - 1].escalationPolicy.frequency - } times`} + {`Repeat ${alertSource.escalationPolicy.frequency} times`} } />