|
54 | 54 | > |
55 | 55 | <div class="flex items-center"> |
56 | 56 | <img |
| 57 | + v-if="getPlatformDetails(plat)" |
57 | 58 | class="w-4 h-4 mr-3" |
58 | 59 | :src="getPlatformDetails(plat).image" |
59 | 60 | :alt="getPlatformDetails(plat).name" |
60 | 61 | /> |
61 | | - <p class="text-xs leading-5 activity-type"> |
62 | | - <app-i18n |
63 | | - :code="`entities.activity.${plat}.${type}`" |
64 | | - /> |
| 62 | + <i v-else class="ri-radar-line text-base text-gray-400 mr-3" /> |
| 63 | + <p v-if="typeNames?.[plat]?.[type]?.display" class="text-xs leading-5 activity-type"> |
| 64 | + {{ typeNames?.[plat]?.[type]?.display?.short }} |
65 | 65 | </p> |
| 66 | + <app-i18n |
| 67 | + v-else-if="getPlatformDetails(plat)" |
| 68 | + :code="`entities.activity.${plat}.${type}`" |
| 69 | + /> |
66 | 70 | </div> |
67 | 71 | <p class="text-2xs text-gray-400"> |
68 | | - {{ total }} activities ・ |
| 72 | + {{ pluralize('activity', total, true) }} ・ |
69 | 73 | {{ |
70 | 74 | Math.round( |
71 | 75 | (total |
@@ -104,8 +108,32 @@ import { CrowdIntegrations } from '@/integrations/integrations-config'; |
104 | 108 | import { mapGetters } from '@/shared/vuex/vuex.helpers'; |
105 | 109 | import AppCubeRender from '@/shared/cube/cube-render.vue'; |
106 | 110 | import AppLoading from '@/shared/loading/loading-placeholder.vue'; |
| 111 | +import { useActivityTypeStore } from '@/modules/activity/store/type'; |
| 112 | +import { storeToRefs } from 'pinia'; |
| 113 | +import { computed, watch } from 'vue'; |
| 114 | +import pluralize from 'pluralize'; |
107 | 115 |
|
108 | 116 | const { period, platform } = mapGetters('dashboard'); |
| 117 | +const { currentTenant } = mapGetters('auth'); |
| 118 | +
|
| 119 | +const activityTypeStore = useActivityTypeStore(); |
| 120 | +const { types } = storeToRefs(activityTypeStore); |
| 121 | +const { setTypes } = activityTypeStore; |
| 122 | +
|
| 123 | +const typeNames = computed(() => ({ |
| 124 | + ...types.value.default, |
| 125 | + ...types.value.custom, |
| 126 | +})); |
| 127 | +
|
| 128 | +watch( |
| 129 | + () => currentTenant, |
| 130 | + (tenant) => { |
| 131 | + if (tenant.value.settings.length > 0) { |
| 132 | + setTypes(tenant.value.settings[0].activityTypes); |
| 133 | + } |
| 134 | + }, |
| 135 | + { immediate: true, deep: true }, |
| 136 | +); |
109 | 137 |
|
110 | 138 | const compileData = (resultSet) => { |
111 | 139 | const pivot = resultSet.chartPivot(); |
|
0 commit comments