Skip to content

Commit

Permalink
chore(docs): Rename from virtual-assistant to chatbot
Browse files Browse the repository at this point in the history
Docs should be ChatBot; keeping code as Chatbot for now since it would be breaking.
  • Loading branch information
rebeccaalpert committed Nov 21, 2024
1 parent 3116c95 commit e46a37a
Show file tree
Hide file tree
Showing 51 changed files with 181 additions and 177 deletions.
57 changes: 30 additions & 27 deletions .github/upload-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,16 @@ if (!uploadFolder) {
}

const uploadFolderName = path.basename(uploadFolder);
let uploadURL = `${repo}-${prnum ? `pr-virtual-assistant-${prnum}` : prbranch}`.replace(/[\/|\.]/g, '-');
let uploadURL = `${repo}-${prnum ? `pr-chatbot-${prnum}` : prbranch}`.replace(/[\/|\.]/g, '-');

switch(uploadFolderName) {
switch (uploadFolderName) {
case 'coverage':
uploadURL += '-a11y.surge.sh';
break;
case 'public':
if (!prnum && prbranch === 'main') {
uploadURL = 'https://pf-extensions.surge.sh/';
}
else {
} else {
uploadURL += '.surge.sh';
}
break;
Expand All @@ -57,41 +56,45 @@ function tryAddComment(comment, commentBody) {
}

if (prnum) {
octokit.issues.listComments({
owner,
repo,
issue_number: prnum
})
.then(res => res.data)
.then(comments => {
octokit.issues
.listComments({
owner,
repo,
issue_number: prnum
})
.then((res) => res.data)
.then((comments) => {
let commentBody = '';
const existingComment = comments.find(comment => comment.user.login === 'patternfly-build');
const existingComment = comments.find((comment) => comment.user.login === 'patternfly-build');
if (existingComment) {
commentBody += existingComment.body.trim();
commentBody += '\n\n';
}

if (uploadFolderName === 'public') {
commentBody += tryAddComment(`Preview: https://${uploadURL}`, commentBody);
}
else if (uploadFolderName === 'coverage') {
} else if (uploadFolderName === 'coverage') {
commentBody += tryAddComment(`A11y report: https://${uploadURL}`, commentBody);
}

if (existingComment) {
octokit.issues.updateComment({
owner,
repo,
comment_id: existingComment.id,
body: commentBody
}).then(() => console.log('Updated comment!'));
octokit.issues
.updateComment({
owner,
repo,
comment_id: existingComment.id,
body: commentBody
})
.then(() => console.log('Updated comment!'));
} else {
octokit.issues.createComment({
owner,
repo,
issue_number: prnum,
body: commentBody
}).then(() => console.log('Created comment!'));
octokit.issues
.createComment({
owner,
repo,
issue_number: prnum,
body: commentBody
})
.then(() => console.log('Created comment!'));
}
});
}
}
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# PatternFly Virtual Assistant
# PatternFly ChatBot

This repo contains React Virtual assistant implementation.
This PatternFly extension library provides components based on PatternFly 6 that can be used to build chatbots.

---

## Install

To play with virtual-assistant in your project, run
To use the chatbot extension in your project, run

```
npm install @patternfly/virtual-assistant --save
Expand Down Expand Up @@ -73,7 +73,7 @@ src
- prop names comply with PatternFly components naming standards (`variant`, `onClick`, `position`, etc.)
- the API is maximally simplified and all props are provided with a description
- it is built on top of existing PatternFly types without prop omitting
- it is well documented using the PatternFly documentation (`/packages/module/patternfly-docs/content/extensions/virtual-assistant/examples/MyComponent/MyComponent.md`) with examples of all possible use cases (`packages/module/patternfly-docs/content/extensions/virtual-assistant/examples/MyComponent/MyComponent[...]Example.tsx`)
- it is well documented using the PatternFly documentation (`/packages/module/patternfly-docs/content/extensions/chatbot/examples/MyComponent/MyComponent.md`) with examples of all possible use cases (`packages/module/patternfly-docs/content/extensions/chatbot/examples/MyComponent/MyComponent[...]Example.tsx`)

#### Component API definition example:

Expand All @@ -91,12 +91,12 @@ export const MyComponent: React.FunctionComponent<MyComponentProps> = ({ customL
````
---
section: extensions
subsection: Virtual assistant
subsection: ChatBot
id: MyComponent
propComponents: ['MyComponent']
---
import MyComponent from "@patternfly/virtual-assistant/dist/dynamic/MyComponent";
import MyComponent from "@patternfly/chatbot/dist/dynamic/MyComponent";
## Component usage
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
{
"name": "@patternfly/virtual-assistant-root",
"name": "@patternfly/chatbot-root",
"private": true,
"version": "0.0.0",
"description": "This library provides a virtual assistant.",
"description": "This library provides React components based on PatternFly 6 that can be used to build chatbots.",
"license": "MIT",
"workspaces": [
"packages/*"
],
"scripts": {
"build": "npm run build:packages && npm run build:fed:packages",
"build:watch": "concurrently \"npm run build:packages:watch\" \"npx wait-on packages/module/dist/esm && npm run build:fed:packages\"",
"build:docs": "npm run docs:build -w @patternfly/virtual-assistant",
"build:packages": "npm run build -w @patternfly/virtual-assistant",
"build:packages:watch": "npm run build:watch -w @patternfly/virtual-assistant",
"build:fed:packages": "npm run build:fed:packages -w @patternfly/virtual-assistant",
"build:docs": "npm run docs:build -w @patternfly/chatbot",
"build:packages": "npm run build -w @patternfly/chatbot",
"build:packages:watch": "npm run build:watch -w @patternfly/chatbot",
"build:fed:packages": "npm run build:fed:packages -w @patternfly/chatbot",
"cypress:open": "cypress open",
"cypress:run:ci:cp": "cypress run --component",
"cypress:run:e2e": "cypress run --headless",
"cypress:run:ci:e2e": "start-server-and-test start http://localhost:8006 cypress:run:e2e",
"start": "concurrently \"npm run build:watch\" \"npx wait-on packages/module/dist && npm run docs:develop -w @patternfly/virtual-assistant\"",
"serve:docs": "npm run docs:serve -w @patternfly/virtual-assistant",
"clean": "npm run clean -w @patternfly/virtual-assistant",
"start": "concurrently \"npm run build:watch\" \"npx wait-on packages/module/dist && npm run docs:develop -w @patternfly/chatbot\"",
"serve:docs": "npm run docs:serve -w @patternfly/chatbot",
"clean": "npm run clean -w @patternfly/chatbot",
"lint:js": "node --max-old-space-size=4096 node_modules/.bin/eslint packages --ext js,jsx,ts,tsx --cache",
"lint:js:fix": "node --max-old-space-size=4096 node_modules/.bin/eslint packages --ext js,jsx,ts,tsx --cache --fix",
"lint:md": "eslint packages --ext md --no-eslintrc --config .eslintrc-md.json --cache",
"lint:md:fix": "eslint packages --ext md --no-eslintrc --config .eslintrc-md.json --cache --fix",
"lint": "npm run lint:js && npm run lint:md",
"lint:fix": "npm run lint:js:fix && npm run lint:md:fix",
"test": "TZ=EST jest packages --passWithNoTests",
"test:a11y": "npm run test:a11y -w @patternfly/virtual-assistant",
"serve:a11y": "npm run serve:a11y -w @patternfly/virtual-assistant"
"test:a11y": "npm run test:a11y -w @patternfly/chatbot",
"serve:a11y": "npm run serve:a11y -w @patternfly/chatbot"
},
"devDependencies": {
"@babel/core": "^7.24.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/module/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@patternfly/virtual-assistant",
"version": "1.0.0-prerelease.0",
"description": "Virtual assistant used for Red Hat projects.",
"name": "@patternfly/chatbot",
"version": "1.0.0",
"description": "This library provides React components based on PatternFly 6 that can be used to build chatbots.",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
section: PatternFly-AI
subsection: Chatbot
subsection: ChatBot
id: Overview
sortValue: 1
source: About
Expand All @@ -10,13 +10,14 @@ source: About

It is important to leverage AI in a way that improves the experiences of your users. In alignment with our [AI principles](/patternfly-ai/about-ai#ai-principles) and [ethical design guidelines,](/patternfly-ai/ai-guidelines) we've created this chatbot extension. The PatternFly chatbot contains a React implementation of an AI chatbot, to provide your users with access to convenient and persistent help.

*Only use this chatbot when it adds value to your users' experiences.* Don't use it simply for the sake of novelty&mdash;your users will only be excited to interact with a new chatbot feature if it directly helps them reach their goals.
_Only use this chatbot when it adds value to your users' experiences._ Don't use it simply for the sake of novelty&mdash;your users will only be excited to interact with a new chatbot feature if it directly helps them reach their goals.

## How to use the chatbot

To illustrate the capabilities of the chatbot, we offer a [chatbot container demo](/patternfly-ai/chatbot/overview/demo) and a [chatbot attachments demo](/patternfly-ai/chatbot/messages/demo). To learn how to write for chatbot experiences, refer to our [chatbot writing guidelines.](/patternfly-ai/conversation-design/#writing-for-chatbots)

We currently support the follow features to customize your chatbot experience:
We currently support the follow features to customize your chatbot experience:

- [The chatbot container](/patternfly-ai/chatbot/ui#container)
- [A toggle for the chatbot container](/patternfly-ai/chatbot/ui#toggle)
- [The chatbot header](/patternfly-ai/chatbot/ui#header)
Expand All @@ -25,4 +26,4 @@ We currently support the follow features to customize your chatbot experience:
- [Chatbot attachments](/patternfly-ai/chatbot/messages#attachments)
- [Conversation history](/patternfly-ai/chatbot/ui#navigation)

We will continue to grow and evolve our chatbot. If you notice a bug or have any suggestions, feel free to file an issue in our [GitHub repository!](https://github.com/patternfly/virtual-assistant/issues) Make sure to check if there is already a pre-existing issue before creating a new one.
We will continue to grow and evolve our chatbot. If you notice a bug or have any suggestions, feel free to file an issue in our [GitHub repository!](https://github.com/patternfly/virtual-assistant/issues) Make sure to check if there is already a pre-existing issue before creating a new one.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Message from '@patternfly/virtual-assistant/dist/dynamic/Message';
import Message from '@patternfly/chatbot/dist/dynamic/Message';
import patternflyAvatar from './patternfly_avatar.jpg';

export const BotMessageExample: React.FunctionComponent = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import FileDetailsLabel from '@patternfly/virtual-assistant/dist/dynamic/FileDetailsLabel';
import FileDetailsLabel from '@patternfly/chatbot/dist/dynamic/FileDetailsLabel';
import { Radio } from '@patternfly/react-core/dist/dynamic/Radio';
import { FormGroup } from '@patternfly/react-core/dist/dynamic/FormGroup';
import { Stack } from '@patternfly/react-core/dist/dynamic/Stack';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import FileDropZone from '@patternfly/virtual-assistant/dist/dynamic/FileDropZone';
import FileDropZone from '@patternfly/chatbot/dist/dynamic/FileDropZone';
import { DropEvent } from '@patternfly/react-core';

interface readFile {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import Message from '@patternfly/virtual-assistant/dist/dynamic/Message';
import Message from '@patternfly/chatbot/dist/dynamic/Message';
import patternflyAvatar from './patternfly_avatar.jpg';
import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
import DownloadIcon from '@patternfly/react-icons/dist/esm/icons/download-icon';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Sidenav top-level section
# should be the same for all markdown files
section: PatternFly-AI
subsection: Chatbot
subsection: ChatBot
# Sidenav secondary level section
# should be the same for all markdown files
id: Messages
Expand All @@ -26,20 +26,20 @@ propComponents:
sortValue: 3
---

import Message from '@patternfly/virtual-assistant/dist/dynamic/Message';
import SourcesCard from '@patternfly/virtual-assistant/dist/dynamic/SourcesCard';
import Message from '@patternfly/chatbot/dist/dynamic/Message';
import SourcesCard from '@patternfly/chatbot/dist/dynamic/SourcesCard';
import { RobotIcon } from '@patternfly/react-icons/dist/esm/icons/robot-icon';
import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
import DownloadIcon from '@patternfly/react-icons/dist/esm/icons/download-icon';
import RedoIcon from '@patternfly/react-icons/dist/esm/icons/redo-icon';
import patternflyAvatar from './patternfly_avatar.jpg';
import userAvatar from './user_avatar.jpg';
import AttachmentEdit from '@patternfly/virtual-assistant/dist/dynamic/AttachmentEdit';
import FileDetails from '@patternfly/virtual-assistant/dist/dynamic/FileDetails';
import FileDetailsLabel from '@patternfly/virtual-assistant/dist/dynamic/FileDetailsLabel';
import FileDropZone from '@patternfly/virtual-assistant/dist/dynamic/FileDropZone';
import { PreviewAttachment } from '@patternfly/virtual-assistant/dist/dynamic/PreviewAttachment';
import ChatbotAlert from '@patternfly/virtual-assistant/dist/dynamic/ChatbotAlert';
import AttachmentEdit from '@patternfly/chatbot/dist/dynamic/AttachmentEdit';
import FileDetails from '@patternfly/chatbot/dist/dynamic/FileDetails';
import FileDetailsLabel from '@patternfly/chatbot/dist/dynamic/FileDetailsLabel';
import FileDropZone from '@patternfly/chatbot/dist/dynamic/FileDropZone';
import { PreviewAttachment } from '@patternfly/chatbot/dist/dynamic/PreviewAttachment';
import ChatbotAlert from '@patternfly/chatbot/dist/dynamic/ChatbotAlert';

The `content` prop of the `<Message>` component is passed to a `<Markdown>` component (from [react-markdown](https://remarkjs.github.io/react-markdown/)), which is configured to translate plain text strings into PatternFly [`<Content>` components](/components/content) and code blocks into PatternFly [`<CodeBlock>` components.](/components/code-block)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import Message from '@patternfly/virtual-assistant/dist/dynamic/Message';
import Message from '@patternfly/chatbot/dist/dynamic/Message';
import userAvatar from './user_avatar.jpg';

export const UserMessageExample: React.FunctionComponent = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import Chatbot, { ChatbotDisplayMode } from '@patternfly/virtual-assistant/dist/dynamic/Chatbot';
import Chatbot, { ChatbotDisplayMode } from '@patternfly/chatbot/dist/dynamic/Chatbot';
import { Radio } from '@patternfly/react-core/dist/dynamic/Radio';
import { Checkbox } from '@patternfly/react-core/dist/dynamic/Checkbox';
import { FormGroup } from '@patternfly/react-core/dist/dynamic/FormGroup';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { ChatbotFooter, ChatbotFootnote } from '@patternfly/virtual-assistant/dist/dynamic/ChatbotFooter';
import { MessageBar } from '@patternfly/virtual-assistant/dist/dynamic/MessageBar';
import { ChatbotFooter, ChatbotFootnote } from '@patternfly/chatbot/dist/dynamic/ChatbotFooter';
import { MessageBar } from '@patternfly/chatbot/dist/dynamic/MessageBar';

export const ChatbotFooterExample: React.FunctionComponent = () => {
const handleSend = (message) => alert(message);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { ChatbotFootnote } from '@patternfly/virtual-assistant/dist/dynamic/ChatbotFooter';
import { ChatbotFootnote } from '@patternfly/chatbot/dist/dynamic/ChatbotFooter';

export const FootnoteDemo: React.FunctionComponent = () => (
<ChatbotFootnote
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import {
ChatbotHeaderTitle,
ChatbotHeaderOptionsDropdown,
ChatbotHeaderSelectorDropdown
} from '@patternfly/virtual-assistant/dist/dynamic/ChatbotHeader';
import { ChatbotDisplayMode } from '@patternfly/virtual-assistant/dist/dynamic/Chatbot';
} from '@patternfly/chatbot/dist/dynamic/ChatbotHeader';
import { ChatbotDisplayMode } from '@patternfly/chatbot/dist/dynamic/Chatbot';
import OutlinedWindowRestoreIcon from '@patternfly/react-icons/dist/esm/icons/outlined-window-restore-icon';
import ExpandIcon from '@patternfly/react-icons/dist/esm/icons/expand-icon';
import OpenDrawerRightIcon from '@patternfly/react-icons/dist/esm/icons/open-drawer-right-icon';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import { ChatbotDisplayMode } from '@patternfly/virtual-assistant/dist/dynamic/Chatbot';
import { ChatbotDisplayMode } from '@patternfly/chatbot/dist/dynamic/Chatbot';
import ChatbotConversationHistoryNav, {
Conversation
} from '@patternfly/virtual-assistant/dist/dynamic/ChatbotConversationHistoryNav';
} from '@patternfly/chatbot/dist/dynamic/ChatbotConversationHistoryNav';
import { Checkbox } from '@patternfly/react-core';

const initialConversations: { [key: string]: Conversation[] } = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import { ChatbotDisplayMode } from '@patternfly/virtual-assistant/dist/dynamic/Chatbot';
import { ChatbotDisplayMode } from '@patternfly/chatbot/dist/dynamic/Chatbot';
import ChatbotConversationHistoryNav, {
Conversation
} from '@patternfly/virtual-assistant/dist/dynamic/ChatbotConversationHistoryNav';
} from '@patternfly/chatbot/dist/dynamic/ChatbotConversationHistoryNav';
import { Checkbox, DropdownItem, DropdownList } from '@patternfly/react-core';

const menuItems = [
Expand Down
Loading

0 comments on commit e46a37a

Please sign in to comment.