diff --git a/eslint.config.ts b/eslint.config.ts index 07ee0531006a9..ed2bc6524584b 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -924,6 +924,7 @@ export default defineConfig([ 'vue/html-closing-bracket-spacing': [2, {startTag: 'never', endTag: 'never', selfClosingTag: 'never'}], 'vue/max-attributes-per-line': [0], 'vue/singleline-html-element-content-newline': [0], + 'vue/require-typed-ref': [2], }, }, { diff --git a/web_src/js/components/ContextPopup.vue b/web_src/js/components/ContextPopup.vue index aebfaa5d26fc0..31db902adce96 100644 --- a/web_src/js/components/ContextPopup.vue +++ b/web_src/js/components/ContextPopup.vue @@ -3,6 +3,7 @@ import {SvgIcon} from '../svg.ts'; import {GET} from '../modules/fetch.ts'; import {getIssueColor, getIssueIcon} from '../features/issue.ts'; import {computed, onMounted, shallowRef} from 'vue'; +import type {Issue} from '../types.ts'; const props = defineProps<{ repoLink: string, @@ -10,9 +11,9 @@ const props = defineProps<{ }>(); const loading = shallowRef(false); -const issue = shallowRef(null); +const issue = shallowRef(null); const renderedLabels = shallowRef(''); -const errorMessage = shallowRef(null); +const errorMessage = shallowRef(''); const createdAt = computed(() => { return new Date(issue.value.created_at).toLocaleDateString(undefined, {year: 'numeric', month: 'short', day: 'numeric'}); @@ -25,7 +26,7 @@ const body = computed(() => { onMounted(async () => { loading.value = true; - errorMessage.value = null; + errorMessage.value = ''; try { const resp = await GET(props.loadIssueInfoUrl); if (!resp.ok) { diff --git a/web_src/js/types.ts b/web_src/js/types.ts index 56d6c56d13433..31f41766e7a7d 100644 --- a/web_src/js/types.ts +++ b/web_src/js/types.ts @@ -52,14 +52,20 @@ export type IssuePageInfo = { }; export type Issue = { - id: number; - number: number; - title: string; - state: 'open' | 'closed'; + id: number, + number: number, + title: string, + body: string, + state: 'open' | 'closed', + created_at: string, pull_request?: { draft: boolean; merged: boolean; - }; + }, + repository: { + full_name: string, + }, + labels: Array, }; export type FomanticInitFunction = {