Skip to content

Commit f6f0919

Browse files
authored
[#2478] Fix frontend display bugs (#2479)
Fix bugs in displaying blurb contents for individual charts There is an inconsistency between frontend and backend on the parsing of the summary.json. Let's standardize how two parts should be interacting with each other.
1 parent 987bc86 commit f6f0919

File tree

10 files changed

+13
-13
lines changed

10 files changed

+13
-13
lines changed

config/chart-blurbs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
https://github.com/reposense/testrepo-Alpha/tree/master|nbriannl
1+
https://github.com/reposense/testrepo-Beta/tree/add-config-json|nbriannl
22
Test for chart-blurbs.md

frontend/src/app.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const app = defineComponent({
124124
names,
125125
repoBlurbMap,
126126
authorBlurbMap,
127-
chartsBlurbMap
127+
chartBlurbMap
128128
} = summary;
129129
this.creationDate = creationDate;
130130
this.reportGenerationTime = reportGenerationTime;
@@ -139,7 +139,7 @@ const app = defineComponent({
139139
this.userUpdated = true;
140140
this.$store.commit('setRepoBlurbMap', repoBlurbMap);
141141
this.$store.commit('setAuthorBlurbMap', authorBlurbMap);
142-
this.$store.commit('setChartsBlurbMap', chartsBlurbMap);
142+
this.$store.commit('setChartsBlurbMap', chartBlurbMap);
143143
} catch (error) {
144144
window.alert(error);
145145
} finally {

frontend/src/components/c-summary-charts.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ export default defineComponent({
10371037
10381038
getChartBlurb(userName: string, repo: User) : string {
10391039
const link = this.getRepoLink(repo);
1040-
const blurb: string | undefined = this.$store.state.chartsBlurbMap[`${link}|${userName}`]
1040+
const blurb: string | undefined = this.$store.state.chartBlurbMap[`${link}|${userName}`]
10411041
if (!blurb) {
10421042
return '';
10431043
}

frontend/src/store/store.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default createStore<StoreState>({
2020
isTabActive: true,
2121
repoBlurbMap: {},
2222
authorBlurbMap: {},
23-
chartsBlurbMap: {}
23+
chartBlurbMap: {}
2424
} as StoreState,
2525

2626
mutations: {
@@ -96,7 +96,7 @@ export default createStore<StoreState>({
9696
state.tabAuthorshipInfo.isRefresh = b;
9797
},
9898
setChartsBlurbMap(state: StoreState, map: {[key: string]: string} | undefined) {
99-
state.chartsBlurbMap = map ?? {};
99+
state.chartBlurbMap = map ?? {};
100100
}
101101
},
102102
actions: {

frontend/src/types/vuex.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ interface StoreState {
4949
isTabActive: boolean;
5050
repoBlurbMap: { [key: string]: string };
5151
authorBlurbMap: { [key: string]: string };
52-
chartsBlurbMap: { [key: string]: string };
52+
chartBlurbMap: { [key: string]: string };
5353
}
5454

5555
declare module '@vue/runtime-core' {

frontend/src/types/window.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ interface Api {
2626
names: string[],
2727
repoBlurbMap: { [key: string]: string },
2828
authorBlurbMap: {[key: string]: string} | undefined,
29-
chartsBlurbMap: {[key: string]: string} | undefined,
29+
chartBlurbMap: {[key: string]: string} | undefined,
3030
} | null>;
3131
loadCommits: (repoName: string, defaultSortOrder: number) => Promise<User[]>;
3232
loadAuthorship: (repoName: string) => Promise<AuthorshipSchema>;

frontend/src/types/zod/summary-type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const summarySchema = z.object({
5353
authorBlurbs: z.object({
5454
blurbMap: z.record(z.string(), z.string())
5555
}).optional(),
56-
chartsBlurbs: z.object({
56+
chartBlurbs: z.object({
5757
blurbMap: z.record(z.string(), z.string())
5858
}).optional(),
5959
isPortfolio: z.boolean(),

frontend/src/utils/api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,15 +239,15 @@ window.api = {
239239

240240
const repoBlurbMap: { [key: string]: string } = data.repoBlurbs.blurbMap;
241241
const authorBlurbMap: {[key: string]: string} | undefined = data.authorBlurbs?.blurbMap;
242-
const chartsBlurbMap: {[key: string]: string} | undefined = data.chartsBlurbs?.blurbMap;
242+
const chartBlurbMap: {[key: string]: string} | undefined = data.chartBlurbs?.blurbMap;
243243
return {
244244
creationDate: reportGeneratedTime,
245245
reportGenerationTime,
246246
errorMessages,
247247
names,
248248
repoBlurbMap,
249249
authorBlurbMap,
250-
chartsBlurbMap
250+
chartBlurbMap
251251
};
252252
},
253253

src/systemtest/resources/LocalRepoSystemTest/testRelativePathing/summary.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
},
5454
"chartBlurbs": {
5555
"blurbMap": {
56-
"https://github.com/reposense/testrepo-Alpha/tree/master|nbriannl":"Test for chart-blurbs.md"
56+
"https://github.com/reposense/testrepo-Beta/tree/add-config-json|nbriannl":"Test for chart-blurbs.md"
5757
}
5858
},
5959
"isPortfolio": false

src/systemtest/resources/LocalRepoSystemTest/testSameFinalDirectory/summary.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
},
6767
"chartBlurbs": {
6868
"blurbMap": {
69-
"https://github.com/reposense/testrepo-Alpha/tree/master|nbriannl":"Test for chart-blurbs.md"
69+
"https://github.com/reposense/testrepo-Beta/tree/add-config-json|nbriannl":"Test for chart-blurbs.md"
7070
}
7171
},
7272
"isPortfolio": false

0 commit comments

Comments
 (0)