Skip to content

Commit

Permalink
chore: clean SDKTypes leak in indexer, dialogFactory (#2313)
Browse files Browse the repository at this point in the history
Co-authored-by: Andy Brown <asbrown002@gmail.com>
  • Loading branch information
yeze322 and a-b-r-o-w-n authored Mar 20, 2020
1 parent a953d80 commit 2cf1676
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Composer/packages/lib/indexers/src/dialogIndexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import has from 'lodash/has';
import uniq from 'lodash/uniq';
import { extractLgTemplateRefs } from '@bfc/shared';
import { extractLgTemplateRefs, SDKTypes } from '@bfc/shared';

import { createPath } from './dialogUtils/dialogChecker';
import { checkerFuncs } from './dialogUtils/dialogChecker';
Expand Down Expand Up @@ -43,7 +43,7 @@ function ExtractLgTemplates(id, dialog): LgTemplateJsonPath[] {
}
// look for other $type
switch (value.$type) {
case 'Microsoft.SendActivity':
case SDKTypes.SendActivity:
targets.push({ value: value.activity, path: path });
break; // if we want stop at some $type, do here
case 'location':
Expand Down Expand Up @@ -80,7 +80,7 @@ function ExtractLuIntents(dialog, id: string): ReferredLuIntents[] {
* */
const visitor: VisitorFunc = (path: string, value: any): boolean => {
// it's a valid schema dialog node.
if (has(value, '$type') && value.$type === 'Microsoft.OnIntent') {
if (has(value, '$type') && value.$type === SDKTypes.OnIntent) {
const intentName = value.intent;
intents.push({
name: intentName,
Expand Down Expand Up @@ -111,7 +111,7 @@ function ExtractTriggers(dialog): ITrigger[] {
id: `triggers[${index}]`,
displayName: '',
type: rule.$type,
isIntent: rule.$type === 'Microsoft.OnIntent',
isIntent: rule.$type === SDKTypes.OnIntent,
};
if (has(rule, '$designer.name')) {
trigger.displayName = rule.$designer.name;
Expand Down Expand Up @@ -139,7 +139,7 @@ function ExtractReferredDialogs(dialog): string[] {
* */
const visitor: VisitorFunc = (path: string, value: any): boolean => {
// it's a valid schema dialog node.
if (has(value, '$type') && value.$type === 'Microsoft.BeginDialog') {
if (has(value, '$type') && value.$type === SDKTypes.BeginDialog) {
const dialogName = value.dialog;
dialogs.push(dialogName);
}
Expand Down
2 changes: 1 addition & 1 deletion Composer/packages/lib/shared/src/dialogFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const initialDialogShape = {
],
}),
[SDKTypes.OnConversationUpdateActivity]: {
$type: 'Microsoft.OnConversationUpdateActivity',
$type: SDKTypes.OnConversationUpdateActivity,
actions: [
{
$type: SDKTypes.Foreach,
Expand Down

0 comments on commit 2cf1676

Please sign in to comment.