@@ -6,18 +6,19 @@ import { computed, toValue, Ref } from 'vue';
66import {
77 useLiveDate , useNamespace , useProject , useResourceDetails , useWorkspace
88} from '@shell/components/Resource/Detail/Metadata/IdentifyingInformation/identifying-fields' ;
9+ import { useOnShowConfiguration } from '@shell/components/Resource/Detail/composables' ;
910
1011export const useBasicMetadata = ( resource : any ) => {
1112 const labels = useDefaultLabels ( resource ) ;
1213 const annotations = useDefaultAnnotations ( resource ) ;
13- const resourceValue = toValue ( resource ) ;
14+ const onShowConfiguration = useOnShowConfiguration ( resource ) ;
1415
1516 return computed ( ( ) => {
1617 return {
17- resource : toValue ( resource ) ,
18- labels : labels . value ,
19- annotations : annotations . value ,
20- onShowConfiguration : ( ) => resourceValue . showConfiguration ( )
18+ resource : toValue ( resource ) ,
19+ labels : labels . value ,
20+ annotations : annotations . value ,
21+ onShowConfiguration
2122 } ;
2223 } ) ;
2324} ;
@@ -28,15 +29,15 @@ export const useDefaultMetadataProps = (resource: any, additionalIdentifyingInfo
2829
2930 const identifyingInformation = computed ( ( ) => [ ...defaultIdentifyingInformation . value , ...( additionalIdentifyingInformationValue || [ ] ) ] ) ;
3031 const basicMetaData = useBasicMetadata ( resource ) ;
31- const resourceValue = toValue ( resource ) ;
32+ const onShowConfiguration = useOnShowConfiguration ( resource ) ;
3233
3334 return computed ( ( ) => {
3435 return {
3536 resource : toValue ( resource ) ,
3637 identifyingInformation : identifyingInformation . value ,
3738 labels : basicMetaData . value . labels ,
3839 annotations : basicMetaData . value . annotations ,
39- onShowConfiguration : ( returnFocusSelector : string ) => resourceValue . showConfiguration ( returnFocusSelector )
40+ onShowConfiguration
4041 } ;
4142 } ) ;
4243} ;
@@ -47,7 +48,6 @@ export const useDefaultMetadataForLegacyPagesProps = (resource: any) => {
4748 const workspace = useWorkspace ( resource ) ;
4849 const namespace = useNamespace ( resource ) ;
4950 const liveDate = useLiveDate ( resource ) ;
50- const resourceValue = toValue ( resource ) ;
5151
5252 const identifyingInformation = computed ( ( ) : IdentifyingInformationRow [ ] => {
5353 const defaultInfo = [
@@ -71,7 +71,7 @@ export const useDefaultMetadataForLegacyPagesProps = (resource: any) => {
7171 identifyingInformation : identifyingInformation . value ,
7272 labels : basicMetaData . value . labels ,
7373 annotations : basicMetaData . value . annotations ,
74- onShowConfiguration : ( returnFocusSelector ?: string ) => resourceValue . showConfiguration ( returnFocusSelector )
74+ onShowConfiguration : basicMetaData . value . onShowConfiguration
7575 } ;
7676 } ) ;
7777} ;
0 commit comments