From c079b9a7e1a31784e9f63e9fbcb6b5bbb7fbefea Mon Sep 17 00:00:00 2001 From: nvollroth <100927440+nvollroth@users.noreply.github.com> Date: Fri, 8 Jul 2022 11:26:35 +0200 Subject: [PATCH] feat: usage information in selection view (#942) * Added the count of Usages to Selection View * Removed unused imports * style: apply automatic fixes of linters Co-authored-by: nvollroth Co-authored-by: jofaul <54673768+jofaul@users.noreply.github.com> --- .../selectionView/ParameterView.tsx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/api-editor/gui/src/features/packageData/selectionView/ParameterView.tsx b/api-editor/gui/src/features/packageData/selectionView/ParameterView.tsx index 156fddf31..5f1d8cd79 100644 --- a/api-editor/gui/src/features/packageData/selectionView/ParameterView.tsx +++ b/api-editor/gui/src/features/packageData/selectionView/ParameterView.tsx @@ -48,6 +48,15 @@ export const ParameterView: React.FC = function ({ pythonPar )} + {parameterUsages && ( + + + Usages + + + + )} + {parameterUsages && ( @@ -141,3 +150,13 @@ const isStringifiedLiteral = function (value: string): boolean { } return !Number.isNaN(Number.parseFloat(value)); }; + +const UsageSum: React.FC = function ({ parameterUsages }) { + let usage = 0; + + parameterUsages.forEach((value) => { + usage += value; + }); + + return {usage}; +};