diff options
| author | Aubrey-Li <63608597+Aubrey-Li@users.noreply.github.com> | 2021-07-24 11:15:04 -0700 |
|---|---|---|
| committer | Aubrey-Li <63608597+Aubrey-Li@users.noreply.github.com> | 2021-07-24 11:15:04 -0700 |
| commit | aa67222bc1a80ae11d1a29b32d5cb54199b38011 (patch) | |
| tree | 5fa6cad23c09370b326e69fb8594c32b8a6e35d7 /src/client | |
| parent | 53dfd5f380d8c75fedc967577fb16310d08cefea (diff) | |
backend issues with creating map node
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/documents/DocumentTypes.ts | 2 | ||||
| -rw-r--r-- | src/client/documents/Documents.ts | 4 | ||||
| -rw-r--r-- | src/client/util/CurrentUserUtils.ts | 4 | ||||
| -rw-r--r-- | src/client/views/nodes/PresBox.tsx | 5 |
4 files changed, 8 insertions, 7 deletions
diff --git a/src/client/documents/DocumentTypes.ts b/src/client/documents/DocumentTypes.ts index 422d9c2e3..5bd5590b7 100644 --- a/src/client/documents/DocumentTypes.ts +++ b/src/client/documents/DocumentTypes.ts @@ -23,7 +23,7 @@ export enum DocumentType { SCRIPTING = "script", EQUATION = "equation", FUNCPLOT = "funcplot", - MAP = "MAP", + MAP = "map", // special purpose wrappers that either take no data or are compositions of lower level types diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 5ec0b0063..b17d3b3a1 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -802,8 +802,8 @@ export namespace Docs { return InstanceFromProto(Prototypes.get(DocumentType.WEB), new HtmlField(html), options); } - export function MapDocument(initial: List<Doc> = new List(), options: DocumentOptions = {}) { - return InstanceFromProto(Prototypes.get(DocumentType.MAP), initial, options); + export function MapDocument(url: string, options: DocumentOptions = {}) { + return InstanceFromProto(Prototypes.get(DocumentType.MAP), new MapField(new URL(url)), options); } export function KVPDocument(document: Doc, options: DocumentOptions = {}) { diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index 21c4ac110..366207334 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -448,8 +448,8 @@ export class CurrentUserUtils { doc.emptyWebpage = Docs.Create.WebDocument("", { title: "webpage", _nativeWidth: 850, isTemplateDoc: true, _height: 512, _width: 400, useCors: true, system: true, cloneFieldFilter: new List<string>(["system"]) }); } if (doc.emptyMap === undefined) { - doc.emptyMap = Docs.Create.MapDocument(new List<Doc>(), { title: "google map", _width: 800, _height: 600, system: true, cloneFieldFilter: new List<string>(["system"]) }); - // ((doc.emptyMap as Doc).proto as Doc)["dragFactory-count"] = 0; + doc.emptyMap = Docs.Create.MapDocument(new List<Doc>(), { title: "map", _width: 800, _height: 600, system: true, cloneFieldFilter: new List<string>(["system"]) }); + ((doc.emptyMap as Doc).proto as Doc)["dragFactory-count"] = 0; } if (doc.activeMobileMenu === undefined) { this.setupActiveMobileMenu(doc); diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx index 693348613..11a735645 100644 --- a/src/client/views/nodes/PresBox.tsx +++ b/src/client/views/nodes/PresBox.tsx @@ -80,7 +80,7 @@ const PresBoxDocument = makeInterface(documentSchema); @observer export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema>(PresBoxDocument) { public static LayoutString(fieldKey: string) { return FieldView.LayoutString(PresBox, fieldKey); } - + /** * transitions & effects for documents * @param renderDoc @@ -1263,7 +1263,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema> <input className="presBox-input" type="number" value={duration} onChange={action((e) => this.setDurationTime(e.target.value))} /> s - </div> + </div> <div className="ribbon-propertyUpDown"> <div className="ribbon-propertyUpDownItem" onClick={undoBatch(() => this.setDurationTime(String(duration), 1000))}> <FontAwesomeIcon icon={"caret-up"} /> @@ -1855,6 +1855,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema> case DocumentType.VID: type = "Video"; break; case DocumentType.IMG: type = "Image"; break; case DocumentType.WEB: type = "Web page"; break; + case DocumentType.MAP: type = "Map"; break; default: type = "Other node"; break; } } |
