mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 01:25:37 -05:00
Handle if no extensions listed in PG spec (#16194)
* Handle if not extensions listed in spec, focus buttons * Set extensions to optional * Added optional field to settings and scheduling.roles
This commit is contained in:
@@ -44,6 +44,7 @@ export const discardText = localize('arc.discard', "Discard");
|
||||
export const resetPassword = localize('arc.resetPassword', "Reset Password");
|
||||
export const addExtensions = localize('arc.addExtensions', "Add extensions");
|
||||
export const dropExtensions = localize('arc.dropExtensions', "Drop extensions");
|
||||
export const noExtensions = localize('arc.noExtensions', "No extensions listed in configuration.");
|
||||
export const openInAzurePortal = localize('arc.openInAzurePortal', "Open in Azure Portal");
|
||||
export const resourceGroup = localize('arc.resourceGroup', "Resource Group");
|
||||
export const region = localize('arc.region', "Region");
|
||||
|
||||
@@ -202,12 +202,18 @@ export class PostgresExtensionsPage extends DashboardPage {
|
||||
|
||||
private refreshExtensionsTable(): void {
|
||||
let extensions = this._postgresModel.config!.spec.engine.extensions;
|
||||
let extensionBasicData = extensions.map(e => {
|
||||
this.extensionNames.push(e.name);
|
||||
return [this.createDropCheckBox(e.name), e.name];
|
||||
});
|
||||
|
||||
let extenesionFinalData: azdata.DeclarativeTableCellValue[][] = [];
|
||||
let extensionBasicData: (string | azdata.CheckBoxComponent | azdata.ImageComponent)[][] = [];
|
||||
|
||||
if (extensions) {
|
||||
extensionBasicData = extensions.map(e => {
|
||||
this.extensionNames.push(e.name);
|
||||
return [this.createDropCheckBox(e.name), e.name];
|
||||
});
|
||||
} else {
|
||||
extensionBasicData = [[this.modelView.modelBuilder.image().component(), loc.noExtensions]];
|
||||
}
|
||||
|
||||
extenesionFinalData = extensionBasicData.map(e => {
|
||||
return e.map((value): azdata.DeclarativeTableCellValue => {
|
||||
return { value: value };
|
||||
@@ -233,6 +239,7 @@ export class PostgresExtensionsPage extends DashboardPage {
|
||||
checkBox.onChanged(() => {
|
||||
if (checkBox.checked) {
|
||||
this.droppedExtensions.push(name);
|
||||
this.dropExtensionsButton.focus();
|
||||
} else {
|
||||
let index = this.droppedExtensions.indexOf(name, 0);
|
||||
this.droppedExtensions.splice(index, 1);
|
||||
@@ -277,6 +284,7 @@ export class PostgresExtensionsPage extends DashboardPage {
|
||||
this.extensionsLink.url = `https://www.postgresql.org/docs/${this._postgresModel.engineVersion}/external-extensions.html`;
|
||||
this.extensionNames = [];
|
||||
this.refreshExtensionsTable();
|
||||
this.addExtensionsButton.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,10 +185,10 @@ declare module 'azdata-ext' {
|
||||
},
|
||||
spec: {
|
||||
engine: {
|
||||
extensions: {
|
||||
extensions?: {
|
||||
name: string // "citus"
|
||||
}[],
|
||||
settings: {
|
||||
settings?: {
|
||||
default: { [key: string]: string }, // { "max_connections": "101", "work_mem": "4MB" }
|
||||
roles: {
|
||||
coordinator: { [key: string]: string },
|
||||
@@ -208,7 +208,7 @@ declare module 'azdata-ext' {
|
||||
limits: SchedulingOptions
|
||||
}
|
||||
},
|
||||
roles: {
|
||||
roles?: {
|
||||
coordinator: {
|
||||
resources: {
|
||||
requests: SchedulingOptions,
|
||||
|
||||
Reference in New Issue
Block a user