feat: include collaborators in project overview

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 <andre.jaenisch@posteo.de>
This commit is contained in:
André Jaenisch 2024-06-15 12:44:19 +02:00
parent 0581a55c92
commit 54d2300467
No known key found for this signature in database
GPG key ID: 5A668E771F1ED854

View file

@ -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);
};
</script>
<section class="w-full mx-auto flex px-8 pt-8">
@ -104,6 +114,16 @@ You should have received a copy of the GNU Affero General Public License along w
<div class="flex -ms-10">
<Repo24 fill="currentColor" />
{following.name}
<!-- Members -->
<ul class="ms-2 gap-4">
{#each mapCollaboratorsToMember(data.user.collaboratorsMap, following.id) as member}
<li title={member.object}>
<div class="bg-surface-500 text-white rounded-full">
<Person24 fill="currentColor" />
</div>
</li>
{/each}
</ul>
</div>
<!-- Description -->
<!-- Compensate padding with negative margin -->
@ -153,6 +173,11 @@ You should have received a copy of the GNU Affero General Public License along w
<p>These are the contents of the items in the previous dump.</p>
<pre>{JSON.stringify(data.user.followingsMap, null, 2)}</pre>
</details>
<details>
<summary>Collaborators mapped</summary>
<p>These are the contents of the items in the previous dump.</p>
<pre>{JSON.stringify(data.user.collaboratorsMap, null, 2)}</pre>
</details>
{/if}
</div>
{:else}