Skip to content

Commit b0f52ab

Browse files
committed
Merge branch 'development'
2 parents 8be99bd + a54f693 commit b0f52ab

File tree

11 files changed

+68
-77
lines changed

11 files changed

+68
-77
lines changed

README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,19 @@ There is a wide variety of Web toolchains; the process below is one way to compi
5050

5151
### Install toolchains and dependencies
5252

53-
1. Install [nvm](https://github.com/nvm-sh/nvm) on MacOS or Linux, [nvm-windows](https://github.com/coreybutler/nvm-windows) on Windows.
54-
2. `nvm install 22.16.0`
55-
3. `nvm use 22.16.0`
56-
4. `npm install --global [email protected]`
57-
5. `corepack enable`
58-
6. `corepack prepare [email protected] --activate`
59-
7. `pnpm i -g @angular/cli`
60-
8. `pnpm i`
61-
9. (Optional) Install [Rust](https://www.rust-lang.org/tools/install). Only required if you want to compile as a desktop application.
53+
First, install [nvm](https://github.com/nvm-sh/nvm) on MacOS or Linux, [nvm-windows](https://github.com/coreybutler/nvm-windows) on Windows. Then:
54+
55+
```sh
56+
nvm install 22.16.0
57+
nvm use 22.16.0
58+
npm install --global [email protected]
59+
corepack enable
60+
corepack prepare [email protected] --activate
61+
pnpm i -g @angular/cli
62+
pnpm i
63+
```
64+
65+
(Optional) Install [Rust](https://www.rust-lang.org/tools/install). Only required if you want to compile as a desktop application.
6266

6367
### Launch local development server (Angular)
6468

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.4.3
1+
3.4.4

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "typedb-studio",
3-
"version": "3.4.3",
3+
"version": "3.4.4",
44
"scripts": {
55
"ng": "ng",
66
"generate-grammar": "lezer-generator --typeScript src/framework/codemirror-lang-typeql/typeql.grammar -o src/framework/codemirror-lang-typeql/generated/typeql.grammar.generated",

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "typedb-studio"
3-
version = "3.4.3"
3+
version = "3.4.4"
44
description = "A Tauri App"
55
authors = ["you"]
66
edition = "2021"

src-tauri/tauri.conf.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "typedb-studio",
4-
"version": "3.4.3",
4+
"version": "3.4.4",
55
"identifier": "com.typedb.studio",
66
"build": {
77
"beforeDevCommand": "pnpm start",
@@ -31,7 +31,7 @@
3131
],
3232
"windows": {
3333
"wix": {
34-
"version": "3.4.3"
34+
"version": "3.4.4"
3535
}
3636
},
3737
"macOS": {

src/module/query/query-tool.component.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,11 @@ button {
180180
position: absolute;
181181
inset: 0;
182182
overflow: auto;
183+
scrollbar-gutter: stable;
184+
}
185+
186+
.answers-structure-container {
187+
overflow: hidden;
183188
}
184189

185190
.answers-text-container {

src/module/scaffold/sidebar/sidebar.component.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,17 @@
3535

3636
<mat-divider></mat-divider>
3737

38-
<!-- <ts-sidebar-link [matTooltip]="collapsed ? 'Settings' : ''" matTooltipPosition="right" link="/settings" domain="settings" idSuffix="settings">-->
39-
<!-- <i class="fa-light fa-gear"></i>@if (!collapsed) { <span>Settings</span> }-->
40-
<!-- </ts-sidebar-link>-->
4138
<ts-sidebar-link [matTooltip]="collapsed ? 'App info' : ''" matTooltipPosition="right" (click)="showAppInfoDialog()" domain="app-info" idSuffix="app-info">
4239
<i class="fa-light fa-info-circle"></i>@if (!collapsed) { <span>App info</span> }
4340
</ts-sidebar-link>
4441

4542
<div class="flex-spacer"></div>
4643

44+
<!-- <ts-sidebar-link [matTooltip]="collapsed ? 'Settings' : ''" matTooltipPosition="right" link="/settings" domain="settings" idSuffix="settings">-->
45+
<!-- <i class="fa-light fa-gear"></i>@if (!collapsed) { <span>Settings</span> }-->
46+
<!-- </ts-sidebar-link>-->
47+
<ts-sidebar-link [external]="true" [matTooltip]="collapsed ? 'TypeDB Cloud' : ''" matTooltipPosition="right" link="https://cloud.typedb.com" domain="admin" idSuffix="admin">
48+
<i class="fa-light fa-clouds"></i>@if (!collapsed) { <span>TypeDB Cloud</span> }
49+
</ts-sidebar-link>
4750
<!-- <ts-connection-widget/>-->
4851
</div>

src/module/schema/schema-tool.component.scss

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -84,38 +84,8 @@ button {
8484
overflow: auto;
8585
}
8686

87-
.answers-text-container {
88-
mat-form-field {
89-
flex: 1;
90-
display: flex;
91-
flex-direction: column;
92-
}
93-
94-
::ng-deep .mdc-text-field,
95-
::ng-deep .mat-mdc-form-field-flex,
96-
::ng-deep .mat-mdc-form-field-infix {
97-
width: 100%;
98-
height: 100%;
99-
--mdc-outlined-text-field-container-shape: 0;
100-
}
101-
102-
::ng-deep .mdc-notched-outline {
103-
display: none;
104-
}
105-
106-
::ng-deep .mdc-text-field {
107-
--mdc-outlined-text-field-input-text-color: #{secondary.$pink};
108-
}
109-
110-
::ng-deep .mat-mdc-form-field:not(.form-field-dense) .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix {
111-
padding: 4px 2px 4px 6px;
112-
}
113-
114-
.answers-text-box {
115-
height: 100% !important;
116-
resize: none;
117-
@include typography.code;
118-
}
87+
.answers-structure-container {
88+
overflow: hidden;
11989
}
12090

12191
.status-text-container {

src/service/query-tool-state.service.ts

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@ import { defaultSigmaSettings } from "../framework/graph-visualiser/defaults";
1414
import { newVisualGraph } from "../framework/graph-visualiser/graph";
1515
import { Layouts } from "../framework/graph-visualiser/layouts";
1616
import { Concept, Value } from "../framework/typedb-driver/concept";
17-
import { ApiResponse, ConceptDocument, ConceptRow, isApiErrorResponse, QueryResponse } from "../framework/typedb-driver/response";
17+
import {
18+
ApiResponse,
19+
ConceptDocument,
20+
ConceptRow,
21+
ConceptRowAnswer,
22+
isApiErrorResponse,
23+
QueryResponse
24+
} from "../framework/typedb-driver/response";
1825
import { INTERNAL_ERROR } from "../framework/util/strings";
1926
import { DriverState } from "./driver-state.service";
2027
import { SchemaState, Schema, SchemaAttribute, SchemaRole, SchemaConcept } from "./schema-state.service";
@@ -326,64 +333,62 @@ export class LogOutputState {
326333
}
327334

328335
appendQueryResult(res: ApiResponse<QueryResponse>) {
336+
let lines: string[] = [];
329337
if (isApiErrorResponse(res)) {
330-
this.appendLines(`${RESULT}${ERROR}`, ``, res.err.message);
338+
lines.push(`${RESULT}${ERROR}`, ``, res.err.message);
331339
return;
332340
}
333341

334-
this.appendLines(`${RESULT}${SUCCESS}`, ``);
342+
lines.push(`${RESULT}${SUCCESS}`, ``);
335343

336344
switch (res.ok.answerType) {
337345
case "ok": {
338-
this.appendLines(`Finished ${res.ok.queryType} query.`);
346+
lines.push(`Finished ${res.ok.queryType} query.`);
339347
break;
340348
}
341349
case "conceptRows": {
342-
this.appendLines(`Finished ${res.ok.queryType} query compilation and validation...`);
343-
if (res.ok.queryType === "write") this.appendLines(`Finished writes. Printing rows...`);
344-
else this.appendLines(`Printing rows...`);
350+
lines.push(`Finished ${res.ok.queryType} query compilation and validation...`);
351+
if (res.ok.queryType === "write") lines.push(`Finished writes. Printing rows...`);
352+
else lines.push(`Printing rows...`);
345353

346354
if (res.ok.answers.length) {
347355
const varNames = Object.keys(res.ok.answers[0]);
348356
if (varNames.length) {
349-
res.ok.answers.forEach(((x, idx) => this.appendConceptRow(x.data, idx === 0)));
350-
} else this.appendLines(`No columns to show.`);
357+
const columnNames = Object.keys(res.ok.answers[0].data);
358+
const variableColumnWidth = columnNames.length > 0 ? Math.max(...columnNames.map(s => s.length)) : 0;
359+
res.ok.answers.forEach((rowAnswer, idx) => {
360+
if (idx == 0) lines.push(this.lineDashSeparator(variableColumnWidth));
361+
lines.push(this.conceptRowDisplayString(rowAnswer.data, variableColumnWidth))
362+
})
363+
} else lines.push(`No columns to show.`);
351364
}
352365

353-
this.appendLines(`Finished. Total rows: ${res.ok.answers.length}`);
366+
lines.push(`Finished. Total rows: ${res.ok.answers.length}`);
354367
break;
355368
}
356369
case "conceptDocuments": {
357-
this.appendLines(`Finished ${res.ok.queryType} query compilation and validation...`);
358-
if (res.ok.queryType === "write") this.appendLines(`Finished writes. Printing documents...`);
359-
else this.appendLines(`Printing documents...`);
360-
res.ok.answers.forEach(x => this.appendConceptDocument(x));
361-
this.appendLines(`Finished. Total documents: ${res.ok.answers.length}`);
370+
lines.push(`Finished ${res.ok.queryType} query compilation and validation...`);
371+
if (res.ok.queryType === "write") lines.push(`Finished writes. Printing documents...`);
372+
else lines.push(`Printing documents...`);
373+
res.ok.answers.forEach(x => lines.push(this.conceptDocumentDisplayString(x)));
374+
lines.push(`Finished. Total documents: ${res.ok.answers.length}`);
362375
break;
363376
}
364377
default:
365378
throw INTERNAL_ERROR;
366379
}
367-
380+
this.appendLines(...lines);
368381
this.appendBlankLine();
369382
}
370383

371-
private appendConceptDocument(document: ConceptDocument) {
384+
private conceptDocumentDisplayString(document: ConceptDocument): string {
372385
try {
373-
const pretty = JSON.stringify(document, null, 2);
374-
this.appendLines(pretty);
386+
return JSON.stringify(document, null, 2);
375387
} catch (err) {
376-
this.appendLines(`Error trying to print JSON: ${err}`);
388+
return `Error trying to print JSON: ${err}`;
377389
}
378390
}
379391

380-
private appendConceptRow(row: ConceptRow, isFirst: boolean) {
381-
const columnNames = Object.keys(row);
382-
const variableColumnWidth = columnNames.length > 0 ? Math.max(...columnNames.map(s => s.length)) : 0;
383-
if (isFirst) this.appendLines(this.lineDashSeparator(variableColumnWidth));
384-
this.appendLines(this.conceptRowDisplayString(row, variableColumnWidth));
385-
}
386-
387392
private conceptRowDisplayString(row: ConceptRow, variableColumnWidth: number) {
388393
const columnNames = Object.keys(row);
389394
const contents = columnNames.map((columnName) =>

0 commit comments

Comments
 (0)