-
Notifications
You must be signed in to change notification settings - Fork 167
/
Copy pathc-home.vue
180 lines (169 loc) · 5.06 KB
/
c-home.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<template lang="pug">
#home
template(v-if="userUpdated")
c-resizer
template(#left)
#summary-wrapper
c-title(ref="cTitle")
c-summary.tab-padding(
v-if="!isPortfolio",
ref="summary",
:repos="users",
:error-messages="errorMessages"
)
c-summary-portfolio.tab-padding(
v-else,
ref="summary",
:repos="users",
:error-messages="errorMessages"
)
.timestamp-footer
span Generated by
a(
:href="getSpecificCommitLink()", target="_blank"
)
strong this version
span of
a(
:href="getRepoSenseHomeLink()", target="_blank"
)
strong RepoSense
span (
a(
:href="getUserGuideLink()", target ="_blank"
)
strong User Guide
span ) on {{ creationDate }}
.report-generation-time(style="display: none;")
span {{ reportGenerationTime }}
template(#right)
#tabs-wrapper(ref="tabWrapper")
.tab-content.panel-padding
.tab-pane
c-authorship#tab-authorship(v-if="tabType === 'authorship'")
c-zoom#tab-zoom(v-else-if="tabType === 'zoom'")
#tab-empty(v-else)
.title
h2 Welcome to this RepoSense report!
p The charts on the left show the contribution activities, grouped by repository and author.
p
| To view the code attributed to a specific author, click the
font-awesome-icon(icon="code")
| icon next to that author's name.
br
| To view the breakdown of commits made by a specific author, click the
font-awesome-icon(icon="list-ul")
| icon next to that author's name.
br
| To hide the code view and show only the activity charts, click the
font-awesome-icon(icon="caret-right")
| icon on the centre divider.
p
| See the
a(
:href="getUsingReportsUserGuideLink()", target="_blank"
)
strong User Guide
| to get a better understanding of how to interpret the report.
template(v-else)
.empty Please upload a .zip file generated by RepoSense.
form#file-upload(onsubmit="return false;")
input(type="file", accept=".zip", @change="updateReportZip")
</template>
<script lang='ts'>
import { defineComponent } from 'vue';
import cTitle from '../components/c-title.vue';
import cResizer from '../components/c-resizer.vue';
import cZoom from './c-zoom.vue';
import cSummary from './c-summary.vue';
import cSummaryPortfolio from './c-summary-portfolio.vue';
import cAuthorship from './c-authorship.vue';
const home = defineComponent({
name: 'c-home',
components: {
cTitle,
cResizer,
cZoom,
cSummary,
cSummaryPortfolio,
cAuthorship,
},
props: {
updateReportZip: {
type: Function,
required: true,
},
repos: {
type: Object,
required: true,
},
users: {
type: Array<Repo>,
required: true,
},
userUpdated: {
type: Boolean,
required: true,
},
loadingOverlayOpacity: {
type: Number,
required: true,
},
tabType: {
type: String,
required: true,
},
creationDate: {
type: String,
required: true,
},
reportGenerationTime: {
type: String,
required: true,
},
errorMessages: {
type: Object,
required: true,
},
},
computed: {
isPortfolio(): boolean {
return window.isPortfolio;
}
},
methods: {
getRepoSenseHomeLink(): string {
const version = window.repoSenseVersion;
if (!version) {
return `${window.HOME_PAGE_URL}/RepoSense/`;
}
return `${window.HOME_PAGE_URL}`;
},
getSpecificCommitLink(): string {
const version = window.repoSenseVersion;
if (!version) {
return `${window.REPOSENSE_REPO_URL}`;
}
if (version.startsWith('v')) {
return `${window.REPOSENSE_REPO_URL}/releases/tag/${version}`;
}
return `${window.REPOSENSE_REPO_URL}/commit/${version}`;
},
getUserGuideLink(): string {
const version = window.repoSenseVersion;
if (!version) {
return `${window.HOME_PAGE_URL}/RepoSense/ug/index.html`;
}
return `${window.HOME_PAGE_URL}/ug/index.html`;
},
getUsingReportsUserGuideLink(): string {
const version = window.repoSenseVersion;
if (!version) {
return `${window.HOME_PAGE_URL}/RepoSense/ug/usingReports.html`;
}
return `${window.HOME_PAGE_URL}/ug/usingReports.html`;
},
},
});
export default home;
</script>