mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
* added faker columns
* updated line settings
This commit is contained in:
@@ -43,7 +43,24 @@ export async function generateColumns(
|
||||
size: 1000,
|
||||
required: false
|
||||
}),
|
||||
client.tablesDB.createBooleanColumn({ databaseId, tableId, key: 'active', required: false })
|
||||
client.tablesDB.createBooleanColumn({
|
||||
databaseId,
|
||||
tableId,
|
||||
key: 'active',
|
||||
required: false
|
||||
}),
|
||||
client.tablesDB.createPointColumn({
|
||||
databaseId,
|
||||
tableId,
|
||||
key: 'location',
|
||||
required: false
|
||||
}),
|
||||
client.tablesDB.createLineColumn({
|
||||
databaseId,
|
||||
tableId,
|
||||
key: 'route',
|
||||
required: false
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -82,7 +99,12 @@ export function generateFakeRecords(
|
||||
age: faker.number.int({ min: 18, max: 80 }),
|
||||
city: faker.location.city(),
|
||||
description: faker.lorem.sentence(),
|
||||
active: faker.datatype.boolean()
|
||||
active: faker.datatype.boolean(),
|
||||
location: [faker.location.longitude(), faker.location.latitude()],
|
||||
route: Array.from({ length: 5 }, () => [
|
||||
faker.location.longitude(),
|
||||
faker.location.latitude()
|
||||
])
|
||||
};
|
||||
} else {
|
||||
for (const column of filteredColumns) {
|
||||
|
||||
+14
-5
@@ -59,11 +59,17 @@
|
||||
}
|
||||
|
||||
function pushCoordinate() {
|
||||
data.default.push(getDefaultSpatialData('point') as number[]);
|
||||
if (data.default) {
|
||||
data.default.push(getDefaultSpatialData('point') as number[]);
|
||||
data.default = [...data.default];
|
||||
}
|
||||
}
|
||||
|
||||
function deleteCoordinate(_: number) {
|
||||
if (data.default.length > 2) data.default.pop();
|
||||
if (data.default && data.default.length > 2) {
|
||||
data.default.pop();
|
||||
data.default = [...data.default];
|
||||
}
|
||||
}
|
||||
|
||||
const {
|
||||
@@ -102,7 +108,10 @@
|
||||
on:change={(e) => {
|
||||
if (e.detail) {
|
||||
$required = false;
|
||||
} else data.default = null;
|
||||
handleDefaultState(false);
|
||||
} else {
|
||||
data.default = null;
|
||||
}
|
||||
}}
|
||||
description="Enable to set a predefined value for this column" />
|
||||
|
||||
@@ -117,9 +126,9 @@
|
||||
values={defaultChecked ? data.default : null}
|
||||
onAddPoint={() => pushCoordinate()}
|
||||
onDeletePoint={deleteCoordinate}
|
||||
onChangePoint={(index, newValue: number, coordIndex: number) => {
|
||||
onChangePoint={(pointIndex: number, coordIndex: number, newValue: number) => {
|
||||
if (data.default) {
|
||||
data.default[index][coordIndex] = newValue;
|
||||
data.default[pointIndex][coordIndex] = newValue;
|
||||
data.default = [...data.default];
|
||||
}
|
||||
}} />
|
||||
|
||||
Reference in New Issue
Block a user