diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/views/DashboardView.tsx | 12 | ||||
| -rw-r--r-- | src/client/views/collections/collectionFreeForm/FaceCollectionBox.tsx | 2 | ||||
| -rw-r--r-- | src/client/views/search/FaceRecognitionHandler.tsx | 12 |
3 files changed, 12 insertions, 14 deletions
diff --git a/src/client/views/DashboardView.tsx b/src/client/views/DashboardView.tsx index f4fc8ee9f..4616e15e5 100644 --- a/src/client/views/DashboardView.tsx +++ b/src/client/views/DashboardView.tsx @@ -426,16 +426,14 @@ export class DashboardView extends ObservableReactComponent<object> { const dashboardDoc = DashboardView.StandardCollectionDockingDocument([{ doc: freeformDoc, initialWidth: 600 }], { title: title }, id, 'row'); Doc.AddDocToList(Doc.MyHeaderBar, 'data', freeformDoc, undefined, undefined, true); + Doc.AddDocToList(Doc.MyDashboards, 'data', dashboardDoc); dashboardDoc.pane_count = 1; freeformDoc.embedContainer = dashboardDoc; dashboardDoc.myOverlayDocs = new List<Doc>(); dashboardDoc[DocData].myPublishedDocs = new List<Doc>(); dashboardDoc[DocData].myTagCollections = new List<Doc>(); - - Doc.AddDocToList(Doc.MyDashboards, 'data', dashboardDoc); - - DashboardView.SetupDashboardTrails(dashboardDoc); - DashboardView.SetupDashboardCalendars(dashboardDoc); + dashboardDoc[DocData].myTrails = DashboardView.SetupDashboardTrails(dashboardDoc); + dashboardDoc[DocData].myCalendars = DashboardView.SetupDashboardCalendars(dashboardDoc); // open this new dashboard Doc.ActiveDashboard = dashboardDoc; Doc.ActivePage = 'dashboard'; @@ -468,7 +466,7 @@ export class DashboardView extends ObservableReactComponent<object> { }; const myCalendars = DocUtils.AssignScripts(Docs.Create.CalendarCollectionDocument([], reqdOpts)); // { treeView_ChildDoubleClick: 'openPresentation(documentView.rootDoc)' } - dashboardDoc[DocData].myCalendars = new PrefetchProxy(myCalendars); + return new PrefetchProxy(myCalendars); } public static SetupDashboardTrails(dashboardDoc: Doc) { @@ -514,12 +512,12 @@ export class DashboardView extends ObservableReactComponent<object> { layout_explainer: 'All of the trails that you have created will appear here.', }; const myTrails = DocUtils.AssignScripts(Docs.Create.TreeDocument([], reqdOpts), { treeView_ChildDoubleClick: 'openPresentation(documentView.Document)' }); - dashboardDoc.myTrails = new PrefetchProxy(myTrails); const contextMenuScripts = [reqdBtnScript.onClick]; if (Cast(myTrails.contextMenuScripts, listSpec(ScriptField), null)?.length !== contextMenuScripts.length) { myTrails.contextMenuScripts = new List<ScriptField>(contextMenuScripts.map(script => ScriptField.MakeFunction(script)!)); } + return new PrefetchProxy(myTrails); } } diff --git a/src/client/views/collections/collectionFreeForm/FaceCollectionBox.tsx b/src/client/views/collections/collectionFreeForm/FaceCollectionBox.tsx index de7c2c027..1cc1f59dc 100644 --- a/src/client/views/collections/collectionFreeForm/FaceCollectionBox.tsx +++ b/src/client/views/collections/collectionFreeForm/FaceCollectionBox.tsx @@ -164,7 +164,7 @@ export class UniqueFaceView extends ObservableReactComponent<UniqueFaceProps> { * This renders the sidebar collection of the unique faces that have been recognized. * * Since the collection of recognized faces is stored on the active dashboard, this class - * does not itself store any Docs, but accesses the uniqueFaces field of the current + * does not itself store any Docs, but accesses the myUniqueFaces field of the current * dashboard. Each Face collection Doc is rendered using a FaceCollectionDocView which * is not a CollectionView or even a DocumentView (but probably should be). */ diff --git a/src/client/views/search/FaceRecognitionHandler.tsx b/src/client/views/search/FaceRecognitionHandler.tsx index f5fc12a8d..a17e4c54a 100644 --- a/src/client/views/search/FaceRecognitionHandler.tsx +++ b/src/client/views/search/FaceRecognitionHandler.tsx @@ -20,7 +20,7 @@ import { ImageField } from '../../../fields/URLField'; * <image data field>_faceDescriptors - list of all the numerical face representations found in the image. * <image data field>_faces - list of unique face Docs corresponding to recognized faces in the image. * - * unique face Doc's are created for each person identified and are stored in the Dashboard's uniqueFaces field + * unique face Doc's are created for each person identified and are stored in the Dashboard's myUniqueFaces field * * Each unique face Doc represents a unique face and collects all matching face images for that person. It has these fields: * face_label - a string label for the person that was recognized (TODO: currently it's just a 'face#') @@ -93,14 +93,14 @@ export class FaceRecognitionHandler { * returns a list of all face collection Docs on the current dashboard * @returns face collection Doc list */ - public static UniqueFaces = () => DocListCast(Doc.ActiveDashboard?.[DocData].uniqueFaces); + public static UniqueFaces = () => DocListCast(Doc.ActiveDashboard?.[DocData].myUniqueFaces); /** * Removes a unique face from the set of recognized unique faces * @param faceDoc unique face Doc * @returns */ - public static DeleteUniqueFace = (faceDoc: Doc) => Doc.ActiveDashboard && Doc.RemoveDocFromList(Doc.ActiveDashboard[DocData], 'uniqueFaces', faceDoc); + public static DeleteUniqueFace = (faceDoc: Doc) => Doc.ActiveDashboard && Doc.RemoveDocFromList(Doc.ActiveDashboard[DocData], 'myUniqueFaces', faceDoc); /** * returns the labels associated with a face collection Doc @@ -169,8 +169,8 @@ export class FaceRecognitionHandler { * @returns a unique face Doc */ private createUniqueFaceDoc = (dashboard: Doc) => { - const faceDocNum = NumCast(dashboard.uniqueFaces_count) + 1; - dashboard.uniqueFaces_count = faceDocNum; // TODO: improve to a better name + const faceDocNum = NumCast(dashboard.myUniqueFaces_count) + 1; + dashboard.myUniqueFaces_count = faceDocNum; // TODO: improve to a better name const uniqueFaceDoc = new Doc(); uniqueFaceDoc.title = `Face ${faceDocNum}`; @@ -179,7 +179,7 @@ export class FaceRecognitionHandler { uniqueFaceDoc.face_images = new List<Doc>(); uniqueFaceDoc.face_descriptors = new List<List<number>>(); - Doc.ActiveDashboard && Doc.AddDocToList(Doc.ActiveDashboard[DocData], 'uniqueFaces', uniqueFaceDoc); + Doc.ActiveDashboard && Doc.AddDocToList(Doc.ActiveDashboard[DocData], 'myUniqueFaces', uniqueFaceDoc); return uniqueFaceDoc; }; |
