(config: any, root: string, readOnly: boolean, extraOptions: object)
| 469 | } |
| 470 | |
| 471 | private static getEmbeddedUrl(config: any, root: string, readOnly: boolean, extraOptions: object): string { |
| 472 | const location = window.location.origin + root; |
| 473 | const parameters = _.reduce( |
| 474 | extraOptions, |
| 475 | (total, value, key): string => { |
| 476 | if (total === '') { |
| 477 | total = '?'; |
| 478 | } else { |
| 479 | total += '&'; |
| 480 | } |
| 481 | |
| 482 | return total + key + '=' + value; |
| 483 | }, |
| 484 | '', |
| 485 | ); |
| 486 | |
| 487 | const path = (readOnly ? 'embed-ro' : 'e') + parameters + '#'; |
| 488 | |
| 489 | return location + path + serialiseState(config); |
| 490 | } |
| 491 | |
| 492 | private static storeCurrentConfig(config: any, extra: string): void { |
| 493 | window.history.pushState(null, '', extra); |
no test coverage detected