File tree Expand file tree Collapse file tree 4 files changed +12
-33
lines changed
shared/components/EmptyListComponent Expand file tree Collapse file tree 4 files changed +12
-33
lines changed Original file line number Diff line number Diff line change @@ -214,6 +214,7 @@ command-palette:
214214 rolebindings : Role Bindings
215215 serviceaccounts : Service Accounts
216216 serviceentries : Service Entries
217+ services : Services
217218 statefulsets : Stateful Sets
218219 storageclasses : Storage Classes
219220 subscriptions : Subscriptions
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,8 +123,7 @@ export const ExtensibilityListCore = ({
123123 defaultSearch : true ,
124124 } ) ;
125125
126- const { description : subtitleText , url : emptyListUrl } =
127- getResourceDescAndUrl ( description ) ;
126+ const emptyListUrl = getResourceUrl ( description ) ;
128127
129128 return (
130129 < ResourcesList
@@ -143,7 +142,7 @@ export const ExtensibilityListCore = ({
143142 textSearchProperties ( defaultSearchProperties ) ,
144143 } }
145144 emptyListProps = { {
146- subtitleText : subtitleText ,
145+ subtitleText : newListProps ?. description ,
147146 url : emptyListUrl ,
148147 } }
149148 />
Original file line number Diff line number Diff line change @@ -168,12 +168,8 @@ export const useCreateResourceDescription = (descID) => {
168168 }
169169} ;
170170
171- export const getResourceDescAndUrl = ( descID ) => {
172- if ( ! descID )
173- return {
174- description : null ,
175- url : null ,
176- } ;
171+ export const getResourceUrl = ( descID ) => {
172+ if ( ! descID ) return null ;
177173
178174 const helmBracketsRegex = / { { " ( .* ?) " } } / g;
179175 const trans = descID . replace ( helmBracketsRegex , '$1' ) ;
@@ -183,19 +179,9 @@ export const getResourceDescAndUrl = (descID) => {
183179
184180 if ( links ?. length >= 1 ) {
185181 const matchedLink = links [ 0 ] ;
186- const processedTrans = trans . replace (
187- matchedLink . matchedText ,
188- `<0>${ matchedLink . urlText } </0>` ,
189- ) ;
190- return {
191- description : processedTrans ,
192- url : matchedLink . url ,
193- } ;
182+ return matchedLink . url ;
194183 } else {
195- return {
196- description : trans ,
197- url : null ,
198- } ;
184+ return null ;
199185 }
200186 }
201187} ;
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