-
Notifications
You must be signed in to change notification settings - Fork 45
feat(desktop): add Convert to cloud button to workspace footer #453
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| import { Tooltip, TooltipContent, TooltipTrigger } from "@superset/ui/tooltip"; | ||
| import { LuCloud } from "react-icons/lu"; | ||
|
|
||
| const BUTTON_HEIGHT = 24; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major Extract the duplicated BUTTON_HEIGHT constant. The 🔎 Recommended refactorCreate a shared constants file: // apps/desktop/src/renderer/screens/main/components/WorkspaceView/WorkspaceFooter/constants.ts
export const BUTTON_HEIGHT = 24;Then import it in both components: +import { BUTTON_HEIGHT } from "../../constants";
import { Tooltip, TooltipContent, TooltipTrigger } from "@superset/ui/tooltip";
import { LuCloud } from "react-icons/lu";
-const BUTTON_HEIGHT = 24;Apply the same change to As per coding guidelines, co-locate shared constants at the appropriate level.
🤖 Prompt for AI Agents |
||
|
|
||
| export function ConvertToCloudButton() { | ||
| const handleConvertToCloud = () => { | ||
| // TODO: Implement convert to cloud functionality | ||
| }; | ||
|
|
||
| return ( | ||
| <Tooltip> | ||
| <TooltipTrigger asChild> | ||
| <button | ||
| type="button" | ||
| onClick={handleConvertToCloud} | ||
| style={{ height: `${BUTTON_HEIGHT}px` }} | ||
| className="flex items-center gap-1.5 px-2.5 rounded border border-foreground/20 bg-foreground/5 hover:bg-foreground/10 text-[11px] font-semibold text-foreground transition-colors" | ||
| > | ||
| <LuCloud className="size-3.5" /> | ||
| <span>Convert to cloud</span> | ||
| </button> | ||
| </TooltipTrigger> | ||
| <TooltipContent side="top" sideOffset={8}> | ||
| Convert workspace to cloud | ||
| </TooltipContent> | ||
| </Tooltip> | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { ConvertToCloudButton } from "./ConvertToCloudButton"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the incorrect import path causing pipeline failure.
The import path
../ConvertToCloudButtonis incorrect and causes a module resolution error. Based on the AI summary, the component is located inWorkspaceFooter/components/ConvertToCloudButton/, but this file is inWorkspaceActionBar/components/WorkspaceActionBarRight/.🔎 Proposed fix
Or preferably, use an alias as per coding guidelines:
📝 Committable suggestion
🧰 Tools
🪛 GitHub Actions: CI
[error] 24-24: Cannot find module '../ConvertToCloudButton' or its corresponding type declarations.
🤖 Prompt for AI Agents