-
Notifications
You must be signed in to change notification settings - Fork 2
Debranding #327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 1.9.0-Release
Are you sure you want to change the base?
Debranding #327
Changes from all commits
52be3c1
f0cebd0
af1ab83
34880ab
855cff7
2be69eb
2672261
6e36980
b886bdf
5c1a343
f5ba6db
c172829
95ad34a
3e0665c
89d9b75
322bf68
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,9 @@ | ||
| INSERT INTO page_html (name, html) VALUES | ||
| ('homePagePanel', '<div class="row"> | ||
| INSERT INTO | ||
| page_html (name, html) | ||
| VALUES | ||
| ( | ||
| 'homePagePanel', | ||
| '<div class="row"> | ||
| <h2>Overview</h2> | ||
| </div> | ||
| <div class="row"> | ||
|
|
@@ -15,8 +19,11 @@ INSERT INTO page_html (name, html) VALUES | |
| inception through an entire software development lifecycle. The end result is a functional software | ||
| tool ready for use by the sponsor''s organization. | ||
| </p> | ||
| </div>'), | ||
| ('sponsor', '<div class="row"> | ||
| </div>' | ||
| ), | ||
| ( | ||
| 'sponsor', | ||
| '<div class="row"> | ||
| <h2 class="ui header">Become a Project Sponsor</h2> | ||
| </div> | ||
| <div class="row"> | ||
|
|
@@ -213,4 +220,45 @@ INSERT INTO page_html (name, html) VALUES | |
| </ol> | ||
| </div> | ||
| </div> | ||
| </div>'); | ||
| </div>' | ||
| ), | ||
| ( | ||
| 'loggedOutFooter', | ||
| "<div id='bringMeDownSignedIn' class='ui container stackable grid'> | ||
| <div class='three column row'> | ||
| <div class='column'> | ||
| <img src='/assets/logo.jpg' alt='Logo' style='max-width:200px; width:100%; height:auto;' /> | ||
| </div> | ||
| <div class='column'> | ||
| <p> | ||
| Department of Software Engineering<br/> | ||
| Golisano Building 70, Room 1690<br/> | ||
| 134 Lomb Memorial Drive<br/> | ||
| Rochester, NY 14623-5608 | ||
| </p> | ||
| </div> | ||
| <div class='column'> | ||
| <p> | ||
| <i class='ui mail icon'></i> | ||
| <a href='mailto:[email protected]'>[email protected]</a> | ||
| </p> | ||
| </div> | ||
| </div> | ||
| <div class='centered row' style='text-align:center;'> | ||
| <p>© " || strftime('%Y','now') || " Rochester Institute of Technology, All Rights Reserved</p> | ||
| </div> | ||
| </div>" | ||
| ), | ||
| ( | ||
| 'loggedInFooter', | ||
| "<div id='bringMeDown' class='ui container stackable grid'> | ||
| <div class='two column row'> | ||
| <div class='column'> | ||
| <h5 id='copyright'> | ||
| <i class='ui icon copyright'></i> | ||
| " || strftime('%Y','now') || " Rochester Institute of Technology, All Rights Reserved | ||
| </h5> | ||
| </div> | ||
| </div> | ||
| </div>" | ||
| ); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,94 +1,67 @@ | ||
| import React, { useContext, useEffect, useState } from "react"; | ||
| import { UserContext } from "../../util/functions/UserContext"; | ||
| import collegeLogo from "../../../Assets/Golisano _College of_Computing_and_Information_Sciences_LOGO.jpg"; | ||
| import { config } from "../../util/functions/constants"; | ||
| import { SecureFetch } from "../../util/functions/secureFetch"; | ||
| import InnerHTML from "dangerously-set-html-content"; | ||
| import "./../../../css/containers/footer.css"; | ||
| import "semantic-ui-css/semantic.min.css" | ||
| import uiConfig from "../../../config/uiConfig"; | ||
|
|
||
| function Footer() { | ||
| const { user } = useContext(UserContext); | ||
| const [signedIn, setSignedIn] = useState(false); | ||
| const [footerHtml, setFooterHtml] = useState(""); | ||
| const [isLoading, setIsLoading] = useState(true); | ||
|
|
||
| const signedIn = user && Object.keys(user).length > 0 && user.user; | ||
| useEffect(() => { | ||
| // A user is considered signed in if the user object has a value | ||
| setSignedIn(Object.keys(user).length !== 0); | ||
| }, [user]); | ||
|
|
||
| if (signedIn) { | ||
| return ( | ||
| <div id="footer"> | ||
| <div id="bringMeDown" className="ui container stackable grid"> | ||
| <div className="two column row"> | ||
| <div className="column"> | ||
| <h5 id="copyright"> | ||
| <i className="ui icon copyright"></i> Rochester Institute of | ||
| Technology, All Rights Reserved | ||
| </h5> | ||
| </div> | ||
| <div id="version" className="column"> | ||
| <h5> | ||
| <a | ||
| href="https://github.com/RIT-Software-Engineering/RIT-SE-Senior-Project" | ||
| target="_blank" | ||
| rel="noreferrer" | ||
| > | ||
| v1.8.1 | ||
| </a> | ||
| </h5> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } else { | ||
|
|
||
| const footerName = signedIn ? "loggedInFooter" : "loggedOutFooter"; | ||
|
|
||
| setIsLoading(true); | ||
| SecureFetch(`${config.url.API_GET_HTML}?name=${footerName}`) | ||
| .then((r) => { | ||
| if (!r.ok) throw new Error("Network response was not ok"); | ||
| return r.json(); | ||
| }) | ||
| .then((data) => { | ||
| const html = data?.[0]?.html || ""; | ||
| setFooterHtml(html); | ||
| setIsLoading(false); | ||
| }) | ||
| .catch((error) => { | ||
| console.error("Error fetching footer:", error); | ||
| setFooterHtml(""); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of completely removing the footer's HTML, maybe we could leave an error message?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes I can look into that! We could discuss this Friday too! |
||
| setIsLoading(false); | ||
| }); | ||
| }, [user]); | ||
| if (isLoading) { | ||
| return ( | ||
| <div id="footer"> | ||
| <div id="bringMeDownSignedIn" className="ui container stackable grid"> | ||
| <div className="three column row"> | ||
| <div className="column"> | ||
| <img | ||
| src={collegeLogo} | ||
| alt="Golisano College of Computing & Information Sciences" | ||
| style={{ | ||
| maxWidth: "200px", | ||
| width: "100%", | ||
| height: "auto", | ||
| }} | ||
| /> | ||
| </div> | ||
| <div className="column"> | ||
| <h4> | ||
| Department of Software Engineering | ||
| <br /> | ||
| Golisano Building 70, Room 1690 | ||
| <br /> | ||
| 134 Lomb Memorial Drive | ||
| <br /> | ||
| Rochester, NY 14623-5608 | ||
| </h4> | ||
| </div> | ||
| <div className="column"> | ||
| <h4> | ||
| <i className="ui mail icon"></i> [email protected] | ||
| </h4> | ||
| </div> | ||
| </div> | ||
| <div | ||
| className="centered row" | ||
| style={{ | ||
| display: "flex", | ||
| flexDirection: "column", | ||
| alignItems: "center", | ||
| gap: "10px", | ||
| }} | ||
| > | ||
| <h5> | ||
| <i className="ui icon copyright"></i> Rochester Institute of | ||
| Technology, All Rights Reserved | ||
| </h5> | ||
| </div> | ||
| <div style={{ padding: "10px", textAlign: "center" }}> | ||
| Loading... | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| return ( | ||
| <div id="footer"> | ||
| {footerHtml ? <InnerHTML html={footerHtml} /> : null} | ||
| {signedIn && ( | ||
| <div id="version" className="ui container" style={{ textAlign: "right" }}> | ||
| <h5> | ||
| <a | ||
| href={uiConfig.footers.loggedIn.githubLink} | ||
| target="_blank" | ||
| rel="noreferrer" | ||
| > | ||
| v{uiConfig.footers.loggedIn.version} | ||
| </a> | ||
| </h5> | ||
| </div> | ||
| )} | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export default Footer; | ||
| export default Footer; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I appreciate the hardcoded strings and configuration variables being centered in this file! This should be great for maintainability moving forward. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| const uiConfig = { | ||
| app: { | ||
| name: "Senior Project Portal", | ||
| orgName: "Department of Software Engineering", | ||
| url: { | ||
| API_GET_HTML: "/api/getHtml" | ||
| }, | ||
| logoLight: "/assets/logo-light.png", | ||
| logoDark: "/assets/logo-dark.png", | ||
| }, | ||
| logoPath: | ||
| "/assets/Golisano _College of_Computing_and_Information_Sciences_LOGO.jpg", | ||
| footers: { | ||
| loggedOut: { | ||
| address: | ||
| "Department of Software Engineering\nGolisano Building 70, Room 1690\n134 Lomb Memorial Drive\nRochester, NY 14623-5608", | ||
| email: "[email protected]", | ||
| copyright: "Rochester Institute of Technology, All Rights Reserved", | ||
| }, | ||
| loggedIn: { | ||
| copyright: "Rochester Institute of Technology, All Rights Reserved", | ||
| version: "1.8.1", | ||
| githubLink: | ||
| "https://github.com/RIT-Software-Engineering/RIT-SE-Senior-Project", | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| export default uiConfig; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This information seems like it may be irrelevant to the README file in the root directory. Consider moving the information about the content editor to a .md markdown file in the test_cases directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will double check, I believe the professor wanted it like this.