Binary file not shown.
|
Before Width: | Height: | Size: 3.1 KiB |
BIN
public/images/google-lookerstudio.png
Normal file
BIN
public/images/google-lookerstudio.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
@@ -1,29 +0,0 @@
|
|||||||
import GoogleDataStudio from "./GoogleDataStudio";
|
|
||||||
|
|
||||||
describe("GoogleDataStudio", () => {
|
|
||||||
const match = GoogleDataStudio.ENABLED[0];
|
|
||||||
|
|
||||||
test("to be enabled on share link", () => {
|
|
||||||
expect(
|
|
||||||
"https://datastudio.google.com/embed/reporting/aab01789-f3a2-4ff3-9cba-c4c94c4a92e8/page/7zFD".match(
|
|
||||||
match
|
|
||||||
)
|
|
||||||
).toBeTruthy();
|
|
||||||
});
|
|
||||||
|
|
||||||
test("to not be enabled elsewhere", () => {
|
|
||||||
expect("https://datastudio.google.com/u/0/".match(match)).toBe(null);
|
|
||||||
expect("https://datastudio.google.com".match(match)).toBe(null);
|
|
||||||
expect("https://www.google.com".match(match)).toBe(null);
|
|
||||||
expect(
|
|
||||||
"https://datastudioogoogle.com/embed/reporting/aab01789-f3a2-4ff3-9cba-c4c94c4a92e8/page/7zFD".match(
|
|
||||||
match
|
|
||||||
)
|
|
||||||
).toBe(null);
|
|
||||||
expect(
|
|
||||||
"https://datastudio.googleecom/embed/reporting/aab01789-f3a2-4ff3-9cba-c4c94c4a92e8/page/7zFD".match(
|
|
||||||
match
|
|
||||||
)
|
|
||||||
).toBe(null);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
34
shared/editor/embeds/GoogleLookerStudio.test.ts
Normal file
34
shared/editor/embeds/GoogleLookerStudio.test.ts
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
import GoogleLookerStudio from "./GoogleLookerStudio";
|
||||||
|
|
||||||
|
describe("GoogleLookerStudio", () => {
|
||||||
|
const match = GoogleLookerStudio.ENABLED[0];
|
||||||
|
|
||||||
|
test("to be enabled on share link", () => {
|
||||||
|
expect(
|
||||||
|
"https://lookerstudio.google.com/embed/reporting/aab01789-f3a2-4ff3-9cba-c4c94c4a92e8/page/7zFD".match(
|
||||||
|
match
|
||||||
|
)
|
||||||
|
).toBeTruthy();
|
||||||
|
expect(
|
||||||
|
"https://datastudio.google.com/embed/reporting/aab01789-f3a2-4ff3-9cba-c4c94c4a92e8/page/7zFD".match(
|
||||||
|
match
|
||||||
|
)
|
||||||
|
).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
test("to not be enabled elsewhere", () => {
|
||||||
|
expect("https://lookerstudio.google.com/u/0/".match(match)).toBe(null);
|
||||||
|
expect("https://lookerstudio.google.com".match(match)).toBe(null);
|
||||||
|
expect("https://www.google.com".match(match)).toBe(null);
|
||||||
|
expect(
|
||||||
|
"https://lookerstudioogoogle.com/embed/reporting/aab01789-f3a2-4ff3-9cba-c4c94c4a92e8/page/7zFD".match(
|
||||||
|
match
|
||||||
|
)
|
||||||
|
).toBe(null);
|
||||||
|
expect(
|
||||||
|
"https://lookerstudio.googleecom/embed/reporting/aab01789-f3a2-4ff3-9cba-c4c94c4a92e8/page/7zFD".match(
|
||||||
|
match
|
||||||
|
)
|
||||||
|
).toBe(null);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -3,30 +3,30 @@ import Frame from "../components/Frame";
|
|||||||
import Image from "../components/Image";
|
import Image from "../components/Image";
|
||||||
import { EmbedProps as Props } from ".";
|
import { EmbedProps as Props } from ".";
|
||||||
|
|
||||||
function GoogleDataStudio(props: Props) {
|
function GoogleLookerStudio(props: Props) {
|
||||||
return (
|
return (
|
||||||
<Frame
|
<Frame
|
||||||
{...props}
|
{...props}
|
||||||
src={props.attrs.href.replace("u/0", "embed").replace("/edit", "")}
|
src={props.attrs.href.replace("u/0", "embed").replace("/edit", "")}
|
||||||
icon={
|
icon={
|
||||||
<Image
|
<Image
|
||||||
src="/images/google-datastudio.png"
|
src="/images/google-lookerstudio.png"
|
||||||
alt="Google Data Studio Icon"
|
alt="Google Looker Studio Icon"
|
||||||
width={16}
|
width={16}
|
||||||
height={16}
|
height={16}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
canonicalUrl={props.attrs.href}
|
canonicalUrl={props.attrs.href}
|
||||||
title="Google Data Studio"
|
title="Google Looker Studio"
|
||||||
border
|
border
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
GoogleDataStudio.ENABLED = [
|
GoogleLookerStudio.ENABLED = [
|
||||||
new RegExp(
|
new RegExp(
|
||||||
"^https?://datastudio\\.google\\.com/(embed|u/0)/reporting/(.*)/page/(.*)(/edit)?$"
|
"^https?://(lookerstudio|datastudio)\\.google\\.com/(embed|u/0)/reporting/(.*)/page/(.*)(/edit)?$"
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
export default GoogleDataStudio;
|
export default GoogleLookerStudio;
|
||||||
@@ -20,11 +20,11 @@ import Framer from "./Framer";
|
|||||||
import Gist from "./Gist";
|
import Gist from "./Gist";
|
||||||
import Gliffy from "./Gliffy";
|
import Gliffy from "./Gliffy";
|
||||||
import GoogleCalendar from "./GoogleCalendar";
|
import GoogleCalendar from "./GoogleCalendar";
|
||||||
import GoogleDataStudio from "./GoogleDataStudio";
|
|
||||||
import GoogleDocs from "./GoogleDocs";
|
import GoogleDocs from "./GoogleDocs";
|
||||||
import GoogleDrawings from "./GoogleDrawings";
|
import GoogleDrawings from "./GoogleDrawings";
|
||||||
import GoogleDrive from "./GoogleDrive";
|
import GoogleDrive from "./GoogleDrive";
|
||||||
import GoogleForms from "./GoogleForms";
|
import GoogleForms from "./GoogleForms";
|
||||||
|
import GoogleLookerStudio from "./GoogleLookerStudio";
|
||||||
import GoogleSheets from "./GoogleSheets";
|
import GoogleSheets from "./GoogleSheets";
|
||||||
import GoogleSlides from "./GoogleSlides";
|
import GoogleSlides from "./GoogleSlides";
|
||||||
import Grist from "./Grist";
|
import Grist from "./Grist";
|
||||||
@@ -248,10 +248,12 @@ const embeds: EmbedDescriptor[] = [
|
|||||||
component: GoogleCalendar,
|
component: GoogleCalendar,
|
||||||
}),
|
}),
|
||||||
new EmbedDescriptor({
|
new EmbedDescriptor({
|
||||||
title: "Google Data Studio",
|
title: "Google Looker Studio",
|
||||||
keywords: "bi business intelligence",
|
keywords: "bi business intelligence",
|
||||||
icon: <Img src="/images/google-datastudio.png" alt="Google Data Studio" />,
|
icon: (
|
||||||
component: GoogleDataStudio,
|
<Img src="/images/google-lookerstudio.png" alt="Google Looker Studio" />
|
||||||
|
),
|
||||||
|
component: GoogleLookerStudio,
|
||||||
}),
|
}),
|
||||||
new EmbedDescriptor({
|
new EmbedDescriptor({
|
||||||
title: "Google Forms",
|
title: "Google Forms",
|
||||||
|
|||||||
Reference in New Issue
Block a user