Skip to content

Commit 7b90026

Browse files
committed
fix: remove outdated column from hero numbers
1 parent 960740e commit 7b90026

6 files changed

Lines changed: 5 additions & 57 deletions

File tree

components/Landing/HeroNumbers.spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const factory = (propsData) => {
1414
const propsData = {
1515
toolsCount: 10,
1616
communityCount: 5,
17-
resourcesCount: 20,
1817
projectsCount: 8,
1918
};
2019

components/Landing/HeroNumbers.vue

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<div class="hero-numbers__item">
2020
<span class="hero-numbers__icon ion-ios-lightbulb-outline" />
2121
<div class="hero-numbers__text">
22-
<h4 class="hero-numbers__count text-h3">
22+
<h4 class="hero-numbers__count text-h3 font-weight-normal">
2323
<animated-number :value="toolsCount" />
2424
</h4>
2525
<h6 class="hero-numbers__title">
@@ -28,19 +28,6 @@
2828
</div>
2929
</div>
3030
</v-col>
31-
<v-col align="center" cols="12" sm="3">
32-
<div class="hero-numbers__item">
33-
<span class="hero-numbers__icon ion-ios-world-outline" />
34-
<div class="hero-numbers__text">
35-
<h4 class="hero-numbers__count text-h3 font-weight-normal">
36-
<animated-number :value="resourcesCount" />
37-
</h4>
38-
<h6 class="hero-numbers__title">
39-
{{ 'Resource' | pluralize(resourcesCount) }}
40-
</h6>
41-
</div>
42-
</div>
43-
</v-col>
4431
<v-col align="center" cols="12" sm="3">
4532
<div class="hero-numbers__item">
4633
<span class="hero-numbers__icon ion-ios-world-outline" />
@@ -77,10 +64,6 @@ export default {
7764
type: Number,
7865
required: true,
7966
},
80-
resourcesCount: {
81-
type: Number,
82-
required: true,
83-
},
8467
projectsCount: {
8568
type: Number,
8669
required: true,

components/Landing/__snapshots__/HeroNumbers.spec.js.snap

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ exports[`HeroNumbers should match snapshot 1`] = `
1919
<v-col-stub cols=\\"12\\" sm=\\"3\\" tag=\\"div\\" align=\\"center\\">
2020
<div class=\\"hero-numbers__item\\"><span class=\\"hero-numbers__icon ion-ios-lightbulb-outline\\"></span>
2121
<div class=\\"hero-numbers__text\\">
22-
<h4 class=\\"hero-numbers__count text-h3\\">
22+
<h4 class=\\"hero-numbers__count text-h3 font-weight-normal\\">
2323
<animated-number-stub value=\\"10\\"></animated-number-stub>
2424
</h4>
2525
<h6 class=\\"hero-numbers__title\\">
@@ -28,18 +28,6 @@ exports[`HeroNumbers should match snapshot 1`] = `
2828
</div>
2929
</div>
3030
</v-col-stub>
31-
<v-col-stub cols=\\"12\\" sm=\\"3\\" tag=\\"div\\" align=\\"center\\">
32-
<div class=\\"hero-numbers__item\\"><span class=\\"hero-numbers__icon ion-ios-world-outline\\"></span>
33-
<div class=\\"hero-numbers__text\\">
34-
<h4 class=\\"hero-numbers__count text-h3 font-weight-normal\\">
35-
<animated-number-stub value=\\"20\\"></animated-number-stub>
36-
</h4>
37-
<h6 class=\\"hero-numbers__title\\">
38-
Resource
39-
</h6>
40-
</div>
41-
</div>
42-
</v-col-stub>
4331
<v-col-stub cols=\\"12\\" sm=\\"3\\" tag=\\"div\\" align=\\"center\\">
4432
<div class=\\"hero-numbers__item\\"><span class=\\"hero-numbers__icon ion-ios-world-outline\\"></span>
4533
<div class=\\"hero-numbers__text\\">

pages/index.spec.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ describe('Index.vue', () => {
1919
resourcesCount: () => {
2020
return 999;
2121
},
22-
toolsCount: () => {
23-
return 555;
24-
},
2522
communitiesCount: () => {
2623
return 10;
2724
},
@@ -32,7 +29,6 @@ describe('Index.vue', () => {
3229
actions: {
3330
getCommunitiesCount: jest.fn(),
3431
getResourcesCount: jest.fn(),
35-
getToolsCount: jest.fn(),
3632
},
3733
},
3834
};
@@ -47,6 +43,5 @@ describe('Index.vue', () => {
4743

4844
expect(mockStore.dashboard.actions.getCommunitiesCount).toHaveBeenCalled();
4945
expect(mockStore.dashboard.actions.getResourcesCount).toHaveBeenCalled();
50-
expect(mockStore.dashboard.actions.getToolsCount).toHaveBeenCalled();
5146
});
5247
});

pages/index.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
</section>
1616
<hero-numbers
1717
:community-count="communitiesCount"
18-
:tools-count="toolsCount"
19-
:resources-count="resourcesCount"
18+
:tools-count="resourcesCount"
2019
:projects-count="projectsCount"
2120
/>
2221
<logo-slider class="landing-mt landing-mb" />
@@ -47,13 +46,13 @@ export default {
4746
computed: {
4847
...mapGetters('dashboard', {
4948
communitiesCount: 'communitiesCount',
50-
toolsCount: 'toolsCount',
49+
// resourcesCount is the total tools count (/stats/tools/count_total)
50+
// and is displayed under the "Tools" label in the hero numbers.
5151
resourcesCount: 'resourcesCount',
5252
projectsCount: 'projectsCount',
5353
}),
5454
},
5555
mounted() {
56-
this.$store.dispatch('dashboard/getToolsCount');
5756
this.$store.dispatch('dashboard/getResourcesCount');
5857
this.$store.dispatch('dashboard/getCommunitiesCount');
5958
},

store/dashboard.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export default {
55
state: () => {
66
return {
77
resourcesCount: 0,
8-
toolsCount: 0,
98
communitiesCount: 0,
109
projectsCount: 0,
1110
};
@@ -30,26 +29,12 @@ export default {
3029
const response = await this.$observatory.$get('/stats/tools/count_total');
3130
commit('setResourcesCount', response[0]);
3231
},
33-
async getToolsCount({ commit }) {
34-
const response = await this.$axios.head('/aggregate', {
35-
params: {
36-
limit: 1,
37-
},
38-
});
39-
commit('setToolsCount', response);
40-
},
4132
},
4233

4334
mutations: {
4435
setResourcesCount(state, payload) {
4536
state.resourcesCount = payload.data;
4637
},
47-
setToolsCount(state, payload) {
48-
const matches = payload.headers['content-range'].match(
49-
/(\d+)-(\d+|\*)\/(\d+|\*)/
50-
);
51-
state.toolsCount = parseInt(matches[3]);
52-
},
5338
setCommunitiesCount(state, payload) {
5439
const communities = payload.getCommunities.map((community) => {
5540
community._metadata = JSON.parse(community._metadata);
@@ -80,7 +65,6 @@ export default {
8065

8166
getters: {
8267
resourcesCount: (state) => state.resourcesCount,
83-
toolsCount: (state) => state.toolsCount,
8468
communitiesCount: (state) => state.communitiesCount,
8569
projectsCount: (state) => state.projectsCount,
8670
},

0 commit comments

Comments
 (0)