|
|
@ -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, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|