Skip to content

Commit 7cb2e08

Browse files
sid597maparent
andauthored
Roam: ENG-733 Glue Settings UI components to database operations (#343)
* sync * address coderabbit code * address lint errors * use async instead of backend * address review * bug fixes * bug fixes * unused import * Add an input type for platform accounts Add functions to upsert platform accounts (individually or in bulk) Keep the old create_account_in_space function as a shim for now. Use the new upsert_account in upsert_documents and upsert_content, allowing for more complete inline information. * Add an input type for platform accounts Add functions to upsert platform accounts (individually or in bulk) Keep the old create_account_in_space function as a shim for now. Use the new upsert_account in upsert_documents and upsert_content, allowing for more complete inline information. * Add an input type for platform accounts Add functions to upsert platform accounts (individually or in bulk) Keep the old create_account_in_space function as a shim for now. Use the new upsert_account in upsert_documents and upsert_content, allowing for more complete inline information. * bulk upsert accounts, use database function imports * add comment for future * use better import method * commonjs-to-esm --------- Co-authored-by: Marc-Antoine Parent <maparent@acm.org>
1 parent 40b63ec commit 7cb2e08

8 files changed

Lines changed: 1034 additions & 133 deletions

apps/roam/src/components/DiscourseContextOverlay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const getOverlayInfo = async (tag: string): Promise<DiscourseData> => {
3939
relations,
4040
}),
4141
// @ts-ignore - backend to be added to roamjs-components
42-
window.roamAlphaAPI.data.backend.q(
42+
window.roamAlphaAPI.data.async.q(
4343
`[:find ?a :where [?b :node/title "${normalizePageTitle(tag)}"] [?a :block/refs ?b]]`,
4444
),
4545
]);

apps/roam/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
installDiscourseFloatingMenu,
2828
removeDiscourseFloatingMenu,
2929
} from "./components/DiscourseFloatingMenu";
30+
import { createOrUpdateDiscourseEmbedding } from "./utils/syncDgNodesToSupabase";
3031

3132
const initPostHog = () => {
3233
posthog.init("phc_SNMmBqwNfcEpNduQ41dBUjtGNEUEKAy6jTn63Fzsrax", {
@@ -135,6 +136,9 @@ export default runExtension(async (onloadArgs) => {
135136
getDiscourseNodes: getDiscourseNodes,
136137
};
137138

139+
// TODO: REMOVE AFTER TESTING
140+
await createOrUpdateDiscourseEmbedding(onloadArgs.extensionAPI);
141+
138142
installDiscourseFloatingMenu(onloadArgs.extensionAPI);
139143

140144
return {

0 commit comments

Comments
 (0)