Feature: Pair Categories (#35)

* Feature/pair categories re (#1)

Implemented pair categories:
- Paired users can now get tags
- Tags get rendered into the main UI as groups
- Tags are persistently stored on the local configuration

* Added multi-server capabilities and cleaned up code

- Tags and available tags are stored per API url
- Added a few tooltips

* Renamed both dictionary to reflect the fact that they are per-server dictionaries

* Swapped icons and no longer renders groups that are empty after filter
This commit is contained in:
Nia292
2023-01-22 10:21:36 +01:00
committed by GitHub
parent 05aa350c34
commit 115960262a
6 changed files with 529 additions and 19 deletions

View File

@@ -4,8 +4,10 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using MareSynchronos.API;
using MareSynchronos.Utils;
using MareSynchronos.WebAPI;
using Microsoft.Extensions.Primitives;
namespace MareSynchronos;
@@ -85,6 +87,20 @@ public class Configuration : IPluginConfiguration
public Dictionary<string, Dictionary<string, string>> GidServerComments { get; set; } = new(StringComparer.Ordinal);
public Dictionary<string, string> UidComments { get; set; } = new(StringComparer.Ordinal);
/// <summary>
/// Each paired user can have multiple tags. Each tag will create a category, and the user will
/// be displayed into that category.
/// The dictionary first maps a server URL to a dictionary, and that
/// dictionary maps the OtherUID of the <see cref="ClientPairDto"/> to a list of tags.
/// </summary>
public Dictionary<string, Dictionary<string, List<string>>> UidServerPairedUserTags = new(StringComparer.Ordinal);
/// <summary>
/// A dictionary that maps a server URL to the tags the user has added for that server.
/// </summary>
public Dictionary<string, HashSet<string>> ServerAvailablePairTags = new(StringComparer.Ordinal);
public HashSet<string> OpenPairTags = new(StringComparer.Ordinal);
public int Version { get; set; } = 5;
public bool ShowTransferWindow { get; set; } = true;