Browse Source

MapView: 'Mapped by' column values should always be delivered - WIP

pull/4749/head
Daniel Spaude 2 years ago
parent
commit
75bf66b448
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 30
      packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue
  2. 30
      packages/nc-gui/components/smartsheet/toolbar/MappedBy.vue
  3. 1
      packages/nc-gui/lib/enums.ts

30
packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue

@ -52,15 +52,45 @@ const {
const { eventBus } = useSmartsheetStoreOrThrow()
eventBus.on((event) => {
alert('eventBus.on in FieldsMenu')
if (event === SmartsheetStoreEvents.FIELD_RELOAD) {
alert('SmartsheetStoreEvents.FIELD_RELOAD')
loadViewColumns()
}
else if (event === SmartsheetStoreEvents.MAPPED_BY_COLUMN_CHANGE) {
alert('SmartsheetStoreEvents.MAPPED_BY_COLUMN_CHANGE')
loadViewColumns()
}
})
// watch(
// () => meta.value,
// (v) => {
// alert('watch(meta.value, (v) => {')
// if (v) {
// loadViewColumns()
// }
// },
// )
// watch(
// () => activeView.value,
// async (newVal, oldVal) => {
// if (newVal !== oldVal && meta.value) {
// alert('FOO')
// await loadViewColumns()
// }
// },
// { immediate: true },
// )
watch(
sortedAndFilteredFields,
(v) => {
// alert('watch(sortedAndFilteredFields, (v) => {')
if (rootFields) rootFields.value = v || []
},
{ immediate: true },

30
packages/nc-gui/components/smartsheet/toolbar/MappedBy.vue

@ -28,6 +28,34 @@ const { loadMapData, loadMapMeta, updateMapMeta, mapMetaData, geoDataFieldColumn
const mappedByDropdown = ref(false)
const { eventBus } = useSmartsheetStoreOrThrow()
// const reloadDataHook = inject(ReloadViewDataHookInj)!
// const reloadViewMetaHook = inject(ReloadViewMetaHookInj, undefined)!
// const rootFields = inject(FieldsInj)
// const isLocked = inject(IsLockedInj, ref(false))
// const isPublic = inject(IsPublicInj, ref(false))
// const { $api, $e } = useNuxtApp()
// const {
// showSystemFields,
// sortedAndFilteredFields,
// fields,
// filteredFieldList,
// filterQuery,
// showAll,
// hideAll,
// saveOrUpdate,
// metaColumnById,
// loadViewColumns,
// } = useViewColumns(activeView, meta, () => reloadDataHook.trigger())
watch(
() => activeView.value?.id,
async (newVal, oldVal) => {
@ -48,6 +76,8 @@ const geoDataMappingFieldColumnId = computed({
await loadMapMeta()
await loadMapData()
;(activeView.value?.view as MapType).fk_geo_data_col_id = val
await loadViewColumns()
// eventBus.emit(SmartsheetStoreEvents.MAPPED_BY_COLUMN_CHANGE)
}
},
})

1
packages/nc-gui/lib/enums.ts

@ -87,6 +87,7 @@ export enum SmartsheetStoreEvents {
FILTER_RELOAD = 'filter-reload',
DATA_RELOAD = 'data-reload',
FIELD_RELOAD = 'field-reload',
MAPPED_BY_COLUMN_CHANGE = 'mapped-by-column-change',
FIELD_ADD = 'field-add',
}

Loading…
Cancel
Save