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

refactor: folders FTA #4345

Draft
wants to merge 27 commits into
base: next
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
65f7c3f
refactor(app-aco): use FTA in app-aco - folder entity
leopuleo Jun 24, 2024
f30304a
refactor(app-aco): use FTA in app-aco - folder entity
leopuleo Jun 25, 2024
0702593
Merge branch 'refs/heads/next' into leo/refactor/app-aco-fta
leopuleo Aug 15, 2024
ea0e4d5
refactor(app-aco): implement useCase and controller layers
leopuleo Aug 27, 2024
ce1bfe2
refactor(app-aco): implement presenter
leopuleo Aug 27, 2024
a5be5e1
refactor(app-aco): add loading use case decoration
leopuleo Aug 27, 2024
2370f07
refactor(app-aco): move Graphql interface to gateway
leopuleo Aug 27, 2024
bf1e730
chore: wip
leopuleo Sep 18, 2024
9851745
Merge branch 'next' into leo/refactor/app-aco-fta
leopuleo Oct 15, 2024
171d1ad
wip: folders FTA
leopuleo Oct 17, 2024
292441e
wip: retrieve data from gateway
leopuleo Oct 17, 2024
d87bf4f
fix: loading folders
leopuleo Oct 17, 2024
f155108
fix: move folderLevelPermissions into new hook
leopuleo Oct 17, 2024
11f093e
refactor: pass type as repo dependency
leopuleo Oct 17, 2024
7309428
refactor: flp FTA
leopuleo Oct 17, 2024
4ee8d25
fix: revert the folder tree state in case of error on drop
leopuleo Oct 18, 2024
295039a
fix: remove previous implementation files
leopuleo Oct 18, 2024
c6c467c
feat: move vm into listFolders
leopuleo Oct 18, 2024
ba5011d
refactor: create separate folders useCases
leopuleo Oct 19, 2024
22bd689
wip: create instance class
leopuleo Oct 21, 2024
1b8b210
refactor: introduce GetFolderLevelPermission feature
leopuleo Oct 21, 2024
0c5b524
refactor: introduce GetFolderLevelPermission feature
leopuleo Oct 21, 2024
603aa5e
refactor: add loading namespace
leopuleo Oct 21, 2024
581ab8e
Merge branch 'next' into leo/refactor/app-aco-fta
leopuleo Oct 21, 2024
22c5c9c
chore: run adio
leopuleo Oct 21, 2024
a478e6f
Merge branch 'next' into leo/refactor/app-aco-fta
leopuleo Nov 8, 2024
9cd7c33
Merge branch 'next' into leo/refactor/app-aco-fta
leopuleo Nov 12, 2024
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
1 change: 1 addition & 0 deletions packages/app-aco/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@webiny/app-admin": "0.0.0",
"@webiny/app-headless-cms-common": "0.0.0",
"@webiny/app-security": "0.0.0",
"@webiny/app-utils": "0.0.0",
"@webiny/app-wcp": "0.0.0",
"@webiny/form": "0.0.0",
"@webiny/plugins": "0.0.0",
Expand Down
21 changes: 0 additions & 21 deletions packages/app-aco/src/Folders.tsx

This file was deleted.

15 changes: 8 additions & 7 deletions packages/app-aco/src/components/FolderTree/List/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ export const List = ({
newTree: NodeModel<DndFolderItemData>[],
{ dragSourceId, dropTargetId }: DropOptions
) => {
// Store the current state of the tree before the drop action
const oldTree = [...treeData];
try {
const item = folders.find(folder => folder.id === dragSourceId);

Expand All @@ -65,14 +67,13 @@ export const List = ({

setTreeData(newTree);

await updateFolder(
{
...item,
parentId: dropTargetId !== ROOT_FOLDER ? (dropTargetId as string) : null
},
{ refetchFoldersList: true }
);
await updateFolder({
...item,
parentId: dropTargetId !== ROOT_FOLDER ? (dropTargetId as string) : null
});
} catch (error) {
// If an error occurs, revert the tree back to its original state
setTreeData(oldTree);
return showSnackbar(error.message);
}
};
Expand Down
4 changes: 2 additions & 2 deletions packages/app-aco/src/components/FolderTree/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const FolderTree = ({
onFolderClick,
rootFolderLabel
}: FolderTreeProps) => {
const { folders, folderLevelPermissions: flp } = useFolders();
const { folders, folderLevelPermissions: flp, loading } = useFolders();
const localFolders = useMemo(() => {
if (!folders) {
return [];
Expand All @@ -44,7 +44,7 @@ export const FolderTree = ({
}, [folders]);

const renderList = () => {
if (!folders) {
if (loading.INIT || loading.LIST) {
return <Loader />;
}

Expand Down
Loading
Loading