diff --git a/package.json b/package.json index 60adf2a5c1..b5e6f09b5b 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "@leafygreen-ui/guide-cue": "5.0.5", "@leafygreen-ui/icon": "11.26.0", "@leafygreen-ui/icon-button": "15.0.19", + "@leafygreen-ui/info-sprinkle": "1.0.2", "@leafygreen-ui/inline-definition": "6.0.14", "@leafygreen-ui/interaction-ring": "7.0.2", "@leafygreen-ui/leafygreen-provider": "3.1.11", diff --git a/src/pages/spawn/spawnHost/SpawnHostCard.stories.tsx b/src/pages/spawn/spawnHost/SpawnHostCard.stories.tsx index fa5affa789..0568b69d20 100644 --- a/src/pages/spawn/spawnHost/SpawnHostCard.stories.tsx +++ b/src/pages/spawn/spawnHost/SpawnHostCard.stories.tsx @@ -1,5 +1,5 @@ -import { SpawnHostCard } from "pages/spawn/spawnHost/SpawnHostCard"; import { CustomStoryObj, CustomMeta } from "test_utils/types"; +import SpawnHostCard from "./SpawnHostCard"; export default { title: "Pages/Spawn/Spawn Host Card", diff --git a/src/pages/spawn/spawnHost/SpawnHostCard.tsx b/src/pages/spawn/spawnHost/SpawnHostCard.tsx index 4a75eaeca3..c43047e611 100644 --- a/src/pages/spawn/spawnHost/SpawnHostCard.tsx +++ b/src/pages/spawn/spawnHost/SpawnHostCard.tsx @@ -1,5 +1,6 @@ import styled from "@emotion/styled"; import Badge from "@leafygreen-ui/badge"; +import { InfoSprinkle } from "@leafygreen-ui/info-sprinkle"; import { Analytics, useSpawnAnalytics, @@ -12,6 +13,7 @@ import { size } from "constants/tokens"; import { useDateFormat } from "hooks"; import { HostStatus } from "types/host"; import { MyHost } from "types/spawn"; +import { workstationSupportedDistros } from "./constants"; type SendEvent = Analytics["sendEvent"]; @@ -19,7 +21,7 @@ interface SpawnHostCardProps { host: MyHost; } -export const SpawnHostCard: React.FC = ({ host }) => { +const SpawnHostCard: React.FC = ({ host }) => { const { sendEvent } = useSpawnAnalytics(); return ( @@ -88,18 +90,29 @@ const spawnHostCardFieldMaps = (sendEvent: SendEvent) => ({ ), IDE: (host: MyHost) => host?.distro?.isVirtualWorkStation && - host?.status === HostStatus.Running ? ( - + host?.status === HostStatus.Running && + workstationSupportedDistros.includes(host?.distro?.id) ? ( + sendEvent({ name: "Opened IDE" })} > - Open IDE + Open IDE (Deprecated) - + + The Evergreen IDE is now deprecated and is no longer installed on new + workstations. + + ) : undefined, }); +const IDEContainer = styled.div` + display: flex; + gap: ${size.xs}; +`; const PaddedBadge = styled(Badge)` margin-right: ${size.xs}; `; + +export default SpawnHostCard; diff --git a/src/pages/spawn/spawnHost/SpawnHostTable.tsx b/src/pages/spawn/spawnHost/SpawnHostTable.tsx index 125246acca..291987149f 100644 --- a/src/pages/spawn/spawnHost/SpawnHostTable.tsx +++ b/src/pages/spawn/spawnHost/SpawnHostTable.tsx @@ -10,7 +10,7 @@ import { BaseTable } from "components/Table/BaseTable"; import { size } from "constants/tokens"; import { useQueryParam } from "hooks/useQueryParam"; import { MyHost, QueryParams } from "types/spawn"; -import { SpawnHostCard } from "./SpawnHostCard"; +import SpawnHostCard from "./SpawnHostCard"; import { SpawnHostTableActions } from "./SpawnHostTableActions"; interface SpawnHostTableProps { diff --git a/src/pages/spawn/spawnHost/__snapshots__/SpawnHostCard.stories.storyshot b/src/pages/spawn/spawnHost/__snapshots__/SpawnHostCard.stories.storyshot index bff2aeb70b..f7b6033af2 100644 --- a/src/pages/spawn/spawnHost/__snapshots__/SpawnHostCard.stories.storyshot +++ b/src/pages/spawn/spawnHost/__snapshots__/SpawnHostCard.stories.storyshot @@ -196,7 +196,9 @@ exports[`Snapshot Tests Pages/Spawn/Spawn Host Card Default 1`] = ` IDE
- +
diff --git a/src/pages/spawn/spawnHost/constants.ts b/src/pages/spawn/spawnHost/constants.ts new file mode 100644 index 0000000000..a120ff8132 --- /dev/null +++ b/src/pages/spawn/spawnHost/constants.ts @@ -0,0 +1,6 @@ +const workstationSupportedDistros = [ + "ubuntu1804-workstation", + "ubuntu1804-workstation-graviton", +]; + +export { workstationSupportedDistros }; diff --git a/src/pages/spawn/spawnHost/index.ts b/src/pages/spawn/spawnHost/index.ts index 3f8436265f..7d2e98bc8f 100644 --- a/src/pages/spawn/spawnHost/index.ts +++ b/src/pages/spawn/spawnHost/index.ts @@ -1,6 +1,5 @@ export { SpawnHostTable } from "./SpawnHostTable"; export { SpawnHostButton } from "./SpawnHostButton"; export { SpawnHostActionButton } from "./SpawnHostActionButton"; -export { SpawnHostCard } from "./SpawnHostCard"; export { EditSpawnHostModal } from "./EditSpawnHostModal"; export { EditSpawnHostButton } from "./EditSpawnHostButton"; diff --git a/yarn.lock b/yarn.lock index a57cf18f0f..948687e543 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3568,6 +3568,18 @@ "@leafygreen-ui/emotion" "^4.0.7" lodash "^4.17.21" +"@leafygreen-ui/info-sprinkle@1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@leafygreen-ui/info-sprinkle/-/info-sprinkle-1.0.2.tgz#bce738c71e2fdbf99950c22e70a938d270f8ebb1" + integrity sha512-SWab7+ljlNQQML6f2t2VOnp2JtZjcJ+KcZcVHUikjt7gYnS6+YtK9MEwZOFsLue6IchaJgPNsVA+Fm+e/PjSuQ== + dependencies: + "@leafygreen-ui/emotion" "^4.0.7" + "@leafygreen-ui/icon" "^11.25.0" + "@leafygreen-ui/lib" "^13.0.0" + "@leafygreen-ui/palette" "^4.0.7" + "@leafygreen-ui/tokens" "^2.2.0" + "@leafygreen-ui/tooltip" "^11.0.0" + "@leafygreen-ui/inline-definition@6.0.14": version "6.0.14" resolved "https://registry.yarnpkg.com/@leafygreen-ui/inline-definition/-/inline-definition-6.0.14.tgz#fd0ba775a2ff88520ed31d0489e57fd90416bad3"