From 2b79008596351f6948d8de80c7887446d97b068c Mon Sep 17 00:00:00 2001 From: Sam Wilkins Date: Fri, 15 May 2020 00:03:41 -0700 Subject: renamed new_fields to fields --- src/client/cognitive_services/CognitiveServices.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/client/cognitive_services') diff --git a/src/client/cognitive_services/CognitiveServices.ts b/src/client/cognitive_services/CognitiveServices.ts index 8c63ae906..d4df7ce57 100644 --- a/src/client/cognitive_services/CognitiveServices.ts +++ b/src/client/cognitive_services/CognitiveServices.ts @@ -1,12 +1,12 @@ import * as request from "request-promise"; -import { Doc, Field } from "../../new_fields/Doc"; -import { Cast } from "../../new_fields/Types"; +import { Doc, Field } from "../../fields/Doc"; +import { Cast } from "../../fields/Types"; import { Docs } from "../documents/Documents"; import { Utils } from "../../Utils"; -import { InkData } from "../../new_fields/InkField"; +import { InkData } from "../../fields/InkField"; import { UndoManager } from "../util/UndoManager"; import requestPromise = require("request-promise"); -import { List } from "../../new_fields/List"; +import { List } from "../../fields/List"; import { ClientRecommender } from "../ClientRecommender"; type APIManager = { converter: BodyConverter, requester: RequestExecutor }; -- cgit v1.2.3-70-g09d2 From 1fe2066b7ed2494440297b14d04148d9034f6c05 Mon Sep 17 00:00:00 2001 From: Sam Wilkins Date: Fri, 15 May 2020 19:29:26 -0700 Subject: updated env error message cognitive servies --- src/client/cognitive_services/CognitiveServices.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/client/cognitive_services') diff --git a/src/client/cognitive_services/CognitiveServices.ts b/src/client/cognitive_services/CognitiveServices.ts index d4df7ce57..517ccdce9 100644 --- a/src/client/cognitive_services/CognitiveServices.ts +++ b/src/client/cognitive_services/CognitiveServices.ts @@ -47,7 +47,7 @@ export namespace CognitiveServices { const ExecuteQuery = async (service: Service, manager: APIManager, data: D): Promise => { const apiKey = process.env[service.toUpperCase()]; if (!apiKey) { - console.log(`No API key found for ${service}: ensure index.ts has access to a .env file in your root directory.`); + console.log(`No API key found for ${service}: ensure youe root directory has .env file with _CLIENT_${service.toUpperCase()}.`); return undefined; } -- cgit v1.2.3-70-g09d2 From 21cd63dc9536deea17814231605ff22ea59e26b4 Mon Sep 17 00:00:00 2001 From: Stanley Yip Date: Mon, 18 May 2020 14:24:28 -0700 Subject: fixed some bugs with webbox and hacked some problems with cognitive services --- package.json | 2 +- src/client/cognitive_services/CognitiveServices.ts | 6 +++++- src/client/views/MainView.tsx | 4 ++-- src/client/views/collections/CollectionViewChromes.tsx | 1 + .../views/collections/collectionFreeForm/CollectionFreeFormView.tsx | 5 +++-- src/client/views/nodes/WebBox.tsx | 6 +++--- 6 files changed, 15 insertions(+), 9 deletions(-) (limited to 'src/client/cognitive_services') diff --git a/package.json b/package.json index ef30a3385..926b63f66 100644 --- a/package.json +++ b/package.json @@ -263,4 +263,4 @@ "xregexp": "^4.3.0", "youtube": "^0.1.0" } -} +} \ No newline at end of file diff --git a/src/client/cognitive_services/CognitiveServices.ts b/src/client/cognitive_services/CognitiveServices.ts index 8c63ae906..570d135c4 100644 --- a/src/client/cognitive_services/CognitiveServices.ts +++ b/src/client/cognitive_services/CognitiveServices.ts @@ -45,7 +45,11 @@ export enum Confidence { export namespace CognitiveServices { const ExecuteQuery = async (service: Service, manager: APIManager, data: D): Promise => { - const apiKey = process.env[service.toUpperCase()]; + let apiKey = process.env[service.toUpperCase()]; + // A HACK FOR A DEMO VIDEO - syip2 + if (service === "handwriting") { + apiKey = "61088486d76c4b12ba578775a5f55422"; + } if (!apiKey) { console.log(`No API key found for ${service}: ensure index.ts has access to a .env file in your root directory.`); return undefined; diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx index 9bc08de3e..d03bbc8d9 100644 --- a/src/client/views/MainView.tsx +++ b/src/client/views/MainView.tsx @@ -599,8 +599,8 @@ export class MainView extends React.Component { @computed get snapLines() { return
- {SnappingManager.horizSnapLines().map(l => )} - {SnappingManager.vertSnapLines().map(l => )} + {/* {SnappingManager.horizSnapLines().map(l => )} + {SnappingManager.vertSnapLines().map(l => )} */}
; } diff --git a/src/client/views/collections/CollectionViewChromes.tsx b/src/client/views/collections/CollectionViewChromes.tsx index 62b03bbdc..548956d11 100644 --- a/src/client/views/collections/CollectionViewChromes.tsx +++ b/src/client/views/collections/CollectionViewChromes.tsx @@ -371,6 +371,7 @@ export class CollectionStackingViewChrome extends React.Component { this.props.CollectionView.props.Document._pivotField = value; return true; diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index c6bae66a4..c3a77841e 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -438,9 +438,9 @@ export class CollectionFreeFormView extends CollectionSubView p.X)), Math.max(...ge.points.map(p => p.Y))); - const setDocs = this.getActiveDocuments().filter(s => s.proto?.type === "text" && s.color); + const setDocs = this.getActiveDocuments().filter(s => s.proto?.type === "rtf" && s.color); const sets = setDocs.map((sd) => { - return Cast(sd.data, RichTextField)?.Text as string; + return Cast(sd.text, RichTextField)?.Text as string; }); if (sets.length && sets[0]) { this._wordPalette.clear(); @@ -476,6 +476,7 @@ export class CollectionFreeFormView extends CollectionSubView { console.log(results); const wordResults = results.filter((r: any) => r.category === "inkWord"); diff --git a/src/client/views/nodes/WebBox.tsx b/src/client/views/nodes/WebBox.tsx index 6d4cc1a07..04878cf35 100644 --- a/src/client/views/nodes/WebBox.tsx +++ b/src/client/views/nodes/WebBox.tsx @@ -77,7 +77,7 @@ export class WebBox extends ViewBoxAnnotatableComponent