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); useNotebook.getState().setNotebookBasePath(userContext.features.notebookBasePath);
} }
if (!userContext.features.enablePGQuickstart || userContext.apiType !== "Postgres") { if (userContext.apiType !== "Postgres") {
this.refreshExplorer(); this.refreshExplorer();
} }
} }

View File

@@ -34,7 +34,7 @@ export const CommandBar: React.FC<Props> = ({ container }: Props) => {
const buttons = useCommandBar((state) => state.contextButtons); const buttons = useCommandBar((state) => state.contextButtons);
const backgroundColor = StyleConstants.BaseLight; const backgroundColor = StyleConstants.BaseLight;
if (userContext.features.enablePGQuickstart && userContext.apiType === "Postgres") { if (userContext.apiType === "Postgres") {
const buttons = CommandBarComponentButtonFactory.createPostgreButtons(container); const buttons = CommandBarComponentButtonFactory.createPostgreButtons(container);
return ( return (
<div className="commandBarContainer"> <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 <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 instructions on the right to enter your password
</Text> </Text>
<Youtube videoId="Jvgh64rvdXU" style={{ margin: "20px 0" }} opts={{ width: "60%" }} /> <Youtube videoId="Jvgh64rvdXU" style={{ margin: "20px 0" }} opts={{ width: "80%" }} />
</Stack> </Stack>
</PivotItem> </PivotItem>
<PivotItem <PivotItem

View File

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