generated from amosproj/amos202Xss0Y-projname
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #204 from amosproj/refactor/frontend
refactor frontend
- Loading branch information
Showing
37 changed files
with
507 additions
and
2,007 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,94 +2,6 @@ | |
// SPDX-FileCopyrightText: 2010-2021 Dirk Riehle <[email protected] | ||
// SPDX-FileCopyrightText: 2019 Georg Schwarz <georg. [email protected]> | ||
|
||
export function instanceOfSampleCluster( | ||
object: | ||
| SampleCluster | ||
| SampleTenant | ||
| SampleNamespace | ||
| SampleTopic | ||
| SampleMessage | ||
): object is SampleCluster { | ||
if (object) { | ||
return 'tenants' in object | ||
} else return false | ||
} | ||
|
||
export function instanceOfSampleNamespace( | ||
object: | ||
| SampleCluster | ||
| SampleTenant | ||
| SampleNamespace | ||
| SampleTopic | ||
| SampleMessage | ||
): object is SampleNamespace { | ||
if (object) { | ||
return 'topics' in object | ||
} else return false | ||
} | ||
|
||
export function instanceOfSampleTopic( | ||
object: | ||
| SampleCluster | ||
| SampleTenant | ||
| SampleNamespace | ||
| SampleTopic | ||
| SampleMessage | ||
): object is SampleTopic { | ||
if (object) { | ||
return 'topicStatsDto' in object | ||
} else return false | ||
} | ||
|
||
export function instanceOfSampleTenant( | ||
object: | ||
| SampleCluster | ||
| SampleTenant | ||
| SampleNamespace | ||
| SampleTopic | ||
| SampleMessage | ||
): object is SampleTenant { | ||
if (object) { | ||
return 'tenantInfo' in object | ||
} else return false | ||
} | ||
|
||
export function instanceOfSampleMessage( | ||
object: | ||
| SampleCluster | ||
| SampleTenant | ||
| SampleNamespace | ||
| SampleTopic | ||
| SampleMessage | ||
): object is SampleMessage { | ||
if (object) { | ||
return 'payload' in object | ||
} else return false | ||
} | ||
|
||
export const flattenClustersToTenants = (myClusters: Array<SampleCluster>) => { | ||
return myClusters | ||
.map((cluster) => cluster.tenants) | ||
.filter((el) => el.length > 0) | ||
.flat() | ||
} | ||
|
||
export const flattenTenantsToNamespaces = (myTenants: Array<SampleTenant>) => { | ||
return myTenants | ||
.map((tenant) => tenant.namespaces) | ||
.filter((el) => el.length > 0) | ||
.flat() | ||
} | ||
|
||
export const flattenNamespacesToTopics = ( | ||
myNamespaces: Array<SampleNamespace> | ||
) => { | ||
return myNamespaces | ||
.map((namespace) => namespace.topics) | ||
.filter((el) => el.length > 0) | ||
.flat() | ||
} | ||
|
||
/** | ||
* Helper function to add comma separator if not the last element. | ||
* @param index the index of current element in array. | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.