Skip to content

Commit 6c52b1e

Browse files
author
kim
committed
refactor: apply PR requested changes
1 parent 5c17908 commit 6c52b1e

File tree

3 files changed

+78
-80
lines changed

3 files changed

+78
-80
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@codemirror/lang-javascript": "6.2.4",
1515
"@emotion/react": "11.14.0",
1616
"@emotion/styled": "11.14.1",
17-
"@graasp/apps-query-client": "github:graasp/graasp-apps-query-client#delay-chatbot-answer",
17+
"@graasp/apps-query-client": "4.1.0",
1818
"@graasp/sdk": "5.16.5",
1919
"@graasp/ui": "5.5.4",
2020
"@mui/icons-material": "6.5.0",

src/modules/settings/chatbot/ChatbotEditingView.tsx

Lines changed: 72 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -90,81 +90,79 @@ function ChatbotEditionView({
9090
};
9191

9292
return (
93-
<>
94-
<Stack spacing={3}>
95-
<Stack
96-
direction="row"
97-
justifyContent="space-between"
98-
alignItems="flex-end"
99-
>
100-
<Typography variant="h5" component="h1" fontWeight="bold">
101-
Edit chatbot
102-
</Typography>
103-
<Button endIcon={<Undo2Icon />} variant="outlined" onClick={onCancel}>
104-
{t('CANCEL_LABEL')}
105-
</Button>
106-
</Stack>
107-
<Stack
108-
direction="row"
109-
justifyContent="center"
110-
alignItems="center"
111-
gap={2}
112-
>
113-
<ChatbotAvatarEditor onChange={onChangeAvatar} />
114-
<TextField
115-
name={t('CHATBOT_NAME_LABEL')}
116-
label={t('CHATBOT_NAME_LABEL')}
117-
fullWidth
118-
value={name}
119-
onChange={({ target: { value } }) => handleChangeChatbotName(value)}
120-
/>
121-
</Stack>
122-
123-
<ChatbotSetting
124-
title={t('CHATBOT_PROMPT_LABEL')}
125-
description={t('CHATBOT_PROMPT_HELPER')}
126-
>
127-
<TextArea
128-
name={t('CHATBOT_PROMPT_LABEL')}
129-
value={prompt}
130-
onChange={({ target: { value } }) => onChangePrompt(value)}
131-
required
132-
/>
133-
</ChatbotSetting>
134-
135-
<ChatbotSetting
136-
title={t('CHATBOT_CUE_LABEL')}
137-
description={t('CHATBOT_CUE_HELPER')}
138-
>
139-
<TextArea
140-
name={t('CHATBOT_CUE_LABEL')}
141-
value={cue}
142-
onChange={({ target: { value } }) => handleChangeChatbotCue(value)}
143-
/>
144-
</ChatbotSetting>
145-
146-
<ChatbotSetting
147-
title={t('CHATBOT_STARTER_SUGGESTION_LABEL')}
148-
description={t('CHATBOT_STARTER_SUGGESTION_HELPER')}
149-
>
150-
<StarterSuggestions
151-
starterSuggestions={starterSuggestions}
152-
onChange={handleChangeStarterConversations}
153-
/>
154-
</ChatbotSetting>
155-
156-
<Box alignSelf="flex-end">
157-
<Button
158-
onClick={handleSave}
159-
disabled={!unsavedChanges || isSaving}
160-
variant="outlined"
161-
loading={isSaving}
162-
>
163-
{unsavedChanges ? t('SAVE_LABEL') : t('SAVED_LABEL')}
164-
</Button>
165-
</Box>
93+
<Stack spacing={3}>
94+
<Stack
95+
direction="row"
96+
justifyContent="space-between"
97+
alignItems="flex-end"
98+
>
99+
<Typography variant="h5" component="h1" fontWeight="bold">
100+
Edit chatbot
101+
</Typography>
102+
<Button endIcon={<Undo2Icon />} variant="outlined" onClick={onCancel}>
103+
{t('CANCEL_LABEL')}
104+
</Button>
105+
</Stack>
106+
<Stack
107+
direction="row"
108+
justifyContent="center"
109+
alignItems="center"
110+
gap={2}
111+
>
112+
<ChatbotAvatarEditor onChange={onChangeAvatar} />
113+
<TextField
114+
name={t('CHATBOT_NAME_LABEL')}
115+
label={t('CHATBOT_NAME_LABEL')}
116+
fullWidth
117+
value={name}
118+
onChange={({ target: { value } }) => handleChangeChatbotName(value)}
119+
/>
166120
</Stack>
167-
</>
121+
122+
<ChatbotSetting
123+
title={t('CHATBOT_PROMPT_LABEL')}
124+
description={t('CHATBOT_PROMPT_HELPER')}
125+
>
126+
<TextArea
127+
name={t('CHATBOT_PROMPT_LABEL')}
128+
value={prompt}
129+
onChange={({ target: { value } }) => onChangePrompt(value)}
130+
required
131+
/>
132+
</ChatbotSetting>
133+
134+
<ChatbotSetting
135+
title={t('CHATBOT_CUE_LABEL')}
136+
description={t('CHATBOT_CUE_HELPER')}
137+
>
138+
<TextArea
139+
name={t('CHATBOT_CUE_LABEL')}
140+
value={cue}
141+
onChange={({ target: { value } }) => handleChangeChatbotCue(value)}
142+
/>
143+
</ChatbotSetting>
144+
145+
<ChatbotSetting
146+
title={t('CHATBOT_STARTER_SUGGESTION_LABEL')}
147+
description={t('CHATBOT_STARTER_SUGGESTION_HELPER')}
148+
>
149+
<StarterSuggestions
150+
starterSuggestions={starterSuggestions}
151+
onChange={handleChangeStarterConversations}
152+
/>
153+
</ChatbotSetting>
154+
155+
<Box alignSelf="flex-end">
156+
<Button
157+
onClick={handleSave}
158+
disabled={!unsavedChanges || isSaving}
159+
variant="outlined"
160+
loading={isSaving}
161+
>
162+
{unsavedChanges ? t('SAVE_LABEL') : t('SAVED_LABEL')}
163+
</Button>
164+
</Box>
165+
</Stack>
168166
);
169167
}
170168
export { ChatbotEditionView };

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2368,9 +2368,9 @@ __metadata:
23682368
languageName: node
23692369
linkType: hard
23702370

