Skip to content

Commit

Permalink
feat(FR-368): Update folder list Immediately after creating a new fol…
Browse files Browse the repository at this point in the history
…der.
  • Loading branch information
agatha197 committed Jan 22, 2025
1 parent 644d9cc commit 918906c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
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'),
);
document.dispatchEvent(
new CustomEvent('backend-ai-folder-updated'),
);
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-updated', (e) =>
this._refreshFolderList(true, 'folder-updated'),
);
}

_isUncontrollableStatus(status: VFolderOperationStatus) {
Expand Down

0 comments on commit 918906c

Please sign in to comment.