-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Chandrasekhar Ramakrishnan <cramakri@ethz.ch> fix #894
- Loading branch information
1 parent
b056d1d
commit 8a4685a
Showing
8 changed files
with
163 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/*! | ||
* Copyright 2020 - Swiss Data Science Center (SDSC) | ||
* A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and | ||
* Eidgenössische Technische Hochschule Zürich (ETHZ). | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** | ||
* renku-ui | ||
* | ||
* Maintenance.js | ||
* Maintenance components. | ||
*/ | ||
|
||
import React, { Component } from "react"; | ||
import { BrowserRouter as Router, Route } from "react-router-dom"; | ||
import { Jumbotron } from "reactstrap"; | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
import { faWrench } from "@fortawesome/free-solid-svg-icons"; | ||
|
||
import { MaintenanceNavBar, FooterNavbar } from "./landing"; | ||
|
||
|
||
class Maintenance extends Component { | ||
render() { | ||
const { info } = this.props; | ||
|
||
const headerText = "Maintenance"; | ||
const body = info && info !== "true" && info !== "1" ? | ||
info : | ||
"Renku is undergoing maintenance. It should be available again soon. Please check back in a little while."; | ||
return ( | ||
<Router> | ||
<div> | ||
<Route component={MaintenanceNavBar} /> | ||
<main role="main" className="container-fluid"> | ||
<Jumbotron> | ||
<h1 className="text-center text-primary"> | ||
<FontAwesomeIcon icon={faWrench} /> {headerText} <FontAwesomeIcon icon={faWrench} /> | ||
</h1> | ||
<br /> | ||
<p className="text-center">{body}</p> | ||
</Jumbotron> | ||
</main> | ||
<Route component={FooterNavbar} /> | ||
</div> | ||
</Router> | ||
); | ||
} | ||
} | ||
|
||
export { Maintenance }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/*! | ||
* Copyright 2020 - Swiss Data Science Center (SDSC) | ||
* A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and | ||
* Eidgenössische Technische Hochschule Zürich (ETHZ). | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** | ||
* renku-ui | ||
* | ||
* Maintenance.js | ||
* Tests for maintenance components. | ||
*/ | ||
|
||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import { MemoryRouter } from "react-router-dom"; | ||
|
||
import { Maintenance } from "./Maintenance"; | ||
|
||
describe("rendering", () => { | ||
it("renders Maintenance without info", () => { | ||
const div = document.createElement("div"); | ||
document.body.appendChild(div); | ||
ReactDOM.render( | ||
<MemoryRouter> | ||
<Maintenance info={null} /> | ||
</MemoryRouter>, | ||
div | ||
); | ||
}); | ||
|
||
it("renders Maintenance witht info", () => { | ||
const div = document.createElement("div"); | ||
document.body.appendChild(div); | ||
ReactDOM.render( | ||
<MemoryRouter> | ||
<Maintenance info={"Important info"} /> | ||
</MemoryRouter>, | ||
div | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters