Skip to content

Commit

Permalink
refactor(backoffice-v2): removed violations from ecosystem and social (
Browse files Browse the repository at this point in the history
  • Loading branch information
Omri-Levy committed Jul 1, 2024
1 parent 05f5a90 commit 75cbfee
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 80 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { FunctionComponent } from 'react';
import { RiskIndicators } from '@/common/components/molecules/RiskIndicators/RiskIndicators';
import { Card } from '@/common/components/atoms/Card/Card';
import { CardHeader } from '@/common/components/atoms/Card/Card.Header';
import { CardContent } from '@/common/components/atoms/Card/Card.Content';
Expand Down Expand Up @@ -37,7 +36,6 @@ export const AdsAndSocialMedia: FunctionComponent<{
return (
<div className={'space-y-8'}>
<h3 className={'text-lg font-bold'}>Ads and Social Media Analysis</h3>
<RiskIndicators violations={violations} />
<Card>
<CardHeader className={'pt-4 font-bold'}>Social Media Presence</CardHeader>
<CardContent className={'space-y-8'}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import React, { FunctionComponent } from 'react';
import { WarningFilledSvg } from '@/common/components/atoms/icons';
import { ctw } from '@/common/utils/ctw/ctw';
import { Card } from '@/common/components/atoms/Card/Card';
import { CardHeader } from '@/common/components/atoms/Card/Card.Header';
import { CardContent } from '@/common/components/atoms/Card/Card.Content';
import { Severity } from '@/common/types';
import { CheckCircle } from '@/common/components/atoms/CheckCircle/CheckCircle';
import { EcosystemAndTransactionsTable } from '@/domains/business-reports/components/EcosystemAndTransactions/components/EcosystemAndTransactionsTable/EcosystemAndTransactionsTable';
import { columns } from '@/domains/business-reports/components/EcosystemAndTransactions/components/EcosystemAndTransactionsTable/columns';

Expand All @@ -27,39 +23,6 @@ export const EcosystemAndTransactions: FunctionComponent<{
return (
<div className={'space-y-8'}>
<h3 className={'col-span-full text-lg font-bold'}>Ecosystem and Transactions Analysis</h3>
<Card>
<CardHeader className={'pt-4 font-bold'}>Risk Indicators</CardHeader>
<CardContent>
<ul className="list-inside list-disc">
{!!violations?.length &&
violations.map(violation => (
<li key={violation.label} className="flex list-none items-center text-slate-500">
<WarningFilledSvg
className={ctw('me-3 mt-px', {
'text-slate-300 [&>:not(:first-child)]:stroke-background':
violation.severity === Severity.MEDIUM,
})}
width={'20'}
height={'20'}
/>
{violation.label}
</li>
))}
{!violations.length && (
<li className="flex list-none items-center text-slate-500">
<CheckCircle
size={18}
className={`stroke-background`}
containerProps={{
className: 'me-3 bg-success',
}}
/>
No Violations Detected
</li>
)}
</ul>
</CardContent>
</Card>
<Card>
<CardHeader className={'pt-4 font-bold'}>Ecosystem</CardHeader>
<CardContent>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import { TextWithNAFallback } from '@/common/components/atoms/TextWithNAFallback/TextWithNAFallback';
import { checkIsUrl } from '@/common/utils/check-is-url/check-is-url';
import { BallerineLink } from '@/common/components/atoms/BallerineLink/BallerineLink';
import { WarningFilledSvg } from '@/common/components/atoms/icons';
import { ctw } from '@/common/utils/ctw/ctw';
import React from 'react';
import { createColumnHelper } from '@tanstack/react-table';
import { safeEvery } from '@ballerine/common';
import { Severity } from '@/common/types';

const columnHelper = createColumnHelper<{
matchedName: string;
Expand Down Expand Up @@ -64,28 +60,4 @@ export const columns = [
return <TextWithNAFallback>{relatedNode}</TextWithNAFallback>;
},
}),
columnHelper.accessor('indicators', {
header: 'Indicators',
cell: info => {
const indicators = info.getValue();

return (
<div className={'flex items-center'}>
{safeEvery(Object.values(indicators), indicator => !!indicator) && (
<>
<WarningFilledSvg
className={ctw('me-3 mt-px', {
'text-slate-300 [&>:not(:first-child)]:stroke-background':
indicators?.severity === Severity.MEDIUM,
})}
width={'20'}
height={'20'}
/>
</>
)}
{indicators?.label ?? 'No Violations Detected'}
</div>
);
},
}),
];
2 changes: 1 addition & 1 deletion services/workflows-service/prisma/data-migrations
15 changes: 5 additions & 10 deletions services/workflows-service/src/alert/alert.service.intg.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -978,8 +978,7 @@ describe('AlertService', () => {
});
});

// Flaky
describe.skip('Rule: PAY_HCA_CC', () => {
describe('Rule: PAY_HCA_CC', () => {
let alertDefinition: AlertDefinition;
let counteryparty: Counterparty;

Expand Down Expand Up @@ -1047,8 +1046,7 @@ describe('AlertService', () => {
});
});

// Flaky
describe.skip('Rule: PAY_HCA_APM', () => {
describe('Rule: PAY_HCA_APM', () => {
let alertDefinition: AlertDefinition;
let counteryparty: Counterparty;

Expand Down Expand Up @@ -1118,8 +1116,7 @@ describe('AlertService', () => {
});
});

// Flaky
describe.skip('Rule: PGAICT', () => {
describe('Rule: PGAICT', () => {
let alertDefinition: AlertDefinition;
let counteryparty: Counterparty;

Expand Down Expand Up @@ -1336,8 +1333,7 @@ describe('AlertService', () => {
});
});

// Flaky
describe.skip('Rule: HVHAI_CC', () => {
describe('Rule: HVHAI_CC', () => {
let oldTransactionFactory: TransactionFactory;

let alertDefinition: AlertDefinition;
Expand Down Expand Up @@ -1631,8 +1627,7 @@ describe('AlertService', () => {
});
});

// Flaky
describe.skip('Rule: MGAV_CC', () => {
describe('Rule: MGAV_CC', () => {
let counterpartiesA: Array<Awaited<ReturnType<typeof createEndUserCounterparty>>> = [];
let alertDefinition: AlertDefinition;

Expand Down
1 change: 0 additions & 1 deletion services/workflows-service/src/test/db-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ module.exports = async () => {
})
.start();

process.env.TEST_DATABASE_SCHEMA_NAME = container.getDatabase();
process.env.DB_URL = container.getConnectionUri();

console.log('\nStarting database container on: ' + process.env.DB_URL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const databaseHelper = new PrismaClient();
// should never be unset - default test in order not to delete default db
const TEST_DATABASE_SCHEMA_NAME = z
.string()
.default('test')
.default('public')
.parse(process.env.DATABASE_SCHEMA_NAME);

const __getTables = async (prisma: PrismaClient): Promise<string[]> => {
Expand Down

0 comments on commit 75cbfee

Please sign in to comment.