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}