Skip to content

Commit

Permalink
fix(connectors): filter up-to-date connectors only
Browse files Browse the repository at this point in the history
  • Loading branch information
burgerni10 committed Sep 8, 2023
1 parent d73b4d1 commit 0e5f40d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
8 changes: 4 additions & 4 deletions backend/src/repository/north-connector.repository.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('North connector repository', () => {
{
id: 'id1',
name: 'north1',
type: 'NorthConnector',
type: 'oianalytics',
description: 'My north connector',
enabled: true,
settings: {},
Expand All @@ -49,7 +49,7 @@ describe('North connector repository', () => {
{
id: 'id2',
name: 'north2',
type: 'NorthConnector',
type: 'oianalytics',
description: 'My second north connector',
enabled: true,
settings: {},
Expand All @@ -72,7 +72,7 @@ describe('North connector repository', () => {
{
id: 'id1',
name: 'north1',
type: 'NorthConnector',
type: 'oianalytics',
description: 'My north connector',
enabled: true,
settings: JSON.stringify({}),
Expand All @@ -89,7 +89,7 @@ describe('North connector repository', () => {
{
id: 'id2',
name: 'north2',
type: 'NorthConnector',
type: 'oianalytics',
description: 'My second north connector',
enabled: true,
settings: JSON.stringify({}),
Expand Down
3 changes: 2 additions & 1 deletion backend/src/repository/north-connector.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ export default class NorthConnectorRepository {
enabled: result.archiveEnabled,
retentionDuration: result.archiveRetentionDuration
}
}));
}))
.filter(result => ['aws-s3', 'azure-blob', 'console', 'file-writer', 'oianalytics', 'oibus', 'rest-api'].includes(result.type));
}

/**
Expand Down
12 changes: 6 additions & 6 deletions backend/src/repository/south-connector.repository.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('South connector repository', () => {
{
id: 'id1',
name: 'south1',
type: 'SouthConnector',
type: 'oianalytics',
description: 'My south connector',
enabled: true,
history: {
Expand All @@ -41,7 +41,7 @@ describe('South connector repository', () => {
{
id: 'id2',
name: 'south2',
type: 'SouthConnector',
type: 'oianalytics',
description: 'My second south connector',
enabled: true,
history: {
Expand All @@ -56,7 +56,7 @@ describe('South connector repository', () => {
{
id: 'id1',
name: 'south1',
type: 'SouthConnector',
type: 'oianalytics',
description: 'My south connector',
enabled: true,
maxInstantPerItem: true,
Expand All @@ -67,7 +67,7 @@ describe('South connector repository', () => {
{
id: 'id2',
name: 'south2',
type: 'SouthConnector',
type: 'oianalytics',
description: 'My second south connector',
enabled: true,
maxInstantPerItem: false,
Expand All @@ -88,7 +88,7 @@ describe('South connector repository', () => {
const expectedValue: SouthConnectorDTO = {
id: 'id1',
name: 'south1',
type: 'SouthConnector',
type: 'oianalytics',
description: 'My south connector',
enabled: true,
history: {
Expand All @@ -101,7 +101,7 @@ describe('South connector repository', () => {
get.mockReturnValueOnce({
id: 'id1',
name: 'south1',
type: 'SouthConnector',
type: 'oianalytics',
description: 'My south connector',
enabled: true,
maxInstantPerItem: false,
Expand Down
19 changes: 18 additions & 1 deletion backend/src/repository/south-connector.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,24 @@ export default class SouthConnectorRepository {
readDelay: result.readDelay
},
settings: JSON.parse(result.settings)
}));
}))
.filter(result =>
[
'ads',
'folder-scanner',
'modbus',
'mqtt',
'mssql',
'mysql',
'odbc',
'oianalytics',
'opcua',
'oracle',
'postgresql',
'slims',
'sqlite'
].includes(result.type)
);
}

/**
Expand Down

0 comments on commit 0e5f40d

Please sign in to comment.