fix(web): calm hero flash, lead detail, and scope sources
Keep the dashboard backdrop out of flow on first paint, clamp long lead notes, scroll the quick-actions rail, return to the lead board, and only list import sources that exist in this environment. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import { computed, onMounted, ref, watch } from 'vue';
|
||||
import type {
|
||||
DataAccessPolicy,
|
||||
DataAccessSection,
|
||||
PersonImportSourceStatDto,
|
||||
RolePermissionKey,
|
||||
SectionDataAccess,
|
||||
} from '@mento/shared';
|
||||
@@ -76,6 +77,9 @@ function setSection(key: DataAccessSection, next: SectionDataAccess) {
|
||||
}
|
||||
|
||||
const { groups: customerGroups, load: loadCustomerGroups } = useCustomerGroups();
|
||||
const importSources = ref<Array<{ value: string; label: string }>>([]);
|
||||
const importSourcesReady = ref(false);
|
||||
const importSourcesFailed = ref(false);
|
||||
const leadStages = ref<IdOption[]>([]);
|
||||
const pipelines = ref<IdOption[]>([]);
|
||||
const dealStages = ref<IdOption[]>([]);
|
||||
@@ -88,6 +92,13 @@ const routineCategories = ref<IdOption[]>([]);
|
||||
|
||||
async function loadOptions() {
|
||||
await loadCustomerGroups().catch(() => undefined);
|
||||
try {
|
||||
const { data } = await api.get<PersonImportSourceStatDto[]>('/people/source-stats');
|
||||
importSources.value = data.map((row) => ({ value: row.source, label: row.label }));
|
||||
importSourcesReady.value = true;
|
||||
} catch {
|
||||
importSourcesFailed.value = true;
|
||||
}
|
||||
try {
|
||||
const { data } = await api.get<Array<{ id: string; name: string }>>('/leads/stages');
|
||||
leadStages.value = data.map((s) => ({ id: s.id, name: s.name }));
|
||||
@@ -217,6 +228,9 @@ const typesForActive = computed(() => {
|
||||
:pipelines="pipelines"
|
||||
:boards="boardsForActive"
|
||||
:activity-types="typesForActive"
|
||||
:import-sources="importSources"
|
||||
:import-sources-ready="importSourcesReady"
|
||||
:import-sources-failed="importSourcesFailed"
|
||||
:disabled="disabled"
|
||||
:compact="compact"
|
||||
@update:model-value="setSection(active, $event)"
|
||||
|
||||
Reference in New Issue
Block a user