Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Toolkit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
digital blueprint
Web Component Framework
Toolkit
Compare revisions
ddbdce302570a7bd72ba1b2e3297bb4e0985b87d to 8ebcd0e8b5326941e0cc3e9d8376ed937870db23
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
dbp/web-components/toolkit
Select target project
No results found
8ebcd0e8b5326941e0cc3e9d8376ed937870db23
Select Git revision
Branches
advertisement
automagic
dbp-translation-component
demo
demo-file-handling
favorites-and-recent-files
icon-set-mapping
lit2
main
person-select-custom
port-i18next-parser
publish
remove-sentry
renovate/lock-file-maintenance
revert-6c632dc6
wc-part
wip-cleanup
17 results
Swap
Target
dbp/web-components/toolkit
Select target project
987FCF504483CBC8/toolkit
1 result
ddbdce302570a7bd72ba1b2e3297bb4e0985b87d
Select Git revision
Branches
advertisement
automagic
dbp-translation-component
demo
demo-file-handling
favorites-and-recent-files
icon-set-mapping
lit2
main
person-select-custom
port-i18next-parser
publish
remove-sentry
renovate/lock-file-maintenance
revert-6c632dc6
wc-part
wip-cleanup
17 results
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (1)
Implement provider-root attribute to "terminate" provider events
· 8ebcd0e8
Bekerle, Patrizio
authored
3 years ago
8ebcd0e8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
packages/app-shell/README.md
+4
-0
4 additions, 0 deletions
packages/app-shell/README.md
packages/app-shell/src/app-shell.js
+0
-13
0 additions, 13 deletions
packages/app-shell/src/app-shell.js
packages/common/src/adapter-lit-element.js
+5
-3
5 additions, 3 deletions
packages/common/src/adapter-lit-element.js
with
9 additions
and
16 deletions
packages/app-shell/README.md
View file @
8ebcd0e8
...
...
@@ -27,6 +27,10 @@ You need Keycloak and other parts to be in place to really make full use of the
Best take a look on examples like
[
index.html
](
https://gitlab.tugraz.at/dbp/esign/signature/-/blob/master/examples/dbp-signature/index.html
)
for more explanation.
You need to set the
`provider-root`
attribute for the app-shell to "terminate" all provider events.
If you don't want to set the app-shell as
`provider-root`
then you need to set the attributes
`auth`
,
`requested-login-status`
and
`analytics-event`
as attribute for the app-shell or in a
`dbp-provider`
above it.
## Attributes
-
`lang`
(optional, default:
`de`
): set to
`de`
or
`en`
for German or English
...
...
This diff is collapsed.
Click to expand it.
packages/app-shell/src/app-shell.js
View file @
8ebcd0e8
...
...
@@ -69,19 +69,6 @@ export class AppShell extends ScopedElementsMixin(DBPLitElement) {
this
.
_attrObserver
=
new
MutationObserver
(
this
.
onAttributeObserved
);
this
.
auth
=
{};
// We need to "provider-terminate" these two attributes in the app-shell, but we
// don't want to force system integrators to add those attributes to the app-shell tag.
// Unfortunately we also need to be able to react to those properties outside the render() function,
// so we can't use a dbp-provider to terminate these attributes in the render() function.
this
.
setProperty
(
'
auth
'
,
{});
this
.
setProperty
(
'
analytics-event
'
,
{});
// We need to "provider-terminate" this attribute in the app-shell as well, and we also
// don't want to force system integrators to add this attribute to the app-shell tag.
// But for this attribute we could use a dbp-provider, because we only need it in the render() function,
// but we can also handle it like the two attributes above and spare us the use of a dbp-provider.
this
.
setProperty
(
'
requested-login-status
'
,
{});
}
static
get
scopedElements
()
{
...
...
This diff is collapsed.
Click to expand it.
packages/common/src/adapter-lit-element.js
View file @
8ebcd0e8
...
...
@@ -83,7 +83,7 @@ export class AdapterLitElement extends LitElement {
this
.
addEventListener
(
'
dbp-subscribe
'
,
function
(
e
)
{
const
name
=
e
.
detail
.
name
;
if
(
that
.
hasProperty
(
name
)
||
that
.
r
oot
)
{
if
(
that
.
hasProperty
(
name
)
||
that
.
providerR
oot
)
{
Logger
.
debug
(
'
AdapterLitElementProvider(
'
+
that
.
tagName
+
'
) eventListener("dbp-subscribe",..) name "
'
+
name
+
'
" found.
'
);
that
.
callbackStore
.
push
({
name
:
name
,
callback
:
e
.
detail
.
callback
,
sender
:
e
.
detail
.
sender
});
...
...
@@ -95,7 +95,7 @@ export class AdapterLitElement extends LitElement {
this
.
addEventListener
(
'
dbp-unsubscribe
'
,
function
(
e
)
{
const
name
=
e
.
detail
.
name
;
const
sender
=
e
.
detail
.
sender
;
if
(
that
.
hasProperty
(
name
)
||
that
.
r
oot
)
{
if
(
that
.
hasProperty
(
name
)
||
that
.
providerR
oot
)
{
Logger
.
debug
(
'
AdapterLitElementProvider(
'
+
that
.
tagName
+
'
) eventListener("dbp-unsubscribe",..) name "
'
+
name
+
'
" found.
'
);
that
.
callbackStore
.
forEach
(
item
=>
{
if
(
item
.
sender
===
sender
&&
item
.
name
===
name
)
{
...
...
@@ -114,7 +114,7 @@ export class AdapterLitElement extends LitElement {
const
name
=
e
.
detail
.
name
;
const
value
=
e
.
detail
.
value
;
if
(
that
.
hasProperty
(
name
)
||
that
.
r
oot
)
{
if
(
that
.
hasProperty
(
name
)
||
that
.
providerR
oot
)
{
Logger
.
debug
(
'
AdapterLitElementProvider(
'
+
that
.
tagName
+
'
) eventListener("dbp-set-property",..) name "
'
+
name
+
'
" found.
'
);
that
.
setProperty
(
name
,
value
);
...
...
@@ -239,8 +239,10 @@ export class AdapterLitElement extends LitElement {
static
get
properties
()
{
return
{
...
super
.
properties
,
subscribe
:
{
type
:
String
},
unsubscribe
:
{
type
:
String
},
providerRoot
:
{
type
:
Boolean
,
attribute
:
'
provider-root
'
},
};
}
...
...
This diff is collapsed.
Click to expand it.