@datagrok/hit-triage 1.10.8 → 1.10.9

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@datagrok/hit-triage",
3
3
  "friendlyName": "Hit Triage",
4
- "version": "1.10.8",
4
+ "version": "1.10.9",
5
5
  "author": {
6
6
  "name": "Davit Rizhinashvili",
7
7
  "email": "drizhinashvili@datagrok.ai"
@@ -22,13 +22,15 @@
22
22
  "rxjs": "6.6.7",
23
23
  "typeahead-standalone": "4.14.1",
24
24
  "uuid": "^11.1.1",
25
- "@datagrok-libraries/bio": "^6.0.7",
26
25
  "@datagrok-libraries/compute-utils": "^1.47.0",
26
+ "@datagrok-libraries/bio": "^6.0.8",
27
27
  "@datagrok-libraries/utils": "^4.7.9",
28
28
  "@datagrok-libraries/statistics": "^1.12.15"
29
29
  },
30
30
  "devDependencies": {
31
- "@types/uuid": "^9.0.2"
31
+ "@types/uuid": "^9.0.2",
32
+ "@playwright/test": "^1.62.1",
33
+ "@datagrok-libraries/bdd": "^0.1.0"
32
34
  },
33
35
  "canEdit": [
34
36
  "Administrators"
@@ -74,6 +76,7 @@
74
76
  "scripts": {
75
77
  "build": "grok build",
76
78
  "typecheck": "grok tsc --noEmit -p tsconfig.json",
77
- "lint": "eslint --ext .ts,.tsx src"
79
+ "lint": "eslint --ext .ts,.tsx src",
80
+ "test:bdd": "grok-bdd run"
78
81
  }
79
82
  }
@@ -302,6 +302,17 @@ export class HitDesignApp<T extends HitDesignTemplate = HitDesignTemplate> exten
302
302
  try {this.dataFrame!.changeColumnType(colName, type as DG.COLUMN_TYPE);} catch (e) {console.error(e);}
303
303
  });
304
304
  }
305
+ // restored before the view binds the table, which subscribes formula columns to recalculation only if it has any
306
+ for (const [colName, tags] of Object.entries(this._campaign?.columnTags ?? {})) {
307
+ const col = this.dataFrame.columns.byName(colName);
308
+ if (!col)
309
+ continue;
310
+ for (const [tag, value] of Object.entries(tags))
311
+ !!tag && !!value && col.setTag(tag, value);
312
+ // the tag alone does not reorder the categories
313
+ if (tags['.category-order'] && col.type === DG.COLUMN_TYPE.STRING)
314
+ col.setCategoryOrder(col.getCategoryOrder());
315
+ }
305
316
  //await this.dataFrame.meta.detectSemanticTypes();
306
317
  }
307
318
 
@@ -1070,6 +1081,9 @@ export class HitDesignApp<T extends HitDesignTemplate = HitDesignTemplate> exten
1070
1081
  enrichedDf.columns.toList().forEach((col) => columnSemTypes[col.name] = col.semType);
1071
1082
  const colTypeMap: {[_: string]: string} = {};
1072
1083
  enrichedDf.columns.toList().forEach((col) => colTypeMap[col.name] = col.type);
1084
+ const columnTags: {[_: string]: {[_: string]: string}} = {};
1085
+ for (const col of enrichedDf.columns.toList().filter((col) => !col.name.startsWith('~')))
1086
+ columnTags[col.name] = Object.fromEntries(col.tags);
1073
1087
  const sketchStateString = this.campaign?.tilesViewerFormSketch ?? undefined;
1074
1088
 
1075
1089
  const getDefaultPerms = async () => {
@@ -1103,6 +1117,7 @@ export class HitDesignApp<T extends HitDesignTemplate = HitDesignTemplate> exten
1103
1117
  filteredRowCount: enrichedDf.filter.trueCount,
1104
1118
  savePath: this._filePath,
1105
1119
  columnTypes: colTypeMap,
1120
+ columnTags,
1106
1121
  tilesViewerFormSketch: sketchStateString,
1107
1122
  version: this.version + 1,
1108
1123
  authorUserId,
package/src/app/types.ts CHANGED
@@ -125,6 +125,8 @@ export type HitDesignMergeConfig = {
125
125
  export type HitDesignCampaign = Omit<HitTriageCampaign, 'filters' | 'ingest'> & {
126
126
  tilesViewerFormSketch?: string,
127
127
  mergeConfig?: HitDesignMergeConfig,
128
+ // the CSV table carries no column metadata
129
+ columnTags?: {[colName: string]: {[tag: string]: string}},
128
130
  };
129
131
 
130
132
  // todo: probably add some more stuff
package/tsconfig.json CHANGED
@@ -2,5 +2,8 @@
2
2
  "extends": "@datagrok/build-config/tsconfig.base.json",
3
3
  "include": [
4
4
  "src"
5
+ ],
6
+ "exclude": [
7
+ "bdd"
5
8
  ]
6
9
  }