terrier-engine 4.4.13 → 4.4.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data-dive/dives/dive-runs.ts +4 -3
- package/package.json +1 -1
- package/terrier/forms.ts +2 -3
- package/terrier/schema.ts +13 -4
|
@@ -58,8 +58,8 @@ export class DiveRunModal extends ModalPart<{dive: DdDive }> {
|
|
|
58
58
|
|
|
59
59
|
this.schema = await Schema.get()
|
|
60
60
|
|
|
61
|
-
// progress is # queries + 1 for the output
|
|
62
|
-
const total = (this.state.dive.query_data?.queries?.length || 0) +
|
|
61
|
+
// progress is # queries +1 for creating and run and +1 for the output
|
|
62
|
+
const total = (this.state.dive.query_data?.queries?.length || 0) + 2
|
|
63
63
|
this.progressBar = this.makePart(ProgressBarPart, {total})
|
|
64
64
|
|
|
65
65
|
// initialize the inputs
|
|
@@ -111,6 +111,7 @@ export class DiveRunModal extends ModalPart<{dive: DdDive }> {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
async createRun() {
|
|
114
|
+
this.progressBar.setProgress(0, 'primary')
|
|
114
115
|
const newRun: UnpersistedDdDiveRun = {
|
|
115
116
|
dd_dive_id: this.state.dive.id,
|
|
116
117
|
status: 'initial',
|
|
@@ -125,12 +126,12 @@ export class DiveRunModal extends ModalPart<{dive: DdDive }> {
|
|
|
125
126
|
} else {
|
|
126
127
|
this.alertToast(`Error creating dive run: ${res.message}`)
|
|
127
128
|
}
|
|
129
|
+
this.progressBar.increment()
|
|
128
130
|
this.dirty()
|
|
129
131
|
}
|
|
130
132
|
|
|
131
133
|
beginStreaming(run: DdDiveRun) {
|
|
132
134
|
this.run = run
|
|
133
|
-
this.progressBar.setProgress(0, 'primary')
|
|
134
135
|
Api.stream(`/data_dive/stream_run/${this.run.id}`)
|
|
135
136
|
.on<RunQueryResult>('query_result', res => {
|
|
136
137
|
this.queryResults[res.id] = res
|
package/package.json
CHANGED
package/terrier/forms.ts
CHANGED
|
@@ -3,8 +3,7 @@ import {strings} from "tuff-core"
|
|
|
3
3
|
import {DbErrors} from "./db-client"
|
|
4
4
|
import {PartTag} from "tuff-core/parts"
|
|
5
5
|
import {InputTag, InputTagAttrs} from "tuff-core/html"
|
|
6
|
-
import TerrierPart from "./parts/terrier-part"
|
|
7
|
-
import {an} from "vitest/dist/types-ad1c3f45";
|
|
6
|
+
import TerrierPart from "./parts/terrier-part"
|
|
8
7
|
|
|
9
8
|
////////////////////////////////////////////////////////////////////////////////
|
|
10
9
|
// Options
|
|
@@ -64,7 +63,7 @@ export class TerrierFormFields<T extends FormPartData> extends FormFields<T> {
|
|
|
64
63
|
*/
|
|
65
64
|
renderErrorBubble(parent: PartTag) {
|
|
66
65
|
if (this.errors) {
|
|
67
|
-
(this.part as TerrierPart<
|
|
66
|
+
(this.part as TerrierPart<any>).renderErrorBubble(parent, this.errors)
|
|
68
67
|
}
|
|
69
68
|
}
|
|
70
69
|
}
|
package/terrier/schema.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import Api from "./api"
|
|
2
|
-
import inflection from "inflection"
|
|
2
|
+
import inflection from "inflection"
|
|
3
3
|
|
|
4
4
|
////////////////////////////////////////////////////////////////////////////////
|
|
5
5
|
// Schema Definitions
|
|
6
6
|
////////////////////////////////////////////////////////////////////////////////
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Possible visibility for models and columns.
|
|
10
|
+
*/
|
|
11
|
+
export type MetaVisibility = 'common' | 'uncommon' | 'never'
|
|
12
|
+
|
|
8
13
|
/**
|
|
9
14
|
* Definition for a single column in the schema.
|
|
10
15
|
*/
|
|
@@ -15,6 +20,7 @@ export type ColumnDef = {
|
|
|
15
20
|
type: string
|
|
16
21
|
possible_values?: string[]
|
|
17
22
|
default?: string
|
|
23
|
+
visibility?: MetaVisibility
|
|
18
24
|
}
|
|
19
25
|
|
|
20
26
|
/**
|
|
@@ -34,6 +40,7 @@ export type HasManyDef = {
|
|
|
34
40
|
model: string
|
|
35
41
|
}
|
|
36
42
|
|
|
43
|
+
|
|
37
44
|
/**
|
|
38
45
|
* Definition for a single model in the schema.
|
|
39
46
|
*/
|
|
@@ -45,7 +52,7 @@ export type ModelDef = {
|
|
|
45
52
|
has_many: Record<string, HasManyDef>
|
|
46
53
|
metadata?: {
|
|
47
54
|
description?: string
|
|
48
|
-
|
|
55
|
+
visibility?: MetaVisibility
|
|
49
56
|
}
|
|
50
57
|
}
|
|
51
58
|
|
|
@@ -96,7 +103,7 @@ function belongsToDisplay(belongsTo: BelongsToDef): string {
|
|
|
96
103
|
* @param schema
|
|
97
104
|
*/
|
|
98
105
|
function commonModels(schema: SchemaDef): ModelDef[] {
|
|
99
|
-
return Object.values(schema.models).filter(m => m.metadata?.common)
|
|
106
|
+
return Object.values(schema.models).filter(m => m.metadata?.visibility == 'common')
|
|
100
107
|
}
|
|
101
108
|
|
|
102
109
|
/**
|
|
@@ -104,7 +111,9 @@ function commonModels(schema: SchemaDef): ModelDef[] {
|
|
|
104
111
|
* @param schema
|
|
105
112
|
*/
|
|
106
113
|
function uncommonModels(schema: SchemaDef): ModelDef[] {
|
|
107
|
-
return Object.values(schema.models).filter(m =>
|
|
114
|
+
return Object.values(schema.models).filter(m => {
|
|
115
|
+
return !m.metadata?.visibility || m.metadata?.visibility == 'uncommon'
|
|
116
|
+
})
|
|
108
117
|
}
|
|
109
118
|
|
|
110
119
|
|