From eae9772c0c36747885097e1ad7944f7fd0428afb Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Mon, 19 Apr 2021 11:43:35 -0400 Subject: [PATCH] Revert "Merge branch 'master' into staging" This reverts commit 60e754ebf0ba56e8ee8f31dda6b2258403bef5b5, reversing changes made to f033e3ef14de0c05dd857b8189a1152cf4fc73e6. --- .github/ISSUE_TEMPLATE/bug-report----.md | 41 ------------- .github/ISSUE_TEMPLATE/feature-request---.md | 33 ---------- README.md | 4 +- src/components/ItemBodyView/ItemBodyView.js | 41 ++++--------- src/components/ParseError/ParseError.js | 61 +++++++++++++++++++ src/components/ParseError/ParseError.md | 36 +++++++++++ src/components/ParseError/index.js | 1 + .../TimelineActionCard/TimelineActionCard.js | 8 ++- src/theme.js | 5 +- 9 files changed, 121 insertions(+), 109 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug-report----.md delete mode 100644 .github/ISSUE_TEMPLATE/feature-request---.md create mode 100644 src/components/ParseError/ParseError.js create mode 100644 src/components/ParseError/ParseError.md create mode 100644 src/components/ParseError/index.js diff --git a/.github/ISSUE_TEMPLATE/bug-report----.md b/.github/ISSUE_TEMPLATE/bug-report----.md deleted file mode 100644 index 04bdbad..0000000 --- a/.github/ISSUE_TEMPLATE/bug-report----.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -name: "Bug Report \U0001F41B " -about: Create a bug report for webqueue2. -title: '' -labels: bug -assignees: '' - ---- - - - - - - - -- [ ] I have searched the [issues](https://github.itap.purdue.edu/ECN/webqueue2/issues) of this repository and believe that this is not a duplicate. - -## What Happened - - - -## Expected Behavior - - - -## Steps to Reproduce - -1. -2. -3. - - -### Logs - - - - diff --git a/.github/ISSUE_TEMPLATE/feature-request---.md b/.github/ISSUE_TEMPLATE/feature-request---.md deleted file mode 100644 index a48abaa..0000000 --- a/.github/ISSUE_TEMPLATE/feature-request---.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -name: "Feature Request \U0001F4EE" -about: Suggest a new idea for the project -title: '' -labels: feature-request -assignees: '' - ---- - - - - - - - -- [ ] I have searched the [issues](https://github.itap.purdue.edu/ECN/webqueue2/issues) of this repository and believe that this is not a duplicate. - -## Problem - - - -## Proposal - - - -### Examples - - - - diff --git a/README.md b/README.md index ead41cb..0b31b4f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# webqueue2 Frontend -A ReactJS based web app to interact with the [webqueue2 API](https://github.itap.purdue.edu/ECN/webqueue2-api) +# webqueue2 +A re-write of Purdue ECN's webqueue ![UI Snapshot](./docs/UI%20Snapshots/UI-Snapshot%202020-12-03%20at%208.10.32%20PM.png) diff --git a/src/components/ItemBodyView/ItemBodyView.js b/src/components/ItemBodyView/ItemBodyView.js index 63ef7c5..950f7ca 100644 --- a/src/components/ItemBodyView/ItemBodyView.js +++ b/src/components/ItemBodyView/ItemBodyView.js @@ -1,7 +1,7 @@ import React from "react"; import PropTypes from "prop-types"; import { Timeline, TimelineItem, TimelineSeparator, TimelineConnector, TimelineContent, TimelineDot } from '@material-ui/lab'; -import { Typography, makeStyles } from "@material-ui/core"; +import { makeStyles } from "@material-ui/core"; import DirectoryInformation from "../DirectoryInformation/"; import Assignment from "../Assignment/"; import TimelineActionCard from "../TimelineActionCard/"; @@ -38,42 +38,23 @@ export default function ItemBodyView({ sections, loading }) { const generateTimelineItem = (section) => { switch (section.type) { case "directory_information": - return ( - - ); + return case "initial_message": - return ( - <> - - - ); + return case "edit": - return ( - - ); + return case "status": - return ( - <> - - {`${section.by} update the status to at ${Date(section.datetime)}`} - - {section.content.map((line) => {line})} - - ); + return case "assignment": - return ( - - ); + return case "reply_to_user": - return ( - - ); + return case "reply_from_user": - return ( - - ); + return + case "parse_error": + return default: - return "No Match Found"; + return `No match found for type: ${section.type}`; }; }; diff --git a/src/components/ParseError/ParseError.js b/src/components/ParseError/ParseError.js new file mode 100644 index 0000000..28dd626 --- /dev/null +++ b/src/components/ParseError/ParseError.js @@ -0,0 +1,61 @@ +import React from "react"; +import PropTypes from "prop-types"; +import { Typography, Paper, makeStyles, useTheme } from '@material-ui/core'; +import clsx from "clsx"; + +export default function ParseError({ file_path, expected, got, line_num }){ + + const theme = useTheme(); + + const useStyles = makeStyles({ + "Paper-root": { + overflow: "hidden" + }, + "headerColor": { + backgroundColor: theme.palette.parse_error.main + }, + "padding": { + padding: theme.spacing(1) + } + + }); + const classes = useStyles(); + + return( + +
+ + Parsing Error + +
+
+ + File Path: {file_path} + + + Line: {line_num} + + + Expected: {expected} + + + Got: {got} + +
+
+ ); +} + +ParseError.propTypes = { + "file_path": PropTypes.string, + "expected": PropTypes.string, + "got": PropTypes.string, + "line_num": PropTypes.number +}; + +ParseError.defaultProps = { + "file_path": "", + "expected": "", + "got": "", + "line_num": "" +}; \ No newline at end of file diff --git a/src/components/ParseError/ParseError.md b/src/components/ParseError/ParseError.md new file mode 100644 index 0000000..98b58a2 --- /dev/null +++ b/src/components/ParseError/ParseError.md @@ -0,0 +1,36 @@ +Displays a parsing error. + +--- + +```jsx +import { ThemeProvider } from "@material-ui/core/styles"; +import webqueue2Theme from "../../theme"; +import ParseError from "./ParseError"; + +const theme = webqueue2Theme(false); + +const demo_data = { + "type": "parse_error", + "datetime": "2020-10-23T00:45:32", + "file_path": "/home/pier/e/campb303/webqueue2/q-snapshot/ce/32", + "expected": "Did not encounter a reply-from-user ending delimiter", + "got": "765-869-4032 to assist please?\tThank you\n", + "line_num": 120 +}; + + + +``` +```jsx static + +``` \ No newline at end of file diff --git a/src/components/ParseError/index.js b/src/components/ParseError/index.js new file mode 100644 index 0000000..8a5ec40 --- /dev/null +++ b/src/components/ParseError/index.js @@ -0,0 +1 @@ +export { default } from "./ParseError"; \ No newline at end of file diff --git a/src/components/TimelineActionCard/TimelineActionCard.js b/src/components/TimelineActionCard/TimelineActionCard.js index 431cd3e..1137b19 100644 --- a/src/components/TimelineActionCard/TimelineActionCard.js +++ b/src/components/TimelineActionCard/TimelineActionCard.js @@ -16,6 +16,10 @@ export default function TimelineActionCard({ type, datetime, by, content }){ "reply_to_user": { "verbage": "replied", "coloring": theme.palette.reply_to_user.main + }, + "status": { + "verbage": "updated the status", + "coloring": theme.palette.status.main } } @@ -54,9 +58,9 @@ TimelineActionCard.propTypes = { ]), /** ISO 8601 formatted time string. */ "datetime": PropTypes.string.isRequired, - /** The name of the person who added the edit. */ + /** The name of the person who added the action. */ "by": PropTypes.string.isRequired, - /** An array of strings containing the content of the edit. */ + /** An array of strings containing the content of the action. */ "content": PropTypes.array.isRequired }; diff --git a/src/theme.js b/src/theme.js index 685626a..52c59bd 100644 --- a/src/theme.js +++ b/src/theme.js @@ -26,8 +26,11 @@ export default function theme(darkMode = false) { "reply_to_user": { main: "rgba(99, 125, 255, 0.2)", }, - "reply_from_user": { + "status": { main: "rgba(99, 255, 151, 0.2)", + }, + "parse_error": { + main: "rgba(255, 99, 204, 0.2)", } }, })