@@ -110,6 +110,11 @@ export const filestreamToProject = (projectName, rawCode) => {
110110 const projectDesc = getProjectDescriptionFromXML ( rawCode ) ;
111111 const projectModified = getProjectModifiedDateFromXML ( rawCode , date ) ;
112112 const projectBoardType = getProjectBoardTypeFromXML ( rawCode ) ;
113+ let projectNameString = getProjectTitleFromXML ( rawCode ) ;
114+ console . log ( `Project Title: ${ projectNameString } ` ) ;
115+ if ( projectNameString === '' ) {
116+ projectNameString = projectName ;
117+ }
113118
114119 // Project create date can be missing in some projects. Set it to the
115120 // last modify date as a last-ditch default
@@ -125,7 +130,7 @@ export const filestreamToProject = (projectName, rawCode) => {
125130 }
126131
127132 return new Project (
128- projectName ,
133+ projectNameString ,
129134 decodeFromValidXml ( projectDesc ) ,
130135 tmpBoardType ,
131136 ProjectTypes . PROPC ,
@@ -181,6 +186,40 @@ function getProjectBoardTypeFromXML(xml) {
181186}
182187
183188
189+
190+ /**
191+ * Retrieve the project board type from the raw project XML
192+ * @param {string } xml
193+ * @return {string }
194+ */
195+ function getProjectTitleFromXML ( xml ) {
196+ const searchString = `transform="translate(-225,-53)">Title: ` ;
197+ const index = xml . indexOf ( searchString ) ;
198+
199+ if ( index === - 1 ) {
200+ return '' ;
201+ }
202+
203+ const title = xml . substring (
204+ ( index + searchString . length ) ,
205+ xml . indexOf ( '</text>' , ( index + searchString . length ) ) ) ;
206+
207+ if ( ! title ) {
208+ return '' ;
209+ }
210+
211+ if ( title . endsWith ( '.svg' ) ) {
212+ return title . substr ( 0 , title . length - 4 ) ;
213+ }
214+
215+ if ( title . endsWith ( '.svge' ) ) {
216+ return title . substr ( 0 , title . length - 5 ) ;
217+ }
218+
219+ return title ;
220+
221+ }
222+
184223/**
185224 * Parse the xml string to locate and return the project created timestamp
186225 *
0 commit comments