terrier-engine 4.4.10 → 4.4.12

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.
@@ -6,8 +6,9 @@ import dayjs from "dayjs"
6
6
  import QueryEditor from "./query-editor"
7
7
  import TerrierPart from "../../terrier/parts/terrier-part"
8
8
  import Schema, {ModelDef, SchemaDef} from "../../terrier/schema"
9
- import {arrays, messages} from "tuff-core"
9
+ import {arrays, messages, strings} from "tuff-core"
10
10
  import {Logger} from "tuff-core/logging"
11
+ import inflection from "inflection";
11
12
 
12
13
  const log = new Logger("Queries")
13
14
 
@@ -205,7 +206,8 @@ export class QueryModelPicker extends TerrierPart<QueryModelPickerState> {
205
206
  label.input({type: 'radio', name: `new-query-model-${this.id}`, value: model.name})
206
207
  .emitChange(this.pickedKey, {model: model.name})
207
208
  label.div(col => {
208
- col.div('.name').text(model.name)
209
+ const name = inflection.pluralize(strings.titleize(model.name))
210
+ col.div('.name').text(name)
209
211
  if (model.metadata?.description) {
210
212
  col.div('.description').text(model.metadata.description)
211
213
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "files": [
5
5
  "*"
6
6
  ],
7
- "version": "4.4.10",
7
+ "version": "4.4.12",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/Terrier-Tech/terrier-engine"
@@ -109,6 +109,7 @@ export class OverlayPart extends Part<NoState> {
109
109
  */
110
110
  clearAll() {
111
111
  this.layerStates = []
112
+ this.updateLayers()
112
113
  }
113
114
 
114
115
  render(parent: PartTag) {
@@ -131,6 +132,18 @@ class OverlayLayer<PartType extends Part<StateType>, StateType extends {}> exten
131
132
  this.part = this.makePart(this.state.partClass, this.state.partState)
132
133
  }
133
134
 
135
+
136
+ assignState(state: OverlayLayerState<PartType, StateType>): boolean {
137
+ const changed = super.assignState(state)
138
+ if (changed) {
139
+ if (this.part) {
140
+ this.removeChild(this.part)
141
+ }
142
+ this.part = this.makePart(this.state.partClass, this.state.partState)
143
+ }
144
+ return changed
145
+ }
146
+
134
147
  render(parent: PartTag) {
135
148
  parent.part(this.part)
136
149
  }