Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,12 @@ export function FormGenerator(props: FormGeneratorProps) {
let onCreateButtonClick;
if (!Array.isArray(keyType)) {
onCreateButtonClick = (fetchItems: any, handleValueChange: any) => {
openPopup(rpcClient, element.keyType, fetchItems, handleValueChange, undefined, { type: keyType }, sidePanelContext);

const view = element.keyType === 'registry' ? 'addResource' : element.keyType;
const customProps = element.keyType === 'registry'
? { type: [keyType] }
: { type: keyType };
openPopup(rpcClient, view, fetchItems, handleValueChange, undefined, customProps, sidePanelContext);
}
}

Expand Down
16 changes: 15 additions & 1 deletion workspaces/mi/mi-visualizer/src/views/Diagram/Proxy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,15 @@ export const ProxyView = ({ model: ProxyModel, documentUri, diagnostics }: Proxy
setFormOpen(false);
}
}


// Show Source button handler
const handleShowSource = () => {
rpcClient.getMiVisualizerRpcClient().openView({
type: EVENT_TYPE.OPEN_VIEW,
location: { view: MACHINE_VIEW.SourceView, documentUri }
});
};

return (
<View>
{isFormOpen ?
Expand All @@ -74,6 +82,12 @@ export const ProxyView = ({ model: ProxyModel, documentUri, diagnostics }: Proxy
isOpen={isFormOpen}
/> :
<>
{/* Toolbar with Show Source button */}
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-end', gap: '8px', padding: '8px 16px' }}>
<button onClick={handleShowSource} style={{ padding: '4px 12px', fontSize: '14px', cursor: 'pointer' }}>
Show Source
</button>
</div>
<ViewHeader title={`Proxy: ${model.name}`} codicon="arrow-swap" onEdit={handleEditProxy}>
<Switch
leftLabel="Flow"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ export function APIWizard({ apiData, path }: APIWizardProps) {
}

const lastHandler = handlers[handlers.length - 1];
if (lastHandler.name === "" || lastHandler.properties.length === 0) return;
if (lastHandler.name === "") return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this change is not relevant to this PR

setValue("handlers", [...handlers, { name: "", properties: [] }], { shouldValidate: true, shouldDirty: true });
}

Expand Down