From f66b046e1bb7994d0a9798ff6530d3d7d3fcc7a7 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 4 Apr 2023 14:53:07 +0800 Subject: [PATCH 1/5] Change brokenLinkMixin to accept undefined as well --- frontend/src/mixin/brokenLinkMixin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/mixin/brokenLinkMixin.ts b/frontend/src/mixin/brokenLinkMixin.ts index 2a7714647c..cda35dbb3c 100644 --- a/frontend/src/mixin/brokenLinkMixin.ts +++ b/frontend/src/mixin/brokenLinkMixin.ts @@ -7,10 +7,10 @@ export default defineComponent({ }; }, methods: { - isBrokenLink(link: string) { + isBrokenLink(link: string | undefined) { return link === undefined; }, - getLinkMessage(link: string, linkMessage: string): string { + getLinkMessage(link: string | undefined, linkMessage: string): string { if (this.isBrokenLink(link)) { return this.disabledLinkMessage; } From ad1b25ca33083ce4bcb0aac1dfcfc8efad3c59e8 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 4 Apr 2023 14:53:45 +0800 Subject: [PATCH 2/5] Fix mistake in window.getAuthorDisplayName type definition --- frontend/src/types/window.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/types/window.ts b/frontend/src/types/window.ts index a8a338d68b..8180527408 100644 --- a/frontend/src/types/window.ts +++ b/frontend/src/types/window.ts @@ -62,7 +62,7 @@ declare global { getBlameLink: (repoId: string, branch: string, filepath: string) => string | undefined; getHistoryLink: (repoId: string, branch: string, filepath: string) => string | undefined; getGroupName: (group: UserType[], filterGroupSelection: string) => string; - getAuthorDisplayName: (authorRepos: Repo[]) => string; + getAuthorDisplayName: (authorRepos: UserType[]) => string; api: Api; sinceDate: string; untilDate: string; From 7417d33892f4ab22ad8b92d8e69831005508d957 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 4 Apr 2023 14:54:11 +0800 Subject: [PATCH 3/5] Migrate c-summary-charts to TypeScript --- frontend/src/components/c-summary-charts.vue | 138 +++++++++++-------- 1 file changed, 78 insertions(+), 60 deletions(-) diff --git a/frontend/src/components/c-summary-charts.vue b/frontend/src/components/c-summary-charts.vue index 6a089ddcb4..c52579608e 100644 --- a/frontend/src/components/c-summary-charts.vue +++ b/frontend/src/components/c-summary-charts.vue @@ -181,13 +181,18 @@ ) - From cf588da7d440c83ec41099bd669c66de63654cff Mon Sep 17 00:00:00 2001 From: vvidday Date: Fri, 7 Apr 2023 15:59:24 +0800 Subject: [PATCH 4/5] Add console statement in getBaseTarget branch --- frontend/src/components/c-summary-charts.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/c-summary-charts.vue b/frontend/src/components/c-summary-charts.vue index 6dd2389a01..2ebf24ba72 100644 --- a/frontend/src/components/c-summary-charts.vue +++ b/frontend/src/components/c-summary-charts.vue @@ -489,7 +489,9 @@ export default defineComponent({ getBaseTarget(target: HTMLElement | null): HTMLElement | null { if (!target) { - // Should never reach here + // Should never reach here - function assumes that target is a child of the div with class 'summary-chart__ramp' + console.error('Error: The getBaseTarget function in c-summary-charts.vue has been called on an element that is ' + + 'not a child of the div with class summary-chart__ramp. This might affect the drag view functionality.'); return null; } return target.className === 'summary-chart__ramp' From de929b955e88354c5c5ed9555d1915c8de9666f3 Mon Sep 17 00:00:00 2001 From: David Ong <45852430+vvidday@users.noreply.github.com> Date: Fri, 7 Apr 2023 16:45:43 +0800 Subject: [PATCH 5/5] Change type to primitive string Co-authored-by: Charisma Kausar <68203159+ckcherry23@users.noreply.github.com> --- frontend/src/components/c-summary-charts.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/c-summary-charts.vue b/frontend/src/components/c-summary-charts.vue index 2ebf24ba72..8b7b0cde4f 100644 --- a/frontend/src/components/c-summary-charts.vue +++ b/frontend/src/components/c-summary-charts.vue @@ -200,7 +200,7 @@ export default defineComponent({ mixins: [brokenLinkDisabler], props: { checkedFileTypes: { - type: Array, + type: Array, required: true, }, filtered: {