Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Emulator][Data Explorer ]Disabled copy partition key feature from data explorer for emulator #2017

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
disabled change buttom for emulator
Nishtha Ahuja committed Dec 10, 2024
commit 428acf8137f21cbd0216d72b6301a4d44533d3f0
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ import * as ViewModels from "../../../../Contracts/ViewModels";

import { handleError } from "Common/ErrorHandlingUtils";
import { cancelDataTransferJob, pollDataTransferJob } from "Common/dataAccess/dataTransfers";
import { Platform, configContext } from "ConfigContext";
import Explorer from "Explorer/Explorer";
import { ChangePartitionKeyPane } from "Explorer/Panes/ChangePartitionKeyPane/ChangePartitionKeyPane";
import {
@@ -177,12 +178,14 @@ export const PartitionKeyComponent: React.FC<PartitionKeyComponentProps> = ({ da
To change the partition key, a new destination container must be created or an existing destination container
selected. Data will then be copied to the destination container.
</Text>
<PrimaryButton
styles={{ root: { width: "fit-content" } }}
text="Change"
onClick={startPartitionkeyChangeWorkflow}
disabled={isCurrentJobInProgress(portalDataTransferJob)}
/>
{configContext.platform !== Platform.Emulator && (
<PrimaryButton
styles={{ root: { width: "fit-content" } }}
text="Change"
onClick={startPartitionkeyChangeWorkflow}
disabled={isCurrentJobInProgress(portalDataTransferJob)}
/>
)}
{portalDataTransferJob && (
<Stack>
<Text styles={textHeadingStyle}>{partitionKeyName} change job</Text>

Unchanged files with check annotations Beta

query: string,
continuationToken?: string,
): Promise<QueryResponse> {
if (!useMongoProxyEndpoint(MongoProxyApi.ResourceList) || !useMongoProxyEndpoint(MongoProxyApi.QueryDocuments)) {

Check warning on line 70 in src/Common/MongoProxyClient.ts

GitHub Actions / Lint

React Hook "useMongoProxyEndpoint" is called in function "queryDocuments" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"

Check warning on line 70 in src/Common/MongoProxyClient.ts

GitHub Actions / Lint

React Hook "useMongoProxyEndpoint" is called in function "queryDocuments" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"
return queryDocuments_ToBeDeprecated(databaseId, collection, isResourceList, query, continuationToken);
}
collection: Collection,
documentId: DocumentId,
): Promise<DataModels.DocumentId> {
if (!useMongoProxyEndpoint(MongoProxyApi.ReadDocument)) {

Check warning on line 197 in src/Common/MongoProxyClient.ts

GitHub Actions / Lint

React Hook "useMongoProxyEndpoint" is called in function "readDocument" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"
return readDocument_ToBeDeprecated(databaseId, collection, documentId);
}
const { databaseAccount } = userContext;
partitionKeyProperty: string,
documentContent: unknown,
): Promise<DataModels.DocumentId> {
if (!useMongoProxyEndpoint(MongoProxyApi.CreateDocument)) {

Check warning on line 292 in src/Common/MongoProxyClient.ts

GitHub Actions / Lint

React Hook "useMongoProxyEndpoint" is called in function "createDocument" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"
return createDocument_ToBeDeprecated(databaseId, collection, partitionKeyProperty, documentContent);
}
const { databaseAccount } = userContext;
documentId: DocumentId,
documentContent: string,
): Promise<DataModels.DocumentId> {
if (!useMongoProxyEndpoint(MongoProxyApi.UpdateDocument)) {

Check warning on line 376 in src/Common/MongoProxyClient.ts

GitHub Actions / Lint

React Hook "useMongoProxyEndpoint" is called in function "updateDocument" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"
return updateDocument_ToBeDeprecated(databaseId, collection, documentId, documentContent);
}
const { databaseAccount } = userContext;
}
export function deleteDocument(databaseId: string, collection: Collection, documentId: DocumentId): Promise<void> {
if (!useMongoProxyEndpoint(MongoProxyApi.DeleteDocument)) {

Check warning on line 467 in src/Common/MongoProxyClient.ts

GitHub Actions / Lint

React Hook "useMongoProxyEndpoint" is called in function "deleteDocument" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"
return deleteDocument_ToBeDeprecated(databaseId, collection, documentId);
}
const { databaseAccount } = userContext;
export function createMongoCollectionWithProxy(
params: DataModels.CreateCollectionParams,
): Promise<DataModels.Collection> {
if (!useMongoProxyEndpoint(MongoProxyApi.CreateCollectionWithProxy)) {

Check warning on line 602 in src/Common/MongoProxyClient.ts

GitHub Actions / Lint

React Hook "useMongoProxyEndpoint" is called in function "createMongoCollectionWithProxy" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"
return createMongoCollectionWithProxy_ToBeDeprecated(params);
}
const { databaseAccount } = userContext;
}
export function getFeatureEndpointOrDefault(feature: string): string {
let endpoint;
if (useMongoProxyEndpoint(feature)) {

Check warning on line 692 in src/Common/MongoProxyClient.ts

GitHub Actions / Lint

React Hook "useMongoProxyEndpoint" is called in function "getFeatureEndpointOrDefault" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"
endpoint = configContext.MONGO_PROXY_ENDPOINT;
} else {
const allowedMongoProxyEndpoints = configContext.allowedMongoProxyEndpoints || [
];
booleanFeatures.forEach(
(f) => (f.reactState = React.useState<boolean>(urlParams.has(f.key) ? urlParams.get(f.key) === "true" : false)),

Check warning on line 96 in src/Explorer/Controls/FeaturePanel/FeaturePanelComponent.tsx

GitHub Actions / Lint

React Hook "React.useState" cannot be called inside a callback. React Hooks must be called in a React function component or a custom React Hook function
);
stringFeatures.forEach(
(f) => (f.reactState = React.useState<string>(urlParams.has(f.key) ? urlParams.get(f.key) : undefined)),

Check warning on line 99 in src/Explorer/Controls/FeaturePanel/FeaturePanelComponent.tsx

GitHub Actions / Lint

React Hook "React.useState" cannot be called inside a callback. React Hooks must be called in a React function component or a custom React Hook function
);
const buildUrl = (): string => {