Merge pull request #498 from FiretableProject/develop

Develop
This commit is contained in:
Shams
2021-08-16 13:27:13 +10:00
committed by GitHub
3 changed files with 19 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "Firetable",
"version": "1.4.0",
"version": "1.4.1",
"homepage": "https://firetable.io/",
"repository": {
"type": "git",

View File

@@ -45,14 +45,20 @@ export default function ReExecute() {
const handleConfirm = async () => {
setUpdating(true);
const _ft_forcedUpdateAt = new Date();
const batch = db.batch();
const querySnapshot = await query.get();
querySnapshot.docs.forEach((doc) => {
batch.update(doc.ref, { _ft_forcedUpdateAt });
});
await batch.commit();
setUpdating(false);
setTimeout(() => setOpen(false), 3000); // give time to for ft function to run
const docs = [...querySnapshot.docs];
while (docs.length) {
const batch = db.batch();
const temp = docs.splice(0, 499);
temp.forEach((doc) => {
batch.update(doc.ref, { _ft_forcedUpdateAt });
});
await batch.commit();
}
setTimeout(() => {
setUpdating(false);
setOpen(false);
}, 3000); // give time to for ft function to run
};
return (

View File

@@ -49,7 +49,7 @@ export default function ActionFab({
const { requestConfirmation } = useConfirmation();
const { requestParams } = useActionParams();
const { tableState } = useFiretableContext();
const { createdAt, updatedAt, id, ref, ...docData } = row;
const { ref } = row;
const { config } = column as any;
const action = !value
@@ -65,8 +65,11 @@ export default function ActionFab({
const callableName: string =
(column as any).callableName ?? config.callableName ?? "actionScript";
const handleRun = (actionParams = null) => {
if (!ref.path || !ref.id) {
snack.open({ message: "no ref set", variant: "error" });
return;
}
setIsRunning(true);
const data = {
ref: { path: ref.path, id: ref.id, tablePath: window.location.pathname },
column: { ...column, editor: undefined },