Commit fc471d2 1 parent 8cee3d4 commit fc471d2 Copy full SHA for fc471d2
File tree 1 file changed +7
-3
lines changed
src/main/webapp/ui/src/tinyMCE/pyrat
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ function Pyrat() {
51
51
const pyratUrl = useDeploymentProperty ( "pyrat.url" ) ;
52
52
useEffect ( ( ) => {
53
53
FetchingData . getSuccessValue ( pyratUrl ) . do ( ( p ) => {
54
- PYRAT_URL = new URL ( p ) ;
54
+ PYRAT_URL = p ;
55
55
} ) ;
56
56
} , [ pyratUrl ] ) ;
57
57
@@ -488,12 +488,16 @@ function createTinyMceTable() {
488
488
const pyratTable = document . createElement ( "table" ) ;
489
489
pyratTable . setAttribute ( "data-tableSource" , "pyrat" ) ;
490
490
491
+ if ( ! PYRAT_URL ) throw new Error ( "PYRAT_URL is not known" ) ;
492
+
493
+ const link = PYRAT_URL . slice ( 0 , PYRAT_URL . lastIndexOf ( "/api/" ) ) ;
494
+
491
495
const linkRow = document . createElement ( "tr" ) ;
492
496
const linkCell = document . createElement ( "th" ) ;
493
497
linkCell . appendChild ( document . createTextNode ( "Imported from " ) ) ;
494
498
const anchor = document . createElement ( "a" ) ;
495
- anchor . href = PYRAT_URL ?. origin ?? "" ;
496
- anchor . appendChild ( document . createTextNode ( PYRAT_URL ?. origin ?? "" ) ) ;
499
+ anchor . href = link ;
500
+ anchor . appendChild ( document . createTextNode ( link ) ) ;
497
501
anchor . setAttribute ( "rel" , "noreferrer" ) ;
498
502
linkCell . appendChild ( anchor ) ;
499
503
linkCell . appendChild ( document . createTextNode ( " on " ) ) ;
You can’t perform that action at this time.
0 commit comments