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
6ded1472
Commit
6ded1472
authored
4 years ago
by
Tögl, Christina
Browse files
Options
Downloads
Patches
Plain Diff
Remove unnecessary code
parent
ffc9387d
No related branches found
No related tags found
1 merge request
!11
Add new component for inline notifications
Pipeline
#14269
passed
4 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/common/src/inline-notification.js
+1
-7
1 addition, 7 deletions
packages/common/src/inline-notification.js
packages/common/utils.js
+0
-16
0 additions, 16 deletions
packages/common/utils.js
with
1 addition
and
23 deletions
packages/common/src/inline-notification.js
+
1
−
7
View file @
6ded1472
import
{
i18n
}
from
'
../i18n
'
;
import
{
createUUID
}
from
'
../utils
'
import
{
css
,
html
}
from
'
lit-element
'
;
import
DBPLitElement
from
'
../dbp-lit-element
'
;
import
*
as
commonStyles
from
'
../styles
'
;
...
...
@@ -17,7 +15,6 @@ import * as commonStyles from '../styles';
export
class
InlineNotification
extends
DBPLitElement
{
constructor
()
{
super
();
this
.
lang
=
'
de
'
;
this
.
type
=
''
;
this
.
summary
=
''
;
this
.
body
=
''
;
...
...
@@ -25,7 +22,6 @@ export class InlineNotification extends DBPLitElement {
static
get
properties
()
{
return
{
lang
:
{
type
:
String
},
type
:
{
type
:
String
},
summary
:
{
type
:
String
},
body
:
{
type
:
String
},
...
...
@@ -34,7 +30,6 @@ export class InlineNotification extends DBPLitElement {
connectedCallback
()
{
super
.
connectedCallback
();
i18n
.
changeLanguage
(
this
.
lang
);
}
static
get
styles
()
{
...
...
@@ -66,13 +61,12 @@ export class InlineNotification extends DBPLitElement {
}
render
()
{
const
notificationId
=
createUUID
();
const
bodyHtml
=
this
.
createBodyHtml
();
return
html
`
<div class="columns">
<div class="column">
<div id="inline-notification
-
${
notificationId
}
" class="notification is-
${
this
.
type
!==
''
?
this
.
type
:
'
info
'
}
">
<div id="inline-notification" class="notification is-
${
this
.
type
!==
''
?
this
.
type
:
'
info
'
}
">
${
this
.
summary
!==
''
?
html
`<h3>
${
this
.
summary
}
</h3>`
:
``
}
${
bodyHtml
}
</div>
...
...
This diff is collapsed.
Click to expand it.
packages/common/utils.js
+
0
−
16
View file @
6ded1472
...
...
@@ -362,19 +362,3 @@ export const getBaseName = (str) => {
export
const
getFileExtension
=
(
str
)
=>
{
return
str
.
split
(
'
.
'
).
pop
();
};
/**
* Creates a UUID
*
* @returns {string}
*/
export
const
createUUID
=
()
=>
{
let
dt
=
new
Date
().
getTime
();
const
uuid
=
'
xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
'
.
replace
(
/
[
xy
]
/g
,
(
c
)
=>
{
const
r
=
(
dt
+
Math
.
random
()
*
16
)
%
16
|
0
;
dt
=
Math
.
floor
(
dt
/
16
);
return
(
c
===
'
x
'
?
r
:(
r
&
0x3
|
0x8
)).
toString
(
16
);
});
return
uuid
;
};
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