From 6ded147203978a3e0221a74fbe09360308621aa1 Mon Sep 17 00:00:00 2001 From: Christina Toegl <toegl@tugraz.at> Date: Wed, 18 Nov 2020 17:23:44 +0100 Subject: [PATCH] Remove unnecessary code --- packages/common/src/inline-notification.js | 8 +------- packages/common/utils.js | 16 ---------------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/packages/common/src/inline-notification.js b/packages/common/src/inline-notification.js index 6b7a1ecc..0e0a32a4 100644 --- a/packages/common/src/inline-notification.js +++ b/packages/common/src/inline-notification.js @@ -1,5 +1,3 @@ -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> diff --git a/packages/common/utils.js b/packages/common/utils.js index 17a21f4f..fb31adb9 100644 --- a/packages/common/utils.js +++ b/packages/common/utils.js @@ -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; -}; -- GitLab