-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #377 from rebeccaalpert/quickstartstile
feat(QuickStartsTile): Add quick starts tile for messages
- Loading branch information
Showing
15 changed files
with
849 additions
and
1 deletion.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
...le/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickStart.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from 'react'; | ||
import Message from '@patternfly/chatbot/dist/dynamic/Message'; | ||
import patternflyAvatar from './patternfly_avatar.jpg'; | ||
import { explorePipelinesQuickStart } from './explore-pipeline-quickstart.ts'; | ||
import { monitorSampleAppQuickStart } from '@patternfly/chatbot/src/Message/QuickStarts/monitor-sampleapp-quickstart.ts'; | ||
import { QuickStart } from '@patternfly/chatbot/dist/esm/Message/QuickStarts/types'; | ||
|
||
export const MessageWithQuickStartExample: React.FunctionComponent = () => ( | ||
<> | ||
<Message | ||
name="Bot" | ||
role="bot" | ||
avatar={patternflyAvatar} | ||
content="Text-based bot message with a quick start tile." | ||
quickStarts={{ | ||
quickStart: explorePipelinesQuickStart as QuickStart, | ||
onSelectQuickStart: (id) => alert(id) | ||
}} | ||
/> | ||
<Message | ||
name="Bot" | ||
role="bot" | ||
avatar={patternflyAvatar} | ||
content="Text-based bot message with a quick start tile that includes prerequisites and a default icon." | ||
quickStarts={{ | ||
quickStart: monitorSampleAppQuickStart, | ||
onSelectQuickStart: (id) => alert(id) | ||
}} | ||
/> | ||
</> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
...tternfly-docs/content/extensions/chatbot/examples/Messages/explore-pipeline-quickstart.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import userAvatar from './user_avatar.svg'; | ||
|
||
export const explorePipelinesQuickStart = { | ||
apiVersion: 'console.openshift.io/v1', | ||
kind: 'QuickStarts', | ||
metadata: { | ||
name: 'explore-pipelines' | ||
}, | ||
spec: { | ||
version: 4.7, | ||
displayName: `Installing the Pipelines Operator`, | ||
durationMinutes: 10, | ||
icon: userAvatar, | ||
description: `Install the OpenShift® Pipelines Operator to build Pipelines using Tekton.`, | ||
prerequisites: [''], | ||
introduction: `OpenShift® Pipelines is a cloud-native, continuous integration and continuous delivery (CI/CD) solution based on Kubernetes resources. It uses Tekton building blocks to automate deployments across multiple Kubernetes distributions by abstracting away the underlying implementation details. | ||
* OpenShift Pipelines is a serverless CI/CD system that runs pipelines with all the required dependencies in isolated containers. | ||
* They are designed for decentralized teams that work on a microservice-based architecture. | ||
* They are defined using standard Custom Resource Definitions making them extensible and easy to integrate with the existing Kubernetes tools. This enables you to scale on-demand. | ||
* You can use OpenShift Pipelines to build images with Kubernetes tools such as Source-to-Image (S2I), Buildah, Buildpacks, and Kaniko that are portable across any Kubernetes platform. | ||
* You can use the Developer perspective to create and manage pipelines and view logs in your namespaces. | ||
To start using Pipelines, install the OpenShift® Pipelines Operator on your cluster.`, | ||
tasks: [ | ||
{ | ||
title: `Installing the OpenShift Pipelines Operator`, | ||
description: `### To install the OpenShift Pipelines Operator: | ||
1. From the **Administrator** perspective in the console navigation panel, click **Operators > OperatorHub**. | ||
2. In the **Filter by keyword** field, type \`OpenShift Pipelines Operator\`. | ||
3. If the tile has an Installed label, the Operator is already installed. Proceed to the next quick start to create a Pipeline. | ||
4. Click the **tile** to open the Operator details. | ||
5. At the top of the OpenShift Pipelines Operator panel that opens, click **Install**. | ||
6. Fill out the Operator subscription form by selecting the channel that matches your OpenShift cluster, and then click **Install**. | ||
7. On the **Installed Operators** page, wait for the OpenShift Pipelines Operator's status to change from **Installing** to **Succeeded**. `, | ||
review: { | ||
instructions: `#### To verify that the OpenShift Pipelines Operator is installed: | ||
1. From the **Operators** section of the navigation, go to the **Installed Operators** page. | ||
2. Verify that the **OpenShift Pipelines Operator** appears in the list of Operators. | ||
In the status column, is the status of the OpenShift Pipelines Operator **Succeeded**?`, | ||
failedTaskHelp: `This task isn’t verified yet. Try the task again, or [read more](https://docs.openshift.com/container-platform/4.6/pipelines/installing-pipelines.html#op-installing-pipelines-operator-in-web-console_installing-pipelines) about this topic.` | ||
}, | ||
summary: { | ||
success: `You have installed the Pipelines Operator!`, | ||
failed: `Try the steps again.` | ||
} | ||
} | ||
], | ||
conclusion: `You successfully installed the OpenShift Pipelines Operator! If you want to learn how to deploy an application and associate a Pipeline with it, take the Creating a Pipeline quick start.`, | ||
nextQuickStart: [`install-app-and-associate-pipeline`], | ||
accessReviewResources: [ | ||
{ | ||
group: 'operators.coreos.com', | ||
resource: 'operatorgroups', | ||
verb: 'list' | ||
}, | ||
{ | ||
group: 'packages.operators.coreos.com', | ||
resource: 'packagemanifests', | ||
verb: 'list' | ||
} | ||
] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import * as React from 'react'; | ||
|
||
interface FallbackImgProps { | ||
/** Image source */ | ||
src: string; | ||
/** Alt text for image */ | ||
alt?: string; | ||
/** ClassName applied to image */ | ||
className?: string; | ||
/** Fallback */ | ||
fallback?: React.ReactNode; | ||
} | ||
|
||
const FallbackImg: React.FC<FallbackImgProps> = ({ src, alt, className, fallback }) => { | ||
const [isSrcValid, setIsSrcValid] = React.useState<boolean>(true); | ||
|
||
if (src && isSrcValid) { | ||
return <img className={className} src={src} alt={alt} onError={() => setIsSrcValid(false)} />; | ||
} | ||
|
||
return <>{fallback}</>; | ||
}; | ||
|
||
export default FallbackImg; |
25 changes: 25 additions & 0 deletions
25
packages/module/src/Message/QuickStarts/QuickStartTile.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
.pf-chatbot__quickstarts-tile { | ||
min-width: 360px; | ||
max-width: 650px; | ||
width: 100%; | ||
|
||
@media screen and (max-width: 700px) { | ||
max-width: 100%; | ||
min-width: initial; | ||
} | ||
// some icons provided to catalog tiles might have no defined height/width. Without this style, in those cases | ||
// the icons would have a height and width of 0. | ||
.pf-v6-c-card__header-main { | ||
.pf-v6-c-icon__content { | ||
display: contents; | ||
} | ||
} | ||
} | ||
|
||
.pf-v6-theme-dark { | ||
.pf-chatbot__quickstarts-tile { | ||
.pfext-catalog-item-icon__img { | ||
filter: brightness(1.5) invert(1) hue-rotate(180deg) saturate(4); | ||
} | ||
} | ||
} |
Oops, something went wrong.