Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add components field to migrated settings. #7674

Merged
merged 5 commits into from
May 7, 2021
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
1 change: 1 addition & 0 deletions Composer/packages/server/src/services/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ export class BotProjectService {
const newSettings: DialogSetting = {
...currentProject.settings,
runtimeSettings: {
components: [],
features: {
showTyping: originalProject.settings?.feature?.UseShowTypingMiddleware || false,
useInspection: originalProject.settings?.feature?.UseInspectionMiddleware || false,
Expand Down
14 changes: 9 additions & 5 deletions extensions/packageManager/src/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,11 +367,6 @@ export default async (composer: IExtensionRegistration): Promise<void> => {

const installedComponents = await loadPackageAssets(mergeResults.components.filter(isAdaptiveComponent));
if (mergeResults) {
res.json({
success: true,
components: installedComponents,
});

let runtimeLanguage = 'c#';
if (
currentProject.settings.runtime.key === 'node-azurewebapp' ||
Expand All @@ -387,18 +382,27 @@ export default async (composer: IExtensionRegistration): Promise<void> => {
!currentProject.settings.runtimeSettings?.components?.find((p) => p.name === newlyInstalledPlugin.name)
) {
const newSettings = await currentProject.getEnvSettings();
// guard against missing settings keys
if (!newSettings.runtimeSettings) {
newSettings.runtimeSettings = {
components: [],
};
}
if (!newSettings.runtimeSettings.components) {
newSettings.runtimeSettings.components = [];
}
newSettings.runtimeSettings.components.push({
name: newlyInstalledPlugin.name,
settingsPrefix: newlyInstalledPlugin.name,
});
currentProject.updateEnvSettings(newSettings);
}
updateRecentlyUsed(installedComponents, runtimeLanguage);

res.json({
success: true,
components: installedComponents,
});
} else {
res.json({
success: false,
Expand Down