-
Notifications
You must be signed in to change notification settings - Fork 132
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
404 describe #3104
404 describe #3104
Changes from all commits
1eac49a
87030b6
06a42a3
71daff4
9bca4c5
3fca224
1fa56b6
e9588fc
35de799
2620dff
328f0a4
31b5d55
725f21f
d16d2ca
62a6084
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,11 +44,7 @@ export default async function initialize( | |
const api = new ZuiApi() | ||
const store = await initStore(api, renderer) | ||
const asyncTasks = initAsyncTasks(renderer) | ||
await initGlobals(store) | ||
await initLake(store) | ||
api.init(store.dispatch, store.getState) | ||
initDOM() | ||
initIpcListeners(store) | ||
initDomainModels({store}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the Domain Models need to be provisioned with the store variable before we call "initLake". So I re-ordered the steps here. |
||
initHandlers({ | ||
transition: startTransition, | ||
oldApi: api, | ||
|
@@ -59,9 +55,13 @@ export default async function initialize( | |
toast, | ||
asyncTasks, | ||
}) | ||
initDomainModels({ | ||
store, | ||
}) | ||
|
||
await initGlobals(store) | ||
await initLake(store) | ||
api.init(store.dispatch, store.getState) | ||
initDOM() | ||
initIpcListeners(store) | ||
|
||
ViewHandler.store = store | ||
setMenuContext({select: (fn) => fn(store.getState()), api}) | ||
initDebugGlobals(store, api) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,9 @@ export type LakeAttrs = { | |
version?: string | ||
authType: AuthType | ||
authData?: AuthData | ||
features?: { | ||
describe: boolean | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm going to add a "features" property the the data we cache about the lake. The only feature right now will be "describe". |
||
} | ||
|
||
export type AuthType = "none" | "auth0" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ import {BrowserTab} from "./browser-tab" | |
import {Frame} from "./frame" | ||
import {getActiveTab} from "src/js/state/Tabs/selectors" | ||
import Editor from "src/js/state/Editor" | ||
import {Lake} from "./lake" | ||
|
||
export class Active extends DomainModel { | ||
static get tab() { | ||
|
@@ -36,4 +37,9 @@ export class Active extends DomainModel { | |
id: globalThis.windowId, | ||
}) | ||
} | ||
|
||
static get lake() { | ||
const id = this.select(Current.getLakeId) | ||
return Lake.find(id) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a shortcut to get the Active lake object. |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import {Lake} from "../lake" | ||
|
||
export class FeatureDetector { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This class is responsible for detecting all the features we want. |
||
constructor(public lake: Lake) {} | ||
|
||
async hasDescribe() { | ||
try { | ||
const resp = await this.lake.client.describeQuery("from :pools") | ||
return !resp.error | ||
} catch (e) { | ||
if (/404/.test(e.message)) return false | ||
else throw e | ||
} | ||
} | ||
|
||
async detect() { | ||
return { | ||
describe: await this.hasDescribe(), | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const RESULTS_QUERY = "zui-results/main" | ||
export const RESULTS_QUERY_COUNT = "zui-results/main-count" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initCurrentTab
only called thisupdateStatus
function. So I inlined it and removedinitCurrentTab
.All of this "lake" status/authentication code needs another look at some point.