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

Updates to configurations view to work with subdirectories #1956

Open
wants to merge 2 commits into
base: sagerb-show-projectDir-when-selecting-entrypoints
Choose a base branch
from
Open
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
23 changes: 18 additions & 5 deletions extensions/vscode/src/views/configurations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,22 @@ export class ConfigurationsTreeDataProvider

try {
const api = await useApi();
const response = await api.configurations.getAll({
const getAllPromise = api.configurations.getAll({
dir: ".",
recursive: true,
});

window.withProgress(
{
title: "Initializing",
location: { viewId: Views.Configurations },
},
async () => {
return getAllPromise;
},
Comment on lines +88 to +90
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just pass the getAllPromise here rather than wrapping it in another function?

);

const response = await getAllPromise;
const configurations = response.data;

return configurations.map((config) => {
Expand Down Expand Up @@ -126,7 +138,10 @@ export class ConfigurationsTreeDataProvider
// We only create a new configuration through this
// command. We do not associate it automatically with
// the current deployment
await newConfig("Create a Configuration File for your Project", viewId);
await newConfig(
"Create a Configuration File for your Project",
viewId ? viewId : Views.Configurations,
);
};

private edit = async (config: ConfigurationTreeItem) => {
Expand All @@ -143,9 +158,7 @@ export class ConfigurationsTreeDataProvider
};

private clone = async (item: ConfigurationTreeItem) => {
const defaultName = await untitledConfigurationName(
item.config.configurationRelPath,
);
const defaultName = await untitledConfigurationName(item.config.projectDir);
const newUri = await this.promptForNewName(item.fileUri, defaultName);
if (newUri === undefined) {
return;
Expand Down