Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e393965
init
mdroidian Apr 27, 2024
00aa560
config page, roam comments
mdroidian Apr 29, 2024
a323e7a
add githubsync
mdroidian Apr 30, 2024
bf89829
get comments
mdroidian May 1, 2024
f342f36
add comments header
mdroidian May 1, 2024
8fc4d29
multipele: observers fixed, add comment, get comments, sent page to g…
mdroidian May 3, 2024
b17b1ea
rebase
mdroidian May 9, 2024
79617c4
working state
mdroidian May 8, 2024
e953356
rebase
mdroidian May 9, 2024
bae6519
github file content encode fix
mdroidian May 9, 2024
f9f14a6
rebase
mdroidian May 9, 2024
402ada7
misc
mdroidian May 9, 2024
1b2bd93
use existing onClose()
mdroidian May 9, 2024
dab592a
use createConfigObserver instead of renderConfigPage
mdroidian May 9, 2024
32452f3
misc
mdroidian May 9, 2024
af67257
save repo to issue and pull from props when downloading comments
mdroidian May 10, 2024
91f3aba
better copy
mdroidian May 10, 2024
d8b5e26
add github api reference links
mdroidian May 10, 2024
8565186
add docs
mdroidian May 10, 2024
c79a736
link to docs from Readme
mdroidian May 10, 2024
d3d7c04
add comment cache (#254)
mdroidian May 14, 2024
82c8df9
better error messages
mdroidian May 14, 2024
6b6b52f
change Comments Block from reference to inline query
mdroidian May 14, 2024
f899fee
misc PR Feedback
mdroidian May 14, 2024
6a356e5
check for comment before sending apiPost
mdroidian May 14, 2024
6db4cbf
re-add NODETEXT and NODEUID for sidebar support
mdroidian May 14, 2024
a2ffa74
handle sidebar pages
mdroidian May 14, 2024
8218df8
move props to sub component, store in localStorage (#255)
mdroidian May 14, 2024
57b2b2f
stop access-token checks if we've alread received from auth window
mdroidian May 14, 2024
d85d3f6
update docs
mdroidian May 14, 2024
72ed156
remove isVisible, replace with JSX conditional
mdroidian May 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
handle sidebar pages
  • Loading branch information
mdroidian committed May 14, 2024
commit a2ffa743797e433d410dd0399bd4c42220b180a8
13 changes: 11 additions & 2 deletions src/components/Export.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,12 @@ const ExportDialog: ExportDialogComponent = ({
title,
body,
setError,
pageUid,
}: {
title: string;
body: string;
setError: (error: string) => void;
pageUid: string;
}): Promise<{ status: number }> => {
try {
// https://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28#create-an-issue
Expand All @@ -260,7 +262,7 @@ const ExportDialog: ExportDialogComponent = ({
}

if (response.status === 201) {
const props = getBlockProps(currentPageUid);
const props = getBlockProps(pageUid);
const newProps = {
...props,
["github-sync"]: {
Expand All @@ -278,7 +280,7 @@ const ExportDialog: ExportDialogComponent = ({
};
window.roamAlphaAPI.updateBlock({
block: {
uid: currentPageUid,
uid: pageUid,
props: newProps,
},
});
Expand Down Expand Up @@ -716,11 +718,18 @@ const ExportDialog: ExportDialogComponent = ({
).status;
}
if (githubDestination === "Issue") {
const pageUid =
typeof results === "function" ? "" : results[0].uid; // TODO handle multiple results
if (!pageUid) {
setError("No page UID found.");
return;
}
status = (
await writeFileToIssue({
title: title.replace(/\.[^/.]+$/, ""), // remove extension
body: content,
setError,
pageUid,
})
).status;
}
Expand Down