Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

Make suggest edits button work #177

Open
wants to merge 2 commits into
base: publish
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion components/utilities/suggestEdits.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const SuggestEdits = ({ sourcefile }) => {
<i className={styles.Icon}>edit</i>
<a
className={styles.Link}
href="https://github.com/open-metadata/OpenMetadata/issues/new?assignees=&labels=documentation&template=doc_update.md&title="
href={sourcefile}
target="_blank"
rel="noopener noreferrer"
>
Expand Down
16 changes: 9 additions & 7 deletions pages/[...slug].js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ export default function Article({
let suggestEditURL;
const { sourceFile } = useAppContext();

suggestEditURL = "https://github.com/open-metadata/docs/issues";
suggestEditURL = sourceFile
? sourceFile
: "https://github.com/open-metadata/OpenMetadata/tree/main/openmetadata-docs" +
filename.substring(filename.indexOf("/content/"));

const components = {
Note,
Expand Down Expand Up @@ -206,11 +209,10 @@ export default function Article({
>
<div className={classNames("content", styles.ContentContainer)}>
<MDXRemote {...source} components={components} />
{/* <Helpful slug={slug} sourcefile={suggestEditURL} /> */}
<Helpful slug={slug} sourcefile={suggestEditURL} />
</div>
</article>
<Psa />
<Helpful />
<div className={styles.Buttons}>{arrowContainer}</div>
</section>
<FloatingNav slug={slug} menu={menu} className="floatingNav" />
Expand Down Expand Up @@ -263,10 +265,10 @@ export async function getStaticProps(context) {
props["source"] = source;
props["currMenuItem"] = current
? {
name: current.name,
url: current.url,
isVersioned: !!current.isVersioned,
}
name: current.name,
url: current.url,
isVersioned: !!current.isVersioned,
}
: null;
props["nextMenuItem"] = next ? { name: next.name, url: next.url } : null;
props["prevMenuItem"] = prev ? { name: prev.name, url: prev.url } : null;
Expand Down