This is an automated email from the ASF dual-hosted git repository.
ljmotta pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git
The following commit(s) were added to refs/heads/main by this push:
new fd788632cf4 kie-issues#1725: KIE Tools: folder indicator is lost
(#2824)
fd788632cf4 is described below
commit fd788632cf45a597d5e8c09ded6acdf37cb1b8bd
Author: Kusuma04-dev <[email protected]>
AuthorDate: Thu Jan 2 19:00:56 2025 +0530
kie-issues#1725: KIE Tools: folder indicator is lost (#2824)
Co-authored-by: chinnamatli kusumalatha
<[email protected]>
---
packages/online-editor/src/home/HomePage.tsx | 112 ++++++++++++++-------------
1 file changed, 57 insertions(+), 55 deletions(-)
diff --git a/packages/online-editor/src/home/HomePage.tsx
b/packages/online-editor/src/home/HomePage.tsx
index b0a7f639172..55004e5f74e 100644
--- a/packages/online-editor/src/home/HomePage.tsx
+++ b/packages/online-editor/src/home/HomePage.tsx
@@ -320,62 +320,64 @@ export function WorkspaceCard(props: {
rejected={() => <>ERROR</>}
resolved={(workspace) => (
<>
- {(editableFiles.length === 1 && workspace.descriptor.origin.kind ===
WorkspaceKind.LOCAL && (
- <Card
- isSelected={props.isSelected}
- isSelectable={true}
- onMouseOver={() => setHovered(true)}
- onMouseLeave={() => setHovered(false)}
- isHoverable={true}
- isCompact={true}
- style={{ cursor: "pointer" }}
- onClick={() => {
- history.push({
- pathname: routes.workspaceWithFilePath.path({
- workspaceId: editableFiles[0].workspaceId,
- fileRelativePath:
editableFiles[0].relativePathWithoutExtension,
- extension: editableFiles[0].extension,
- }),
- });
- }}
- >
- <CardHeader>
- <FileLink file={editableFiles[0]} style={{ width: "100%",
minWidth: 0 }}>
- <CardHeaderMain style={{ width: "100%" }}>
- <SingleFileWorkspaceListItem
- isBig={true}
- file={editableFiles[0]}
- workspaceDescriptor={workspace.descriptor}
+ {(editableFiles.length === 1 &&
+ workspacePromise.data?.files.length === 1 &&
+ workspace.descriptor.origin.kind === WorkspaceKind.LOCAL && (
+ <Card
+ isSelected={props.isSelected}
+ isSelectable={true}
+ onMouseOver={() => setHovered(true)}
+ onMouseLeave={() => setHovered(false)}
+ isHoverable={true}
+ isCompact={true}
+ style={{ cursor: "pointer" }}
+ onClick={() => {
+ history.push({
+ pathname: routes.workspaceWithFilePath.path({
+ workspaceId: editableFiles[0].workspaceId,
+ fileRelativePath:
editableFiles[0].relativePathWithoutExtension,
+ extension: editableFiles[0].extension,
+ }),
+ });
+ }}
+ >
+ <CardHeader>
+ <FileLink file={editableFiles[0]} style={{ width: "100%",
minWidth: 0 }}>
+ <CardHeaderMain style={{ width: "100%" }}>
+ <SingleFileWorkspaceListItem
+ isBig={true}
+ file={editableFiles[0]}
+ workspaceDescriptor={workspace.descriptor}
+ />
+ </CardHeaderMain>
+ </FileLink>
+ <CardActions
+ style={{ visibility: isHovered ? "visible" : "hidden" }}
+ onClick={(e) => e.stopPropagation()} // Prevent bug when
clicking at the backdrop of ResponsiveDropdown
+ >
+ <DeleteDropdownWithConfirmation
+ key={`${workspace.descriptor.workspaceId}-${isHovered}`}
+ onDelete={() => {
+ props.onDelete?.();
+ workspaces.deleteWorkspace({ workspaceId:
props.workspaceId });
+ }}
+ item={
+ <Flex flexWrap={{ default: "nowrap" }}>
+ <FlexItem>
+ Delete
<b>{`"${editableFiles[0].nameWithoutExtension}"`}</b>
+ </FlexItem>
+ <FlexItem>
+ <b>
+ <FileLabel
extension={editableFiles[0].extension} />
+ </b>
+ </FlexItem>
+ </Flex>
+ }
/>
- </CardHeaderMain>
- </FileLink>
- <CardActions
- style={{ visibility: isHovered ? "visible" : "hidden" }}
- onClick={(e) => e.stopPropagation()} // Prevent bug when
clicking at the backdrop of ResponsiveDropdown
- >
- <DeleteDropdownWithConfirmation
- key={`${workspace.descriptor.workspaceId}-${isHovered}`}
- onDelete={() => {
- props.onDelete?.();
- workspaces.deleteWorkspace({ workspaceId:
props.workspaceId });
- }}
- item={
- <Flex flexWrap={{ default: "nowrap" }}>
- <FlexItem>
- Delete
<b>{`"${editableFiles[0].nameWithoutExtension}"`}</b>
- </FlexItem>
- <FlexItem>
- <b>
- <FileLabel extension={editableFiles[0].extension}
/>
- </b>
- </FlexItem>
- </Flex>
- }
- />
- </CardActions>
- </CardHeader>
- </Card>
- )) || (
+ </CardActions>
+ </CardHeader>
+ </Card>
+ )) || (
<Card
isExpanded={false}
isSelected={props.isSelected}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]