Skip to content

Commit a0549fa

Browse files
committed
Updated the UI for docs Plugin
1 parent 1e15901 commit a0549fa

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

src/client/create-diagram-dialog/components/create-diagram-dialog.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ const CreateDiagramDialog = () => {
2626
useEffect(() => {
2727
const handleMessage = async (e: MessageEvent) => {
2828
const action = e.data.action;
29+
const type = e.data.type;
30+
2931
if (action === 'save') {
3032
const data = e.data.data;
3133
const metadata = new URLSearchParams({
@@ -54,6 +56,8 @@ const CreateDiagramDialog = () => {
5456
console.error('Error preparing diagram insertion', error);
5557
showAlertDialog('Error preparing diagram, please try again');
5658
}
59+
} else if (type === 'mermaid-chart-google-docs-back' && action === 'navigateBack') {
60+
handleDialogClose();
5761
}
5862
};
5963

src/client/edit-diagram-dialog/components/edit-diagram-dialog.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ const EditDiagramDialog = () => {
4545
useEffect(() => {
4646
const handleMessage = async (e: MessageEvent) => {
4747
const action = e.data.action;
48+
const type = e.data.type;
49+
4850
console.log('action', action);
4951
if (action === 'save') {
5052
const data = e.data.data;
@@ -73,6 +75,8 @@ const EditDiagramDialog = () => {
7375
console.error('Error preparing diagram update', error);
7476
showAlertDialog('Error preparing diagram update, please try again');
7577
}
78+
} else if (type === 'mermaid-chart-google-docs-back' && action === 'navigateBack') {
79+
handleDialogClose();
7680
}
7781
};
7882

src/client/select-diagram-dialog/components/select-diagram-dialog.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const SelectDiagramDialog = () => {
2626
return;
2727
}
2828
const url = buildUrl(
29-
'/app/plugins/select?pluginSource=googledocs',
29+
'/app/plugins/confluence/select?pluginSource=googledocs',
3030
authState.token
3131
);
3232
setDiagramsUrl(url);
@@ -35,6 +35,8 @@ const SelectDiagramDialog = () => {
3535
useEffect(() => {
3636
const handleMessage = async (e: MessageEvent) => {
3737
const action = e.data.action;
38+
const type = e.data.type;
39+
3840
if (action === 'save') {
3941
const data = e.data.data;
4042
const metadata = new URLSearchParams({
@@ -63,6 +65,9 @@ const SelectDiagramDialog = () => {
6365
showAlertDialog('Error preparing diagram, please try again');
6466
console.error('Error preparing diagram insertion', error);
6567
}
68+
} else if (type === 'mermaid-chart-google-docs-back' && action === 'navigateBack') {
69+
// Handle back navigation from the iframe - close the dialog
70+
handleDialogClose();
6671
}
6772
};
6873

0 commit comments

Comments
 (0)