Skip to content

Commit 0f6cd89

Browse files
committed
AWS bedrock added
1 parent e3fae42 commit 0f6cd89

File tree

4 files changed

+42
-26
lines changed

4 files changed

+42
-26
lines changed

apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/quick_start/components/AIAgentConnectorImport.jsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React, { useState } from 'react';
33
import api from '../api';
44
import func from "@/util/func";
55
import PasswordTextField from '../../../components/layouts/PasswordTextField';
6+
import GoToDocsButton from './shared/GoToDocsButton';
67

78
/**
89
* Common component for AI Agent Connector imports (N8N, Langchain, Copilot Studio)
@@ -21,9 +22,6 @@ const AIAgentConnectorImport = ({
2122
fields.reduce((acc, field) => ({ ...acc, [field.name]: '' }), {})
2223
);
2324

24-
const goToDocs = () => {
25-
window.open(docsUrl);
26-
};
2725

2826
const validateForm = () => {
2927
for (const field of fields) {
@@ -127,7 +125,7 @@ const AIAgentConnectorImport = ({
127125
>
128126
Import
129127
</Button>
130-
<Button onClick={goToDocs}>Go to docs</Button>
128+
<GoToDocsButton docsUrl={docsUrl} />
131129
</ButtonGroup>
132130
</VerticalStack>
133131
</div>

apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/quick_start/components/NewConnection.jsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import DropdownSearch from '../../../components/shared/DropdownSearch'
55
import SearchField from "../../../components/shared/SearchField"
66
import "../QuickStart.css"
77
import PersistStore from '../../../../main/PersistStore'
8+
import GoToDocsButton from './shared/GoToDocsButton'
89

910
function NewConnection() {
1011

@@ -49,11 +50,6 @@ function NewConnection() {
4950
setTasksCompleted(2)
5051
}
5152

52-
const openDocs = (docsUrl) => {
53-
if(docsUrl && docsUrl.length > 0){
54-
window.open(docsUrl)
55-
}
56-
}
5753

5854
const setConnector = (label) => {
5955
let obj = connectorsList.find(element => element.label === label)
@@ -75,13 +71,9 @@ function NewConnection() {
7571
{badge && badge.length > 0 ? <Badge size='small' status='info'>{badge}</Badge> : null}
7672
</Text>
7773
<div className='see-docs'>
78-
<Button plain onClick={(event) => {
79-
event.stopPropagation();
80-
openDocs(docsUrl);
81-
}}
82-
>
83-
Go to docs
84-
</Button>
74+
<div onClick={(event) => event.stopPropagation()}>
75+
<GoToDocsButton docsUrl={docsUrl} variant='plain' />
76+
</div>
8577
</div>
8678
</div>
8779
<Text variant='bodySm' color="subdued">{text}</Text>

apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/quick_start/components/SimpleDocsComponent.jsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { VerticalStack, Button, Text, Divider } from '@shopify/polaris'
1+
import { VerticalStack, Text, Divider } from '@shopify/polaris'
2+
import GoToDocsButton from './shared/GoToDocsButton'
23

34
function SimpleDocsComponent({description, docsUrl}) {
45

@@ -9,15 +10,7 @@ function SimpleDocsComponent({description, docsUrl}) {
910
{description}
1011
</Text>
1112
<Divider />
12-
<div style={{width: '50%'}}>
13-
<Button outline onClick={
14-
() => {
15-
window.open(docsUrl, "_blank");
16-
}
17-
}>
18-
Go to docs
19-
</Button>
20-
</div>
13+
<GoToDocsButton docsUrl={docsUrl} width='50%' />
2114
</VerticalStack>
2215
</div>
2316
)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { Button } from '@shopify/polaris'
2+
3+
function GoToDocsButton({ docsUrl, variant = 'outline', size, width, ...props }) {
4+
5+
const openDocs = () => {
6+
if(docsUrl && docsUrl.length > 0){
7+
window.open(docsUrl, "_blank");
8+
}
9+
}
10+
11+
const buttonContent = (
12+
<Button
13+
{...(variant === 'plain' ? { plain: true } : { outline: true })}
14+
onClick={openDocs}
15+
size={size}
16+
{...props}
17+
>
18+
Go to docs
19+
</Button>
20+
)
21+
22+
if (width) {
23+
return (
24+
<div style={{width}}>
25+
{buttonContent}
26+
</div>
27+
)
28+
}
29+
30+
return buttonContent
31+
}
32+
33+
export default GoToDocsButton

0 commit comments

Comments
 (0)