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(FR-368): Update folder list Immediately after creating a new folder. #3053

Open
wants to merge 1 commit into
base: main
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
3 changes: 3 additions & 0 deletions react/src/components/FolderCreateModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ const FolderCreateModal: React.FC<FolderCreateModalProps> = ({
document.dispatchEvent(
new CustomEvent('backend-ai-folder-list-changed'),
);
agatha197 marked this conversation as resolved.
Show resolved Hide resolved
document.dispatchEvent(
new CustomEvent('backend-ai-folder-created'),
);
onRequestClose(result);
},
onError: (error) => {
Expand Down
4 changes: 0 additions & 4 deletions src/components/backend-ai-data-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ interface GroupData {
@customElement('backend-ai-data-view')
export default class BackendAIData extends BackendAIPage {
@property({ type: String }) apiMajorVersion = '';
@property({ type: String }) folderListFetchKey = 'first';
@property({ type: Boolean }) is_admin = false;
@property({ type: Boolean }) enableStorageProxy = false;
@property({ type: Boolean }) enableInferenceWorkload = false;
Expand Down Expand Up @@ -814,9 +813,6 @@ export default class BackendAIData extends BackendAIPage {
// already connected
this._getStorageProxyInformation();
}
document.addEventListener('backend-ai-folder-list-changed', () => {
this.folderListFetchKey = new Date().toISOString();
});
document.addEventListener('backend-ai-vfolder-cloning', (e: any) => {
if (e.detail) {
const selectedItems = e.detail;
Expand Down
3 changes: 3 additions & 0 deletions src/components/backend-ai-storage-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,9 @@ export default class BackendAiStorageList extends BackendAIPage {
document.addEventListener('backend-ai-group-changed', (e) =>
this._refreshFolderList(true, 'group-changed'),
);
document.addEventListener('backend-ai-folder-created', (e) =>
this._refreshFolderList(true, 'folder-updated'),
);
}

_isUncontrollableStatus(status: VFolderOperationStatus) {
Expand Down
Loading