Compare commits

...

3 Commits

Author SHA1 Message Date
Victor Meng
af5fd699f9 Increase the video width 2022-09-16 18:25:02 -07:00
Victor Meng
d78610cd33 Remove feature flag 2022-09-14 18:27:09 -07:00
Victor Meng
bc99ca372b Hardcode API type to Postgres to test Postgres quick start 2022-09-14 17:21:26 -07:00
4 changed files with 28 additions and 32 deletions

View File

@@ -185,7 +185,7 @@ export default class Explorer {
useNotebook.getState().setNotebookBasePath(userContext.features.notebookBasePath);
}
if (!userContext.features.enablePGQuickstart || userContext.apiType !== "Postgres") {
if (userContext.apiType !== "Postgres") {
this.refreshExplorer();
}
}

View File

@@ -34,7 +34,7 @@ export const CommandBar: React.FC<Props> = ({ container }: Props) => {
const buttons = useCommandBar((state) => state.contextButtons);
const backgroundColor = StyleConstants.BaseLight;
if (userContext.features.enablePGQuickstart && userContext.apiType === "Postgres") {
if (userContext.apiType === "Postgres") {
const buttons = CommandBarComponentButtonFactory.createPostgreButtons(container);
return (
<div className="commandBarContainer">

View File

@@ -119,7 +119,7 @@ WHERE user_id = 3861633;`;
<br /> Before you can interact with your data using PGShell, you will need to login - please follow
instructions on the right to enter your password
</Text>
<Youtube videoId="Jvgh64rvdXU" style={{ margin: "20px 0" }} opts={{ width: "60%" }} />
<Youtube videoId="Jvgh64rvdXU" style={{ margin: "20px 0" }} opts={{ width: "80%" }} />
</Stack>
</PivotItem>
<PivotItem

View File

@@ -86,7 +86,7 @@ function isAccountNewerThanThresholdInMs(createdAt: string, threshold: number) {
function updateUserContext(newContext: Partial<UserContext>): void {
if (newContext.databaseAccount) {
newContext.apiType = apiType(newContext.databaseAccount);
newContext.apiType = "Postgres";
const isNewAccount = isAccountNewerThanThresholdInMs(
newContext.databaseAccount?.systemData?.createdAt || "",
@@ -107,34 +107,30 @@ function updateUserContext(newContext: Partial<UserContext>): void {
Object.assign(userContext, newContext);
}
function apiType(account: DatabaseAccount | undefined): ApiType {
if (!account) {
return "SQL";
}
// function apiType(account: DatabaseAccount | undefined): ApiType {
// if (!account) {
// return "SQL";
// }
if (features.enablePGQuickstart) {
return "Postgres";
}
const capabilities = account.properties?.capabilities;
if (capabilities) {
if (capabilities.find((c) => c.name === "EnableCassandra")) {
return "Cassandra";
}
if (capabilities.find((c) => c.name === "EnableGremlin")) {
return "Gremlin";
}
if (capabilities.find((c) => c.name === "EnableMongo")) {
return "Mongo";
}
if (capabilities.find((c) => c.name === "EnableTable")) {
return "Tables";
}
}
if (account.kind === "MongoDB" || account.kind === "Parse") {
return "Mongo";
}
return "SQL";
}
// const capabilities = account.properties?.capabilities;
// if (capabilities) {
// if (capabilities.find((c) => c.name === "EnableCassandra")) {
// return "Cassandra";
// }
// if (capabilities.find((c) => c.name === "EnableGremlin")) {
// return "Gremlin";
// }
// if (capabilities.find((c) => c.name === "EnableMongo")) {
// return "Mongo";
// }
// if (capabilities.find((c) => c.name === "EnableTable")) {
// return "Tables";
// }
// }
// if (account.kind === "MongoDB" || account.kind === "Parse") {
// return "Mongo";
// }
// return "SQL";
// }
export { userContext, updateUserContext };