File tree Expand file tree Collapse file tree 3 files changed +8
-22
lines changed
shared/components/EmptyListComponent Expand file tree Collapse file tree 3 files changed +8
-22
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import { useGetCRbyPath } from './useGetCRbyPath';
1313import ExtensibilityCreate from './ExtensibilityCreate' ;
1414import {
1515 applyFormula ,
16- getResourceDescAndUrl ,
16+ getResourceUrl ,
1717 getTextSearchProperties ,
1818 TranslationBundleContext ,
1919 useCreateResourceDescription ,
@@ -123,7 +123,7 @@ export const ExtensibilityListCore = ({
123123 defaultSearch : true ,
124124 } ) ;
125125
126- const { url : emptyListUrl } = getResourceDescAndUrl ( description ) ;
126+ const { url : emptyListUrl } = getResourceUrl ( description ) ;
127127
128128 return (
129129 < ResourcesList
@@ -142,7 +142,7 @@ export const ExtensibilityListCore = ({
142142 textSearchProperties ( defaultSearchProperties ) ,
143143 } }
144144 emptyListProps = { {
145- subtitleText : newListProps ?. description ?. props ?. i18nKey ,
145+ subtitleText : newListProps ?. description ,
146146 url : emptyListUrl ,
147147 } }
148148 />
Original file line number Diff line number Diff line change @@ -168,10 +168,9 @@ export const useCreateResourceDescription = (descID) => {
168168 }
169169} ;
170170
171- export const getResourceDescAndUrl = ( descID ) => {
171+ export const getResourceUrl = ( descID ) => {
172172 if ( ! descID )
173173 return {
174- description : null ,
175174 url : null ,
176175 } ;
177176
@@ -183,17 +182,11 @@ export const getResourceDescAndUrl = (descID) => {
183182
184183 if ( links ?. length >= 1 ) {
185184 const matchedLink = links [ 0 ] ;
186- const processedTrans = trans . replace (
187- matchedLink . matchedText ,
188- `<0>${ matchedLink . urlText } </0>` ,
189- ) ;
190185 return {
191- description : processedTrans ,
192186 url : matchedLink . url ,
193187 } ;
194188 } else {
195189 return {
196- description : trans ,
197190 url : null ,
198191 } ;
199192 }
Original file line number Diff line number Diff line change 11import { ReactNode } from 'react' ;
2- import { Trans , useTranslation } from 'react-i18next' ;
2+ import { useTranslation } from 'react-i18next' ;
33import { Button , IllustratedMessage , Title } from '@ui5/webcomponents-react' ;
44import '@ui5/webcomponents-fiori/dist/illustrations/AllIllustrations' ;
55import { ExternalLink } from 'shared/components/ExternalLink/ExternalLink' ;
@@ -28,15 +28,6 @@ export const EmptyListComponent = ({
2828 image = 'NoEntries' ,
2929} : EmptyListComponentProps ) => {
3030 const { t } = useTranslation ( ) ;
31- const subtitle = subtitleText ? (
32- < Trans
33- i18nKey = { subtitleText }
34- defaults = { subtitleText }
35- components = { [ < ExternalLink key = { subtitleText } url = { url } /> ] }
36- />
37- ) : (
38- ''
39- ) ;
4031
4132 if ( showButton === undefined ) {
4233 showButton = typeof onClick === 'function' ;
@@ -57,7 +48,9 @@ export const EmptyListComponent = ({
5748 { titleText }
5849 </ Title >
5950 }
60- subtitle = { < span className = "sap-margin-top-small" > { subtitle } </ span > }
51+ subtitle = {
52+ < span className = "sap-margin-top-small" > { subtitleText ?? '' } </ span >
53+ }
6154 >
6255 < div className = "emptyListComponent__buttons" >
6356 { showButton && < Button onClick = { onClick } > { buttonText } </ Button > }
You can’t perform that action at this time.
0 commit comments