mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-04-22 17:44:58 +01:00
Properly check if a container is query copilot sample container (#1540)
This commit is contained in:
parent
676434cac5
commit
13434715b3
@ -435,24 +435,89 @@ export const QueryCopilotSampleContainerId = "SampleContainer";
|
|||||||
export const QueryCopilotSampleContainerSchema = {
|
export const QueryCopilotSampleContainerSchema = {
|
||||||
product: {
|
product: {
|
||||||
sampleData: {
|
sampleData: {
|
||||||
id: "de6fadec-0384-43c8-93ea-16c0170b5460",
|
id: "c415e70f-9bf5-4cda-aebe-a290cb8b94c2",
|
||||||
name: "Premium Phone Mini (Red)",
|
name: "Amazing Phone 3000 (Black)",
|
||||||
price: 652.04,
|
price: 223.33,
|
||||||
category: "Electronics",
|
category: "Electronics",
|
||||||
description:
|
description:
|
||||||
"This Premium Phone Mini (Red) is designed by the company under agreement with the FCC, so we'd give it a pass in either direction, but no one should be using this handset without a compatible handset. All in all, this phone is one of the most affordable Android handsets out there at $100. Check them out.\n\n9. HTC One M9 4",
|
"This Amazing Phone 3000 (Black) is made of black metal! It has a very well made aluminum body and it feels very comfortable. We loved the sound that comes out of it! Also, the design of the phone was a little loose at first because I was using the camera and felt uncomfortable wearing it. The phone is actually made slightly smaller than these photos! This is due to the addition of a 3.3mm filter",
|
||||||
stock: 74,
|
stock: 84,
|
||||||
countryOfOrigin: "Mexico",
|
countryOfOrigin: "USA",
|
||||||
firstAvailable: "2018-07-07 17:42:28",
|
firstAvailable: "2018-09-07 19:41:44",
|
||||||
priceHistory: [592.81],
|
priceHistory: [238.68, 234.7, 221.49, 205.88, 220.15],
|
||||||
customerRatings: [
|
customerRatings: [
|
||||||
{ username: "dannyhowell", stars: 1, date: "2022-03-12 17:01:23", verifiedUser: true },
|
{
|
||||||
{ username: "lindsay26", stars: 1, date: "2022-12-29 07:18:20", verifiedUser: false },
|
username: "steven66",
|
||||||
{ username: "smithmiguel", stars: 3, date: "2022-09-08 11:43:27", verifiedUser: false },
|
firstName: "Carol",
|
||||||
{ username: "julie07", stars: 3, date: "2021-03-14 23:54:10", verifiedUser: true },
|
gender: "female",
|
||||||
{ username: "kelly93", stars: 3, date: "2022-11-05 12:45:43", verifiedUser: false },
|
lastName: "Shelton",
|
||||||
{ username: "katherinereynolds", stars: 2, date: "2022-09-14 11:49:36", verifiedUser: false },
|
age: "25-35",
|
||||||
{ username: "chandlerkenneth", stars: 1, date: "2022-01-14 12:14:43", verifiedUser: true },
|
area: "suburban",
|
||||||
|
address: "261 Collins Burgs Apt. 332\nNorth Taylor, NM 32268",
|
||||||
|
stars: 5,
|
||||||
|
date: "2021-04-22 13:42:14",
|
||||||
|
verifiedUser: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
username: "khudson",
|
||||||
|
firstName: "Ronald",
|
||||||
|
gender: "male",
|
||||||
|
lastName: "Webb",
|
||||||
|
age: "18-24",
|
||||||
|
area: "suburban",
|
||||||
|
address: "9912 Parker Court Apt. 068\nNorth Austin, HI 76225",
|
||||||
|
stars: 5,
|
||||||
|
date: "2021-02-07 07:00:22",
|
||||||
|
verifiedUser: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
username: "lfrancis",
|
||||||
|
firstName: "Brady",
|
||||||
|
gender: "male",
|
||||||
|
lastName: "Wright",
|
||||||
|
age: "35-45",
|
||||||
|
area: "urban",
|
||||||
|
address: "PSC 5437, Box 3159\nAPO AA 26385",
|
||||||
|
stars: 2,
|
||||||
|
date: "2022-02-23 21:40:10",
|
||||||
|
verifiedUser: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
username: "nicolemartinez",
|
||||||
|
firstName: "Megan",
|
||||||
|
gender: "female",
|
||||||
|
lastName: "Tran",
|
||||||
|
age: "18-24",
|
||||||
|
area: "rural",
|
||||||
|
address: "7445 Salazar Brooks\nNew Sarah, PW 18097",
|
||||||
|
stars: 4,
|
||||||
|
date: "2021-09-01 22:21:40",
|
||||||
|
verifiedUser: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
username: "uguzman",
|
||||||
|
firstName: "Deanna",
|
||||||
|
gender: "female",
|
||||||
|
lastName: "Campbell",
|
||||||
|
age: "18-24",
|
||||||
|
area: "urban",
|
||||||
|
address: "41104 Moreno Fort Suite 872\nPort Michaelbury, AK 48712",
|
||||||
|
stars: 1,
|
||||||
|
date: "2022-03-07 02:23:14",
|
||||||
|
verifiedUser: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
username: "rebeccahunt",
|
||||||
|
firstName: "Jared",
|
||||||
|
gender: "male",
|
||||||
|
lastName: "Lopez",
|
||||||
|
age: "18-24",
|
||||||
|
area: "rural",
|
||||||
|
address: "392 Morgan Village Apt. 785\nGreenshire, CT 05921",
|
||||||
|
stars: 5,
|
||||||
|
date: "2021-04-17 04:17:49",
|
||||||
|
verifiedUser: false,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
rareProperty: true,
|
rareProperty: true,
|
||||||
},
|
},
|
||||||
@ -494,6 +559,24 @@ export const QueryCopilotSampleContainerSchema = {
|
|||||||
username: {
|
username: {
|
||||||
type: "string",
|
type: "string",
|
||||||
},
|
},
|
||||||
|
firstName: {
|
||||||
|
type: "string",
|
||||||
|
},
|
||||||
|
gender: {
|
||||||
|
type: "string",
|
||||||
|
},
|
||||||
|
lastName: {
|
||||||
|
type: "string",
|
||||||
|
},
|
||||||
|
age: {
|
||||||
|
type: "string",
|
||||||
|
},
|
||||||
|
area: {
|
||||||
|
type: "string",
|
||||||
|
},
|
||||||
|
address: {
|
||||||
|
type: "string",
|
||||||
|
},
|
||||||
stars: {
|
stars: {
|
||||||
type: "number",
|
type: "number",
|
||||||
},
|
},
|
||||||
|
@ -1291,7 +1291,7 @@ export default class Explorer {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const sampleDataResourceTokenCollection = new ResourceTokenCollection(this, databaseId, collection);
|
const sampleDataResourceTokenCollection = new ResourceTokenCollection(this, databaseId, collection, true);
|
||||||
useDatabases.setState({ sampleDataResourceTokenCollection });
|
useDatabases.setState({ sampleDataResourceTokenCollection });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,8 +28,9 @@ export default class ResourceTokenCollection implements ViewModels.CollectionBas
|
|||||||
public children: ko.ObservableArray<ViewModels.TreeNode>;
|
public children: ko.ObservableArray<ViewModels.TreeNode>;
|
||||||
public selectedSubnodeKind: ko.Observable<ViewModels.CollectionTabKind>;
|
public selectedSubnodeKind: ko.Observable<ViewModels.CollectionTabKind>;
|
||||||
public isCollectionExpanded: ko.Observable<boolean>;
|
public isCollectionExpanded: ko.Observable<boolean>;
|
||||||
|
public isSampleCollection?: boolean;
|
||||||
|
|
||||||
constructor(container: Explorer, databaseId: string, data: DataModels.Collection) {
|
constructor(container: Explorer, databaseId: string, data: DataModels.Collection, isSampleCollection?: boolean) {
|
||||||
this.nodeKind = "Collection";
|
this.nodeKind = "Collection";
|
||||||
this.container = container;
|
this.container = container;
|
||||||
this.databaseId = databaseId;
|
this.databaseId = databaseId;
|
||||||
@ -42,6 +43,7 @@ export default class ResourceTokenCollection implements ViewModels.CollectionBas
|
|||||||
this.children = ko.observableArray<ViewModels.TreeNode>([]);
|
this.children = ko.observableArray<ViewModels.TreeNode>([]);
|
||||||
this.selectedSubnodeKind = ko.observable<ViewModels.CollectionTabKind>();
|
this.selectedSubnodeKind = ko.observable<ViewModels.CollectionTabKind>();
|
||||||
this.isCollectionExpanded = ko.observable<boolean>(true);
|
this.isCollectionExpanded = ko.observable<boolean>(true);
|
||||||
|
this.isSampleCollection = isSampleCollection;
|
||||||
}
|
}
|
||||||
|
|
||||||
public expandCollection(): void {
|
public expandCollection(): void {
|
||||||
|
@ -66,11 +66,12 @@ export const useSelectedNode: UseStore<SelectedNodeState> = create((set, get) =>
|
|||||||
return useNotebook.getState().connectionInfo?.status === ConnectionStatusType.Connected;
|
return useNotebook.getState().connectionInfo?.status === ConnectionStatusType.Connected;
|
||||||
},
|
},
|
||||||
isQueryCopilotCollectionSelected: (): boolean => {
|
isQueryCopilotCollectionSelected: (): boolean => {
|
||||||
const selectedNode = get().selectedNode;
|
const selectedNode = get().selectedNode as ViewModels.CollectionBase;
|
||||||
if (
|
if (
|
||||||
selectedNode &&
|
selectedNode &&
|
||||||
|
selectedNode.isSampleCollection &&
|
||||||
selectedNode.id() === QueryCopilotSampleContainerId &&
|
selectedNode.id() === QueryCopilotSampleContainerId &&
|
||||||
(selectedNode as ViewModels.Collection)?.databaseId === QueryCopilotSampleDatabaseId
|
selectedNode.databaseId === QueryCopilotSampleDatabaseId
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user