Skip to content

Commit

Permalink
docs: refactor Getting Started landing page DOC-1067 DOC-1069 (#2345)
Browse files Browse the repository at this point in the history
* docs: refactor Getting Started landing page DOC-1067

* docs: add navigation card components

* chore: Add a few more grid styles

* docs: add Jest test and adjust Getting Started landing page

* docs: fix formatting

* docs: fix lint errors in SimpleCard

* docs: refactor grid test DOC-1067

* docs: reduce duplication in SimpleCard test

* docs: reduce duplication in SimpleCard test

* docs: fix formatting DOC-1067

* docs: update SimpleCardGrid naming DOC-1067

* docs: reduce duplication in SimpleCard test

* docs: reduce duplication in SimpleCard test

* docs: add overview journey image

* Optimised images with calibre/image-actions

* docs: adjust landing page text

* docs: update overview image

* Optimised images with calibre/image-actions

* docs: update overview image

* docs: adjust width and hide toc

* docs: hide image on mobile

* docs: redo button

* chore: Changes to cards

* docs: remove row from simplecard

* chore: Update the CSS on cards

* chore: Make the cards hover

* docs: extra fixes on simple cards

* docs: loop elems once and remove button outline

* docs: rephrase introduction

* docs: fix the width & height of button

* docs: change icon sizing to literal

* docs: convert arrow to static asset to prevent jank

* docs: fix up grid test

* docs: remove unused param in grid test

* docs: fix cursor on footer button

* Apply suggestions from code review

Co-authored-by: Karl Cardenas <[email protected]>

* docs: fix formatting

---------

Co-authored-by: yuliiiah <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Karl Cardenas <[email protected]>
  • Loading branch information
4 people committed Mar 18, 2024
1 parent 49886b6 commit aacef07
Show file tree
Hide file tree
Showing 16 changed files with 399 additions and 16 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ api: ## Generate API docs
npm run clean-api-docs
npm run generate-api-docs

test: ## Run Jest tests
npm test

##@ Git Targets

commit: ## Add a Git commit. Usage: make commit MESSAGE="<your message here>"
Expand Down
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,36 @@ To add a video, use the following syntax. Ensure you capitalize the letter "V":
<Video title="vsphere-pcg-creation" src="/cluster-creation-videos/vmware.mp4"></Video>
```
### Simple Card Grid
This is a custom component that creates a grid of simple text cards with two columns, styled according to our color
scheme. The rows of cards are dynamically created according to the list of specified cards.
```js
<SimpleCardGrid
cards={[
{
title: "Lorem Ipsum",
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
buttonText: "Learn more",
relativeURL: "./link",
},
{
title: "Lorem Ipsum",
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
buttonText: "Learn more",
relativeURL: "./link",
},
{
title: "Lorem Ipsum",
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
buttonText: "Learn more",
relativeURL: "./link",
},
]}
/>
```
## Netlify Previews
By default Netlify previews are enabled for pull requests. However, some branches do not require Netlify previews. In
Expand Down
2 changes: 1 addition & 1 deletion docs/docs-content/getting-started/dashboard.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
sidebar_label: "Palette Dashboard"
title: "Palette Dashboard"
description: "Spectro Cloud Palette Dashboard"
description: "Explore the Spectro Cloud Palette Dashboard."
icon: ""
hide_table_of_contents: false
sidebar_position: 20
Expand Down
89 changes: 75 additions & 14 deletions docs/docs-content/getting-started/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,96 @@
sidebar_label: "Getting Started"
title: "Getting Started"
description: "Spectro Cloud Getting Started"
hide_table_of_contents: false
hide_table_of_contents: true
sidebar_custom_props:
icon: "overview"
tags: ["getting-started"]
---

This page gives an overview of how to get started with Spectro Cloud Palette and begin leveraging its Kubernetes
This page gives you an overview of how to get started with Spectro Cloud Palette and begin leveraging its Kubernetes
full-stack management at scale. Palette's unique capabilities provide end-to-end declarative cluster management, cluster
monitoring and reconciliation, as well as adherence to the highest security standards. It provides support for public
cloud providers, data centers, bare metal and edge, so you can use Palette no matter the complexity of your production
environments.
monitoring and reconciliation, as well as enterprise-grade security.

Palette provides developers and platform engineers with complete control of their Kubernetes clusters. The platform
provides support for public cloud providers, data centers, bare metal, and edge so that you can deploy and use
Kubernetes no matter the complexity or location of your production environments. Check out the following short video for
a quick overview of Palette's key functionalities.

<YouTube
url="https://www.youtube.com/embed/P9QBOifS_cc"
title="Demo | Spectro Cloud Palette - Kubernetes-as-a-Service"
/>

<br />

## Deploy Kubernetes Clusters with Palette

The first step towards adopting Palette in your organization is to
[create a login](https://www.spectrocloud.com/get-started). The
[Palette Free Tier](https://www.spectrocloud.com/free-tier) allows you to experience the benefits of Palette first-hand.

The Getting Started section introduces you to the concepts and workflows you need to begin using Palette. Explore more
through the following pages.
We have curated the pages in the Getting Started section to give you a gradual introduction to the fundamental concepts
and workflows you need to deploy and manage Kubernetes clusters through Palette.

- [Introduction to Palette](./introduction.md)
<div class="desktop-only-display">

- [Palette Dashboard](./dashboard.md)
![Overview of the getting started journey rocket](/getting-started/getting-started_getting-started_journey-overview.png)

- [Cluster Profiles](./cluster-profiles.md)
</div>

- [Create a Cluster Profile](./create-cluster-profile.md)
<br />

- [Deploy a Cluster](./deploy-k8s-cluster.md)
First, you will learn how to create cluster profiles, which are the blueprints for your Kubernetes stacks. Then, you
will deploy your first cluster using your cluster profile. Once you have deployed your first cluster, you update it
using Palette's cluster management functionality. The Getting Started section also includes other topics that you can
explore further, such as cluster deployment with Terraform, Palette's edge capabilities, and virtual machine
orchestration.

- [Deploy Cluster Profile Updates](./update-k8s-cluster.md)
Explore more through the following pages.

- [Deploy a Cluster with Terraform](./terraform.md)
<SimpleCardGrid
cards={[
{
title: "Introduction to Palette",
description: "Learn about what makes Palette different.",
buttonText: "Learn more",
relativeURL: "./introduction",
},
{
title: "Palette Dashboard",
description: "Tour the Palette Project and Tenant Admin dashboards.",
buttonText: "Learn more",
relativeURL: "./dashboard",
},
{
title: "Cluster Profiles",
description: "Learn about Palette Cluster Profiles and Packs.",
buttonText: "Learn more",
relativeURL: "./cluster-profiles",
},
{
title: "Create a Cluster Profile",
description: "Create a full cluster profile in Palette.",
buttonText: "Learn more",
relativeURL: "./create-cluster-profile",
},
{
title: "Deploy a Cluster",
description: "Deploy a Palette host cluster in AWS, Azure or Google Cloud.",
buttonText: "Learn more",
relativeURL: "./deploy-k8s-cluster",
},
{
title: "Deploy Cluster Profile Updates",
description: "Update your deployed clusters using Palette Cluster Profiles.",
buttonText: "Learn more",
relativeURL: "./update-k8s-cluster",
},
{
title: "Deploy a Cluster with Terraform",
description: "Deploy a Palette host cluster with Terraform.",
buttonText: "Learn more",
relativeURL: "./terraform",
},
]}
/>
2 changes: 1 addition & 1 deletion docs/docs-content/getting-started/introduction.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
sidebar_label: "Introduction to Palette"
title: "Introduction to Palette"
description: "Learn what Spectro Cloud's Palette platform is."
description: "Learn about Spectro Cloud Palette."
icon: ""
hide_table_of_contents: false
sidebar_position: 10
Expand Down
10 changes: 10 additions & 0 deletions src/components/SimpleCardGrid/SimpleCardFooterArrow.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import RightArrow from "/static/assets/icons/arrow-right-long.svg";
import styles from "./SimpleCardGrid.module.scss";
import React from "react";

interface FooterArrowProps {
index?: number;
}
export default function SimpleCardFooterArrow({ index }: FooterArrowProps) {
return <RightArrow className={styles.simpleCardFooterArrow} key={`simpleCardFooterArrow-${index}`} />;
}
99 changes: 99 additions & 0 deletions src/components/SimpleCardGrid/SimpleCardGrid.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
.simpleCardGrid {
display: grid;
grid-gap: 32px;
grid-template-columns: 1fr 1fr;
grid-template-rows: 2fr;
}

.simpleCard {
min-width: 360px;
padding: 12px 16px;
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
gap: 10px;
border: 1px solid var(--simpleCardBorder);
border-radius: 12px;
color: var(--ifm-font-color-base);
box-shadow: -10px 10px var(--simpleCardSecondary);
word-wrap: break-word;
}

.simpleCardDescription {
font-size: 14px;
font-weight: 400;
line-height: 20px;
color: var(--simpleCardSubtle);
}

.simpleCardHeader {
display: flex;
justify-content: flex-start;
align-items: center;
gap: 12px;
font-size: 20px;
font-weight: 500;
line-height: 24px;
}

.simpleCardFooter {
display: flex;
justify-content: flex-end;
align-items: center;
}

.simpleCardFooterBtn {
display: flex;
align-items: center;
gap: 10px;
background-color: var(--simpleCardSecondary);
border-radius: 4px;
color: var(--ifm-font-color-base);
font-size: 14px;
font-weight: var(--ifm-button-font-weight);
padding: 10px 16px;
border: none;
outline: none;
height: 32px;
width: 136px;
cursor: pointer;
}

.simpleCardFooterArrow {
height: 1em;
fill: var(--ifm-font-color-base);
}

.simpleCardIndex {
width: 32px;
height: 32px;
display: flex;
justify-content: center;
align-items: center;
background-color: var(--simpleCardPrimary);
color: var(--ifm-background-color);
border-radius: 4px;
}

.simpleCard:hover {
box-shadow: -10px 10px var(--simpleCardSecondaryHover);
}

.simpleCard:hover .simpleCardFooter button {
background-color: var(--simpleCardSecondaryHover);
}

.simpleCard:hover .simpleCardIndex {
background-color: var(--simpleCardPrimaryHover);
}

@media (max-width: 1120px) {
.simpleCardGrid {
grid-template-columns: 1fr;
}

.simpleCard {
min-width: 280px;
}
}
91 changes: 91 additions & 0 deletions src/components/SimpleCardGrid/SimpleCardGrid.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import React from "react";
import { render, screen } from "@testing-library/react";
import SimpleCardGrid from "./SimpleCardGrid";

jest.mock("./SimpleCardFooterArrow", () => {
return jest.fn(() => {
return <div data-testid="mock-arrow"></div>;
});
});

describe("Display SimpleCardGrid", () => {
interface testCard {
title: string;
description: string;
buttonText: string;
relativeURL: string;
}

interface testCase {
name: string;
cards: testCard[];
}

const testCards: testCard[] = [
{
title: "First Card",
description: "Card 1",
buttonText: "Learn more 1",
relativeURL: "./getting-started-1",
},
{
title: "Second Card",
description: "Card 2",
buttonText: "Learn more 2",
relativeURL: "./getting-started-2",
},
{
title: "Third Card",
description: "Card 3",
buttonText: "Learn more 3",
relativeURL: "./getting-started-3",
},
];

const testCases: testCase[] = [
{
name: "multiple row cards",
cards: testCards.slice(),
},
{
name: "single row cards",
cards: testCards.slice(2),
},
{
name: "less cards than a single row",
cards: testCards.slice(1),
},
{
name: "empty cards",
cards: [],
},
];

function assert(testCards: testCard[]) {
render(<SimpleCardGrid cards={testCards} />);
if (testCards.length == 0) {
expect(screen.queryAllByRole("button")).toHaveLength(0);
return;
}

testCards.forEach((tc, index) => {
expect(screen.getByText(tc.title)).toBeInTheDocument();
expect(screen.getByText(tc.description)).toBeInTheDocument();
expect(screen.getByText(tc.buttonText, { selector: "button" })).toBeInTheDocument();
expect(
screen.getAllByRole("link").filter((value) => {
return value.getAttribute("href") == tc.relativeURL;
})
).not.toBeNull();
});

expect(screen.getAllByTestId("mock-arrow")).toHaveLength(testCards.length);
expect(screen.getAllByRole("button")).toHaveLength(testCards.length);
}

testCases.forEach((tc) => {
it(tc.name, () => {
assert(tc.cards);
});
});
});
Loading

0 comments on commit aacef07

Please sign in to comment.