Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content in the custom dialog box #145

Open
AlekhyaYalla opened this issue Jul 10, 2023 · 1 comment
Open

Content in the custom dialog box #145

AlekhyaYalla opened this issue Jul 10, 2023 · 1 comment

Comments

@AlekhyaYalla
Copy link

I'm trying to create a custom dialog box. How do I specify the content in the box through configuration.
I know about the method .openMessageDialog. But I want to use custom dialog box.
Below is my code for the
typescript```

    const dialogOptions: IDialogOptions<string> = {
        title: "Codespaces Extension",
        configuration: {
            message: _message,
            showCancel: _showCancel,
        },
        lightDismiss: false,
    };
    const dialogResult = await dialogSVC.openCustomDialog(contentContributionId, dialogOptions);
How does it identify the message in the content
@karelkral
Copy link

You must register your dialog as the separate extension and then use name of this extension when calling openCustomDialog. See example for azure devops extension, Hub.tsx. Here is the name of extension "panel-content".

private async onCustomPromptClick(): Promise<void> {
    const dialogService = await SDK.getService<IHostPageLayoutService>(CommonServiceIds.HostPageLayoutService);
    dialogService.openCustomDialog<boolean | undefined>(SDK.getExtensionContext().id + ".panel-content", {
        title: "Custom dialog",
        configuration: {
            message: "Use compact pivots?",
            initialValue: this.state.useCompactPivots
        },
        onClose: (result) => {
            if (result !== undefined) {
                this.setState({ useCompactPivots: result });
            }
        }
    });
}

Registration of dialog content in vss-extension.json:

{
"contributions": [
{
"id": "panel-content",
"type": "ms.vss-web.external-content",
"properties": {
"uri": "dist/Panel/Panel.html"
}
}
]
}

ghost referenced this issue Jul 15, 2023
Removing node-sass and request package and adding sass instead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants