Skip to content

Commit

Permalink
feat: don't filter data file by extname (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
z0gSh1u authored Oct 9, 2024
1 parent 3b84c70 commit 992023d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
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": "vectorse@126.com",
"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

0 comments on commit 992023d

Please sign in to comment.