2371-
"@graasp/apps-query-client@github:graasp/graasp-apps-query-client#delay-chatbot-answer":
2372-
version: 4.0.0
2373-
resolution: "@graasp/apps-query-client@https://github.com/graasp/graasp-apps-query-client.git#commit=fbf9747d5a37bfb585ee0444f8048fdd9c3d84e9"
2371+
"@graasp/apps-query-client@npm:4.1.0":
2372+
version: 4.1.0
2373+
resolution: "@graasp/apps-query-client@npm:4.1.0"
23742374
dependencies:
23752375
"@emotion/react": "npm:11.14.0"
23762376
"@emotion/styled": "npm:11.14.1"
@@ -2392,7 +2392,7 @@ __metadata:
23922392
date-fns: ^3.3.0 || ^4.0.0
23932393
react: ^18.0.0 || ^19.0.0
23942394
react-dom: ^18.0.0 || ^19.0.0
2395-
checksum: 10/e9f66ac68f5e9952a083ad10e42670e281f3a2aad265c54abf27db67dae826ee4ddbc8027818c6d43fec58a97e63af48c1926b908ff5f1c6ba80e55ebe074805
2395+
checksum: 10/2b236df94152fdff9843e1a5aa2885a902f8a0e1e3f1908a3331090ae249c47a55ff7b3a7f4c72d3c3d538e8fc894ccb98bea93ff48f7af9e59a4cc40dc2f8e5
23962396
languageName: node
23972397
linkType: hard
23982398

@@ -7778,7 +7778,7 @@ __metadata:
77787778
"@eslint/compat": "npm:1.4.1"
77797779
"@eslint/eslintrc": "npm:3.3.3"
77807780
"@eslint/js": "npm:9.39.1"
7781-
"@graasp/apps-query-client": "github:graasp/graasp-apps-query-client#delay-chatbot-answer"
7781+
"@graasp/apps-query-client": "npm:4.1.0"
77827782
"@graasp/sdk": "npm:5.16.5"
77837783
"@graasp/ui": "npm:5.5.4"
77847784
"@mui/icons-material": "npm:6.5.0"

0 commit comments

Comments
 (0)