-
Notifications
You must be signed in to change notification settings - Fork 12
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
Feat: Add file tree, add include and exclude prefix for auto ingestion #639
Conversation
}); | ||
} | ||
}} | ||
className="justify-start items-center group ml-2 hidden group-hover:block" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use visible
/invisible
instead of hidden
/block
This will prevent the row from resizing when it adds the icon button to the row
className="justify-start items-center group ml-2 hidden group-hover:block" | |
className="justify-start items-center group ml-2 invisible group-hover:visible" |
58ed35e
to
e804f6f
Compare
apiclient/types/knowledgesource.go
Outdated
FilePathPrefixInclude []string `json:"filePathPrefixInclude,omitempty"` | ||
FilePathPrefixExclude []string `json:"filePathPrefixExclude,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this both here and KnowledgeSourceManifest
? Seems like just in KnowledgeSourceManifest
is enough.
pkg/api/handlers/knowledgesource.go
Outdated
FilePathPrefixExclude: knowledgeSource.Spec.Manifest.FilePathPrefixExclude, | ||
FilePathPrefixInclude: knowledgeSource.Spec.Manifest.FilePathPrefixInclude, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be removed if we use the fields from KnowledgeSourceManifest
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, right. I will drop that
matchInclude := isFileMatchPrefixPattern(file.Spec.FileName, source.Spec.Manifest.FilePathPrefixInclude) | ||
matchExclude := isFileMatchPrefixPattern(file.Spec.FileName, source.Spec.Manifest.FilePathPrefixExclude) | ||
switch { | ||
case source.Spec.Manifest.AutoApprove != nil && *source.Spec.Manifest.AutoApprove: | ||
file.Spec.Approved = typed.Pointer(true) | ||
case matchExclude: | ||
file.Spec.Approved = typed.Pointer(false) | ||
case matchInclude: | ||
file.Spec.Approved = typed.Pointer(true) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: only do the processing that's necessary.
matchInclude := isFileMatchPrefixPattern(file.Spec.FileName, source.Spec.Manifest.FilePathPrefixInclude) | |
matchExclude := isFileMatchPrefixPattern(file.Spec.FileName, source.Spec.Manifest.FilePathPrefixExclude) | |
switch { | |
case source.Spec.Manifest.AutoApprove != nil && *source.Spec.Manifest.AutoApprove: | |
file.Spec.Approved = typed.Pointer(true) | |
case matchExclude: | |
file.Spec.Approved = typed.Pointer(false) | |
case matchInclude: | |
file.Spec.Approved = typed.Pointer(true) | |
} | |
switch { | |
case source.Spec.Manifest.AutoApprove != nil && *source.Spec.Manifest.AutoApprove: | |
file.Spec.Approved = typed.Pointer(true) | |
case isFileMatchPrefixPattern(file.Spec.FileName, source.Spec.Manifest.FilePathPrefixInclude): | |
file.Spec.Approved = typed.Pointer(false) | |
case isFileMatchPrefixPattern(file.Spec.FileName, source.Spec.Manifest.FilePathPrefixInclude): | |
file.Spec.Approved = typed.Pointer(true) | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
discovered above issue
@ryanhopperlowe good catch, should be fixed 🙏 |
Beautiful 🙌 |
Signed-off-by: Daishan Peng <[email protected]>
Signed-off-by: Daishan Peng <[email protected]>
Signed-off-by: Daishan Peng <[email protected]>
Signed-off-by: Daishan Peng <[email protected]>
Signed-off-by: Daishan Peng <[email protected]>
Signed-off-by: Daishan Peng <[email protected]>
8045809
to
88e4c53
Compare
This PR add file tree to show knowledge files. Demo is here https://www.loom.com/share/0e707405c1194ea1a9a1ffd595347a22
It also adds a backend piece of functionality to include/exclude folder prefix so that user can add a folder in UI to automatically ingest files inside the folder.