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 {css, html} from 'lit-element';
import DBPLitElement from '../dbp-lit-element'; import DBPLitElement from '../dbp-lit-element';
import * as commonStyles from '../styles'; import * as commonStyles from '../styles';
...@@ -17,7 +15,6 @@ import * as commonStyles from '../styles'; ...@@ -17,7 +15,6 @@ import * as commonStyles from '../styles';
export class InlineNotification extends DBPLitElement { export class InlineNotification extends DBPLitElement {
constructor() { constructor() {
super(); super();
this.lang = 'de';
this.type = ''; this.type = '';
this.summary = ''; this.summary = '';
this.body = ''; this.body = '';
...@@ -25,7 +22,6 @@ export class InlineNotification extends DBPLitElement { ...@@ -25,7 +22,6 @@ export class InlineNotification extends DBPLitElement {
static get properties() { static get properties() {
return { return {
lang: { type: String },
type: { type: String }, type: { type: String },
summary: { type: String }, summary: { type: String },
body: { type: String }, body: { type: String },
...@@ -34,7 +30,6 @@ export class InlineNotification extends DBPLitElement { ...@@ -34,7 +30,6 @@ export class InlineNotification extends DBPLitElement {
connectedCallback() { connectedCallback() {
super.connectedCallback(); super.connectedCallback();
i18n.changeLanguage(this.lang);
} }
static get styles() { static get styles() {
...@@ -66,13 +61,12 @@ export class InlineNotification extends DBPLitElement { ...@@ -66,13 +61,12 @@ export class InlineNotification extends DBPLitElement {
} }
render() { render() {
const notificationId = createUUID();
const bodyHtml = this.createBodyHtml(); const bodyHtml = this.createBodyHtml();
return html` return html`
<div class="columns"> <div class="columns">
<div class="column"> <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>` : `` } ${ this.summary !== '' ? html`<h3>${ this.summary }</h3>` : `` }
${ bodyHtml } ${ bodyHtml }
</div> </div>
......
...@@ -362,19 +362,3 @@ export const getBaseName = (str) => { ...@@ -362,19 +362,3 @@ export const getBaseName = (str) => {
export const getFileExtension = (str) => { export const getFileExtension = (str) => {
return str.split('.').pop(); 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.
Please register or to comment