Skip to content
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: don't filter data file by extname #63

Merged
merged 1 commit into from
Oct 9, 2024
Merged
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 packages/secretnote-lite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alipay/secretnote-lite",
"version": "0.0.43",
"version": "0.0.44",
"license": "Apache-2.0",
"author": "[email protected]",
"repository": "https://github.com/secretflow/secretnote/tree/main/packages/secretnote",
Expand Down
4 changes: 1 addition & 3 deletions packages/secretnote-lite/src/modules/file/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
import { SecretNoteServerManager, ServerStatus } from '../server';

export const BASE_PATH = '/';
export const FILE_EXTS = ['.csv', '.log', '.txt', '.jsonl'];
@singleton()
export class FileService {
protected readonly contentsManager: ContentsManager;
Expand Down Expand Up @@ -183,8 +182,7 @@ export class FileService {
}

private isFileVisible(path: string) {
const ext = this.getFileExtByPath(path);
return FILE_EXTS.includes(`.${ext}`);
return true; // let all files be visible
}

private onServerChanged() {
Expand Down
3 changes: 1 addition & 2 deletions packages/secretnote-lite/src/modules/file/view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { SideBarContribution } from '@/modules/layout';
import { genericErrorHandler, readFile } from '@/utils';

import './index.less';
import { FILE_EXTS, FileService } from './service';
import { FileService } from './service';

const { DirectoryTree } = Tree;

Expand Down Expand Up @@ -97,7 +97,6 @@ export const FileComponent = () => {

const uploadRender = (nodeData: DataNode) => {
const props: UploadProps = {
accept: FILE_EXTS.join(','),
beforeUpload: async (file) => {
const isExisted = await fileService.isFileExist(nodeData, file.name);
if (isExisted) {
Expand Down
Loading