os download page updates
parent
464b730cd8
commit
e46b4de0bb
|
@ -1579,7 +1579,7 @@ textarea:focus {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
table {
|
table {
|
||||||
margin: 2rem;
|
margin: auto;
|
||||||
margin-top: 3rem;
|
margin-top: 3rem;
|
||||||
width: 93%;
|
width: 93%;
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
|
@ -1596,6 +1596,7 @@ textarea:focus {
|
||||||
padding-bottom: 1rem;
|
padding-bottom: 1rem;
|
||||||
span {
|
span {
|
||||||
display: block;
|
display: block;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,12 +13,14 @@ import * as React from "react";
|
||||||
import { mount } from "enzyme";
|
import { mount } from "enzyme";
|
||||||
import { OsDownload } from "../content";
|
import { OsDownload } from "../content";
|
||||||
|
|
||||||
|
const DOWNLOAD_PREFIX = "DOWNLOAD ";
|
||||||
|
|
||||||
describe("<OsDownload />", () => {
|
describe("<OsDownload />", () => {
|
||||||
it("fetches and renders", async () => {
|
it("fetches and renders", async () => {
|
||||||
const wrapper = await mount<OsDownload>(<OsDownload />);
|
const wrapper = await mount<OsDownload>(<OsDownload />);
|
||||||
expect(wrapper.state().tagName).toEqual("v1.0.0");
|
expect(wrapper.state().tagName).toEqual("v1.0.0");
|
||||||
expect(wrapper.state().genesisImg).toEqual("fake rpi3 img url");
|
expect(wrapper.state().genesisImg).toEqual("fake rpi3 img url");
|
||||||
expect(wrapper.text()).toContain("Download FBOS v1.0.0");
|
expect(wrapper.text()).toContain(DOWNLOAD_PREFIX + "v1.0.0");
|
||||||
wrapper.update();
|
wrapper.update();
|
||||||
expect(wrapper.find("a").first().props().href)
|
expect(wrapper.find("a").first().props().href)
|
||||||
.toEqual("fake rpi3 img url");
|
.toEqual("fake rpi3 img url");
|
||||||
|
@ -28,7 +30,7 @@ describe("<OsDownload />", () => {
|
||||||
globalConfig.GENESIS_IMG_FALLBACK = "fake rpi3 img fallback url///////v0.0.0";
|
globalConfig.GENESIS_IMG_FALLBACK = "fake rpi3 img fallback url///////v0.0.0";
|
||||||
mockResponse = Promise.reject();
|
mockResponse = Promise.reject();
|
||||||
const wrapper = await mount(<OsDownload />);
|
const wrapper = await mount(<OsDownload />);
|
||||||
expect(wrapper.text()).toContain("Download FBOS v0.0.0");
|
expect(wrapper.text()).toContain(DOWNLOAD_PREFIX + "v0.0.0");
|
||||||
expect(wrapper.find("a").first().props().href)
|
expect(wrapper.find("a").first().props().href)
|
||||||
.toEqual(globalConfig.GENESIS_IMG_FALLBACK);
|
.toEqual(globalConfig.GENESIS_IMG_FALLBACK);
|
||||||
});
|
});
|
||||||
|
@ -36,7 +38,7 @@ describe("<OsDownload />", () => {
|
||||||
it("uses override", async () => {
|
it("uses override", async () => {
|
||||||
globalConfig.GENESIS_IMG_OVERRIDE = "fake rpi3 img override url";
|
globalConfig.GENESIS_IMG_OVERRIDE = "fake rpi3 img override url";
|
||||||
const wrapper = await mount(<OsDownload />);
|
const wrapper = await mount(<OsDownload />);
|
||||||
expect(wrapper.text()).toContain("Download FBOS");
|
expect(wrapper.text()).toContain(DOWNLOAD_PREFIX);
|
||||||
wrapper.update();
|
wrapper.update();
|
||||||
expect(wrapper.find("a").first().props().href)
|
expect(wrapper.find("a").first().props().href)
|
||||||
.toEqual(globalConfig.GENESIS_IMG_OVERRIDE);
|
.toEqual(globalConfig.GENESIS_IMG_OVERRIDE);
|
||||||
|
|
|
@ -22,6 +22,9 @@ const tagNameFromUrl = (url: string) => {
|
||||||
return tagPart.startsWith("v") ? tagPart : "";
|
return tagPart.startsWith("v") ? tagPart : "";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const downloadButtonText = (versionString: string) =>
|
||||||
|
`${t("DOWNLOAD")} ${versionString}`;
|
||||||
|
|
||||||
export class OsDownload extends React.Component<{}, OsDownloadState> {
|
export class OsDownload extends React.Component<{}, OsDownloadState> {
|
||||||
state: OsDownloadState = { tagName: "", genesisImg: "", expressImg: "" };
|
state: OsDownloadState = { tagName: "", genesisImg: "", expressImg: "" };
|
||||||
|
|
||||||
|
@ -75,15 +78,15 @@ export class OsDownload extends React.Component<{}, OsDownloadState> {
|
||||||
<span>{"Genesis v1.2"}</span>
|
<span>{"Genesis v1.2"}</span>
|
||||||
<span>{"Genesis v1.3"}</span>
|
<span>{"Genesis v1.3"}</span>
|
||||||
<span>{"Genesis v1.4"}</span>
|
<span>{"Genesis v1.4"}</span>
|
||||||
<span>{"Genesis XL v1.4"}</span>
|
|
||||||
<span>{"Genesis v1.5"}</span>
|
<span>{"Genesis v1.5"}</span>
|
||||||
|
<span>{"Genesis XL v1.4"}</span>
|
||||||
<span>{"Genesis XL v1.5"}</span>
|
<span>{"Genesis XL v1.5"}</span>
|
||||||
</td>
|
</td>
|
||||||
<td>{t("Raspberry Pi 3")}</td>
|
<td>{t("Raspberry Pi 3")}</td>
|
||||||
<td>
|
<td>
|
||||||
<a className="transparent-link-button"
|
<a className="transparent-link-button"
|
||||||
href={this.genesisImgDownloadLink}>
|
href={this.genesisImgDownloadLink}>
|
||||||
{`${t("Download")} FBOS ${this.genesisTagName}`}
|
{downloadButtonText(this.genesisTagName)}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -96,7 +99,7 @@ export class OsDownload extends React.Component<{}, OsDownloadState> {
|
||||||
<td>
|
<td>
|
||||||
<a className="transparent-link-button"
|
<a className="transparent-link-button"
|
||||||
href={this.expressImgDownloadLink}>
|
href={this.expressImgDownloadLink}>
|
||||||
{`${t("Download")} FBOS ${this.expressTagName}`}
|
{downloadButtonText(this.expressTagName)}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Reference in New Issue