Skip to content

Commit e5a06fb

Browse files
author
Uroš Marolt
committed
Merge branch 'main' into bugfix/searchFullName
2 parents 4773330 + 69c1cee commit e5a06fb

File tree

18 files changed

+115
-96
lines changed

18 files changed

+115
-96
lines changed

frontend/src/modules/activity/config/filters/date/options.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
import { SelectFilterOptionGroup } from '@/shared/modules/filters/types/filterTypes/SelectFilterConfig';
22
import moment from 'moment';
33

4+
// Days period is -1 to include today's data
45
const options: SelectFilterOptionGroup[] = [
56
{
67
options: [
78
{
89
label: 'Last 24 hours',
9-
value: moment().subtract(24, 'hour').format('YYYY-MM-DD'),
10+
value: moment().utc().subtract(24, 'hour').format('YYYY-MM-DD'),
1011
},
1112
{
1213
label: 'Last 7 days',
13-
value: moment().subtract(7, 'day').format('YYYY-MM-DD'),
14+
value: moment().utc().subtract(6, 'day').format('YYYY-MM-DD'),
1415
},
1516
{
1617
label: 'Last 14 days',
17-
value: moment().subtract(14, 'day').format('YYYY-MM-DD'),
18+
value: moment().utc().subtract(13, 'day').format('YYYY-MM-DD'),
1819
},
1920
{
2021
label: 'Last 30 days',
21-
value: moment().subtract(30, 'day').format('YYYY-MM-DD'),
22+
value: moment().utc().subtract(29, 'day').format('YYYY-MM-DD'),
2223
},
2324
{
2425
label: 'Last 90 days',
25-
value: moment().subtract(90, 'day').format('YYYY-MM-DD'),
26+
value: moment().utc().subtract(89, 'day').format('YYYY-MM-DD'),
2627
},
2728
],
2829
},

frontend/src/modules/conversation/config/filters/dateStarted/options.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
import { SelectFilterOptionGroup } from '@/shared/modules/filters/types/filterTypes/SelectFilterConfig';
22
import moment from 'moment';
33

4+
// Days period is -1 to include today's data
45
const options: SelectFilterOptionGroup[] = [
56
{
67
options: [
78
{
89
label: 'Last 24 hours',
9-
value: moment().subtract(24, 'hour').format('YYYY-MM-DD'),
10+
value: moment().utc().subtract(24, 'hour').format('YYYY-MM-DD'),
1011
},
1112
{
1213
label: 'Last 7 days',
13-
value: moment().subtract(7, 'day').format('YYYY-MM-DD'),
14+
value: moment().utc().subtract(6, 'day').format('YYYY-MM-DD'),
1415
},
1516
{
1617
label: 'Last 14 days',
17-
value: moment().subtract(14, 'day').format('YYYY-MM-DD'),
18+
value: moment().utc().subtract(13, 'day').format('YYYY-MM-DD'),
1819
},
1920
{
2021
label: 'Last 30 days',
21-
value: moment().subtract(30, 'day').format('YYYY-MM-DD'),
22+
value: moment().utc().subtract(29, 'day').format('YYYY-MM-DD'),
2223
},
2324
{
2425
label: 'Last 90 days',
25-
value: moment().subtract(90, 'day').format('YYYY-MM-DD'),
26+
value: moment().utc().subtract(89, 'day').format('YYYY-MM-DD'),
2627
},
2728
],
2829
},

frontend/src/modules/dashboard/components/conversations/dashboard-conversation-list.vue

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
:to="{
3838
name: 'activity',
3939
hash: '#conversation',
40+
query: filterQueryService().setQuery(allConversationsFilter),
4041
}"
4142
class="text-red font-medium text-center text-xs leading-5"
4243
>
@@ -57,6 +58,8 @@ import { mapGetters } from 'vuex';
5758
import AppDashboardEmptyState from '@/modules/dashboard/components/dashboard-empty-state.vue';
5859
import AppDashboardConversationItem from '@/modules/dashboard/components/conversations/dashboard-conversation-item.vue';
5960
import AppConversationDrawer from '@/modules/conversation/components/conversation-drawer.vue';
61+
import { filterQueryService } from '@/shared/modules/filters/services/filter-query.service';
62+
import moment from 'moment';
6063
6164
export default {
6265
name: 'AppDashboardConversationList',
@@ -68,13 +71,29 @@ export default {
6871
data() {
6972
return {
7073
conversationId: null,
74+
filterQueryService,
7175
};
7276
},
7377
computed: {
7478
...mapGetters('dashboard', [
7579
'trendingConversations',
7680
'conversations',
7781
]),
82+
allConversationsFilter() {
83+
return {
84+
search: '',
85+
relation: 'and',
86+
order: {
87+
prop: 'activityCount',
88+
order: 'descending',
89+
},
90+
lastActivityDate: {
91+
operator: 'gt',
92+
value: moment().utc().subtract(6, 'day').format('YYYY-MM-DD'),
93+
include: true,
94+
},
95+
};
96+
},
7897
},
7998
methods: {
8099
refreshConversations() {

frontend/src/modules/dashboard/components/dashboard-activities.vue

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
title="Activities"
66
:total-loading="activities.loading"
77
:total="activities.total"
8-
:route="{ name: 'activity', hash: '#activity' }"
8+
:route="{
9+
name: 'activity',
10+
hash: '#activity',
11+
query: filterQueryService().setQuery(allActivitiesFilter),
12+
}"
913
button-title="All activities"
1014
report-name="Activities report"
1115
/>
@@ -87,6 +91,7 @@ import AppDashboardConversationList from '@/modules/dashboard/components/convers
8791
import AppDashboardActivityList from '@/modules/dashboard/components/activity/dashboard-activity-list.vue';
8892
import AppDashboardActivitySentiment from '@/modules/dashboard/components/activity/dashboard-activity-sentiment.vue';
8993
import AppDashboardCount from '@/modules/dashboard/components/dashboard-count.vue';
94+
import { filterQueryService } from '@/shared/modules/filters/services/filter-query.service';
9095
9196
export default {
9297
name: 'AppDashboardActivities',
@@ -104,6 +109,7 @@ export default {
104109
tab: 'trending',
105110
activitiesChart,
106111
activitiesCount,
112+
filterQueryService,
107113
};
108114
},
109115
computed: {
@@ -118,6 +124,16 @@ export default {
118124
},
119125
];
120126
},
127+
allActivitiesFilter() {
128+
return {
129+
search: '',
130+
relation: 'and',
131+
order: {
132+
prop: 'timestamp',
133+
order: 'descending',
134+
},
135+
};
136+
},
121137
},
122138
};
123139
</script>

frontend/src/modules/dashboard/components/dashboard-count.vue

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ export default {
9696
.utc()
9797
.startOf('day')
9898
.subtract(
99-
this.period.granularity === 'day'
100-
? this.period.value - 1
101-
: this.period.value,
99+
this.period.value - 1,
102100
this.period.granularity,
103101
)
104102
.toISOString(),
@@ -111,27 +109,21 @@ export default {
111109
.utc()
112110
.startOf('day')
113111
.subtract(
114-
this.period.granularity === 'day'
115-
? this.period.value - 1
116-
: this.period.value,
112+
this.period.value - 1,
117113
this.period.granularity,
118114
)
119115
.subtract(1, 'ms')
120116
.startOf('day')
121117
.subtract(
122-
this.period.granularity === 'day'
123-
? this.period.value - 1
124-
: this.period.value,
118+
this.period.value - 1,
125119
this.period.granularity,
126120
)
127121
.toISOString(),
128122
moment()
129123
.utc()
130124
.startOf('day')
131125
.subtract(
132-
this.period.granularity === 'day'
133-
? this.period.value - 1
134-
: this.period.value,
126+
this.period.value - 1,
135127
this.period.granularity,
136128
)
137129
.subtract(1, 'ms')

frontend/src/modules/dashboard/components/dashboard-members.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
title="Members"
66
:total-loading="members.loadingRecent"
77
:total="members.total"
8-
:route="{ name: 'member' }"
8+
:route="{
9+
name: 'member',
10+
query: filterQueryService().setQuery(allMembers.filter),
11+
}"
912
button-title="All members"
1013
report-name="Members report"
1114
/>
@@ -93,7 +96,7 @@
9396
:to="{
9497
name: 'member',
9598
query: filterQueryService().setQuery({
96-
...newAndActive.filter,
99+
...allMembers.filter,
97100
joinedDate: {
98101
value: periodStartDate,
99102
operator: 'gt',
@@ -251,6 +254,7 @@ export default {
251254
]),
252255
periodStartDate() {
253256
return moment()
257+
.utc()
254258
.subtract(this.period.value, 'day')
255259
.format('YYYY-MM-DD');
256260
},

frontend/src/modules/dashboard/components/dashboard-organizations.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
title="Organizations"
66
:total-loading="organizations.loadingRecent"
77
:total="organizations.total"
8-
:route="{ name: 'organization' }"
8+
:route="{
9+
name: 'organization',
10+
query: filterQueryService().setQuery(allOrganizations.filter),
11+
}"
912
button-title="All organizations"
1013
report-name="Organizations report"
1114
/>
@@ -76,7 +79,7 @@
7679
:to="{
7780
name: 'organization',
7881
query: filterQueryService().setQuery({
79-
...newAndActive.filter,
82+
...allOrganizations.filter,
8083
joinedDate: {
8184
value: periodStartDate,
8285
operator: 'gt',

frontend/src/modules/dashboard/dashboard.cube.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ export function dateRange(period) {
2828
const end = moment().utc().endOf('day');
2929
const start = moment()
3030
.subtract(
31-
period.granularity === 'day'
32-
? period.value - 1
33-
: period.value,
31+
period.value - 1,
3432
period.granularity,
3533
)
3634
.utc()

frontend/src/modules/dashboard/store/actions.js

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ export default {
3939
async getTrendingConversations({ commit, state }) {
4040
state.conversations.loading = true;
4141
const { platform, period } = state.filters;
42+
4243
return ConversationService.query({
4344
filter: {
4445
and: [
4546
{
4647
lastActive: {
4748
gte: moment()
49+
.utc()
4850
.startOf('day')
4951
.subtract(
50-
period.granularity === 'day'
51-
? period.value - 1
52-
: period.value,
52+
period.value - 1,
5353
period.granularity,
5454
)
5555
.toISOString(),
@@ -104,18 +104,18 @@ export default {
104104
async getRecentActivities({ commit, state }) {
105105
state.activities.loading = true;
106106
const { platform, period } = state.filters;
107+
107108
return ActivityService.query({
108109
filter: {
109110
...DEFAULT_ACTIVITY_FILTERS,
110111
and: [
111112
{
112113
timestamp: {
113114
gte: moment()
115+
.utc()
114116
.startOf('day')
115117
.subtract(
116-
period.granularity === 'day'
117-
? period.value - 1
118-
: period.value,
118+
period.value - 1,
119119
period.granularity,
120120
)
121121
.toISOString(),
@@ -191,9 +191,10 @@ export default {
191191
activityIsContribution: null,
192192
activityTimestampFrom: moment()
193193
.utc()
194-
.subtract(period.value, period.granularity)
194+
.subtract(period.value - 1, period.granularity)
195+
.startOf('day')
195196
.toISOString(),
196-
activityTimestampTo: moment().utc(),
197+
activityTimestampTo: moment().utc().endOf('day'),
197198
orderBy: 'activityCount_DESC',
198199
offset: 0,
199200
limit: 5,
@@ -211,18 +212,18 @@ export default {
211212
async getRecentMembers({ commit, state }) {
212213
state.members.loadingRecent = true;
213214
const { platform, period } = state.filters;
215+
214216
return MemberService.listMembers({
215217
filter: {
216218
and: [
217219
...DEFAULT_MEMBER_FILTERS,
218220
{
219221
joinedAt: {
220222
gte: moment()
223+
.utc()
221224
.startOf('day')
222225
.subtract(
223-
period.granularity === 'day'
224-
? period.value - 1
225-
: period.value,
226+
period.value - 1,
226227
period.granularity,
227228
)
228229
.toISOString(),
@@ -304,11 +305,10 @@ export default {
304305
{
305306
lastActive: {
306307
gte: moment()
308+
.utc()
307309
.startOf('day')
308310
.subtract(
309-
period.granularity === 'day'
310-
? period.value - 1
311-
: period.value,
311+
period.value - 1,
312312
period.granularity,
313313
)
314314
.toISOString(),
@@ -349,11 +349,10 @@ export default {
349349
{
350350
joinedAt: {
351351
gte: moment()
352+
.utc()
352353
.startOf('day')
353354
.subtract(
354-
period.granularity === 'day'
355-
? period.value - 1
356-
: period.value,
355+
period.value - 1,
357356
period.granularity,
358357
)
359358
.toISOString(),

frontend/src/modules/member/components/member-identities.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
:tooltip-label="platformContent(platform).tooltipLabel"
1818
:as-link="platformContent(platform).asLink"
1919
:show-handles-badge="true"
20-
:backup-url="props.member.attributes.url[platform]"
20+
:backup-url="props.member.attributes.url?.[platform]"
2121
/>
2222
</div>
2323
</div>
@@ -54,7 +54,7 @@ const platformContent = (platform) => {
5454
};
5555
5656
const hasSocialIdentities = computed(
57-
() => Object.keys(props.username).some((k) => !!props.username[k].length),
57+
() => Object.values(props.username).some((k) => k.length > 0),
5858
);
5959
</script>
6060

0 commit comments

Comments
 (0)