Skip to content
Snippets Groups Projects
Commit 6ded1472 authored by Tögl, Christina's avatar Tögl, Christina
Browse files

Remove unnecessary code

parent ffc9387d
No related branches found
No related tags found
1 merge request!11Add new component for inline notifications
Pipeline #14269 passed
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>
......
......@@ -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;
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment