solara/lib/core/dashboard/component/AliasesBottomSheet.js in solara-0.2.0 vs solara/lib/core/dashboard/component/AliasesBottomSheet.js in solara-0.2.1

- old
+ new

@@ -88,29 +88,31 @@ this.closeAliasesBtn.onclick = () => this.hide(); this.overlay.onclick = () => this.hide(); } - show(aliases, brand) { + show(aliases, brandKey) { const commonAliasesList = this.shadowRoot.getElementById('commonAliasesList'); const brandAliasesList = this.shadowRoot.getElementById('brandAliasesList'); commonAliasesList.innerHTML = ''; brandAliasesList.innerHTML = ''; + const pattern = /alias|='[^']*'/g; + aliases.aliases.common_aliases.forEach(alias => { const li = document.createElement('li'); - li.textContent = alias; + li.textContent = alias.replace(pattern, '').trim(); commonAliasesList.appendChild(li); }); - const brandAliases = aliases.aliases.brand_aliases[brand.key] || []; + const brandAliases = aliases.aliases.brand_aliases[brandKey] || []; + brandAliases.forEach(alias => { const li = document.createElement('li'); - li.textContent = alias; + li.textContent = alias.replace(pattern, '').trim(); brandAliasesList.appendChild(li); }); - this.aliasesBottomSheet.style.display = 'block'; this.overlay.style.display = 'block'; setTimeout(() => this.aliasesBottomSheet.classList.add('show'), 10); } \ No newline at end of file