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

Improved Task Card List Test Scene #462

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using i5.VIAProMa.UI.ListView.Issues;
using System;
using i5.VIAProMa.UI.ListView.Issues;
using i5.VIAProMa.UI.MultiListView.Core;
using i5.VIAProMa.Utilities;
using Microsoft.MixedReality.Toolkit.UI;
Expand Down Expand Up @@ -51,10 +52,16 @@ public void OpenIssueList()
{
listWindow.SetActive(true);
UIEnabled = false;
reloadIssueList();
visualization.ContentProvider.ContentChanged += OnContentChanged;
ReloadIssueList();
}

public void reloadIssueList()
private void OnContentChanged(object sender, EventArgs e)
{
ReloadIssueList();
}

private void ReloadIssueList()
{
var issues = visualization.ContentProvider.Issues;
var issueViewList = listWindow.GetComponent(typeof(IssuesMultiListView)) as IssuesMultiListView;
Expand All @@ -78,6 +85,7 @@ public void reloadIssueList()

public void CloseIssueList()
{
visualization.ContentProvider.ContentChanged -= OnContentChanged;
UIEnabled = true;
listWindow.SetActive(false);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
using System.Collections;
using System.Collections.Generic;
using i5.VIAProMa.DataModel.API;
using i5.VIAProMa.Visualizations;
using i5.VIAProMa.Visualizations.Competence;
using UnityEngine;

public class ListTaskCardTestRunner : MonoBehaviour
namespace Tests.Visualizations.ListTaskCards
{
[Range(1, 10)] public int[] simulatedIssues;
public Visualization visualizations;

void Update()
public class ListTaskCardTestRunner : MonoBehaviour
{
if (Input.GetKeyDown(KeyCode.F5))
private const int SimulatedIssuesCount = 1;
[SerializeField] private Visualization[] visualizations;

private void Update()
{
for (int i = 0; i < simulatedIssues.Length; i++)
if (!Input.GetKeyDown(KeyCode.F5)) return;
foreach (var visualization in visualizations)
{
var issue = new Issue(DataSource.GITHUB, -1, "Test", "A test", 0, null, IssueStatus.CLOSED, "", "", null, null);
visualizations.ContentProvider.Issues.Add(issue);
visualization.ContentProvider.SelectContent();

for (var i = 0; i < SimulatedIssuesCount; i++)
{
var issue = new Issue(DataSource.GITHUB, -1, "Test", "A test", 0, null, IssueStatus.CLOSED, "", "",
null, null);
visualization.ContentProvider.Issues.Add(issue);
}

visualization.ContentProvider.EndContentSelection();
}
}
}
Expand Down
Loading