Skip to content

Commit 05f91c1

Browse files
easyCZroboquat
authored andcommitted
Format components/dashboard with prettier
1 parent 45f13cf commit 05f91c1

File tree

95 files changed

+8738
-5754
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+8738
-5754
lines changed
Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,45 @@
1-
import { projectsPathMain } from '../../src/projects/projects.routes';
2-
import { settingsPathAccount } from '../../src/settings/settings.routes';
3-
import { workspacesPathMain } from '../../src/workspaces/workspaces.routes';
1+
import { projectsPathMain } from "../../src/projects/projects.routes";
2+
import { settingsPathAccount } from "../../src/settings/settings.routes";
3+
import { workspacesPathMain } from "../../src/workspaces/workspaces.routes";
44

5-
describe('The app', () => {
6-
before(() => {
7-
cy.visit('/');
8-
})
5+
describe("The app", () => {
6+
before(() => {
7+
cy.visit("/");
8+
});
99

10-
it('should load and start from the Workspaces page', () => {
11-
cy.location("pathname").should("eq", workspacesPathMain);
10+
it("should load and start from the Workspaces page", () => {
11+
cy.location("pathname").should("eq", workspacesPathMain);
1212

13-
cy.findByRole('heading', { name: /Workspaces/i, level: 1 }).should('exist');
13+
cy.findByRole("heading", { name: /Workspaces/i, level: 1 }).should("exist");
1414

15-
cy.findAllByRole('navigation').last().as('sections').findAllByRole('link').should('have.length', 3);
15+
cy.findAllByRole("navigation").last().as("sections").findAllByRole("link").should("have.length", 3);
1616

17-
cy.get("@sections").findByText(/Workspaces/i).as('workspacesTab').should('exist');
18-
cy.get('@sections').findByText(/Projects/i).as('projectsTab').should('exist');
19-
cy.get("@sections").findByText(/Settings/i).as('settingsTab').should('exist');
17+
cy.get("@sections")
18+
.findByText(/Workspaces/i)
19+
.as("workspacesTab")
20+
.should("exist");
21+
cy.get("@sections")
22+
.findByText(/Projects/i)
23+
.as("projectsTab")
24+
.should("exist");
25+
cy.get("@sections")
26+
.findByText(/Settings/i)
27+
.as("settingsTab")
28+
.should("exist");
2029

21-
cy.get('@projectsTab').click();
22-
cy.location('pathname').should('eq', projectsPathMain);
30+
cy.get("@projectsTab").click();
31+
cy.location("pathname").should("eq", projectsPathMain);
2332

24-
cy.get('@settingsTab').click();
25-
cy.location('pathname').should('eq', settingsPathAccount);
33+
cy.get("@settingsTab").click();
34+
cy.location("pathname").should("eq", settingsPathAccount);
2635

27-
cy.get('@workspacesTab').click();
28-
cy.location('pathname').should('eq', workspacesPathMain);
36+
cy.get("@workspacesTab").click();
37+
cy.location("pathname").should("eq", workspacesPathMain);
2938

30-
// TODO complete checks about the general layout of the app.
31-
// The "Workspaces" page will have its own spec file.
32-
})
33-
})
39+
// TODO complete checks about the general layout of the app.
40+
// The "Workspaces" page will have its own spec file.
41+
});
42+
});
3443

3544
// This empty export is due to `"isolatedModules": true` in the main `tsconfig.json` 🤷🏻
36-
export {}
45+
export {};

components/dashboard/src/App.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
* See License-AGPL.txt in the project root for license information.
55
*/
66

7-
import { getURLHash } from './App'
7+
import { getURLHash } from "./App";
88

9-
test('urlHash', () => {
9+
test("urlHash", () => {
1010
global.window = Object.create(window);
11-
Object.defineProperty(window, 'location', {
11+
Object.defineProperty(window, "location", {
1212
value: {
13-
hash: '#https://example.org/user/repo'
14-
}
13+
hash: "#https://example.org/user/repo",
14+
},
1515
});
1616

17-
expect(getURLHash()).toBe('https://example.org/user/repo');
18-
});
17+
expect(getURLHash()).toBe("https://example.org/user/repo");
18+
});

components/dashboard/src/App.tsx

Lines changed: 309 additions & 256 deletions
Large diffs are not rendered by default.

components/dashboard/src/FromReferrer.tsx

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Link } from "react-router-dom";
99
export default function FromReferrer() {
1010
const contextUrl = document.referrer;
1111

12-
if (contextUrl && contextUrl !== '' && new URL(contextUrl).pathname !== '/') {
12+
if (contextUrl && contextUrl !== "" && new URL(contextUrl).pathname !== "/") {
1313
// Redirect to gitpod.io/#<contextUrl> to get the same experience as with direct call
1414
const url = new URL(window.location.toString());
1515
url.pathname = "/";
@@ -18,21 +18,30 @@ export default function FromReferrer() {
1818
return <div></div>;
1919
}
2020

21-
return <div className="app-container flex flex-col space-y-2">
22-
<div className="px-6 py-3 flex justify-between space-x-2 text-gray-400 h-96">
23-
<div className="flex flex-col items-center w-96 m-auto mt-40">
24-
<h3 className="text-center pb-3 text-gray-500 dark:text-gray-400">No Referrer Found</h3>
25-
<div className="text-center pb-6 text-gray-500">
26-
<p>
27-
It looks like you are trying to open a workspace, but the referrer URL is empty or has an incomplete path.
28-
This happens when the Git hoster or browser doesn't send the referrer header.
29-
<br/> Please prefix the repository URL with <pre>https://{window.location.host}/#</pre> in order to start a workspace. <a className="gp-link" href="https://www.gitpod.io/docs/getting-started/">Learn more</a>
30-
</p>
21+
return (
22+
<div className="app-container flex flex-col space-y-2">
23+
<div className="px-6 py-3 flex justify-between space-x-2 text-gray-400 h-96">
24+
<div className="flex flex-col items-center w-96 m-auto mt-40">
25+
<h3 className="text-center pb-3 text-gray-500 dark:text-gray-400">No Referrer Found</h3>
26+
<div className="text-center pb-6 text-gray-500">
27+
<p>
28+
It looks like you are trying to open a workspace, but the referrer URL is empty or has an
29+
incomplete path. This happens when the Git hoster or browser doesn't send the referrer
30+
header.
31+
<br /> Please prefix the repository URL with <pre>https://{window.location.host}/#</pre> in
32+
order to start a workspace.{" "}
33+
<a className="gp-link" href="https://www.gitpod.io/docs/getting-started/">
34+
Learn more
35+
</a>
36+
</p>
37+
</div>
38+
<span>
39+
<Link to="/">
40+
<button className="secondary">Go to Dashboard</button>
41+
</Link>
42+
</span>
3143
</div>
32-
<span>
33-
<Link to="/"><button className="secondary">Go to Dashboard</button></Link>
34-
</span>
3544
</div>
3645
</div>
37-
</div>;
46+
);
3847
}

0 commit comments

Comments
 (0)