mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -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 resetPassword = localize('arc.resetPassword', "Reset Password");
|
||||||
export const addExtensions = localize('arc.addExtensions', "Add extensions");
|
export const addExtensions = localize('arc.addExtensions', "Add extensions");
|
||||||
export const dropExtensions = localize('arc.dropExtensions', "Drop 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 openInAzurePortal = localize('arc.openInAzurePortal', "Open in Azure Portal");
|
||||||
export const resourceGroup = localize('arc.resourceGroup', "Resource Group");
|
export const resourceGroup = localize('arc.resourceGroup', "Resource Group");
|
||||||
export const region = localize('arc.region', "Region");
|
export const region = localize('arc.region', "Region");
|
||||||
|
|||||||
@@ -202,12 +202,18 @@ export class PostgresExtensionsPage extends DashboardPage {
|
|||||||
|
|
||||||
private refreshExtensionsTable(): void {
|
private refreshExtensionsTable(): void {
|
||||||
let extensions = this._postgresModel.config!.spec.engine.extensions;
|
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 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 => {
|
extenesionFinalData = extensionBasicData.map(e => {
|
||||||
return e.map((value): azdata.DeclarativeTableCellValue => {
|
return e.map((value): azdata.DeclarativeTableCellValue => {
|
||||||
return { value: value };
|
return { value: value };
|
||||||
@@ -233,6 +239,7 @@ export class PostgresExtensionsPage extends DashboardPage {
|
|||||||
checkBox.onChanged(() => {
|
checkBox.onChanged(() => {
|
||||||
if (checkBox.checked) {
|
if (checkBox.checked) {
|
||||||
this.droppedExtensions.push(name);
|
this.droppedExtensions.push(name);
|
||||||
|
this.dropExtensionsButton.focus();
|
||||||
} else {
|
} else {
|
||||||
let index = this.droppedExtensions.indexOf(name, 0);
|
let index = this.droppedExtensions.indexOf(name, 0);
|
||||||
this.droppedExtensions.splice(index, 1);
|
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.extensionsLink.url = `https://www.postgresql.org/docs/${this._postgresModel.engineVersion}/external-extensions.html`;
|
||||||
this.extensionNames = [];
|
this.extensionNames = [];
|
||||||
this.refreshExtensionsTable();
|
this.refreshExtensionsTable();
|
||||||
|
this.addExtensionsButton.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -185,10 +185,10 @@ declare module 'azdata-ext' {
|
|||||||
},
|
},
|
||||||
spec: {
|
spec: {
|
||||||
engine: {
|
engine: {
|
||||||
extensions: {
|
extensions?: {
|
||||||
name: string // "citus"
|
name: string // "citus"
|
||||||
}[],
|
}[],
|
||||||
settings: {
|
settings?: {
|
||||||
default: { [key: string]: string }, // { "max_connections": "101", "work_mem": "4MB" }
|
default: { [key: string]: string }, // { "max_connections": "101", "work_mem": "4MB" }
|
||||||
roles: {
|
roles: {
|
||||||
coordinator: { [key: string]: string },
|
coordinator: { [key: string]: string },
|
||||||
@@ -208,7 +208,7 @@ declare module 'azdata-ext' {
|
|||||||
limits: SchedulingOptions
|
limits: SchedulingOptions
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
roles: {
|
roles?: {
|
||||||
coordinator: {
|
coordinator: {
|
||||||
resources: {
|
resources: {
|
||||||
requests: SchedulingOptions,
|
requests: SchedulingOptions,
|
||||||
|
|||||||
Reference in New Issue
Block a user