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
Commits
8ebcd0e8
Commit
8ebcd0e8
authored
3 years ago
by
Bekerle, Patrizio
Browse files
Options
Downloads
Patches
Plain Diff
Implement provider-root attribute to "terminate" provider events
parent
ddbdce30
No related branches found
No related tags found
No related merge requests found
Pipeline
#50757
failed
3 years ago
Stage: test
Stage: deploy
Stage: e2e
Changes
3
Pipelines
1
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
+
4
−
0
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
+
0
−
13
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
+
5
−
3
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.
Preview
0%
Loading
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