OfficeDev / TeamsFx

Developer tools for building Teams apps
Other
427 stars 165 forks source link

.NET 8 Teams Tab Config Save button never registered #11142

Closed kylejuliandev closed 2 weeks ago

kylejuliandev commented 1 month ago

Describe the bug .NET 8 Teams Tab Config Save button never registered. I believe this is to do with the new Blazor Rendering mode(s) that have come in .NET 8. The template(s) do not specify a rendering mode on TabConfig.cs (see Template code), but when I specify a rendermode of InteractiveServer the Save button is registered. I'm not sure I fully understand it myself, still getting my head round the rendermodes.

To Reproduce Steps to reproduce the behavior:

  1. Follow documentation on creating Personal Tab project
  2. Debug the Tab app in Visual Studio
  3. Click the Add to a chat button
  4. Enter the name of the Person or Chat you want to add the Personal tab too
  5. Click the Set up a tab button
  6. The Save button is disabled

Expected behavior Save button to be registered and Tab set up as expected.

Screenshots

Add Tab Application to Chat

Add Custom Tab Application to Teams Chat

Set up a tab

Set up a tab

Save button remains unregistered and disabled

Save button remains unregistered and disabled

microsoft-github-policy-service[bot] commented 1 month ago

Thank you for contacting us! Any issue or feedback from you is quite important to us. We will do our best to fully respond to your issue as soon as possible. Sometimes additional investigations may be needed, we will usually get back to you within 2 days by adding comments to this issue. Please stay tuned.

kylejuliandev commented 1 month ago

Additionally, I had to adjust the ContentUrl and WebsiteUrl to avoid duplicate slashes.

protected override async Task OnAfterRenderAsync(bool firstRender)
{
    if (firstRender)
    {
        var settings = new TeamsInstanceSettings
        {
            SuggestedDisplayName = "Tab",
            EntityId = _entityId.ToString(),
            ContentUrl = $"{NavigationManager.BaseUri}tab",
            WebsiteUrl = $"{NavigationManager.BaseUri}tab"
        };

        await MicrosoftTeams.InitializeAsync();
        await MicrosoftTeams.RegisterOnSaveHandlerAsync(settings);
    }
}
Yimin-Jin commented 1 month ago

Your suggestion of setting the rendermode explicitly as InteractiveServer is feasible. We will fix this issue along with the additional "/" problem you mentioned. Thank you for bringing these to our attention.