Compare commits
6 Commits
344a3067fa
...
v1.19.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
5c71523d90
|
|||
|
bea1b97fb7
|
|||
|
6ba1cf31cf
|
|||
|
9cdd021cda
|
|||
|
ef53870b35
|
|||
|
918a794784
|
@@ -142,10 +142,12 @@ export default class PlaceDetails extends Component {
|
|||||||
|
|
||||||
if (type === 'phone') {
|
if (type === 'phone') {
|
||||||
return htmlSafe(
|
return htmlSafe(
|
||||||
parts.map((p) => {
|
parts
|
||||||
|
.map((p) => {
|
||||||
const safeTel = p.replace(/[\s-]+/g, '');
|
const safeTel = p.replace(/[\s-]+/g, '');
|
||||||
return `<a href="tel:${safeTel}">${p}</a>`;
|
return `<a href="tel:${safeTel}">${p}</a>`;
|
||||||
}).join('<br>')
|
})
|
||||||
|
.join('<br>')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,10 +159,12 @@ export default class PlaceDetails extends Component {
|
|||||||
|
|
||||||
if (type === 'whatsapp') {
|
if (type === 'whatsapp') {
|
||||||
return htmlSafe(
|
return htmlSafe(
|
||||||
parts.map((p) => {
|
parts
|
||||||
|
.map((p) => {
|
||||||
const safeTel = p.replace(/[\s-]+/g, '');
|
const safeTel = p.replace(/[\s-]+/g, '');
|
||||||
return `<a href="https://wa.me/${safeTel}" target="_blank" rel="noopener noreferrer">${p}</a>`;
|
return `<a href="https://wa.me/${safeTel}" target="_blank" rel="noopener noreferrer">${p}</a>`;
|
||||||
}).join('<br>')
|
})
|
||||||
|
.join('<br>')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export default class UserMenuComponent extends Component {
|
|||||||
@action
|
@action
|
||||||
connectRS() {
|
connectRS() {
|
||||||
this.args.onClose();
|
this.args.onClose();
|
||||||
this.args.storage.connect();
|
this.args.storage.showConnectWidget();
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
|
|||||||
@@ -46,6 +46,14 @@ export default class StorageService extends Service {
|
|||||||
// console.debug('[rs] client ready');
|
// console.debug('[rs] client ready');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.rs.on('error', (error) => {
|
||||||
|
if (!error) return;
|
||||||
|
console.info('[rs] Error —', `${error.name}: ${error.message}`);
|
||||||
|
if (error.name === 'Unauthorized') {
|
||||||
|
this.showConnectWidget();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.rs.on('connected', () => {
|
this.rs.on('connected', () => {
|
||||||
this.connected = true;
|
this.connected = true;
|
||||||
this.userAddress = this.rs.remote.userAddress;
|
this.userAddress = this.rs.remote.userAddress;
|
||||||
@@ -445,7 +453,7 @@ export default class StorageService extends Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
connect() {
|
showConnectWidget() {
|
||||||
this.isWidgetOpen = true;
|
this.isWidgetOpen = true;
|
||||||
|
|
||||||
// Check if widget is already attached
|
// Check if widget is already attached
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "marco",
|
"name": "marco",
|
||||||
"version": "1.18.4",
|
"version": "1.19.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Unhosted maps app",
|
"description": "Unhosted maps app",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -87,7 +87,7 @@
|
|||||||
"prettier-plugin-ember-template-tag": "^2.1.2",
|
"prettier-plugin-ember-template-tag": "^2.1.2",
|
||||||
"qunit": "^2.25.0",
|
"qunit": "^2.25.0",
|
||||||
"qunit-dom": "^3.5.0",
|
"qunit-dom": "^3.5.0",
|
||||||
"remotestorage-widget": "^1.8.0",
|
"remotestorage-widget": "^1.8.1",
|
||||||
"remotestoragejs": "2.0.0-beta.8",
|
"remotestoragejs": "2.0.0-beta.8",
|
||||||
"sinon": "^21.0.1",
|
"sinon": "^21.0.1",
|
||||||
"stylelint": "^16.26.1",
|
"stylelint": "^16.26.1",
|
||||||
|
|||||||
10
pnpm-lock.yaml
generated
10
pnpm-lock.yaml
generated
@@ -166,8 +166,8 @@ importers:
|
|||||||
specifier: ^3.5.0
|
specifier: ^3.5.0
|
||||||
version: 3.5.0
|
version: 3.5.0
|
||||||
remotestorage-widget:
|
remotestorage-widget:
|
||||||
specifier: ^1.8.0
|
specifier: ^1.8.1
|
||||||
version: 1.8.0
|
version: 1.8.1
|
||||||
remotestoragejs:
|
remotestoragejs:
|
||||||
specifier: 2.0.0-beta.8
|
specifier: 2.0.0-beta.8
|
||||||
version: 2.0.0-beta.8
|
version: 2.0.0-beta.8
|
||||||
@@ -4564,8 +4564,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-NZQZdC5wOE/H3UT28fVGL+ikOZcEzfMGk/c3iN9UGxzWHMa1op7274oyiUVrAG4B2EuFhus8SvkaYnhvW92p9Q==}
|
resolution: {integrity: sha512-NZQZdC5wOE/H3UT28fVGL+ikOZcEzfMGk/c3iN9UGxzWHMa1op7274oyiUVrAG4B2EuFhus8SvkaYnhvW92p9Q==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
remotestorage-widget@1.8.0:
|
remotestorage-widget@1.8.1:
|
||||||
resolution: {integrity: sha512-l8AE2npC2nNkC8bAU6WhWO5Wl4exaXbE2yR82s5Oiqg6h0KN2mYwvLLTQGkp6mSmZTA86e7XaOcNp4lXS8CsBA==}
|
resolution: {integrity: sha512-HxNu2VvIRW3wzkf5fLEzs56ySQ7+YQbRqyp3CKvmw/G+zKhRsmj06HtFoAcm3B14/nJh2SOAv3LyfKuXfUsKPw==}
|
||||||
|
|
||||||
remotestoragejs@2.0.0-beta.8:
|
remotestoragejs@2.0.0-beta.8:
|
||||||
resolution: {integrity: sha512-rtyHTG2VbtiKTRmbwjponRf5VTPJMcHv/ijNid1zX48C0Z0F8ZCBBfkKD2QCxTQyQvCupkWNy3wuIu4HE+AEng==}
|
resolution: {integrity: sha512-rtyHTG2VbtiKTRmbwjponRf5VTPJMcHv/ijNid1zX48C0Z0F8ZCBBfkKD2QCxTQyQvCupkWNy3wuIu4HE+AEng==}
|
||||||
@@ -10648,7 +10648,7 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
jsesc: 3.1.0
|
jsesc: 3.1.0
|
||||||
|
|
||||||
remotestorage-widget@1.8.0: {}
|
remotestorage-widget@1.8.1: {}
|
||||||
|
|
||||||
remotestoragejs@2.0.0-beta.8:
|
remotestoragejs@2.0.0-beta.8:
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
2
release/assets/main-BVEi_-zb.js
Normal file
2
release/assets/main-BVEi_-zb.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -39,7 +39,7 @@
|
|||||||
<meta name="msapplication-TileColor" content="#F6E9A6">
|
<meta name="msapplication-TileColor" content="#F6E9A6">
|
||||||
<meta name="msapplication-TileImage" content="/icons/icon-144.png">
|
<meta name="msapplication-TileImage" content="/icons/icon-144.png">
|
||||||
|
|
||||||
<script type="module" crossorigin src="/assets/main-0ky279gM.js"></script>
|
<script type="module" crossorigin src="/assets/main-BVEi_-zb.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/main-BF2Ls-fG.css">
|
<link rel="stylesheet" crossorigin href="/assets/main-BF2Ls-fG.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -318,15 +318,17 @@ module('Integration | Component | place-details', function (hooks) {
|
|||||||
assert.ok(whatsappBlock, 'WhatsApp block is rendered');
|
assert.ok(whatsappBlock, 'WhatsApp block is rendered');
|
||||||
|
|
||||||
const links = whatsappBlock.querySelectorAll('a[href^="https://wa.me/"]');
|
const links = whatsappBlock.querySelectorAll('a[href^="https://wa.me/"]');
|
||||||
assert.strictEqual(
|
assert.strictEqual(links.length, 2, 'Rendered exactly 2 WhatsApp links');
|
||||||
links.length,
|
|
||||||
2,
|
|
||||||
'Rendered exactly 2 WhatsApp links'
|
|
||||||
);
|
|
||||||
|
|
||||||
// Verify it stripped the dashes and spaces for the wa.me URL
|
// Verify it stripped the dashes and spaces for the wa.me URL
|
||||||
assert.strictEqual(links[0].getAttribute('href'), 'https://wa.me/+44987654321');
|
assert.strictEqual(
|
||||||
assert.strictEqual(links[1].getAttribute('href'), 'https://wa.me/+12345678900');
|
links[0].getAttribute('href'),
|
||||||
|
'https://wa.me/+44987654321'
|
||||||
|
);
|
||||||
|
assert.strictEqual(
|
||||||
|
links[1].getAttribute('href'),
|
||||||
|
'https://wa.me/+12345678900'
|
||||||
|
);
|
||||||
|
|
||||||
// Verify it kept the dashes and spaces for the visible text
|
// Verify it kept the dashes and spaces for the visible text
|
||||||
assert.dom(links[0]).hasText('+44 987 654 321');
|
assert.dom(links[0]).hasText('+44 987 654 321');
|
||||||
|
|||||||
Reference in New Issue
Block a user