Browse Source

geodata: fix linter issues

pull/4749/head
flisowna 2 years ago
parent
commit
6f932a3266
  1. 1
      packages/nc-gui/components/cell/GeoData.vue
  2. 9
      packages/nc-gui/components/smartsheet/expanded-form/index.vue
  3. 2
      packages/nc-gui/components/smartsheet/header/CellIcon.ts
  4. 10
      packages/nc-gui/components/smartsheet/sidebar/MenuBottom.vue
  5. 28
      packages/nocodb/src/lib/models/MapView.ts

1
packages/nc-gui/components/cell/GeoData.vue

@ -38,7 +38,6 @@ const handleFinish = () => {
} }
const clear = () => { const clear = () => {
isExpanded = false isExpanded = false
formState.latitude = latitude formState.latitude = latitude

9
packages/nc-gui/components/smartsheet/expanded-form/index.vue

@ -23,6 +23,10 @@ import {
} from '#imports' } from '#imports'
import type { Row } from '~/lib' import type { Row } from '~/lib'
const props = defineProps<Props>()
const emits = defineEmits(['update:modelValue', 'cancel'])
export interface InitialGeoPositionData { export interface InitialGeoPositionData {
lat?: number lat?: number
long?: number long?: number
@ -41,10 +45,6 @@ interface Props {
initialGeoPositionData?: InitialGeoPositionData initialGeoPositionData?: InitialGeoPositionData
} }
const props = defineProps<Props>()
const emits = defineEmits(['update:modelValue', 'cancel'])
const row = ref(props.row) const row = ref(props.row)
const state = toRef(props, 'state') const state = toRef(props, 'state')
@ -157,7 +157,6 @@ export default {
<SmartsheetExpandedFormHeader :view="props.view" @cancel="onClose" /> <SmartsheetExpandedFormHeader :view="props.view" @cancel="onClose" />
<div class="!bg-gray-100 rounded flex-1"> <div class="!bg-gray-100 rounded flex-1">
<div class="flex h-full nc-form-wrapper items-stretch min-h-[max(70vh,100%)]"> <div class="flex h-full nc-form-wrapper items-stretch min-h-[max(70vh,100%)]">
<div class="flex-1 overflow-auto scrollbar-thin-dull nc-form-fields-container"> <div class="flex-1 overflow-auto scrollbar-thin-dull nc-form-fields-container">
<div class="w-[500px] mx-auto"> <div class="w-[500px] mx-auto">

2
packages/nc-gui/components/smartsheet/header/CellIcon.ts

@ -11,11 +11,11 @@ import {
isCurrency, isCurrency,
isDate, isDate,
isDateTime, isDateTime,
isGeoData,
isDecimal, isDecimal,
isDuration, isDuration,
isEmail, isEmail,
isFloat, isFloat,
isGeoData,
isInt, isInt,
isJSON, isJSON,
isPercent, isPercent,

10
packages/nc-gui/components/smartsheet/sidebar/MenuBottom.vue

@ -1,19 +1,13 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ViewTypes } from 'nocodb-sdk' import { ViewTypes } from 'nocodb-sdk'
import { IsGeodataActiveInj, ReadonlyInj, ref, useGlobal, useNuxtApp, useSmartsheetStoreOrThrow, viewIcons } from '#imports' import { useNuxtApp, useSmartsheetStoreOrThrow, viewIcons } from '#imports'
const isGeodataActive = inject(IsGeodataActiveInj, ref(false)) const emits = defineEmits<Emits>()
interface Emits { interface Emits {
(event: 'openModal', data: { type: ViewTypes; title?: string }): void (event: 'openModal', data: { type: ViewTypes; title?: string }): void
} }
const emits = defineEmits<Emits>()
const readOnly = inject(ReadonlyInj)
const { includeM2M } = useGlobal()
const { $e } = useNuxtApp() const { $e } = useNuxtApp()
const { isSqlView } = useSmartsheetStoreOrThrow() const { isSqlView } = useSmartsheetStoreOrThrow()

28
packages/nocodb/src/lib/models/MapView.ts

@ -10,7 +10,7 @@ export default class MapView implements MapType {
project_id?: string; project_id?: string;
base_id?: string; base_id?: string;
fk_geo_data_col_id?: string; fk_geo_data_col_id?: string;
meta?: string | object; meta?: string | Record<string, unknown>;
// below fields are not in use at this moment // below fields are not in use at this moment
// keep them for time being // keep them for time being
@ -41,9 +41,6 @@ export default class MapView implements MapType {
return view && new MapView(view); return view && new MapView(view);
} }
public static async IsColumnBeingUsedInMapView( public static async IsColumnBeingUsedInMapView(
columnId: string, columnId: string,
ncMeta = Noco.ncMeta ncMeta = Noco.ncMeta
@ -59,8 +56,7 @@ export default class MapView implements MapType {
); );
} }
static async insert(view: Partial<MapView>, ncMeta = Noco.ncMeta) { static async insert(view: Partial<MapView>, ncMeta = Noco.ncMeta) {
const insertObj = { const insertObj = {
project_id: view.project_id, project_id: view.project_id,
base_id: view.base_id, base_id: view.base_id,
@ -75,13 +71,7 @@ export default class MapView implements MapType {
insertObj.base_id = viewRef.base_id; insertObj.base_id = viewRef.base_id;
} }
await ncMeta.metaInsert2( await ncMeta.metaInsert2(null, null, MetaTable.MAP_VIEW, insertObj, true);
null,
null,
MetaTable.MAP_VIEW,
insertObj,
true
);
return this.get(view.fk_view_id, ncMeta); return this.get(view.fk_view_id, ncMeta);
} }
@ -107,14 +97,8 @@ export default class MapView implements MapType {
await NocoCache.set(key, o); await NocoCache.set(key, o);
} }
// update meta // update meta
return await ncMeta.metaUpdate( return await ncMeta.metaUpdate(null, null, MetaTable.MAP_VIEW, updateObj, {
null, fk_view_id: mapId,
null, });
MetaTable.MAP_VIEW,
updateObj,
{
fk_view_id: mapId,
}
);
} }
} }

Loading…
Cancel
Save