Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
siibra-explorer
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiao Gui
siibra-explorer
Commits
271c9e55
Commit
271c9e55
authored
2 years ago
by
Xiao Gui
Browse files
Options
Downloads
Patches
Plain Diff
bugfix: closing widgets
bugfix: time limit on fetching plugin manifests chore: updated checklist
parent
ae9deee2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
deploy/plugins/index.js
+37
-32
37 additions, 32 deletions
deploy/plugins/index.js
e2e/checklist.md
+1
-0
1 addition, 0 deletions
e2e/checklist.md
src/widget/service.ts
+1
-1
1 addition, 1 deletion
src/widget/service.ts
with
39 additions
and
33 deletions
deploy/plugins/index.js
+
37
−
32
View file @
271c9e55
...
@@ -35,40 +35,45 @@ const getKey = url => `plugin:manifest-cache:${url}`
...
@@ -35,40 +35,45 @@ const getKey = url => `plugin:manifest-cache:${url}`
router
.
get
(
'
/manifests
'
,
async
(
_req
,
res
)
=>
{
router
.
get
(
'
/manifests
'
,
async
(
_req
,
res
)
=>
{
const
allManifests
=
await
Promise
.
all
(
const
allManifests
=
await
Promise
.
all
(
[...
V2_7_PLUGIN_URLS
,
...
V2_7_STAGING_PLUGIN_URLS
].
map
(
async
url
=>
[...
V2_7_PLUGIN_URLS
,
...
V2_7_STAGING_PLUGIN_URLS
].
map
(
async
url
=>
{
race
(
try
{
async
()
=>
{
return
await
race
(
const
key
=
getKey
(
url
)
async
()
=>
{
const
key
=
getKey
(
url
)
await
lruStore
.
_initPr
const
{
store
}
=
lruStore
try
{
const
storedManifest
=
await
store
.
get
(
key
)
if
(
storedManifest
)
return
JSON
.
parse
(
storedManifest
)
else
throw
`not found`
}
catch
(
e
)
{
const
resp
=
await
got
(
url
)
const
json
=
JSON
.
parse
(
resp
.
body
)
const
{
iframeUrl
,
'
siibra-explorer
'
:
flag
}
=
json
if
(
!
flag
)
return
null
if
(
!
iframeUrl
)
return
null
const
u
=
new
URL
(
url
)
let
replaceObj
=
{}
await
lruStore
.
_initPr
if
(
!
/^https
?
:
\/\/
/
.
test
(
iframeUrl
))
{
const
{
store
}
=
lruStore
u
.
pathname
=
path
.
resolve
(
path
.
dirname
(
u
.
pathname
),
iframeUrl
)
replaceObj
[
'
iframeUrl
'
]
=
u
.
toString
()
try
{
const
storedManifest
=
await
store
.
get
(
key
)
if
(
storedManifest
)
return
JSON
.
parse
(
storedManifest
)
else
throw
`not found`
}
catch
(
e
)
{
const
resp
=
await
got
(
url
)
const
json
=
JSON
.
parse
(
resp
.
body
)
const
{
iframeUrl
,
'
siibra-explorer
'
:
flag
}
=
json
if
(
!
flag
)
return
null
if
(
!
iframeUrl
)
return
null
const
u
=
new
URL
(
url
)
let
replaceObj
=
{}
if
(
!
/^https
?
:
\/\/
/
.
test
(
iframeUrl
))
{
u
.
pathname
=
path
.
resolve
(
path
.
dirname
(
u
.
pathname
),
iframeUrl
)
replaceObj
[
'
iframeUrl
'
]
=
u
.
toString
()
}
const
returnObj
=
{...
json
,
...
replaceObj
}
await
store
.
set
(
key
,
JSON
.
stringify
(
returnObj
),
{
maxAge
:
1000
*
60
*
60
})
return
returnObj
}
}
const
returnObj
=
{...
json
,
...
replaceObj
}
}
,
await
store
.
set
(
key
,
JSON
.
stringify
(
returnObj
),
{
maxAge
:
1000
*
60
*
60
})
{
timeout
:
1000
}
return
returnObj
)
}
}
catch
(
e
)
{
},
console
.
error
(
`fetching manifest error:
${
e
}
`
)
{
timeout
:
1000
}
return
null
)
}
)
}
)
)
)
res
.
status
(
200
).
json
(
res
.
status
(
200
).
json
(
...
...
This diff is collapsed.
Click to expand it.
e2e/checklist.md
+
1
−
0
View file @
271c9e55
...
@@ -72,3 +72,4 @@
...
@@ -72,3 +72,4 @@
-
[
] [vipUrl
](
https://atlases.ebrains.eu/viewer-staging/mouse
)
redirects allen mouse 2017
-
[
] [vipUrl
](
https://atlases.ebrains.eu/viewer-staging/mouse
)
redirects allen mouse 2017
## plugins
## plugins
-
[ ] jugex plugin works
-
[ ] jugex plugin works
-
[ ] 1um section works
This diff is collapsed.
Click to expand it.
src/widget/service.ts
+
1
−
1
View file @
271c9e55
...
@@ -19,7 +19,6 @@ export class WidgetService {
...
@@ -19,7 +19,6 @@ export class WidgetService {
}
}
public
addNewWidget
<
T
>
(
Component
:
new
(...
arg
:
any
)
=>
T
,
injector
:
Injector
):
WidgetPortal
<
T
>
{
public
addNewWidget
<
T
>
(
Component
:
new
(...
arg
:
any
)
=>
T
,
injector
:
Injector
):
WidgetPortal
<
T
>
{
const
widgetPortal
=
this
.
vcr
.
createComponent
(
this
.
cf
,
0
,
injector
)
as
ComponentRef
<
WidgetPortal
<
T
>>
const
inj
=
Injector
.
create
({
const
inj
=
Injector
.
create
({
providers
:
[{
providers
:
[{
provide
:
RM_WIDGET
,
provide
:
RM_WIDGET
,
...
@@ -27,6 +26,7 @@ export class WidgetService {
...
@@ -27,6 +26,7 @@ export class WidgetService {
}],
}],
parent
:
injector
parent
:
injector
})
})
const
widgetPortal
=
this
.
vcr
.
createComponent
(
this
.
cf
,
0
,
inj
)
as
ComponentRef
<
WidgetPortal
<
T
>>
const
cmpPortal
=
new
ComponentPortal
<
T
>
(
Component
,
this
.
vcr
,
inj
)
const
cmpPortal
=
new
ComponentPortal
<
T
>
(
Component
,
this
.
vcr
,
inj
)
this
.
viewRefMap
.
set
(
widgetPortal
.
instance
,
widgetPortal
)
this
.
viewRefMap
.
set
(
widgetPortal
.
instance
,
widgetPortal
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment