[Feature] GraphPresenter should react to global provider state changes
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- csharp
- Lĩnh vực
- authentication, frontend
Hướng nghiên cứu
Bắt đầu với control GraphPresenter và phần xử lý RequestBuilder của nó, sau đó kiểm tra các sự kiện provider và provider-state của ProviderManager được sử dụng trong ví dụ MailMessagesSample. Theo dõi điều gì xảy ra khi provider thay đổi hoặc bị đăng xuất; được xem là hoàn tất khi control vẫn hoạt động sau các thay đổi đăng nhập và không hiển thị nội dung khi đã đăng xuất.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the problem this feature would solve
The GraphPresenter requires an IBaseRequestBuilder implementation to determine what data to fetch from Graph. We don't currently have a good way to define the RequestBuilder property in XAML, so this must be done from code. The problem is that if the provider state changes after the RequestBuilder property is set, the GraphPresenter will fail. The way to fix this is to nullify the RequestBuilder, and then re-set it.
Describe the solution
Update the GraphPresenter to listen for changes in the global provider state, and do whatever is required to keep the control functional after a login change.
The GraphPresenter should not display any content if the global provider is not signed in.
Describe alternatives you've considered
None
Additional context & Screenshots
All of this code is required to support a single instance of the GraphPresenter control:
namespace SampleTest.Samples.GraphPresenter
{
public sealed partial class MailMessagesSample : Page
{
public IBaseRequestBuilder MessagesRequestBuilder { get; set; }
public MailMessagesSample()
{
this.InitializeComponent();
ProviderManager.Instance.ProviderUpdated += OnProviderUpdated;
ProviderManager.Instance.ProviderStateChanged += OnProviderStateChanged;
}
private void OnProviderUpdated(object sender, IProvider provider)
{
if (provider == null)
{
ClearRequestBuilders();
}
}
private void OnProviderStateChanged(object sender, ProviderStateChangedEventArgs e)
{
if (e.NewState == ProviderState.SignedIn)
{
var graphClient = ProviderManager.Instance.GlobalProvider.GetClient();
MessagesRequestBuilder = graphClient.Me.Messages;
}
else
{
ClearRequestBuilders();
}
}
private void ClearRequestBuilders()
{
MessagesRequestBuilder = null;
}
}
}
<controls:GraphPresenter
IsCollection="True"
RequestBuilder="{x:Bind MessagesRequestBuilder, Mode=OneWay}"
ResponseType="graph:Message">
<controls:GraphPresenter.ContentTemplate>
<DataTemplate>
...
</DataTemplate>
</controls:GraphPresenter.ContentTemplate>
</controls:GraphPresenter>
- Ngôn ngữ chính
- C#
- Star
- 156
- Fork
- 37
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CommunityToolkit/Graph-Controls
-
bug :bug:
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
CommunityToolkit/Graph-Controls#211 · 3 bình luận ·
-
CommunityToolkit.Authentication.Msal use Microsoft Graph V4 but if you install V5,you cannot releaseĐang mởbug :bug: needs attention :wave: needs triage :mag:
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
CommunityToolkit/Graph-Controls#208 · 20 bình luận ·
-
enhancement :sparkles:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
-
Area: Providers
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
CommunityToolkit/Graph-Controls#195 · 1 bình luận ·
-
Area: Providers bug :bug:
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
CommunityToolkit/Graph-Controls#189 · 3 bình luận ·
Tất cả issue của CommunityToolkit/Graph-Controls
Issue tương tự
-
[Core] IPlatformServices.PrefersDarkTheme: the desktop's theme as the signed-in user sees itĐang mởarea: core bug help wanted ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
ZaidX88/sluice#265 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: remote bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Install a C# EnvironmentĐang mở📅 Sprint 4 Module-Tools Setup Submit:None 🦔 Size Tiny
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
CodeYourFuture/Module-Tools#712 ·
-
A: Mapping P3: Standard T: New Feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
space-wizards/space-station-14#46878 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 60/100
CommunityToolkit/Windows#896 · 2 bình luận ·