Added categories and search based filtering to the resource dialog. (#12658)

* added filtering to the resource type along with a new component.

* -Added caching of cards
-Removed unused component props
-localized tags
-limited the scope of list items

* Made some changes in the PR

* - Added Iot Category to SQL edge
- Moved category names to constants
- Moved localization strings to localized constants
- Made filtering logic more concise
- Changed how category list is generated
--Category list can now be ordered
-Added back event generation for selectedCard

* Fixed bugs, and some additional changes
-Fixed radiogroup height to avoid the movement of options below it
-Restoring the focus back to the search and listview components
- Added focus behaviour for listview
- Fixed a typo in comment

* Made categories an Enum

* Added localized string

* localized category string
converted categories to enum.

* made the filtering logic more concise.

* returning string if no localized string formed
removed unnecessary returns

* fixed the filtering tag logic
resetting search when category is changed

* removing the iot tag from sql edge deployment

* made filtering logic more concise
made enum const

* added vscode list

* some cleanup

* Some PR changes
- Made PR camelcase
- added comments to SQL
- removed unnecessary export

* -Some PR related changes
-Removing unsupported style property
-scoping down css and removing unused ones.

* Fixed a comment text

* Fixed typings for listview event
This commit is contained in:
Aasim Khan
2020-10-07 13:38:12 -07:00
committed by GitHub
parent 830cef06db
commit 280a9d20f9
18 changed files with 512 additions and 28 deletions

View File

@@ -249,6 +249,13 @@ class ModelBuilderImpl implements azdata.ModelBuilder {
return builder;
}
listView(): azdata.ComponentBuilder<azdata.ListViewComponent, azdata.ListViewComponentProperties> {
let id = this.getNextComponentId();
let builder: ComponentBuilderImpl<azdata.ListViewComponent, azdata.ListViewComponentProperties> = this.getComponentBuilder(new ListViewComponentWrapper(this._proxy, this._handle, id), id);
this._componentBuilders.set(id, builder);
return builder;
}
tabbedPanel(): azdata.TabbedPanelComponentBuilder {
let id = this.getNextComponentId();
let builder = new TabbedPanelComponentBuilder(new TabbedPanelComponentWrapper(this._proxy, this._handle, id));
@@ -1819,6 +1826,43 @@ class RadioCardGroupComponentWrapper extends ComponentWrapper implements azdata.
}
}
class ListViewComponentWrapper extends ComponentWrapper implements azdata.ListViewComponent {
constructor(proxy: MainThreadModelViewShape, handle: number, id: string) {
super(proxy, handle, ModelComponentTypes.ListView, id);
this.properties = {};
this._emitterMap.set(ComponentEventType.onDidClick, new Emitter<azdata.ListViewClickEvent>());
}
public get title(): azdata.ListViewTitle {
return this.properties['title'];
}
public set title(v: azdata.ListViewTitle) {
this.setProperty('title', v);
}
public get options(): azdata.ListViewOption[] {
return this.properties['options'];
}
public set options(v: azdata.ListViewOption[]) {
this.setProperty('options', v);
}
public get selectedOptionId(): string | undefined {
return this.properties['selectedOptionId'];
}
public set selectedOptionId(v: string | undefined) {
this.setProperty('selectedOptionId', v);
}
public get onDidClick(): vscode.Event<azdata.ListViewClickEvent> {
let emitter = this._emitterMap.get(ComponentEventType.onDidClick);
return emitter && emitter.event;
}
}
class TabbedPanelComponentWrapper extends ComponentWrapper implements azdata.TabbedPanelComponent {
constructor(proxy: MainThreadModelViewShape, handle: number, id: string) {
super(proxy, handle, ModelComponentTypes.TabbedPanel, id);