55 </div >
66 <div class =" sort-section" >
77 <h6 class =" text-xs font-bold pb-2" >Period:</h6 >
8- <div class =" flex lg:flex-col" >
8+ <div class =" flex lg:flex-col gap-1 " >
99 <PeriodDropdown />
1010 </div >
1111 </div >
1212 <div class =" sort-section has-border" >
1313 <h6 class =" text-xs font-bold pb-2" >Sort by:</h6 >
14- <div class =" flex lg:flex-col" >
14+ <div class =" flex lg:flex-col gap-1 " >
1515 <RadioButton
1616 class =" lg:pb-1"
1717 :input-id =" `score`"
2424 />
2525 <RadioButton
2626 class =" pb-2 contributions-radio"
27- :input-id =" `commits `"
27+ :input-id =" `contributions `"
2828 :input-name =" `sortby`"
29- :label-for =" `commits `"
30- :label-text =" `Commits `"
31- :value =" 'commit '"
29+ :label-for =" `contributions `"
30+ :label-text =" `Contributions `"
31+ :value =" 'contributions '"
3232 @on-sort-by-changed =" onSortByChanged"
3333 />
3434 </div >
3535 </div >
3636 <div class =" sort-section has-border" >
3737 <h6 class =" text-xs font-bold pb-2" >Show:</h6 >
38- <div class =" flex lg:flex-col" >
38+ <div class =" flex lg:flex-col gap-1 " >
3939 <RadioButton
4040 class =" lg:pb-1"
4141 :input-id =" `all`"
5959 </div >
6060 <div class =" sort-section" >
6161 <h6 class =" text-xs font-bold pb-2" >Count:</h6 >
62- <div class =" flex lg:flex-col" >
63- <CheckBox
62+ <div class =" flex lg:flex-col justify-between gap-1" >
63+ <div class =" flex" >
64+ <RadioButton
65+ class =" lg:pb-1"
66+ :input-id =" `all contributions`"
67+ :input-name =" `count`"
68+ :label-for =" `all contributions`"
69+ :label-text =" `All Contributions`"
70+ :checked =" true"
71+ :value =" 'all'"
72+ @on-count-type-changed =" onCountTypeChanged"
73+ />
74+ <div class =" tooltip" >
75+ <span class =" text-sm font-bold cursor-pointer px-1 blue-green" >
76+ ⓘ ;
77+ </span >
78+ <span class =" tooltip-text" >
79+ Commits, Issues, Pull Requests and Code Reviews.
80+ </span >
81+ </div >
82+ </div >
83+ <RadioButton
6484 class =" lg:pb-1"
6585 :input-id =" `commits`"
6686 :input-name =" `count`"
6787 :label-for =" `commits`"
6888 :label-text =" `Commits`"
69- :checked =" true"
7089 :value =" 'commits'"
90+ @on-count-type-changed =" onCountTypeChanged"
7191 />
7292 </div >
7393 </div >
7797<script >
7898import { mapGetters } from ' vuex'
7999import RadioButton from ' ./RadioButton.vue'
80- import CheckBox from ' ./CheckBox.vue'
81100import PeriodDropdown from ' ./PeriodDropdown.vue'
82101export default {
83102 name: ' InputsSection' ,
84103 components: {
85104 RadioButton,
86- CheckBox,
87105 PeriodDropdown,
88106 },
89107 props: {
@@ -96,6 +114,7 @@ export default {
96114 getShow: ' getShow' ,
97115 getSortBy: ' getSortBy' ,
98116 getUserSearchTerm: ' getUserSearchTerm' ,
117+ getCountType: ' getCountType' ,
99118 }),
100119 },
101120 methods: {
@@ -105,13 +124,13 @@ export default {
105124
106125 if (this .getUserSearchTerm ) {
107126 const response = await this .$axios .get (
108- ` v1/users?sort_by=${ sortBy} &page=${ this .getCurrentPage } &period=${ this .getPeriod } &contributors=${ this .getShow } &search=${ this .getUserSearchTerm } ` ,
127+ ` v1/users?sort_by=${ sortBy} &page=${ this .getCurrentPage } &period=${ this .getPeriod } &contributors=${ this .getShow } &search=${ this .getUserSearchTerm } &type= ${ this . getCountType } ` ,
109128 )
110129 this .$store .commit (' setUsers' , response .data .users )
111130 this .$store .commit (' setPageCount' , response .data .totalPages )
112131 } else {
113132 const response = await this .$axios .get (
114- ` v1/users?sort_by=${ sortBy} &page=${ this .getCurrentPage } &period=${ this .getPeriod } &contributors=${ this .getShow } ` ,
133+ ` v1/users?sort_by=${ sortBy} &page=${ this .getCurrentPage } &period=${ this .getPeriod } &contributors=${ this .getShow } &type= ${ this . getCountType } ` ,
115134 )
116135
117136 this .$store .commit (' setUsers' , response .data .users )
@@ -123,14 +142,14 @@ export default {
123142 this .$store .commit (' setShow' , show)
124143 if (this .getUserSearchTerm ) {
125144 const response = await this .$axios .get (
126- ` v1/users?sort_by=${ this .getSortBy } &page=${ this .getCurrentPage } &period=${ this .getPeriod } &contributors=${ show} &search=${ this .getUserSearchTerm } ` ,
145+ ` v1/users?sort_by=${ this .getSortBy } &page=${ this .getCurrentPage } &period=${ this .getPeriod } &contributors=${ show} &search=${ this .getUserSearchTerm } &type= ${ this . getCountType } ` ,
127146 )
128147
129148 this .$store .commit (' setUsers' , response .data .users )
130149 this .$store .commit (' setPageCount' , response .data .totalPages )
131150 } else {
132151 const response = await this .$axios .get (
133- ` v1/users?sort_by=${ this .getSortBy } &page=${ this .getCurrentPage } &period=${ this .getPeriod } &contributors=${ show} ` ,
152+ ` v1/users?sort_by=${ this .getSortBy } &page=${ this .getCurrentPage } &period=${ this .getPeriod } &contributors=${ show} &type= ${ this . getCountType } ` ,
134153 )
135154
136155 this .$store .commit (' setUsers' , response .data .users )
@@ -141,20 +160,39 @@ export default {
141160 this .$store .commit (' setCurrentPage' , 1 )
142161 if (searchTerm) {
143162 const response = await this .$axios .get (
144- ` v1/users?sort_by=${ this .getSortBy } &page=${ this .getCurrentPage } &period=${ this .getPeriod } &contributors=${ this .getShow } &search=${ searchTerm} ` ,
163+ ` v1/users?sort_by=${ this .getSortBy } &page=${ this .getCurrentPage } &period=${ this .getPeriod } &contributors=${ this .getShow } &search=${ searchTerm} &type= ${ this . getCountType } ` ,
145164 )
146165 this .$store .commit (' setUserSearchTerm' , searchTerm)
147166 this .$store .commit (' setUsers' , response .data .users )
148167 this .$store .commit (' setPageCount' , response .data .totalPages )
149168 } else {
150169 const response = await this .$axios .get (
151- ` v1/users?sort_by=${ this .getSortBy } &page=${ this .getCurrentPage } &period=${ this .getPeriod } &contributors=${ this .getShow } ` ,
170+ ` v1/users?sort_by=${ this .getSortBy } &page=${ this .getCurrentPage } &period=${ this .getPeriod } &contributors=${ this .getShow } &type= ${ this . getCountType } ` ,
152171 )
153172 this .$store .commit (' setUserSearchTerm' , ' ' )
154173 this .$store .commit (' setUsers' , response .data .users )
155174 this .$store .commit (' setPageCount' , response .data .totalPages )
156175 }
157176 },
177+ async onCountTypeChanged (countType ) {
178+ this .$store .commit (' setCurrentPage' , 1 )
179+ this .$store .commit (' setCountType' , countType)
180+ if (this .getUserSearchTerm ) {
181+ const response = await this .$axios .get (
182+ ` v1/users?sort_by=${ this .getSortBy } &page=${ this .getCurrentPage } &period=${ this .getPeriod } &contributors=${ this .getShow } &search=${ this .getUserSearchTerm } &type=${ this .getCountType } ` ,
183+ )
184+
185+ this .$store .commit (' setUsers' , response .data .users )
186+ this .$store .commit (' setPageCount' , response .data .totalPages )
187+ } else {
188+ const response = await this .$axios .get (
189+ ` v1/users?sort_by=${ this .getSortBy } &page=${ this .getCurrentPage } &period=${ this .getPeriod } &contributors=${ this .getShow } &type=${ this .getCountType } ` ,
190+ )
191+
192+ this .$store .commit (' setUsers' , response .data .users )
193+ this .$store .commit (' setPageCount' , response .data .totalPages )
194+ }
195+ },
158196 },
159197}
160198 </script >
@@ -172,4 +210,30 @@ export default {
172210 margin-left : 2.8 rem ;
173211 @apply lg :ml-0;
174212}
213+
214+ /* Tooltip container */
215+ .tooltip {
216+ @apply p-0;
217+ }
218+
219+ /* Tooltip text */
220+ .tooltip .tooltip-text {
221+ @apply w-32 bg-white text-black p-2 text-xs;
222+ visibility : hidden;
223+ text-align : center;
224+ border-radius : 6 px ;
225+
226+ /* Position the tooltip text */
227+ position : absolute;
228+ z-index : 1 ;
229+ }
230+
231+ /* Show the tooltip text when you mouse over the tooltip container */
232+ .tooltip:hover .tooltip-text {
233+ visibility : visible;
234+ }
235+
236+ .blue-green {
237+ color : #00b199 ;
238+ }
175239 </style >
0 commit comments