Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
9ef446a
lu reference
zhixzhan Aug 4, 2020
07859d8
Merge branch 'main' into lu-import-file
zhixzhan Aug 4, 2020
6b66747
update
zhixzhan Aug 11, 2020
f7dd5b3
update
zhixzhan Aug 12, 2020
1300854
Merge branch 'main' into lu-import-file
zhixzhan Aug 12, 2020
54bb879
minimal publish model
zhixzhan Aug 13, 2020
6caa48c
update resolver
zhixzhan Aug 20, 2020
97c34ed
Merge branch 'main' into lu-import-file
zhixzhan Aug 24, 2020
f9e98dc
update package
zhixzhan Aug 24, 2020
f073115
update
zhixzhan Aug 24, 2020
229f87a
support path based resolve
zhixzhan Aug 25, 2020
bbec33c
support wildcard match * / **
zhixzhan Aug 26, 2020
9f38f01
Merge branch 'main' into lu-import-file
zhixzhan Aug 26, 2020
609773c
update
zhixzhan Aug 26, 2020
99355fc
resolver support .qna file ext
zhixzhan Aug 26, 2020
8bc0f81
define source qna in bot structure
zhixzhan Aug 26, 2020
e45ce62
include dialog name in source qna name
zhixzhan Aug 26, 2020
cab4b28
qnaIndexer update
zhixzhan Aug 26, 2020
5fa2190
update
zhixzhan Aug 26, 2020
ae5ab55
create qna file for imported url & name
zhixzhan Aug 27, 2020
539ee3a
update
zhixzhan Aug 27, 2020
f29fe41
enable source qna in all up view
zhixzhan Aug 27, 2020
8b85aa4
import url sync all locale
zhixzhan Aug 27, 2020
d88c696
update import name
zhixzhan Aug 27, 2020
ceb1175
qna parse more infomation
zhixzhan Aug 28, 2020
ae3d940
keep header in qna crud
zhixzhan Aug 28, 2020
dd9c7ea
group source.qna in dialog.qna
zhixzhan Aug 28, 2020
b29aead
refactor qnaUtil curd methods
zhixzhan Sep 2, 2020
9e753fc
refactor qna all up view
zhixzhan Sep 3, 2020
26a9b7d
update
zhixzhan Sep 4, 2020
5a1450f
remove > !# @source.name in options
zhixzhan Sep 4, 2020
9e08434
do not insert \n before section
zhixzhan Sep 4, 2020
8474b95
update
zhixzhan Sep 7, 2020
ac37b95
remove source from nav tree
zhixzhan Sep 7, 2020
2a6fdb5
enable multi turn
zhixzhan Sep 7, 2020
1891984
Merge branch 'main' into qna-import
zhixzhan Sep 7, 2020
d5c0c3e
create qna file for imported url & name
zhixzhan Sep 7, 2020
62a8e5a
update package
zhixzhan Sep 8, 2020
1ad7ee2
imports methods
zhixzhan Sep 8, 2020
0782cb3
remove import in table-view
zhixzhan Sep 8, 2020
56784c7
update
zhixzhan Sep 9, 2020
5e52f43
update
zhixzhan Sep 9, 2020
96aac3f
enable multiturn
zhixzhan Sep 10, 2020
59e4f40
remove file state
zhixzhan Sep 10, 2020
d330c0f
update style
zhixzhan Sep 10, 2020
7242f53
handle focus states
zhixzhan Sep 10, 2020
2cbb7dc
Merge branch 'main' into qna-import
zhixzhan Sep 11, 2020
d9097e5
clean install
zhixzhan Sep 11, 2020
f1f0743
rename
zhixzhan Sep 11, 2020
dc497f3
refactor create qna modal
zhixzhan Sep 11, 2020
31b1152
... menuItems for navTree
zhixzhan Sep 11, 2020
376ad56
rename
zhixzhan Sep 11, 2020
fb1169c
create from scratch & url
zhixzhan Sep 11, 2020
c5cf18a
clean up
zhixzhan Sep 14, 2020
17c3ee6
fix build
zhixzhan Sep 14, 2020
4e60b2c
update
zhixzhan Sep 14, 2020
87c3d87
update all up view UX
liweitian Sep 15, 2020
4a47af1
creation flow from qna scratch
zhixzhan Sep 15, 2020
6899079
edit container name
zhixzhan Sep 15, 2020
349dab0
update css
liweitian Sep 15, 2020
9054f62
update css
liweitian Sep 15, 2020
45dfbca
migrate exist qna to container
zhixzhan Sep 16, 2020
a905b8a
edit url source
zhixzhan Sep 16, 2020
29831b5
update css
liweitian Sep 16, 2020
32a2c50
update css
liweitian Sep 16, 2020
0ab26e6
Merge branch 'qna-import' into qnaListViewUpdate
zhixzhan Sep 17, 2020
242a2ec
Merge pull request #5 from zhixzhan/qnaListViewUpdate
zhixzhan Sep 17, 2020
6620d0c
clean up
zhixzhan Sep 17, 2020
91ee11d
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
zhixzhan Sep 17, 2020
57b027e
update bf-lu package
zhixzhan Sep 17, 2020
021cfbf
update
zhixzhan Sep 17, 2020
f2ee9c5
update ux
zhixzhan Sep 17, 2020
533fc12
creation back
zhixzhan Sep 18, 2020
b9c50d5
update
zhixzhan Sep 18, 2020
ff7a311
fix create qna bot
zhixzhan Sep 18, 2020
87e0e40
update css
liweitian Sep 18, 2020
a7b7e59
update container edit
zhixzhan Sep 21, 2020
7d7e6a7
update tests
zhixzhan Sep 21, 2020
451188b
Merge branch 'qna-import' of https://github.com/zhixzhan/BotFramework…
zhixzhan Sep 21, 2020
54015d6
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
zhixzhan Sep 21, 2020
3396bee
update to multi projectId
zhixzhan Sep 21, 2020
3a048de
fix bug and update css
liweitian Sep 21, 2020
441eba2
fix bug
liweitian Sep 22, 2020
fa57f3b
add tests
zhixzhan Sep 23, 2020
b3d8142
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
zhixzhan Sep 23, 2020
7b7cf2c
resolve merge conflict
zhixzhan Sep 23, 2020
c518e7d
update
zhixzhan Sep 24, 2020
de7cafd
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
zhixzhan Sep 24, 2020
f727b38
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
zhixzhan Sep 28, 2020
e389065
use notification card
zhixzhan Sep 28, 2020
297d2ba
unify create qna modal
zhixzhan Sep 29, 2020
48bea21
show code & back KB
zhixzhan Sep 29, 2020
59bb713
rename migrated file to *-munual.source.qna
zhixzhan Sep 29, 2020
ed48616
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
zhixzhan Sep 29, 2020
3ac35ae
clean
zhixzhan Sep 29, 2020
5df2a3a
update css
liweitian Sep 29, 2020
89319c8
update styles
zhixzhan Sep 30, 2020
7f5fb4c
update tests
zhixzhan Sep 30, 2020
b732f3b
Merge branch 'main' into qna-import
zhixzhan Sep 30, 2020
9bbe1c3
revert test
zhixzhan Sep 30, 2020
a0ba992
update showcode button test id
zhixzhan Sep 30, 2020
1af691b
resolve comments
zhixzhan Oct 9, 2020
9841dbf
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
zhixzhan Oct 9, 2020
37fc4fd
resolve types
zhixzhan Oct 9, 2020
f51f479
update
zhixzhan Oct 9, 2020
02ee18a
required validation
zhixzhan Oct 10, 2020
b98392f
edit field height
zhixzhan Oct 10, 2020
8b3f729
update
zhixzhan Oct 10, 2020
488333b
update
zhixzhan Oct 10, 2020
552423d
expand row index
zhixzhan Oct 10, 2020
ed816ca
craete QnA pair controls
zhixzhan Oct 10, 2020
bc80487
update
zhixzhan Oct 10, 2020
f1e92c3
fix empty group creation
zhixzhan Oct 12, 2020
50676ef
not change backgroud when switch to scratch
zhixzhan Oct 12, 2020
45c735c
update
zhixzhan Oct 12, 2020
06d3b24
height
zhixzhan Oct 13, 2020
61abea3
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
zhixzhan Oct 13, 2020
ee03414
update
zhixzhan Oct 13, 2020
8eb0282
update
zhixzhan Oct 13, 2020
a0127ec
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
zhixzhan Oct 14, 2020
2dbbc18
resolve merge conflict
zhixzhan Oct 14, 2020
a68649e
fix creation
zhixzhan Oct 14, 2020
1b18182
fix bug
zhixzhan Oct 15, 2020
e87afe3
Merge branch 'main' of https://github.com/microsoft/BotFramework-Comp…
zhixzhan Oct 15, 2020
8b135b3
show + when hover
zhixzhan Oct 15, 2020
91ddd32
Merge branch 'main' into qna-import
cwhitten Oct 15, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Composer/cypress/integration/LGPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ context('LG Page', () => {
cy.contains('TodoSample');
cy.contains('All');

cy.get('.toggleEditMode button').as('switchButton');
cy.findByTestId('showcode').as('switchButton');

// by default is table view
cy.findByTestId('LGPage').findByTestId('table-view').should('exist');
Expand Down
4 changes: 2 additions & 2 deletions Composer/cypress/integration/LUPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ context('LU Page', () => {
cy.contains('__TestToDoBotWithLuisSample');
cy.contains('All');

cy.get('.toggleEditMode button').should('not.exist');
cy.findByTestId('showcode').should('not.exist');

// by default it goes to table view
cy.findByTestId('LUPage').findByTestId('table-view').should('exist');
Expand All @@ -25,7 +25,7 @@ context('LU Page', () => {
cy.findByTestId('ProjectTree').within(() => {
cy.findByText('__TestToDoBotWithLuisSample').click('left');
});
cy.get('.toggleEditMode button').as('switchButton');
cy.findByTestId('showcode').as('switchButton');
// goto edit-mode
cy.get('@switchButton').click();
cy.findByTestId('LUPage').get('.monaco-editor').should('exist');
Expand Down
5 changes: 2 additions & 3 deletions Composer/cypress/integration/NotificationPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ context('Notification Page', () => {
it('can show lg syntax error ', () => {
cy.visitPage('Bot Responses');

cy.get('.toggleEditMode button').as('switchButton');
cy.get('@switchButton').click();
cy.findByTestId('showcode').click();
cy.get('textarea').type('#', { delay: 200 });

cy.findByTestId('LeftNav-CommandBarButtonNotifications').click();
Expand All @@ -29,7 +28,7 @@ context('Notification Page', () => {
cy.findByText('__TestToDoBotWithLuisSample').click();
});

cy.get('.toggleEditMode button').click();
cy.findByTestId('showcode').click();
cy.get('textarea').type('t', { delay: 200 });

cy.findByTestId('LeftNav-CommandBarButtonNotifications').click();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import React from 'react';
import { fireEvent } from '@bfc/test-utils';

import { renderWithRecoil } from '../testUtils/renderWithRecoil';
import CreateQnAFromUrlModal from '../../src/components/QnA/CreateQnAFromUrlModal';
import { showCreateQnAFromUrlDialogState, showCreateQnAFromUrlDialogWithScratchState } from '../../src/recoilModel';

describe('<CreateQnAFromUrlModal />', () => {
const onDismiss = jest.fn(() => {});
const onSubmit = jest.fn(() => {});
const projectId = 'test-create-qna';

it('renders <CreateQnAFromUrlModal /> and create from scratch', () => {
const container = renderWithRecoil(
<CreateQnAFromUrlModal
dialogId="test"
projectId={projectId}
qnaFiles={[]}
onDismiss={onDismiss}
onSubmit={onSubmit}
/>,
({ set }) => {
set(showCreateQnAFromUrlDialogState(projectId), true);
set(showCreateQnAFromUrlDialogWithScratchState(projectId), true);
}
);

const { getByTestId } = container;
const createFromScratchButton = getByTestId('createKnowledgeBaseFromScratch');
expect(createFromScratchButton).not.toBeNull();
fireEvent.click(createFromScratchButton);
// actions tobe called
});

it('create with name/url and validate the value', () => {
const container = renderWithRecoil(
<CreateQnAFromUrlModal
dialogId="test"
projectId={projectId}
qnaFiles={[]}
onDismiss={onDismiss}
onSubmit={onSubmit}
/>,
() => {}
);

const { findByText, getByTestId } = container;
const inputName = getByTestId('knowledgeLocationTextField-name') as HTMLInputElement;
fireEvent.change(inputName, { target: { value: 'test' } });

const inputUrl = getByTestId('knowledgeLocationTextField-url') as HTMLInputElement;
fireEvent.change(inputUrl, { target: { value: 'test' } });

expect(inputUrl.value).toBe('test');
expect(findByText(/A valid url should start with/)).not.toBeNull();
fireEvent.change(inputUrl, { target: { value: 'http://test' } });

const createKnowledgeButton = getByTestId('createKnowledgeBase');
expect(createKnowledgeButton).not.toBeNull();
fireEvent.click(createKnowledgeButton);
expect(onSubmit).toBeCalled();
expect(onSubmit).toBeCalledWith({ url: 'http://test', name: 'test', multiTurn: false });
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/* eslint-disable react-hooks/rules-of-hooks */
import React from 'react';

import QnAPage from '../../../src/pages/knowledge-base/QnAPage';
import TableView from '../../../src/pages/knowledge-base/table-view';
import CodeEditor from '../../../src/pages/knowledge-base/code-editor';
import { renderWithRecoil } from '../../testUtils';
Expand All @@ -26,12 +27,16 @@ answer

const state = {
projectId: 'test',
dialogs: [{ id: '1' }, { id: '2' }],
dialogs: [
{ id: '1', content: '', skills: [] },
{ id: '2', content: '', skills: [] },
],
locale: 'en-us',
qnaFiles: [
{
id: 'a.en-us',
content: initialContent,
imports: [],
qnaSections: [
{
Questions: [{ content: 'question', id: 1 }],
Expand Down Expand Up @@ -63,16 +68,20 @@ const initRecoilState = ({ set }) => {

describe('QnA page all up view', () => {
it('should render QnA page table view', () => {
const { getByText, getByTestId } = renderWithRecoil(
const { getByTestId, getByText } = renderWithRecoil(
<TableView dialogId={'a'} projectId={state.projectId} />,
initRecoilState
);
getByTestId('table-view');
getByText('question (1)');
getByText('answer');
getByText('Question');
});

it('should render QnA page code editor', () => {
renderWithRecoil(<CodeEditor dialogId={'a'} projectId={state.projectId} />, initRecoilState);
});

it('should render QnA page', () => {
const { getByTestId } = renderWithRecoil(<QnAPage dialogId={'a'} projectId={state.projectId} />, initRecoilState);
getByTestId('QnAPage');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import React from 'react';

import { renderWithRecoil } from '../../testUtils';
import LGPage from '../../../src/pages/language-generation/LGPage';
import TableView from '../../../src/pages/language-generation/table-view';
import CodeEditor from '../../../src/pages/language-generation/code-editor';
import {
localeState,
luFilesState,
lgFilesState,
settingsState,
schemasState,
Expand All @@ -31,16 +31,16 @@ const initialTemplates = [

const state = {
projectId: 'test',
dialogs: [{ id: '1' }, { id: '2' }],
dialogs: [
{ id: '1', content: '', diagnostics: [], skills: [] },
{ id: '2', content: '', diagnostics: [], skills: [] },
],
locale: 'en-us',
lgFiles: [
{ id: 'a.en-us', content: initialContent, templates: initialTemplates },
{ id: 'a.fr-fr', content: initialContent, templates: initialTemplates },
],
luFiles: [
{ id: 'a.en-us', content: initialContent, templates: initialTemplates },
{ id: 'a.fr-fr', content: initialContent, templates: initialTemplates },
{ id: 'a.en-us', content: initialContent, templates: initialTemplates, diagnostics: [] },
{ id: 'a.fr-fr', content: initialContent, templates: initialTemplates, diagnostics: [] },
],

settings: {
defaultLanguage: 'en-us',
languages: ['en-us', 'fr-fr'],
Expand All @@ -51,7 +51,6 @@ const initRecoilState = ({ set }) => {
set(currentProjectIdState, state.projectId);
set(localeState(state.projectId), state.locale);
set(dialogsState(state.projectId), state.dialogs);
set(luFilesState(state.projectId), state.luFiles);
set(lgFilesState(state.projectId), state.lgFiles);
set(settingsState(state.projectId), state.settings);
set(schemasState(state.projectId), mockProjectResponse.schemas);
Expand All @@ -70,4 +69,9 @@ describe('LG page all up view', () => {
it('should render lg page code editor', () => {
renderWithRecoil(<CodeEditor dialogId={'a'} projectId={state.projectId} />, initRecoilState);
});

it('should render lg page', () => {
const { getByTestId } = renderWithRecoil(<LGPage dialogId={'a'} projectId={state.projectId} />, initRecoilState);
getByTestId('LGPage');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

import React from 'react';

import LUPage from '../../../src/pages/language-understanding/LUPage';
import TableView from '../../../src/pages/language-understanding/table-view';
import CodeEditor from '../../../src/pages/language-understanding/code-editor';
import { renderWithRecoil } from '../../testUtils';
import {
localeState,
dialogsState,
luFilesState,
lgFilesState,
settingsState,
schemasState,
currentProjectIdState,
Expand All @@ -22,17 +22,23 @@ const initialContent = `
- hello
`;

const initialIntents = [
{
Name: 'Greeting',
Body: '- hello',
},
];

const state = {
projectId: 'test',
dialogs: [{ id: '1' }, { id: '2' }],
locale: 'en-us',
lgFiles: [
{ id: 'a.en-us', content: initialContent },
{ id: 'a.fr-fr', content: initialContent },
dialogs: [
{ id: '1', content: '', skills: [] },
{ id: '2', content: '', skills: [] },
],
locale: 'en-us',
luFiles: [
{ id: 'a.en-us', content: initialContent },
{ id: 'a.fr-fr', content: initialContent },
{ id: 'a.en-us', content: initialContent, templates: initialIntents, diagnostics: [] },
{ id: 'a.fr-fr', content: initialContent, templates: initialIntents, diagnostics: [] },
],
settings: {
defaultLanguage: 'en-us',
Expand All @@ -45,7 +51,6 @@ const initRecoilState = ({ set }) => {
set(localeState(state.projectId), state.locale);
set(dialogsState(state.projectId), state.dialogs);
set(luFilesState(state.projectId), state.luFiles);
set(lgFilesState(state.projectId), state.lgFiles);
set(settingsState(state.projectId), state.settings);
set(schemasState(state.projectId), mockProjectResponse.schemas);
};
Expand All @@ -63,4 +68,8 @@ describe('LU page all up view', () => {
it('should render lu page code editor', () => {
renderWithRecoil(<CodeEditor dialogId={'a'} projectId={state.projectId} />, initRecoilState);
});

it('should render lu page', () => {
renderWithRecoil(<LUPage dialogId={'a'} projectId={state.projectId} />, initRecoilState);
});
});
92 changes: 0 additions & 92 deletions Composer/packages/client/__tests__/utils/qnaUtil.test.ts

This file was deleted.

Loading