From 54d230046704b11a5fd022deb81d925eff7c56a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Jaenisch?= Date: Sat, 15 Jun 2024 12:44:19 +0200 Subject: [PATCH] feat: include collaborators in project overview MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This shows the avatar fallback because I have no way to know the avatar in Vervis at the moment. Also no username associated, that is, I would need to look it up. Should work for getting the idea at the moment. Signed-off-by: André Jaenisch --- src/lib/components/templates/Profile.svelte | 25 +++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/lib/components/templates/Profile.svelte b/src/lib/components/templates/Profile.svelte index 5b67104..a29f4a3 100644 --- a/src/lib/components/templates/Profile.svelte +++ b/src/lib/components/templates/Profile.svelte @@ -16,6 +16,7 @@ You should have received a copy of the GNU Affero General Public License along w import { EyeClosed16, NorthStar24, + Person24, Repo24, RepoForked16, Star16, @@ -54,6 +55,15 @@ You should have received a copy of the GNU Affero General Public License along w * Allow for linking stories in Storybook. */ export let sb = ''; + + /* Since I fetch collaborators for every following I need to filter. */ + const mapCollaboratorsToMember = function (collaborators, associatedProject) { + const candidates = collaborators.filter((collaborator) => { + return collaborator.context === associatedProject; + }); + + return candidates.map((candidate) => candidate.items).flat(1); + };
@@ -104,6 +114,16 @@ You should have received a copy of the GNU Affero General Public License along w
{following.name} + +
    + {#each mapCollaboratorsToMember(data.user.collaboratorsMap, following.id) as member} +
  • +
    + +
    +
  • + {/each} +
@@ -153,6 +173,11 @@ You should have received a copy of the GNU Affero General Public License along w

These are the contents of the items in the previous dump.

{JSON.stringify(data.user.followingsMap, null, 2)}
+
+ Collaborators mapped +

These are the contents of the items in the previous dump.

+
{JSON.stringify(data.user.collaboratorsMap, null, 2)}
+
{/if} {:else}