@buerokratt-ria/common-gui-components 0.0.37 → 0.0.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ All changes to this project will be documented in this file.
4
4
 
5
5
  ## Template [MajorVersion.MediterraneanVersion.MinorVersion] - DD-MM-YYYY
6
6
 
7
+ ## [0.0.38] - 20.01.2026
8
+
9
+ - Added isFiveRatingScale Handle
10
+
7
11
  ## [0.0.37] - 19.01.2026
8
12
 
9
13
  - Added Sanitization to Markdownify
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buerokratt-ria/common-gui-components",
3
- "version": "0.0.37",
3
+ "version": "0.0.38",
4
4
  "description": "Common GUI components and pre defined templates.",
5
5
  "main": "index.ts",
6
6
  "author": "ExiRai",
@@ -704,7 +704,7 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({
704
704
  header: t('chat.history.rating') ?? '',
705
705
  cell: (props) => {
706
706
  const value = props.getValue();
707
- return value !== null && value !== undefined ? <span>{`${value}/10`}</span> : null;
707
+ return value !== null && value !== undefined ? <span>{`${value}/${props.row.original?.isFiveRatingScale === 'true' ? 5 : 10}`}</span> : null;
708
708
  }
709
709
  }),
710
710
  columnHelper.accessor('feedbackText', {
@@ -887,6 +887,7 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({
887
887
  }
888
888
 
889
889
  let processedValue: any = rawValue;
890
+ const totalCheck = chat.isFiveRatingScale === 'true' ? 5 : 10;
890
891
  switch (col.id) {
891
892
  case 'created':
892
893
  case 'ended':
@@ -902,7 +903,7 @@ const ChatHistory: FC<PropsWithChildren<HistoryProps>> = ({
902
903
  processedValue = rawValue ? t('global.yes') : t('global.no');
903
904
  break;
904
905
  case 'feedbackRating':
905
- processedValue = rawValue != null ? `${rawValue}/10` : '';
906
+ processedValue = rawValue == null ? '' : `${rawValue}/${totalCheck}`;
906
907
  break;
907
908
  case 'status':
908
909
  processedValue =
package/types/chat.ts CHANGED
@@ -88,6 +88,7 @@ export interface Chat {
88
88
  nps?: number;
89
89
  userDisplayName?: string;
90
90
  istest?: boolean;
91
+ isFiveRatingScale?: string;
91
92
  }
92
93
  export interface GroupedChat {
93
94
  myChats: Chat[];