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
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
7 changes: 2 additions & 5 deletions Composer/packages/ui-plugins/lg/src/LgField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,8 @@ const LgField: React.FC<FieldProps<string>> = props => {
},
};

const diagnostic = lgFile && filterTemplateDiagnostics(lgFile.diagnostics, template)[0];
const diagnostics = lgFile ? filterTemplateDiagnostics(lgFile.diagnostics, template) : [];

const errorMsg = diagnostic
? diagnostic.message.split('error message: ')[diagnostic.message.split('error message: ').length - 1]
: '';
const [localValue, setLocalValue] = useState(template.body);
const sync = useRef(
debounce((shellData: any, localData: any) => {
Expand Down Expand Up @@ -110,7 +107,7 @@ const LgField: React.FC<FieldProps<string>> = props => {
height={100}
value={localValue}
onChange={onChange}
errorMessage={errorMsg}
diagnostics={diagnostics}
hidePlaceholder
languageServer={{
path: lspServerPath,
Expand Down
8 changes: 2 additions & 6 deletions Composer/packages/ui-plugins/luis/src/LuisIntentEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,15 @@ const LuisIntentEditor: React.FC<FieldProps<string>> = props => {
onChange(intentName);
};

const diagnostic = luFile && filterSectionDiagnostics(luFile.diagnostics, luIntent)[0];

const errorMsg = diagnostic
? diagnostic.message.split('error message: ')[diagnostic.message.split('error message: ').length - 1]
: '';
const diagnostics = luFile ? filterSectionDiagnostics(luFile.diagnostics, luIntent) : [];

return (
<LuEditor
height={150}
luOption={{ fileId: luFile.id, sectionId: luIntent.Name }}
value={luIntent.Body}
onChange={commitChanges}
errorMessage={errorMsg}
diagnostics={diagnostics}
options={{
lineNumbers: 'off',
minimap: {
Expand Down