mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-09 17:52:34 -05:00
radio card change (#12049)
* radio card change * Clone the object * freeze change description * Change to deepClone
This commit is contained in:
@@ -83,7 +83,7 @@ export class ResourceTypePickerDialog extends DialogBase {
|
||||
ariaLabel: localize('deploymentDialog.deploymentOptions', "Deployment options"),
|
||||
width: '1100px'
|
||||
}).component();
|
||||
this._toDispose.push(this._cardGroup.onSelectionChanged((cardId: string) => {
|
||||
this._toDispose.push(this._cardGroup.onSelectionChanged(({ cardId }) => {
|
||||
const resourceType = resourceTypes.find(rt => { return rt.name === cardId; });
|
||||
if (resourceType) {
|
||||
this.selectResourceType(resourceType);
|
||||
|
||||
5
src/sql/azdata.proposed.d.ts
vendored
5
src/sql/azdata.proposed.d.ts
vendored
@@ -174,7 +174,10 @@ declare module 'azdata' {
|
||||
}
|
||||
|
||||
export interface RadioCardGroupComponent extends Component, RadioCardGroupComponentProperties {
|
||||
onSelectionChanged: vscode.Event<any>;
|
||||
/**
|
||||
* The card object returned from this function is a clone of the internal representation - changes will not impact the original object
|
||||
*/
|
||||
onSelectionChanged: vscode.Event<{ cardId: string; card?: RadioCard }>;
|
||||
}
|
||||
|
||||
export interface SeparatorComponent extends Component {
|
||||
|
||||
@@ -11,6 +11,7 @@ import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import 'vs/css!./media/card';
|
||||
import { IComponent, IComponentDescriptor, IModelStore, ComponentEventType } from 'sql/platform/dashboard/browser/interfaces';
|
||||
import { deepClone } from 'vs/base/common/objects';
|
||||
|
||||
@Component({
|
||||
templateUrl: decodeURI(require.toUrl('./radioCardGroup.component.html'))
|
||||
@@ -141,7 +142,10 @@ export default class RadioCardGroup extends ComponentBase implements IComponent,
|
||||
this._changeRef.detectChanges();
|
||||
this.fireEvent({
|
||||
eventType: ComponentEventType.onDidChange,
|
||||
args: cardId
|
||||
args: {
|
||||
cardId,
|
||||
card: deepClone(this.getCardById(cardId))
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user