File tree Expand file tree Collapse file tree 3 files changed +15
-11
lines changed
Expand file tree Collapse file tree 3 files changed +15
-11
lines changed Original file line number Diff line number Diff line change 1- import { ResourceProps } from './YamlViewButton.tsx' ;
1+ import { YamlViewButtonProps } from './YamlViewButton.tsx' ;
22import { FC } from 'react' ;
33
44import { stringify } from 'yaml' ;
@@ -10,7 +10,7 @@ import IllustratedError from '../Shared/IllustratedError.tsx';
1010import YamlViewer from './YamlViewer.tsx' ;
1111import useResource from '../../lib/api/useApiResource' ;
1212
13- export const YamlLoader : FC < ResourceProps > = ( {
13+ export const YamlLoader : FC < YamlViewButtonProps > = ( {
1414 workspaceName,
1515 resourceType,
1616 resourceName,
Original file line number Diff line number Diff line change @@ -3,13 +3,13 @@ import { FC, useState } from 'react';
33import { YamlLoader } from './YamlLoader.tsx' ;
44import { useTranslation } from 'react-i18next' ;
55
6- export type ResourceProps = {
6+ export type YamlViewButtonProps = {
77 workspaceName ?: string ;
88 resourceType : 'projects' | 'workspaces' | 'managedcontrolplanes' ;
99 resourceName : string ;
1010} ;
1111
12- export const YamlViewButton : FC < ResourceProps > = ( {
12+ export const YamlViewButton : FC < YamlViewButtonProps > = ( {
1313 workspaceName,
1414 resourceType,
1515 resourceName,
@@ -31,12 +31,17 @@ export const YamlViewButton: FC<ResourceProps> = ({
3131 }
3232 />
3333 }
34+ onClose = { ( ) => {
35+ setIsOpen ( false ) ;
36+ } }
3437 >
35- < YamlLoader
36- workspaceName = { workspaceName }
37- resourceName = { resourceName }
38- resourceType = { resourceType }
39- />
38+ { isOpen && (
39+ < YamlLoader
40+ workspaceName = { workspaceName }
41+ resourceName = { resourceName }
42+ resourceType = { resourceType }
43+ />
44+ ) }
4045 </ Dialog >
4146 < Button
4247 icon = "document"
Original file line number Diff line number Diff line change 11import { Resource } from '../resource.ts' ;
2- import { ControlPlaneType } from './controlPlanes.ts' ;
32
43export const ResourceObject = (
54 workspaceName : string ,
65 resourceType : string ,
76 resourceName : string ,
8- ) : Resource < ControlPlaneType > => {
7+ ) : Resource < unknown > => {
98 return {
109 path : `/apis/core.openmcp.cloud/v1alpha1/${ workspaceName ? `namespaces/${ workspaceName } /` : '' } ${ resourceType } /${ resourceName } ` ,
1110 } ;
You can’t perform that action at this time.
0 commit comments