Skip to content
代码片段 群组 项目
提交 94e2decf 编辑于 作者: Denys Mishunov's avatar Denys Mishunov
浏览文件

Merge branch 'je-add-generated-by-ai-note' into 'master'

Add a note about content generated by AI

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/118011



Merged-by: default avatarDenys Mishunov <dmishunov@gitlab.com>
Approved-by: default avatarNataliia Radina <nradina@gitlab.com>
Approved-by: default avatarDenys Mishunov <dmishunov@gitlab.com>
Co-authored-by: default avatarJacques <jerasmus@gitlab.com>
No related branches found
No related tags found
无相关合并请求
...@@ -98,7 +98,8 @@ export default { ...@@ -98,7 +98,8 @@ export default {
primary-button-link="https://internal-handbook.gitlab.io/handbook/product/ai-strategy/ai-integration-effort/legal_restrictions/" primary-button-link="https://internal-handbook.gitlab.io/handbook/product/ai-strategy/ai-integration-effort/legal_restrictions/"
:primary-button-text="__('Read more')" :primary-button-text="__('Read more')"
> >
<span v-safe-html="$options.i18n.GENIE_CHAT_LEGAL_NOTICE"></span> <strong v-safe-html="$options.i18n.GENIE_CHAT_LEGAL_GENERATED_BY_AI"></strong>
<p v-safe-html="$options.i18n.GENIE_CHAT_LEGAL_NOTICE"></p>
</gl-alert> </gl-alert>
<code-block-highlighted <code-block-highlighted
:language="snippetLanguage" :language="snippetLanguage"
......
...@@ -12,6 +12,7 @@ export const i18n = { ...@@ -12,6 +12,7 @@ export const i18n = {
{ gitlabOrg: '<code>/gitlab-org</code>', gitlabCom: '<code>/gitlab-com</code>' }, { gitlabOrg: '<code>/gitlab-org</code>', gitlabCom: '<code>/gitlab-com</code>' },
false, false,
), ),
GENIE_CHAT_LEGAL_GENERATED_BY_AI: s__('AI|Responses generated by AI'),
REQUEST_ERROR: s__('AI|Something went wrong. Please try again later'), REQUEST_ERROR: s__('AI|Something went wrong. Please try again later'),
EXPERIMENT_BADGE: s__('AI|Experiment'), EXPERIMENT_BADGE: s__('AI|Experiment'),
FEEDBACK_LINK: s__('AI|Give feedback on code explanation'), FEEDBACK_LINK: s__('AI|Give feedback on code explanation'),
......
...@@ -22,6 +22,7 @@ describe('AiGenieChat', () => { ...@@ -22,6 +22,7 @@ describe('AiGenieChat', () => {
const findSelectedText = () => wrapper.findComponent(CodeBlockHighlighted); const findSelectedText = () => wrapper.findComponent(CodeBlockHighlighted);
const findChatContent = () => wrapper.findByTestId('chat-content'); const findChatContent = () => wrapper.findByTestId('chat-content');
const findAlert = () => wrapper.findByTestId('chat-error'); const findAlert = () => wrapper.findByTestId('chat-error');
const findGeneratedByAI = () => wrapper.findByText(i18n.GENIE_CHAT_LEGAL_GENERATED_BY_AI);
const findWarning = () => wrapper.findByTestId('chat-legal-warning'); const findWarning = () => wrapper.findByTestId('chat-legal-warning');
const findBadge = () => wrapper.findComponent(GlBadge); const findBadge = () => wrapper.findComponent(GlBadge);
const findFeedbackLink = () => wrapper.findByTestId('feedback-link'); const findFeedbackLink = () => wrapper.findByTestId('feedback-link');
...@@ -95,7 +96,12 @@ describe('AiGenieChat', () => { ...@@ -95,7 +96,12 @@ describe('AiGenieChat', () => {
expect(findSelectedText().props('language')).toBe(snippetLanguage); expect(findSelectedText().props('language')).toBe(snippetLanguage);
}); });
it('renders a legal warning when renderd', () => { it('renders a generated by AI note', () => {
createComponent();
expect(findGeneratedByAI().exists()).toBe(true);
});
it('renders a legal warning when rendered', () => {
createComponent(); createComponent();
expect(findWarning().exists()).toBe(true); expect(findWarning().exists()).toBe(true);
}); });
......
...@@ -1866,6 +1866,9 @@ msgstr "" ...@@ -1866,6 +1866,9 @@ msgstr ""
msgid "AI|Give feedback on code explanation" msgid "AI|Give feedback on code explanation"
msgstr "" msgstr ""
   
msgid "AI|Responses generated by AI"
msgstr ""
msgid "AI|Something went wrong. Please try again later" msgid "AI|Something went wrong. Please try again later"
msgstr "" msgstr ""
   
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册