/// <summary> /// Switch what pull requests we want to view. /// </summary> /// <param name="newState">What state we want the pull requests we are looking at to be in.</param> private void SwitchPrStateView(PrState newState) { m_stateToView = newState; switch (m_stateToView) { case PrState.Actionable: m_titleText = Display.ActionableTitle; break; case PrState.Created: m_titleText = Display.CreatedTitle; break; case PrState.Drafts: m_titleText = Display.DraftsTitle; break; case PrState.SignedOff: m_titleText = Display.SignedOffTitle; break; case PrState.Waiting: m_titleText = Display.WaitingTitle; break; default: throw new NotSupportedException(m_stateToView.ToString()); } // Update the title of the window when we switch. // Window?parent = Application.Top.Subviews.FirstOrDefault() as Window; if (parent != null) { parent.Title = m_titleText; } // Force refresh the contents. // m_refreshTask.RequestRefresh(); }
/// <inheritdoc/> public async IAsyncEnumerable <PullRequestViewElement> FetchAssignedPullRequests(PrState state) { m_statistics.Reset(); await Task.CompletedTask; yield return(Fake("Fix: Validate function parameters coming from user", "Alice G.")); yield return(Fake("Docs: Use xunit branding from the website")); yield return(Fake("Docs: Update README.md with more details")); yield return(Fake("GitPullRequestExtensions: Fix null - ref bug where a PR can have no commits")); yield return(Fake("Feature: Add description view, disabled by default for now.")); yield return(Fake("DataSouce: Skip reviews that the reviewer has declined")); yield return(Fake("Docs: Try to syntax highlight config in README.md")); yield return(Fake("Docs: Update README.md")); yield return(Fake("Feature: Add 's' hot key to filter view to signedoff pull requests")); yield return(Fake("Switch build version")); yield return(Fake("Docs: Document AAD feature in README.md")); m_statistics.SignedOff = 20; m_statistics.Waiting = 2; m_statistics.Drafts = 1; OnStatisticsUpdate(); }
/// <summary> /// Retrieves pull requests from the configured data source. /// </summary> /// <returns>An async stream of <see cref="PullRequestViewElement"/></returns> public IAsyncEnumerable <PullRequestViewElement> FetchAssignedPullRequests(PrState state) { m_statistics.Reset(); return(FetchPullRequstsInternal(state)); }