From d22e41acb970a3b47cfb8f8d1add33722f122d54 Mon Sep 17 00:00:00 2001
From: dseydel
Date: Tue, 3 Jan 2023 12:58:19 +0100
Subject: [PATCH] Add Issue List
---
src/components/IssueCard.vue | 61 ++++++++++++++++++++++++++++++++++++
src/pages/ItemPage.vue | 29 ++++++++++++++++-
2 files changed, 89 insertions(+), 1 deletion(-)
create mode 100644 src/components/IssueCard.vue
diff --git a/src/components/IssueCard.vue b/src/components/IssueCard.vue
new file mode 100644
index 0000000..72784e1
--- /dev/null
+++ b/src/components/IssueCard.vue
@@ -0,0 +1,61 @@
+
+
+
+
+
+ Issue #{{issue.number}}
+ {{issue.title}}
+
+
+
+ {{label.name}}
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/ItemPage.vue b/src/pages/ItemPage.vue
index cb1a933..c5f6d87 100644
--- a/src/pages/ItemPage.vue
+++ b/src/pages/ItemPage.vue
@@ -69,7 +69,14 @@
Du kannst Fragen und Vorschläge auch auf unserem Discord-Server loswerden.
-
+
+
Issues
+
+
+
+
+
+
@@ -88,8 +95,10 @@ import MarkdownDisplay from "@/components/MarkdownDisplay.vue"
import ItemSummary from "@/components/ItemSummary.vue"
import DownloadModal from "@/components/DownloadModal.vue"
import {event} from "vue-gtag";
+import IssueCard from "@/components/IssueCard.vue";
const item = ref(null)
+const issues = ref(null)
const route = useRoute()
async function fetchItem() {
@@ -99,11 +108,29 @@ async function fetchItem() {
)
item.value = await res.json()
+ await fetchIssues();
+
event('visit-storage-item', {
event_label: item.value.names[0].value
})
}
+async function fetchIssues(){
+ issues.value = null
+
+ let REST_URL = "https://api.github.com/repos"
+ // Remove github prefix for getting the project path
+ let projectPath = item.github_url.replace("https://github.com/", "");
+
+ // Only request currently opened issues
+ const res = await fetch(
+ `${REST_URL}/${projectPath}/issues?state=open`
+ )
+
+ issues.value = await res.json()
+ console.log(issues.value)
+}
+
fetchItem()