Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 332d9ee

Browse files
Merge branch 'feature/multi-tenant'
2 parents 59248de + eedbe9d commit 332d9ee

File tree

8 files changed

+96
-65
lines changed

8 files changed

+96
-65
lines changed

‎examples/fe-example-react/src/main.tsx‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
1313
<>
1414
<ConvoStackWrapper>
1515
<ConvoStackWidget
16-
graphqlUrl="http://localhost:3000/graphql"
17-
websocketUrl="ws://localhost:3000/graphql"
16+
graphqlUrl="http://localhost:3033/graphql"
17+
websocketUrl="ws://localhost:3033/graphql"
18+
workspaceId="clijh54bz0009wud1v4yhrt8o"
1819
userData={{
19-
email: "m@g.com",
20+
email: "m@sdfgfsdgg.com",
2021
name: "zxx",
2122
hash: "z420",
22-
userId: "m",
23+
userId: "mmsxsddfmm",
2324
}}
2425
customStyling={{
2526
headerText: "My Custom Header",

‎examples/fe-example-react/tsconfig.tsbuildinfo‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎package-lock.json‎

Lines changed: 52 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/convostack-frontend-react/src/App.tsx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
setStyling,
1010
setUserData,
1111
setWebsocketlUrl,
12+
setWorkspaceId,
1213
} from "./redux/slice";
1314
import { CustomIcons } from "./types";
1415
import { ConvoStackWidgetProps } from "./ConvoStackWidget";
@@ -19,6 +20,7 @@ export const CustomIconsContext = createContext<CustomIcons | undefined>(
1920

2021
const App: React.FC<Omit<ConvoStackWidgetProps, "children">> = ({
2122
graphqlUrl,
23+
workspaceId,
2224
websocketUrl,
2325
userData,
2426
customStyling,
@@ -31,12 +33,14 @@ const App: React.FC<Omit<ConvoStackWidgetProps, "children">> = ({
3133
useEffect(() => {
3234
dispatch(setWebsocketlUrl(websocketUrl));
3335
dispatch(setGraphqlUrl(graphqlUrl));
36+
dispatch(setWorkspaceId(workspaceId));
3437
if (defaultAgent !== undefined) dispatch(setDefaultAgent(defaultAgent));
3538
if (customStyling !== undefined) dispatch(setStyling(customStyling));
3639
if (userData !== undefined) dispatch(setUserData(userData));
3740
}, [
3841
websocketUrl,
3942
graphqlUrl,
43+
workspaceId,
4044
customStyling,
4145
userData,
4246
dispatch,

‎packages/convostack-frontend-react/src/ConvoStackWidget.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { CustomIcons, CustomStyling, UserData } from "./types";
77
export interface ConvoStackWidgetProps {
88
graphqlUrl: string;
99
websocketUrl: string;
10+
workspaceId?: string;
1011
userData?: UserData;
1112
customStyling?: CustomStyling;
1213
icons?: CustomIcons;
@@ -18,6 +19,7 @@ export interface ConvoStackWidgetProps {
1819
const ConvoStackWidget: React.FC<ConvoStackWidgetProps> = ({
1920
graphqlUrl,
2021
websocketUrl,
22+
workspaceId,
2123
userData,
2224
customStyling,
2325
icons,
@@ -28,7 +30,7 @@ const ConvoStackWidget: React.FC<ConvoStackWidgetProps> = ({
2830
const [isLoading, setIsLoading] = useState(true);
2931
useEffect(() => {
3032
const fetchData = async () => {
31-
await fetchTokens(graphqlUrl, userData);
33+
await fetchTokens(graphqlUrl, workspaceId,userData);
3234
};
3335

3436
fetchData()
@@ -44,6 +46,7 @@ const ConvoStackWidget: React.FC<ConvoStackWidgetProps> = ({
4446
<App
4547
graphqlUrl={graphqlUrl}
4648
websocketUrl={websocketUrl}
49+
workspaceId={workspaceId}
4750
userData={userData}
4851
customStyling={customStyling}
4952
icons={icons}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /