Compare commits

..

5 Commits

Author SHA1 Message Date
Asier Isayas
0774ad4561 extract parition key 2024-08-14 13:49:17 -04:00
sunghyunkang1111
24860a6842 revert extract partition key (#1935) 2024-08-14 02:54:20 -05:00
Asier Isayas
bf6b362610 Activate Mongo Proxy in MPAC (#1934)
* activate mongo proxy in mpac

* activate mongo proxy in mpac

---------

Co-authored-by: Asier Isayas <aisayas@microsoft.com>
2024-08-13 16:34:34 -04:00
sunghyunkang1111
baca7922b4 move nps survey open dialog call to after explorer initialization (#1932) 2024-08-13 14:16:20 -05:00
Ashley Stanton-Nurse
b59ba20ed0 fix #1929 by using flex instead of grid to lay out the tabs view (#1930) 2024-08-13 11:19:24 -07:00
6 changed files with 72 additions and 30 deletions

View File

@@ -2352,8 +2352,8 @@ a:link {
.tabsManagerContainer { .tabsManagerContainer {
height: 100%; height: 100%;
display: grid; display: flex;
grid-template-rows: 36px 36px 1fr; flex-direction: column;
min-width: 0; // This prevents it to grow past the parent's width if its content is too wide min-width: 0; // This prevents it to grow past the parent's width if its content is too wide
} }
@@ -2610,9 +2610,8 @@ a:link {
} }
.tabPanesContainer { .tabPanesContainer {
grid-row: span 2; // Fill the remaining space
display: flex; display: flex;
height: 100%; flex-grow: 1;
overflow: hidden; overflow: hidden;
} }

View File

@@ -70,7 +70,6 @@ export function sendMessage(data: any): void {
} }
export function sendReadyMessage(): void { export function sendReadyMessage(): void {
console.log("SENDING READY MESSAGE");
_sendMessage({ _sendMessage({
signature: "pcIframe", signature: "pcIframe",
kind: "ready", kind: "ready",

View File

@@ -676,8 +676,8 @@ export function useMongoProxyEndpoint(api: string): boolean {
const activeMongoProxyEndpoints: string[] = [ const activeMongoProxyEndpoints: string[] = [
MongoProxyEndpoints.Local, MongoProxyEndpoints.Local,
MongoProxyEndpoints.Mpac, MongoProxyEndpoints.Mpac,
MongoProxyEndpoints.Prod, // MongoProxyEndpoints.Prod,
MongoProxyEndpoints.Fairfax, // MongoProxyEndpoints.Fairfax,
]; ];
let canAccessMongoProxy: boolean = userContext.databaseAccount.properties.publicNetworkAccess === "Enabled"; let canAccessMongoProxy: boolean = userContext.databaseAccount.properties.publicNetworkAccess === "Enabled";
if ( if (

View File

@@ -109,14 +109,14 @@ let configContext: Readonly<ConfigContext> = {
PORTAL_BACKEND_ENDPOINT: PortalBackendEndpoints.Prod, PORTAL_BACKEND_ENDPOINT: PortalBackendEndpoints.Prod,
MONGO_PROXY_ENDPOINT: MongoProxyEndpoints.Prod, MONGO_PROXY_ENDPOINT: MongoProxyEndpoints.Prod,
NEW_MONGO_APIS: [ NEW_MONGO_APIS: [
// "resourcelist", "resourcelist",
// "queryDocuments", "queryDocuments",
// "createDocument", "createDocument",
// "readDocument", "readDocument",
// "updateDocument", "updateDocument",
// "deleteDocument", "deleteDocument",
// "createCollectionWithProxy", "createCollectionWithProxy",
// "legacyMongoShell", "legacyMongoShell",
], ],
MONGO_PROXY_OUTBOUND_IPS_ALLOWLISTED: false, MONGO_PROXY_OUTBOUND_IPS_ALLOWLISTED: false,
CASSANDRA_PROXY_ENDPOINT: CassandraProxyEndpoints.Prod, CASSANDRA_PROXY_ENDPOINT: CassandraProxyEndpoints.Prod,

View File

@@ -57,7 +57,8 @@ export const Tabs = ({ explorer }: TabsProps): JSX.Element => {
const defaultMessageBarStyles: IMessageBarStyles = { const defaultMessageBarStyles: IMessageBarStyles = {
root: { root: {
height: `${LayoutConstants.rowHeight}px`, height: `${LayoutConstants.rowHeight}px`,
overflow: "auto", overflow: "hidden",
flexDirection: "row",
}, },
}; };

View File

@@ -85,18 +85,61 @@ export const queryPagesUntilContentPresent = async (
}; };
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
export const extractPartitionKeyValues = ( // export const extractPartitionKeyValues = (
documentContent: any, // documentContent: any,
partitionKeyDefinition: PartitionKeyDefinition, // partitionKeyDefinition: PartitionKeyDefinition,
): PartitionKey[] => { // ): PartitionKey[] => {
if (!partitionKeyDefinition.paths || partitionKeyDefinition.paths.length === 0) { // if (!partitionKeyDefinition.paths || partitionKeyDefinition.paths.length === 0) {
return undefined; // return undefined;
// }
// const partitionKeyValues: PartitionKey[] = [];
// partitionKeyDefinition.paths.forEach((partitionKeyPath: string) => {
// const partitionKeyPathWithoutSlash: string = partitionKeyPath.substring(1);
// // if (documentContent[partitionKeyPathWithoutSlash]) {
// // partitionKeyValues.push(documentContent[partitionKeyPathWithoutSlash]);
// // }
// const partitionKeyPathParts: string[] = partitionKeyPathWithoutSlash.split("/");
// let partitionKeyValue: any = documentContent;
// for(let partitionKeyPathPartIndex in partitionKeyPathParts) {
// const partitionKeyPathPart: string = partitionKeyPathParts[partitionKeyPathPartIndex];
// if (!(partitionKeyPathPart in documentContent)) {
// partitionKeyValue = {};
// break;
// }
// partitionKeyValue = partitionKeyValue[partitionKeyPathPart];
// }
// partitionKeyValues.push(partitionKeyValue);
// });
// return partitionKeyValues;
// };
/* eslint-disable @typescript-eslint/no-explicit-any */
export const extractPartitionKeyValues = (document: any, partitionKeyDefinition: PartitionKeyDefinition): PartitionKey[] => {
if (partitionKeyDefinition && partitionKeyDefinition.paths && partitionKeyDefinition.paths.length > 0) {
var partitionKey: any = [];
partitionKeyDefinition.paths.forEach(function (path) {
path = path.substring(1);
const pathParts: string[] = path.split("/");
var obj = document;
for (var i = 0; i < pathParts.length; ++i) {
if (!((typeof obj === "object") && (pathParts[i] in obj))) {
obj = {};
break;
} }
const partitionKeyValues: PartitionKey[] = []; obj = obj[pathParts[i]];
partitionKeyDefinition.paths.forEach((partitionKeyPath: string) => { }
const partitionKeyPathWithoutSlash: string = partitionKeyPath.substring(1);
partitionKeyValues.push(documentContent[partitionKeyPathWithoutSlash]); partitionKey.push(obj);
}); });
return partitionKeyValues;
}; return partitionKey;
}
return undefined;
}