mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Add loading text properties for option sources (#13743)
* Add loading text to deployment radio options * Fix loading race condition * Update text
This commit is contained in:
@@ -189,7 +189,9 @@
|
||||
"editable": false,
|
||||
"options": {
|
||||
"source": {
|
||||
"providerId": "arc.controller.config.profiles"
|
||||
"providerId": "arc.controller.config.profiles",
|
||||
"loadingText": "%arc.data.controller.cluster.config.profile.loading%",
|
||||
"loadingCompletedText": "%arc.data.controller.cluster.config.profile.loadingcompleted%"
|
||||
},
|
||||
"defaultValue": "azure-arc-aks-default-storage",
|
||||
"optionsType": "radio"
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
"arc.data.controller.kube.cluster.context": "Cluster context",
|
||||
"arc.data.controller.cluster.config.profile.title": "Choose the config profile",
|
||||
"arc.data.controller.cluster.config.profile": "Config profile",
|
||||
"arc.data.controller.cluster.config.profile.loading": "Loading config profiles",
|
||||
"arc.data.controller.cluster.config.profile.loadingcompleted": "Loading config profiles complete",
|
||||
"arc.data.controller.create.azureconfig.title": "Azure and Connectivity Configuration",
|
||||
"arc.data.controller.connectivitymode.description": "Select the connectivity mode for the controller.",
|
||||
"arc.data.controller.create.controllerconfig.title": "Controller Configuration",
|
||||
|
||||
@@ -244,6 +244,8 @@ export type ComponentCSSStyles = {
|
||||
|
||||
export interface IOptionsSource {
|
||||
provider?: IOptionsSourceProvider
|
||||
loadingText?: string,
|
||||
loadingCompletedText?: string,
|
||||
readonly variableNames?: { [index: string]: string; };
|
||||
readonly providerId: string;
|
||||
}
|
||||
|
||||
@@ -986,6 +986,7 @@ async function createRadioOptions(context: FieldContext, getRadioButtonInfo?: ((
|
||||
}
|
||||
const label = createLabel(context.view, { text: context.fieldInfo.label, description: context.fieldInfo.description, required: context.fieldInfo.required, width: context.fieldInfo.labelWidth, cssStyles: context.fieldInfo.labelCSSStyles });
|
||||
const radioGroupLoadingComponentBuilder = new RadioGroupLoadingComponentBuilder(context.view, context.onNewDisposableCreated, context.fieldInfo);
|
||||
|
||||
context.fieldInfo.labelPosition = LabelPosition.Left;
|
||||
context.onNewInputComponentCreated(context.fieldInfo.variableName || context.fieldInfo.label, {
|
||||
component: radioGroupLoadingComponentBuilder,
|
||||
@@ -995,8 +996,17 @@ async function createRadioOptions(context: FieldContext, getRadioButtonInfo?: ((
|
||||
getDisplayValue: async (): Promise<string> => radioGroupLoadingComponentBuilder.displayValue,
|
||||
onValueChanged: radioGroupLoadingComponentBuilder.onValueChanged,
|
||||
});
|
||||
addLabelInputPairToContainer(context.view, context.components, label, radioGroupLoadingComponentBuilder.component(), context.fieldInfo);
|
||||
const options = context.fieldInfo.options as OptionsInfo;
|
||||
let loadingText = options?.source?.loadingText;
|
||||
let loadingCompletedText = options?.source?.loadingCompletedText;
|
||||
if (loadingText || loadingCompletedText) {
|
||||
radioGroupLoadingComponentBuilder.withProps({
|
||||
showText: true,
|
||||
loadingText: loadingText,
|
||||
loadingCompletedText: loadingCompletedText
|
||||
});
|
||||
}
|
||||
addLabelInputPairToContainer(context.view, context.components, label, radioGroupLoadingComponentBuilder.component(), context.fieldInfo);
|
||||
// Start loading the options but continue on so that we can continue setting up the rest of the components - the group
|
||||
// will show a loading spinner while the options are loaded
|
||||
radioGroupLoadingComponentBuilder.loadOptions(
|
||||
|
||||
@@ -1660,8 +1660,9 @@ class ButtonWrapper extends ComponentWithIconWrapper implements azdata.ButtonCom
|
||||
class LoadingComponentWrapper extends ComponentWrapper implements azdata.LoadingComponent {
|
||||
constructor(proxy: MainThreadModelViewShape, handle: number, id: string) {
|
||||
super(proxy, handle, ModelComponentTypes.LoadingComponent, id);
|
||||
this.properties = {};
|
||||
this.loading = true;
|
||||
this.properties = {
|
||||
loading: true
|
||||
};
|
||||
}
|
||||
|
||||
public get loading(): boolean {
|
||||
|
||||
Reference in New Issue
Block a user