Skip to content

Commit 2b43ba0

Browse files
committed
fix: use nfinite urls
1 parent e160f7c commit 2b43ba0

File tree

7 files changed

+29
-29
lines changed

7 files changed

+29
-29
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"private": true,
44
"version": "0.0.0",
55
"license": "MIT",
6-
"homepage": "https:/www.hubstairs.com",
6+
"homepage": "https:/www.nfinite.app",
77
"repository": {
88
"type": "git",
99
"url": "https://github.com/hubstairs/display-controller.git"
1010
},
11-
"author": "Guillaume HERTAULT <gh@hubstairs.com>",
11+
"author": "Guillaume HERTAULT <gh@hnfinite.com>",
1212
"workspaces": [
1313
"packages/*"
1414
],

packages/display-js/src/index.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe('methods', () => {
7878
test('future calls to destroyed display should not not work', async () => {
7979
expect.assertions(4)
8080

81-
const display1 = new Display(html` <iframe id="to-destroy" src="https://display.hubstairs.com/v1/1234"></iframe> `)
81+
const display1 = new Display(html` <iframe id="to-destroy" src="https://display.nfinite.app/v1/1234"></iframe> `)
8282

8383
await expect(display1.destroy()).resolves.toBeUndefined()
8484
expect(document.querySelector('#to-destroy')).toBeFalsy()

packages/display-js/src/lib/embed.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ export function createEmbed({ html }, element) {
6666
/**
6767
* Make an oEmbed call for the specified URL.
6868
*
69-
* @param {string} displayUrl The hubstairs.com url for the display.
69+
* @param {string} displayUrl The nfinite.app url for the display.
7070
* @param {Object} [params] Parameters to pass to oEmbed.
7171
* @return {Promise}
7272
*/
7373
export function getOEmbedData({ url, displayid, displayUrl, oembedUrl, ...params } = {}) {
7474
try {
7575
const fullDisplayUrl = getHubstairsUrl({ url, displayid, displayUrl })
7676

77-
let fullOembedUrl = `${oembedUrl || 'https://api.hubstairs.com/oembed'}?url=${encodeURIComponent(fullDisplayUrl)}`
77+
let fullOembedUrl = `${oembedUrl || 'https://my.nfinite.app/api/oembed'}?url=${encodeURIComponent(fullDisplayUrl)}`
7878

7979
for (const param in params) {
8080
if (Object.prototype.hasOwnProperty.call(params, param)) {

packages/display-js/src/lib/embed.test.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ const mockOEmbedResponse = {
1818
maxheight: 1000,
1919
title: 'My title',
2020
maxwidth: 1250,
21-
url: 'https://display.hubstairs.com/my-video',
21+
url: 'https://display.nfinite.app/my-video',
2222
html: `<iframe
2323
width="200px"
2424
height="160px"
25-
src="https://display.hubstairs.com/my-video"
25+
src="https://display.nfinite.app/my-video"
2626
frameborder="0"
2727
allow="autoplay; fullscreen; vr"
2828
allowvr
@@ -32,7 +32,7 @@ webkitallowfullscreen="true"
3232
>
3333
</iframe>`,
3434
provider_name: 'Hubstairs',
35-
provider_url: 'http://www.hubstairs.com/',
35+
provider_url: 'http://www.nfinite.app/',
3636
}
3737

3838
const mockOEmbedResponseResponsive = {
@@ -43,11 +43,11 @@ const mockOEmbedResponseResponsive = {
4343
width: 1250,
4444
height: 1000,
4545
title: 'My title',
46-
url: 'https://display.hubstairs.com/v1/my-video',
46+
url: 'https://display.nfinite.app/v1/my-video',
4747
html: `<div style="padding:125% 0 0 0;position:relative;">
4848
<iframe
4949
style="position:absolute;top:0;left:0;width:100%;height:100%;"
50-
src="https://display.hubstairs.com/v1/my-video"
50+
src="https://display.nfinite.app/v1/my-video"
5151
frameborder="0"
5252
allow="autoplay; fullscreen; vr"
5353
allowvr
@@ -58,7 +58,7 @@ webkitallowfullscreen="true"
5858
</iframe>
5959
</div>`,
6060
provider_name: 'Hubstairs',
61-
provider_url: 'http://www.hubstairs.com/',
61+
provider_url: 'http://www.nfinite.app/',
6262
}
6363

6464
beforeEach(() => {
@@ -94,13 +94,13 @@ describe('getOEmbedParameters', () => {
9494

9595
describe('getOEmbedData', () => {
9696
test('doesn’t operate on non-Hubstairs urls', async () => {
97-
await expect(getOEmbedData({ url: 'https://nothubstairs.com' })).rejects.toThrowError(HubstairsError)
97+
await expect(getOEmbedData({ url: 'https://notnfinite.com' })).rejects.toThrowError(HubstairsError)
9898
})
9999

100100
test('returns a json oembed response', async () => {
101101
expect.assertions(2)
102102
fetch.mockResponse(JSON.stringify(mockOEmbedResponse), { status: 200 })
103-
const result = await getOEmbedData({ url: 'https://display.hubstairs.com/v1/1234' })
103+
const result = await getOEmbedData({ url: 'https://display.nfinite.app/v1/1234' })
104104
expect(typeof result).toBe('object')
105105
expect(result.type).toBe('rich')
106106
})
@@ -115,34 +115,34 @@ describe('createEmbed', () => {
115115

116116
test('returns the already-initialized iframe', () => {
117117
const container = html`<div data-hubstairs-initialized></div> `
118-
const iframe = html`<iframe src="https://display.hubstairs.com/v1/5e417dbac5d2651adbe509ec"></iframe> `
118+
const iframe = html`<iframe src="https://display.nfinite.app/v1/5e417dbac5d2651adbe509ec"></iframe> `
119119
container.appendChild(iframe)
120120
expect(createEmbed({ html: 'html' }, container)).toEqual(iframe)
121121
})
122122

123123
test('creates an iframe from the oembed data', () => {
124124
const container = html`<div></div> `
125-
const markup = '<iframe src="https://display.hubstairs.com/v1/5e417dbac5d2651adbe509ec"></iframe>'
125+
const markup = '<iframe src="https://display.nfinite.app/v1/5e417dbac5d2651adbe509ec"></iframe>'
126126

127127
const embed = createEmbed({ html: markup }, container)
128128
expect(container.getAttribute('data-hubstairs-initialized')).toBe('true')
129129
expect(embed.outerHTML).toEqual(
130-
html`<iframe src="https://display.hubstairs.com/v1/5e417dbac5d2651adbe509ec" style="display: none;"></iframe> `
130+
html`<iframe src="https://display.nfinite.app/v1/5e417dbac5d2651adbe509ec" style="display: none;"></iframe> `
131131
.outerHTML,
132132
)
133133
})
134134

135135
test('returns the iframe from a responsive embed', () => {
136136
const container = html`<div></div> `
137137
const markup =
138-
'<div style="position:relative;padding-bottom:42.5%;height:0"><iframe src="https://display.hubstairs.com/v1/5e417dbac5d2651adbe509ec" style="position:absolute;top:0;left:0;width:100%;height:100%" frameborder="0"></iframe></div>'
138+
'<div style="position:relative;padding-bottom:42.5%;height:0"><iframe src="https://display.nfinite.app/v1/5e417dbac5d2651adbe509ec" style="position:absolute;top:0;left:0;width:100%;height:100%" frameborder="0"></iframe></div>'
139139

140140
const embed = createEmbed({ html: markup }, container)
141141
expect(container.getAttribute('data-hubstairs-initialized')).toBe('true')
142142
expect(embed.outerHTML).toEqual(
143143
html`
144144
<iframe
145-
src="https://display.hubstairs.com/v1/5e417dbac5d2651adbe509ec"
145+
src="https://display.nfinite.app/v1/5e417dbac5d2651adbe509ec"
146146
style="position:absolute;top:0;left:0;width:100%;height:100%"
147147
frameborder="0"
148148
></iframe>

packages/display-js/src/lib/functions.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export function getHubstairsUrl({ url, displayid, displayUrl } = {}) {
9090
}
9191

9292
if (isObjectId(idOrUrl)) {
93-
return `${displayUrl || 'https://display.hubstairs.com'}/v1/${idOrUrl}`
93+
return `${displayUrl || 'https://display.nfinite.app'}/v1/${idOrUrl}`
9494
}
9595

9696
if (isHubstairsUrl(idOrUrl)) {
@@ -101,5 +101,5 @@ export function getHubstairsUrl({ url, displayid, displayUrl } = {}) {
101101
throw new HubstairsError(`“${displayid}” is not a valid display id.`, 'TypeError')
102102
}
103103

104-
throw new HubstairsError(`“${idOrUrl}” is not a display.hubstairs.com url.`, 'TypeError')
104+
throw new HubstairsError(`“${idOrUrl}” is not a display.nfinite.app url.`, 'TypeError')
105105
}

packages/display-js/src/lib/functions.test.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ describe('isHubstairsUrl', () => {
7676
describe('getHubstairsUrl', () => {
7777
test('returns correctly a url from the embed parameters', () => {
7878
expect(getHubstairsUrl({ displayid: '5e417dbac5d2651adbe509ec' })).toBe(
79-
'https://display.hubstairs.com/v1/5e417dbac5d2651adbe509ec',
79+
'https://display.nfinite.app/v1/5e417dbac5d2651adbe509ec',
8080
)
81-
expect(getHubstairsUrl({ url: 'http://display.hubstairs.com/v1/5e417dbac5d2651adbe509ec' })).toBe(
82-
'https://display.hubstairs.com/v1/5e417dbac5d2651adbe509ec',
81+
expect(getHubstairsUrl({ url: 'http://display.nfinite.app/v1/5e417dbac5d2651adbe509ec' })).toBe(
82+
'https://display.nfinite.app/v1/5e417dbac5d2651adbe509ec',
8383
)
84-
expect(getHubstairsUrl({ url: 'https://display.hubstairs.com/v1/5e417dbac5d2651adbe509ec' })).toBe(
85-
'https://display.hubstairs.com/v1/5e417dbac5d2651adbe509ec',
84+
expect(getHubstairsUrl({ url: 'https://display.nfinite.app/v1/5e417dbac5d2651adbe509ec' })).toBe(
85+
'https://display.nfinite.app/v1/5e417dbac5d2651adbe509ec',
8686
)
8787
})
8888

@@ -94,13 +94,13 @@ describe('getHubstairsUrl', () => {
9494

9595
test('throws an error if the displayid parameter is not an integer', () => {
9696
expect(() => {
97-
getHubstairsUrl({ displayid: 'https://nothubstairs.com/2' })
97+
getHubstairsUrl({ displayid: 'https://notnfinite.app/2' })
9898
}).toThrowError(HubstairsError)
9999
})
100100

101101
test('throws an error if the url parameter is not a Hubstairs url', () => {
102102
expect(() => {
103-
getHubstairsUrl({ url: 'https://nothubstairs.com/2' })
103+
getHubstairsUrl({ url: 'https://notnfinite.app/aa' })
104104
}).toThrowError(HubstairsError)
105105
})
106106
})

tests_utils/browser-env.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import jquery from 'jquery'
44
const html = `<body>
55
<div id="test_display" data-hubstairs-displayid="5e417dbac5d2651adbe509ec"></div>
66
<div class="multiple">
7-
<iframe class="two" src="https://display.hubstairs.com/v1/5e417dbac5d2651adbe509ec"></iframe>
8-
<iframe class="one" src="https://display.hubstairs.com/v1/5e417dbac5d2651adbe509ed"></iframe>
7+
<iframe class="two" src="https://display.nfinite.app/v1/5e417dbac5d2651adbe509ec"></iframe>
8+
<iframe class="one" src="https://display.nfinite.app/v1/5e417dbac5d2651adbe509ed"></iframe>
99
</div>
1010
</body>`
1111

0 commit comments

Comments
 (0)