Skip to content

Commit 3f41ead

Browse files
committed
add deprecations for calendly and opentable blocks
1 parent 17ff7f2 commit 3f41ead

File tree

2 files changed

+33
-10
lines changed

2 files changed

+33
-10
lines changed

extensions/blocks/calendly/index.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ import './editor.scss';
1919

2020
export const name = 'calendly';
2121
export const title = __( 'Calendly', 'jetpack' );
22+
const supports = {
23+
align: true,
24+
alignWide: false,
25+
html: false,
26+
};
2227
export const settings = {
2328
title,
2429
description: __( 'Embed a calendar for customers to schedule appointments', 'jetpack' ),
@@ -29,11 +34,7 @@ export const settings = {
2934
__( 'schedule', 'jetpack' ),
3035
__( 'appointments', 'jetpack' ),
3136
],
32-
supports: {
33-
align: true,
34-
alignWide: false,
35-
html: false,
36-
},
37+
supports,
3738
edit,
3839
save: ( { attributes: { url } } ) => (
3940
<div>
@@ -61,4 +62,11 @@ export const settings = {
6162
},
6263
],
6364
},
65+
deprecated: [
66+
{
67+
attributes,
68+
supports,
69+
save: ( { attributes: { url } } ) => <a href={ url }>{ url }</a>,
70+
},
71+
],
6472
};

extensions/blocks/opentable/index.js

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ import './view.scss';
2020
export const name = 'opentable';
2121
export const title = __( 'OpenTable', 'jetpack' );
2222
import { getAttributesFromEmbedCode, restRefRegex, ridRegex } from './utils';
23-
23+
const supports = {
24+
align: true,
25+
html: false,
26+
};
2427
export const settings = {
2528
title,
2629
description: __( 'Allow visitors to book a reservation with OpenTable', 'jetpack' ),
@@ -31,10 +34,7 @@ export const settings = {
3134
__( 'reservation', 'jetpack' ),
3235
__( 'restaurant', 'jetpack' ),
3336
],
34-
supports: {
35-
align: true,
36-
html: false,
37-
},
37+
supports,
3838
edit,
3939
save: ( { attributes: { rid } } ) => (
4040
<div>
@@ -71,4 +71,19 @@ export const settings = {
7171
},
7272
],
7373
},
74+
deprecated: [
75+
{
76+
attributes: defaultAttributes,
77+
supports,
78+
save: ( { attributes: { rid } } ) => (
79+
<>
80+
{ rid.map( restaurantId => (
81+
<a href={ `https://www.opentable.com/restref/client/?rid=${ restaurantId }` }>
82+
{ `https://www.opentable.com/restref/client/?rid=${ restaurantId }` }
83+
</a>
84+
) ) }
85+
</>
86+
),
87+
},
88+
],
7489
};

0 commit comments

Comments
 (0)