Skip to content

Commit 92818ee

Browse files
authored
Fix OSS graph display (#1841)
1 parent 70fa5be commit 92818ee

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

frontend/src/modules/member/components/view/member-view-contributions.vue

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,29 +68,29 @@
6868
}"
6969
:style="{ ...tooltipPos, opacity: tooltipOpacity }"
7070
>
71-
<div class="section border-b mx-4">
71+
<div class="section mx-4">
7272
<p class="key">
7373
Repository
7474
</p>
7575
<p class="break-words font-medium text-black">
7676
{{ nodes[targetNodeId]?.fullName ?? '' }}
7777
</p>
7878
</div>
79-
<div class="section border-b mx-4">
79+
<div class="section border-t mx-4">
8080
<p class="key">
8181
Contributions
8282
</p>
8383
<p class="text-sm text-gray-900">
8484
{{ nodes[targetNodeId]?.numberCommits ?? '' }}
8585
</p>
8686
</div>
87-
<div class="section ml-4">
87+
<div v-if="nodes[targetNodeId]?.topics?.length" class="section ml-4 border-t">
8888
<p class="key">
8989
Topics
9090
</p>
9191
<div class="flex flex-wrap h-24 overflow-y-scroll pr-4">
9292
<div
93-
v-for="topic in nodes[targetNodeId]?.topics ?? []"
93+
v-for="topic in nodes[targetNodeId].topics"
9494
:key="topic"
9595
class="topic"
9696
>
@@ -321,7 +321,7 @@ const nodes = computed(() => {
321321
nodeList[name].size = size;
322322
nodeList[name].numberCommits += contribution.numberCommits;
323323
nodeList[name].topics = [
324-
...new Set([...nodeList[name].topics, ...contribution.topics]),
324+
...new Set([...(nodeList[name].topics || []), ...(contribution.topics || [])]),
325325
];
326326
}
327327
});
@@ -341,13 +341,16 @@ const edges = computed(() => {
341341
props.contributions.forEach((contribution) => {
342342
// Extract the name of the contribution from the URL
343343
const name = contribution.url.split('/').pop();
344-
contribution.topics.forEach((topic) => {
345-
if (!topicMap[topic]) {
346-
topicMap[topic] = [name];
347-
} else {
348-
topicMap[topic].push(name);
349-
}
350-
});
344+
345+
if (contribution.topics) {
346+
contribution.topics.forEach((topic) => {
347+
if (!topicMap[topic]) {
348+
topicMap[topic] = [name];
349+
} else {
350+
topicMap[topic].push(name);
351+
}
352+
});
353+
}
351354
});
352355
353356
// Next, the topics in the topicMap are iterated over and for each topic,
@@ -542,7 +545,7 @@ const eventHandlers = {
542545
};
543546
</script>
544547
545-
<style lang="css" scoped>
548+
<style lang="scss" scoped>
546549
.tooltip {
547550
top: 0;
548551
left: 0;

0 commit comments

Comments
 (0)