From f50ce2c2d2e4dcbb9d45f84ff8dabfc1adf712bb Mon Sep 17 00:00:00 2001 From: Shams mosowi Date: Tue, 14 Jul 2020 12:32:57 +1000 Subject: [PATCH] convert config file from json to ts --- cloud_functions/functions/src/generateConfig.ts | 2 +- cloud_functions/functions/src/index.ts | 6 +++++- www/src/components/Table/Filters/index.tsx | 1 - 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cloud_functions/functions/src/generateConfig.ts b/cloud_functions/functions/src/generateConfig.ts index afe93f3d..2ab3dc83 100644 --- a/cloud_functions/functions/src/generateConfig.ts +++ b/cloud_functions/functions/src/generateConfig.ts @@ -1,7 +1,7 @@ const fs = require("fs"); const main = configString => { - fs.writeFileSync("./src/functionConfig.json", configString); + fs.writeFileSync("./src/functionConfig.ts", `export default ${configString}`); }; main(process.argv[2]); diff --git a/cloud_functions/functions/src/index.ts b/cloud_functions/functions/src/index.ts index 5f6666a6..4cfc3e22 100644 --- a/cloud_functions/functions/src/index.ts +++ b/cloud_functions/functions/src/index.ts @@ -5,7 +5,7 @@ export const callable = callableFns; // all the cloud functions bellow are deployed using the triggerCloudBuild callable function // these functions are designed to be built and deployed based on the configuration passed through the callable -import * as config from "./functionConfig.json"; // generated using generateConfig.ts +import config from "./functionConfig"; // generated using generateConfig.ts import algoliaFnsGenerator from "./algolia"; // algolia sync functions template import collectionSyncFnsGenerator from "./collectionSync"; import snapshotSyncFnsGenerator from "./snapshotSync"; @@ -18,6 +18,10 @@ export const FT_algolia = { [functionConfig.name]: { ...algoliaFnsGenerator(functionConfig) }, }; +// { +// [functionConfig.name]: { ...algoliaFnsGenerator(functionConfig) }, +// }; + export const FT_sync = { [`${`${`${functionConfig.source}` .replace(/\//g, "_") diff --git a/www/src/components/Table/Filters/index.tsx b/www/src/components/Table/Filters/index.tsx index bf8e3dca..c941d741 100644 --- a/www/src/components/Table/Filters/index.tsx +++ b/www/src/components/Table/Filters/index.tsx @@ -260,7 +260,6 @@ const Filters = ({ columns, setFilters }: any) => { /\{\{(.*?)\}\}/g, (m, k) => userClaims[k] )} - // filters={'regions:SYD AND roles:COACHING"} onChange={value => { setQuery(query => ({ ...query, value })); }}