Skip to content

Commit

Permalink
Revert "port: Register missingProperties custom function to get all v…
Browse files Browse the repository at this point in the history
…ariables the template contains (#3885)" (#3970) (#3971)

This reverts commit 3e2beae.
  • Loading branch information
Josh Gummersall committed Nov 4, 2021
1 parent e863249 commit a8823db
Show file tree
Hide file tree
Showing 18 changed files with 56 additions and 476 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,6 @@ describe('ActionTests', function () {
await TestUtils.runTestScript(resourceExplorer, 'Action_SetProperties');
});

it('MissingProperty', async () => {
await TestUtils.runTestScript(resourceExplorer, 'Action_MissingProperty');
});

it('SetProperty', async () => {
await TestUtils.runTestScript(resourceExplorer, 'Action_SetProperty');
});
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,3 @@

# length
- length in main

# nameAndAge
- my name is ${user.name} and my age is ${user.age}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ import { Headers as Headers_2 } from 'node-fetch';
import { ImportResolverDelegate } from 'botbuilder-lg';
import { IntExpression } from 'adaptive-expressions';
import { ListStyle } from 'botbuilder-dialogs';
import { MemoryInterface } from 'adaptive-expressions';
import { ModelResult } from 'botbuilder-dialogs';
import { NumberExpression } from 'adaptive-expressions';
import { ObjectExpression } from 'adaptive-expressions';
import { Options } from 'adaptive-expressions';
import { PromptOptions } from 'botbuilder-dialogs';
import { Recognizer } from 'botbuilder-dialogs';
import { RecognizerConfiguration } from 'botbuilder-dialogs';
Expand Down Expand Up @@ -1366,7 +1364,6 @@ export class LanguageGenerationBotComponent extends BotComponent {
// @public
export interface LanguageGenerator<T = unknown, D = Record<string, unknown>> {
generate(dialogContext: DialogContext, template: string, data: D): Promise<T>;
missingProperties(dialogContext: DialogContext, template: string, state?: MemoryInterface, options?: Options): string[];
}

// @public
Expand Down Expand Up @@ -1448,12 +1445,6 @@ export class MentionEntityRecognizer extends TextEntityRecognizer {
protected _recognize(text: string, culture: string): ModelResult[];
}

// @public
export class MissingPropertiesFunction extends ExpressionEvaluator {
constructor(context: DialogContext);
static readonly functionName = "missingProperties";
}

// @public (undocumented)
export class MostSpecificSelector extends TriggerSelector implements MostSpecificSelectorConfiguration {
// (undocumented)
Expand Down Expand Up @@ -1489,8 +1480,6 @@ export abstract class MultiLanguageGeneratorBase<T = unknown, D extends Record<s
// (undocumented)
getConverter(property: keyof MultiLanguageGeneratorBaseConfiguration): Converter | ConverterFactory;
languagePolicy: LanguagePolicy;
// (undocumented)
missingProperties(dialogContext: DialogContext, template: string, state?: MemoryInterface, options?: Options): string[];
abstract tryGetGenerator(dialogContext: DialogContext, locale: string): {
exist: boolean;
result: LanguageGenerator<T, D>;
Expand Down Expand Up @@ -2339,8 +2328,7 @@ export class TemplateEngineLanguageGenerator<T = unknown, D extends Record<strin
generate(dialogContext: DialogContext, template: string, data: D): Promise<T>;
// (undocumented)
id: string;
missingProperties(dialogContext: DialogContext, template: string, _state?: MemoryInterface, _options?: Options): string[];
}
}

// @public (undocumented)
export interface TemplateEngineLanguageGeneratorConfiguration {
Expand Down
3 changes: 1 addition & 2 deletions libraries/botbuilder-dialogs-adaptive/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
"botbuilder-dialogs-declarative": "4.1.6",
"botbuilder-lg": "4.1.6",
"lodash": "^4.17.21",
"node-fetch": "^2.6.0",
"uuid": "^8.3.2"
"node-fetch": "^2.6.0"
},
"devDependencies": {
"@microsoft/recognizers-text": "~1.1.4",
Expand Down
7 changes: 1 addition & 6 deletions libraries/botbuilder-dialogs-adaptive/src/adaptiveDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Licensed under the MIT License.
*/

import { BoolExpression, BoolExpressionConverter, Expression, IntExpression } from 'adaptive-expressions';
import { BoolExpression, BoolExpressionConverter, IntExpression } from 'adaptive-expressions';
import {
Activity,
ActivityTypes,
Expand Down Expand Up @@ -48,7 +48,6 @@ import { EntityAssignment } from './entityAssignment';
import { EntityAssignmentComparer } from './entityAssignmentComparer';
import { EntityAssignments } from './entityAssignments';
import { EntityInfo, NormalizedEntityInfos } from './entityInfo';
import { MissingPropertiesFunction } from './functions';
import { LanguageGenerator } from './languageGenerator';
import { languageGeneratorKey } from './languageGeneratorExtensions';
import { BoolProperty } from './properties';
Expand Down Expand Up @@ -776,10 +775,6 @@ export class AdaptiveDialog<O extends object = {}> extends DialogContainer<O> im
protected onSetScopedServices(dialogContext: DialogContext): void {
if (this.generator) {
dialogContext.services.set(languageGeneratorKey, this.generator);
Expression.functions.set(
MissingPropertiesFunction.functionName,
new MissingPropertiesFunction(dialogContext)
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@

export * from './hasPendingActionsFunction';
export * from './isDialogActiveFunction';
export * from './missingPropertiesFunction';

This file was deleted.

0 comments on commit a8823db

Please sign in to comment.