-
Notifications
You must be signed in to change notification settings - Fork 51
Bug: native mode filepath bas path is not populating #514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@nerdalert Hi, I would like to work on this. Can I get some more info on it? How can I replicate this bug? |
Hi @elkielki apologies for the slow replay, was open pto. There is a bug in uploading, once that is fixed I will shoot over where to change the code. I * think * it will look something like this but can't verify until the file upload is patched: $ git diff
diff --git a/src/components/Contribute/Knowledge/Native/index.tsx b/src/components/Contribute/Knowledge/Native/index.tsx
index b8bddd2..deaeae4 100644
--- a/src/components/Contribute/Knowledge/Native/index.tsx
+++ b/src/components/Contribute/Knowledge/Native/index.tsx
@@ -73,6 +73,7 @@ export const KnowledgeFormNative: React.FunctionComponent<KnowledgeFormProps> =
const [filePath, setFilePath] = useState<string>('');
// Document Information (using fields from KnowledgeFormData)
+ const LOCAL_TAXONOMY_ROOT_DIR = process.env.NEXT_PUBLIC_LOCAL_TAXONOMY_ROOT_DIR || `${process.env.HOME}/.instructlab-ui`;
const [knowledgeDocumentRepositoryUrl, setKnowledgeDocumentRepositoryUrl] = useState<string>('');
const [knowledgeDocumentCommit, setKnowledgeDocumentCommit] = useState<string>('');
const [documentName, setDocumentName] = useState<string>(''); // store as comma-separated
@@ -390,7 +391,7 @@ export const KnowledgeFormNative: React.FunctionComponent<KnowledgeFormProps> =
// Set repositoryUrl if not set
if (!knowledgeDocumentRepositoryUrl) {
- const baseUrl = repoUrl.replace(/\/[^/]+$/, '');
+ const baseUrl = `${LOCAL_TAXONOMY_ROOT_DIR}/taxonomy-knowledge-docs`;
setKnowledgeDocumentRepositoryUrl(baseUrl);
devLog(`Set knowledgeDocumentRepositoryUrl to: ${baseUrl}`);
}
@@ -463,7 +464,7 @@ export const KnowledgeFormNative: React.FunctionComponent<KnowledgeFormProps> =
setDocumentOutline(autoFillKnowledgeFields.documentOutline);
setSubmissionSummary(autoFillKnowledgeFields.submissionSummary);
setDomain(autoFillKnowledgeFields.domain);
- setKnowledgeDocumentRepositoryUrl('~/.instructlab-ui/taxonomy-knowledge-docs');
+ setKnowledgeDocumentRepositoryUrl(`${LOCAL_TAXONOMY_ROOT_DIR}/taxonomy-knowledge-docs`);
setKnowledgeDocumentCommit(autoFillKnowledgeFields.knowledgeDocumentCommit);
setDocumentName(autoFillKnowledgeFields.documentName);
setFilePath(autoFillKnowledgeFields.filePath);
Ty ty |
@vishnoianil @nerdalert No problem :) I'll check those issues out instead. |
/undefined/knowledgefiles/foo.md
Needs to use the
NEXT_PUBLIC_TAXONOMY_ROOT_DIR
as the base.The text was updated successfully, but these errors were encountered: