File tree Expand file tree Collapse file tree 3 files changed +11
-7
lines changed
panelview/components/story-maps Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -1069,7 +1069,7 @@ export function addCommands(
10691069 console . log ( 'addLandmark command executing' ) ;
10701070 // only want to use one story for now so hardcoding the id for now
10711071
1072- const storyMapId = 'b48c2622-1188-4734-9450-68e3b7623354' ;
1072+ const storyMapId = UUID . uuid4 ( ) ;
10731073 const newLandmarkId = UUID . uuid4 ( ) ;
10741074 const current = tracker . currentWidget ;
10751075 if ( ! current ) {
@@ -1108,7 +1108,7 @@ export function addCommands(
11081108 } else {
11091109 // else need to update tories
11101110 // get first story
1111- const story = current . model . sharedModel . getStoryMap ( storyMapId ) ;
1111+ const story = current . model . getSelectedStory ( ) . story ;
11121112 if ( ! story ) {
11131113 console . log ( 'brok' ) ;
11141114 return ;
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ interface IStoryViewerPanelProps {
1515}
1616
1717function StoryViewerPanel ( { model, togglePreview } : IStoryViewerPanelProps ) {
18- // ! TODO change name and remove rank from schema
1918 const [ currentRankDisplayed , setCurrentRankDisplayed ] = useState ( 0 ) ;
2019 const [ storyData , setStoryData ] = useState < IJGISStoryMap | null > ( null ) ;
2120
Original file line number Diff line number Diff line change @@ -605,12 +605,17 @@ export class JupyterGISModel implements IJupyterGISModel {
605605 return this . sharedModel . awareness . clientID ;
606606 }
607607
608+ /**
609+ * Placeholder in case we eventually want to support multiple stories
610+ * @returns First/only story
611+ */
608612 getSelectedStory ( ) : { landmarkId : string ; story : IJGISStoryMap | undefined } {
613+ const stories = this . sharedModel . storiesMap ;
614+ const storyId = Object . keys ( stories ) [ 0 ] ;
615+
609616 return {
610- landmarkId : 'b48c2622-1188-4734-9450-68e3b7623354' ,
611- story : this . sharedModel . getStoryMap (
612- 'b48c2622-1188-4734-9450-68e3b7623354' ,
613- ) ,
617+ landmarkId : storyId ,
618+ story : this . sharedModel . getStoryMap ( storyId ) ,
614619 } ;
615620 }
616621
You can’t perform that action at this time.
0 commit comments