From e18a17e92d20d995f357aeb2757481b78d87c04f Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Thu, 17 Sep 2020 14:59:45 -0400 Subject: [PATCH 01/14] Fix reference to non-existant function --- api/ECNQueue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/ECNQueue.py b/api/ECNQueue.py index 53c376c..6d588df 100644 --- a/api/ECNQueue.py +++ b/api/ECNQueue.py @@ -54,7 +54,7 @@ def __init__(self, queue: str, number: int) -> None: self.priority = self.__getMostRecentHeaderByType("Priority") self.department = self.__getMostRecentHeaderByType("Department") self.building = self.__getMostRecentHeaderByType("Building") - self.dateReceived = self.__getParsedDate(self.__getMostRecentHeaderByType("Date")) + self.dateReceived = self.__getFormattedDate(self.__getMostRecentHeaderByType("Date")) self.jsonData = { "queue": self.queue, From db4d476ce9a82215e8929601e1338e2ac7cd4356 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Thu, 17 Sep 2020 17:11:19 -0400 Subject: [PATCH 02/14] Remove un-needed files --- requirements.txt | 31 ------------------------------- testfile | 1 - 2 files changed, 32 deletions(-) delete mode 100644 requirements.txt delete mode 100644 testfile diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 60a7d4a..0000000 --- a/requirements.txt +++ /dev/null @@ -1,31 +0,0 @@ -aniso8601==8.0.0 -astroid==2.4.2 -attrs==20.1.0 -click==7.1.2 -Flask==1.1.2 -Flask-RESTful==0.3.8 -gunicorn==20.0.4 -importlib-metadata==1.7.0 -iniconfig==1.0.1 -isort==4.3.21 -itsdangerous==1.1.0 -Jinja2==2.11.2 -lazy-object-proxy==1.4.3 -MarkupSafe==1.1.1 -mccabe==0.6.1 -more-itertools==8.5.0 -packaging==20.4 -pkg-resources==0.0.0 -pluggy==0.13.1 -py==1.9.0 -pylint==2.5.3 -pyparsing==2.4.7 -pytest==6.0.1 -python-dateutil==2.8.1 -pytz==2020.1 -six==1.15.0 -toml==0.10.1 -typed-ast==1.4.1 -Werkzeug==1.0.1 -wrapt==1.12.1 -zipp==3.1.0 diff --git a/testfile b/testfile deleted file mode 100644 index 2691857..0000000 --- a/testfile +++ /dev/null @@ -1 +0,0 @@ -testfile From 8d9a72877f7816d1bf583b74e58549ee1ebc94d5 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Thu, 17 Sep 2020 17:17:48 -0400 Subject: [PATCH 03/14] Remove unused component --- src/components/TeamMemberCard/TeamMemberCard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/TeamMemberCard/TeamMemberCard.js b/src/components/TeamMemberCard/TeamMemberCard.js index 832ac6b..febfa5e 100644 --- a/src/components/TeamMemberCard/TeamMemberCard.js +++ b/src/components/TeamMemberCard/TeamMemberCard.js @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types' import { Card, CardHeader, Avatar, IconButton, CardContent, - CardActions, Typography, Link, makeStyles } from '@material-ui/core'; + CardActions, Link, makeStyles } from '@material-ui/core'; import WebsiteIcon from '@material-ui/icons/Language'; import webqueue2Theme from "../../theme"; From 1b04a6a0bee8262d92e472fc670cea8e11e7cd7e Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Thu, 17 Sep 2020 17:31:07 -0400 Subject: [PATCH 04/14] Fix component path generation is documentation --- styleguidist/styleguide.config.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/styleguidist/styleguide.config.js b/styleguidist/styleguide.config.js index f08f9c1..de44a92 100644 --- a/styleguidist/styleguide.config.js +++ b/styleguidist/styleguide.config.js @@ -119,8 +119,7 @@ module.exports = { */ getComponentPathLine(componentPath) { const name = path.basename(componentPath, '.js') - const dir = path.dirname(componentPath) - return `import ${name} from '${dir}/';` + return `import ${name} from './components/${name}/';` }, /** From 7309063dac649a577e84d967188d670e8254cb08 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Thu, 17 Sep 2020 17:35:34 -0400 Subject: [PATCH 05/14] Rename CustomAppBar to ItemTableAppBar --- src/App.js | 4 ++-- src/{CustomAppBar.js => ItemTableAppBar.js} | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename src/{CustomAppBar.js => ItemTableAppBar.js} (96%) diff --git a/src/App.js b/src/App.js index 66b6dc8..1dbcdea 100644 --- a/src/App.js +++ b/src/App.js @@ -2,7 +2,7 @@ import React, { useState } from "react"; import { ThemeProvider } from "@material-ui/core/styles"; import webqueueTheme from "./theme"; import { Box, makeStyles } from "@material-ui/core"; -import CustomAppBar from "./CustomAppBar"; +import ItemTableAppBar from "./ItemTableAppBar"; import ItemTable from "./components/ItemTable/"; import ItemViewAppBar from "./ItemViewAppBar"; import ItemView from "./ItemView"; @@ -55,7 +55,7 @@ function App(){ - + diff --git a/src/CustomAppBar.js b/src/ItemTableAppBar.js similarity index 96% rename from src/CustomAppBar.js rename to src/ItemTableAppBar.js index c5c8f63..3c467c3 100644 --- a/src/CustomAppBar.js +++ b/src/ItemTableAppBar.js @@ -5,7 +5,7 @@ import DarkModeIcon from '@material-ui/icons/Brightness4'; import LightModeIcon from '@material-ui/icons/Brightness7'; -export default function CustomAppBar(props){ +export default function ItemTableAppBar(props){ const useStyles = makeStyles((theme) => ({ menuButton: { marginLeft: theme.spacing(2), From 5498151b3c08a33263d665a5f6d684a3084f0ec1 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Thu, 17 Sep 2020 18:09:21 -0400 Subject: [PATCH 06/14] Remove unused menu icon --- src/ItemTableAppBar.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/ItemTableAppBar.js b/src/ItemTableAppBar.js index 3c467c3..2517ac9 100644 --- a/src/ItemTableAppBar.js +++ b/src/ItemTableAppBar.js @@ -1,6 +1,5 @@ import React from "react"; import {makeStyles, Tooltip, Typography, AppBar, Toolbar, IconButton, Zoom} from "@material-ui/core" -import MenuIcon from "@material-ui/icons/Menu"; import DarkModeIcon from '@material-ui/icons/Brightness4'; import LightModeIcon from '@material-ui/icons/Brightness7'; @@ -36,10 +35,6 @@ export default function ItemTableAppBar(props){ {props.darkMode ? : } - - - - From a8f1017d009f95b0abe231472d6b904ad01cf9d9 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Thu, 17 Sep 2020 18:23:15 -0400 Subject: [PATCH 07/14] Move ItemTableAppBar to react-styleguidist folder structure w/ docs --- src/App.js | 2 +- .../ItemTableAppBar}/ItemTableAppBar.js | 0 .../ItemTableAppBar/ItemTableAppBar.md | 16 ++++++++++++++++ src/components/ItemTableAppBar/index.js | 3 +++ 4 files changed, 20 insertions(+), 1 deletion(-) rename src/{ => components/ItemTableAppBar}/ItemTableAppBar.js (100%) create mode 100644 src/components/ItemTableAppBar/ItemTableAppBar.md create mode 100644 src/components/ItemTableAppBar/index.js diff --git a/src/App.js b/src/App.js index 1dbcdea..6ccb0b4 100644 --- a/src/App.js +++ b/src/App.js @@ -2,7 +2,7 @@ import React, { useState } from "react"; import { ThemeProvider } from "@material-ui/core/styles"; import webqueueTheme from "./theme"; import { Box, makeStyles } from "@material-ui/core"; -import ItemTableAppBar from "./ItemTableAppBar"; +import ItemTableAppBar from "./components/ItemTableAppBar/"; import ItemTable from "./components/ItemTable/"; import ItemViewAppBar from "./ItemViewAppBar"; import ItemView from "./ItemView"; diff --git a/src/ItemTableAppBar.js b/src/components/ItemTableAppBar/ItemTableAppBar.js similarity index 100% rename from src/ItemTableAppBar.js rename to src/components/ItemTableAppBar/ItemTableAppBar.js diff --git a/src/components/ItemTableAppBar/ItemTableAppBar.md b/src/components/ItemTableAppBar/ItemTableAppBar.md new file mode 100644 index 0000000..e870d28 --- /dev/null +++ b/src/components/ItemTableAppBar/ItemTableAppBar.md @@ -0,0 +1,16 @@ +The ItemTableAppBar is the primary toolbar for the [ItemTable](/#/Components/ItemTable). It displays the application title and application wide actions. + +```jsx +import React, { useState } from "react"; +import webqueue2Theme from "../../theme.js"; + +const [darkMode, setDarkMode] = useState(false); + +const theme = webqueue2Theme(darkMode); + + +``` + +```jsx static + +``` \ No newline at end of file diff --git a/src/components/ItemTableAppBar/index.js b/src/components/ItemTableAppBar/index.js new file mode 100644 index 0000000..474e0bc --- /dev/null +++ b/src/components/ItemTableAppBar/index.js @@ -0,0 +1,3 @@ +import ItemTableAppBar from "./ItemTableAppBar"; + +export default ItemTableAppBar; \ No newline at end of file From 585f9e7a7a6889d495299129c24d4cb8dd88ca6c Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Thu, 17 Sep 2020 18:49:48 -0400 Subject: [PATCH 08/14] Update ItemTable docs to reference ItemTableAppBar --- src/components/ItemTable/ItemTable.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ItemTable/ItemTable.md b/src/components/ItemTable/ItemTable.md index 0631361..335eee0 100644 --- a/src/components/ItemTable/ItemTable.md +++ b/src/components/ItemTable/ItemTable.md @@ -1,4 +1,4 @@ -The ItemTable is the primary view for webqueue2. It displays item metadata for items of selected queues and allows for filtering by field and opening an item by clicking. By default, it is pre-configured to fetch data from the webqueue2 API. +The ItemTable is the primary view for webqueue2. It displays item metadata for items of selected queues and allows for filtering by field and opening an item by clicking. By default, it is pre-configured to fetch data from the webqueue2 API. It is to be used with the [ItemTableAppBar](/#/Components/ItemTableAppBar). It is based on [material-table](https://material-table.com/). ```jsx From b32e80250116a95fbcf5717a6c77e9f54753b7f9 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Thu, 17 Sep 2020 19:18:46 -0400 Subject: [PATCH 09/14] Add propTypes and defaultProps to ItemTableAppBar --- .../ItemTableAppBar/ItemTableAppBar.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/components/ItemTableAppBar/ItemTableAppBar.js b/src/components/ItemTableAppBar/ItemTableAppBar.js index 2517ac9..44dffd6 100644 --- a/src/components/ItemTableAppBar/ItemTableAppBar.js +++ b/src/components/ItemTableAppBar/ItemTableAppBar.js @@ -1,4 +1,5 @@ import React from "react"; +import PropTypes from 'prop-types' import {makeStyles, Tooltip, Typography, AppBar, Toolbar, IconButton, Zoom} from "@material-ui/core" import DarkModeIcon from '@material-ui/icons/Brightness4'; import LightModeIcon from '@material-ui/icons/Brightness7'; @@ -39,4 +40,17 @@ export default function ItemTableAppBar(props){ ); -} \ No newline at end of file +}; + +ItemTableAppBar.propTypes = { + /** The title of the app bar. */ + "title": PropTypes.string, + /** Function to toggle darkMode. */ + "setDarkMode": PropTypes.func.isRequired, + /** State variable for darkMode */ + "darkMode": PropTypes.bool.isRequired +}; + +ItemTableAppBar.defaultProps = { + "title": "" +}; \ No newline at end of file From ebe9518d14b14d8e59f33f0e68075d8e7783b63c Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Fri, 18 Sep 2020 15:42:01 -0400 Subject: [PATCH 10/14] Add propTypes to ItemMetadataView --- src/ItemMetadataView.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ItemMetadataView.js b/src/ItemMetadataView.js index 9a08889..55f7a56 100644 --- a/src/ItemMetadataView.js +++ b/src/ItemMetadataView.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types' import { makeStyles, Grid, Paper } from '@material-ui/core'; import { Alert } from '@material-ui/lab' @@ -40,4 +41,9 @@ export default function ItemMetadataView({item}){ ); -} \ No newline at end of file +} + +ItemV.ItemMetadataView = { + /** The item to be displayed. */ + "item": PropTypes.object.isRequired +}; \ No newline at end of file From c08073df6408e1eb8dbb120b310974b22dceba85 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Sat, 19 Sep 2020 21:14:42 -0400 Subject: [PATCH 11/14] Move ItemMetadataView to react-styleguidist folder structure w/ docs --- src/ItemView.js | 2 +- .../ItemMetadataView}/ItemMetadataView.js | 2 +- .../ItemMetadataView/ItemMetadataView.md | 16 ++++++++++++++++ src/components/ItemMetadataView/index.js | 3 +++ 4 files changed, 21 insertions(+), 2 deletions(-) rename src/{ => components/ItemMetadataView}/ItemMetadataView.js (97%) create mode 100644 src/components/ItemMetadataView/ItemMetadataView.md create mode 100644 src/components/ItemMetadataView/index.js diff --git a/src/ItemView.js b/src/ItemView.js index c340f51..9ab3bef 100644 --- a/src/ItemView.js +++ b/src/ItemView.js @@ -1,6 +1,6 @@ import React from 'react'; import { Paper, Typography, makeStyles } from '@material-ui/core'; -import ItemMetadataView from "./ItemMetadataView" +import ItemMetadataView from "./components/ItemMetadataView/" function ItemView(props){ diff --git a/src/ItemMetadataView.js b/src/components/ItemMetadataView/ItemMetadataView.js similarity index 97% rename from src/ItemMetadataView.js rename to src/components/ItemMetadataView/ItemMetadataView.js index 55f7a56..f6fda1e 100644 --- a/src/ItemMetadataView.js +++ b/src/components/ItemMetadataView/ItemMetadataView.js @@ -43,7 +43,7 @@ export default function ItemMetadataView({item}){ ); } -ItemV.ItemMetadataView = { +ItemMetadataView.propTypes = { /** The item to be displayed. */ "item": PropTypes.object.isRequired }; \ No newline at end of file diff --git a/src/components/ItemMetadataView/ItemMetadataView.md b/src/components/ItemMetadataView/ItemMetadataView.md new file mode 100644 index 0000000..5aa20e8 --- /dev/null +++ b/src/components/ItemMetadataView/ItemMetadataView.md @@ -0,0 +1,16 @@ +The ItemMetadataView displays the metadata for an item as part of the [ItemView](/#/Components/ItemView). + +```jsx +import Paper from "@material-ui/core"; +import ItemMetadataView from "./ItemMetadataView"; + +const demoItem = {"queue": "ce", "number": 100, "lastUpdated": "07-23-20 10:11 PM", "headers": [{"type": "Merged-Time", "content": "Tue, 23 Jun 2020 13:31:53 -0400"}, {"type": "Merged-By", "content": "campb303"}, {"type": "QTime", "content": "1"}, {"type": "QTime-Updated-Time", "content": "Tue, 23 Jun 2020 13:28:50 EDT"}, {"type": "QTime-Updated-By", "content": "campb303"}, {"type": "Time", "content": "1"}, {"type": "Time-Updated-Time", "content": "Tue, 23 Jun 2020 13:28:50 EDT"}, {"type": "Time-Updated-By", "content": "campb303"}, {"type": "Replied-Time", "content": "Tue, 23 Jun 2020 13:28:48 -0400"}, {"type": "Replied-By", "content": "campb303"}, {"type": "Edited-Time", "content": "Tue, 23 Jun 2020 13:27:56 -0400"}, {"type": "Edited-By", "content": "campb303"}, {"type": "QAssigned-To", "content": "campb303"}, {"type": "QAssigned-To-Updated-Time", "content": "Tue, 23 Jun 2020 13:27:00 EDT"}, {"type": "QAssigned-To-Updated-By", "content": "campb303"}, {"type": "Assigned-To", "content": "campb303"}, {"type": "Assigned-To-Updated-Time", "content": "Tue, 23 Jun 2020 13:27:00 EDT"}, {"type": "Assigned-To-Updated-By", "content": "campb303"}, {"type": "QStatus", "content": "Dont Delete"}, {"type": "QStatus-Updated-Time", "content": "Tue, 23 Jun 2020 13:26:55 EDT"}, {"type": "QStatus-Updated-By", "content": "campb303"}, {"type": "Status", "content": "Dont Delete"}, {"type": "Status-Updated-Time", "content": "Tue, 23 Jun 2020 13:26:55 EDT"}, {"type": "Status-Updated-By", "content": "campb303"}, {"type": "Date", "content": "Tue, 23 Jun 2020 13:25:51 -0400"}, {"type": "From", "content": "Justin Campbell "}, {"type": "Message-ID", "content": "<911CE050-3240-4980-91DD-9C3EBB8DBCF8@purdue.edu>"}, {"type": "Subject", "content": "Beepboop"}, {"type": "To", "content": "cesite@ecn.purdue.edu"}, {"type": "Content-Type", "content": "text/plain; charset=\"utf-8\""}, {"type": "X-ECN-Queue-Original-Path", "content": "/home/pier/e/queue/Attachments/inbox/2020-06-23/208-original.txt"}], "content": ["Testtest\n", "\n", "*** Status updated by: campb303 at: 6/23/2020 13:26:55 ***\n", "Dont Delete\n", "*** Edited by: campb303 at: 06/23/20 13:27:56 ***\n", "\n", "This be an edit my boy\n", "\n", "\n", "\n", "*** Replied by: campb303 at: 06/23/20 13:28:18 ***\n", "\n", "This be a reply my son\n", "\n", "Justin\n", "ECN\n", "\n", "=== Additional information supplied by user ===\n", "\n", "Subject: Re: Beepboop\n", "From: Justin Campbell \n", "Date: Tue, 23 Jun 2020 13:30:45 -0400\n", "X-ECN-Queue-Original-Path: /home/pier/e/queue/Attachments/inbox/2020-06-23/212-original.txt\n", "X-ECN-Queue-Original-URL: https://engineering.purdue.edu/webqueue/Attachments/inbox/2020-06-23/212-original.txt\n", "\n", "Huzzah!\n", "\n", "===============================================\n"], "isLocked": "ce 100 is locked by knewell using qvi", "userEmail": "campb303@purdue.edu", "userName": "Justin Campbell", "userAlias": "campb303", "assignedTo": "campb303", "subject": "Beepboop", "status": "Dont Delete", "priority": "", "department": "", "building": "", "dateReceived": "Tue, 23 Jun 2020 13:25:51 -0400"}; + +
+ +
+``` + +```jsx static + +``` \ No newline at end of file diff --git a/src/components/ItemMetadataView/index.js b/src/components/ItemMetadataView/index.js new file mode 100644 index 0000000..7de396d --- /dev/null +++ b/src/components/ItemMetadataView/index.js @@ -0,0 +1,3 @@ +import ItemMetadataView from "./ItemMetadataView"; + +export default ItemMetadataView; \ No newline at end of file From ba98c459cac39aef698380ed6bea259ef8aa7daf Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Sat, 19 Sep 2020 21:37:34 -0400 Subject: [PATCH 12/14] Move ItemViewAppBar to react-styleguidist folder structure w/ docs --- src/App.js | 2 +- .../ItemViewAppBar}/ItemViewAppBar.js | 16 +++++++++++++++- src/components/ItemViewAppBar/ItemViewAppBar.md | 17 +++++++++++++++++ src/components/ItemViewAppBar/index.js | 3 +++ 4 files changed, 36 insertions(+), 2 deletions(-) rename src/{ => components/ItemViewAppBar}/ItemViewAppBar.js (73%) create mode 100644 src/components/ItemViewAppBar/ItemViewAppBar.md create mode 100644 src/components/ItemViewAppBar/index.js diff --git a/src/App.js b/src/App.js index 6ccb0b4..e1fabb3 100644 --- a/src/App.js +++ b/src/App.js @@ -4,7 +4,7 @@ import webqueueTheme from "./theme"; import { Box, makeStyles } from "@material-ui/core"; import ItemTableAppBar from "./components/ItemTableAppBar/"; import ItemTable from "./components/ItemTable/"; -import ItemViewAppBar from "./ItemViewAppBar"; +import ItemViewAppBar from "./components/ItemViewAppBar/"; import ItemView from "./ItemView"; import clsx from "clsx"; diff --git a/src/ItemViewAppBar.js b/src/components/ItemViewAppBar/ItemViewAppBar.js similarity index 73% rename from src/ItemViewAppBar.js rename to src/components/ItemViewAppBar/ItemViewAppBar.js index 45dec54..a150cd6 100644 --- a/src/ItemViewAppBar.js +++ b/src/components/ItemViewAppBar/ItemViewAppBar.js @@ -1,4 +1,5 @@ import React from "react"; +import PropTypes from "prop-types"; import {makeStyles, Tooltip, Typography, AppBar, Toolbar, IconButton, Zoom} from "@material-ui/core" import CloseItemViewIcon from '@material-ui/icons/ChevronRight'; @@ -36,4 +37,17 @@ export default function ItemViewAppBar(props){ ); -} \ No newline at end of file +} + +ItemViewAppBar.propTypes = { + /** The webqueue2 MUI theme. */ + "theme": PropTypes.object.isRequired, + /** Function to toggle sidebar open. */ + "setSidebarOpen": PropTypes.func.isRequired, + /** The title of the app bar. */ + "title": PropTypes.string +}; + +ItemViewAppBar.defaultProps = { + "title": "" +}; \ No newline at end of file diff --git a/src/components/ItemViewAppBar/ItemViewAppBar.md b/src/components/ItemViewAppBar/ItemViewAppBar.md new file mode 100644 index 0000000..acf98df --- /dev/null +++ b/src/components/ItemViewAppBar/ItemViewAppBar.md @@ -0,0 +1,17 @@ +The ItemViewAppBar is the primary toolbar for the [ItemView](/#/Components/ItemView). It displays the item title and action for closing the sidebar. + +```jsx +import React, { useState } from "react"; +import ItemViewAppBar from "./ItemViewAppBar"; +import webqueue2Theme from "../../theme.js"; + +const theme = webqueue2Theme(false); + +const [sidebarOpen, setSidebarOpen] = useState(false); + + +``` + +```jsx static + +``` \ No newline at end of file diff --git a/src/components/ItemViewAppBar/index.js b/src/components/ItemViewAppBar/index.js new file mode 100644 index 0000000..4c009ea --- /dev/null +++ b/src/components/ItemViewAppBar/index.js @@ -0,0 +1,3 @@ +import ItemViewAppBar from "./ItemViewAppBar"; + +export default ItemViewAppBar; \ No newline at end of file From 2456f83a5ee67aa178b0302c75f3a415dda771a3 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Sat, 19 Sep 2020 21:37:48 -0400 Subject: [PATCH 13/14] Add theme propType to ItemTableAppBar --- src/components/ItemTableAppBar/ItemTableAppBar.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/ItemTableAppBar/ItemTableAppBar.js b/src/components/ItemTableAppBar/ItemTableAppBar.js index 44dffd6..e6f032a 100644 --- a/src/components/ItemTableAppBar/ItemTableAppBar.js +++ b/src/components/ItemTableAppBar/ItemTableAppBar.js @@ -1,5 +1,5 @@ import React from "react"; -import PropTypes from 'prop-types' +import PropTypes from 'prop-types'; import {makeStyles, Tooltip, Typography, AppBar, Toolbar, IconButton, Zoom} from "@material-ui/core" import DarkModeIcon from '@material-ui/icons/Brightness4'; import LightModeIcon from '@material-ui/icons/Brightness7'; @@ -48,7 +48,9 @@ ItemTableAppBar.propTypes = { /** Function to toggle darkMode. */ "setDarkMode": PropTypes.func.isRequired, /** State variable for darkMode */ - "darkMode": PropTypes.bool.isRequired + "darkMode": PropTypes.bool.isRequired, + /** The webqueue2 MUI theme. */ + "theme": PropTypes.object.isRequired }; ItemTableAppBar.defaultProps = { From c3237acbaa51709ea5b98c6079bdff6382fafd22 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Sat, 19 Sep 2020 21:50:42 -0400 Subject: [PATCH 14/14] Move ItemView to react-styleguidist folder structure w/ docs --- src/App.js | 2 +- .../ItemMetadataView/ItemMetadataView.md | 2 -- src/{ => components/ItemView}/ItemView.js | 12 ++++++++---- src/components/ItemView/ItemView.md | 18 ++++++++++++++++++ src/components/ItemView/index.js | 3 +++ 5 files changed, 30 insertions(+), 7 deletions(-) rename src/{ => components/ItemView}/ItemView.js (69%) create mode 100644 src/components/ItemView/ItemView.md create mode 100644 src/components/ItemView/index.js diff --git a/src/App.js b/src/App.js index e1fabb3..ce76978 100644 --- a/src/App.js +++ b/src/App.js @@ -5,7 +5,7 @@ import { Box, makeStyles } from "@material-ui/core"; import ItemTableAppBar from "./components/ItemTableAppBar/"; import ItemTable from "./components/ItemTable/"; import ItemViewAppBar from "./components/ItemViewAppBar/"; -import ItemView from "./ItemView"; +import ItemView from "./components/ItemView/"; import clsx from "clsx"; const testItem = {"queue": "ce", "number": 100, "lastUpdated": "07-23-20 10:11 PM", "headers": [{"type": "Merged-Time", "content": "Tue, 23 Jun 2020 13:31:53 -0400"}, {"type": "Merged-By", "content": "campb303"}, {"type": "QTime", "content": "1"}, {"type": "QTime-Updated-Time", "content": "Tue, 23 Jun 2020 13:28:50 EDT"}, {"type": "QTime-Updated-By", "content": "campb303"}, {"type": "Time", "content": "1"}, {"type": "Time-Updated-Time", "content": "Tue, 23 Jun 2020 13:28:50 EDT"}, {"type": "Time-Updated-By", "content": "campb303"}, {"type": "Replied-Time", "content": "Tue, 23 Jun 2020 13:28:48 -0400"}, {"type": "Replied-By", "content": "campb303"}, {"type": "Edited-Time", "content": "Tue, 23 Jun 2020 13:27:56 -0400"}, {"type": "Edited-By", "content": "campb303"}, {"type": "QAssigned-To", "content": "campb303"}, {"type": "QAssigned-To-Updated-Time", "content": "Tue, 23 Jun 2020 13:27:00 EDT"}, {"type": "QAssigned-To-Updated-By", "content": "campb303"}, {"type": "Assigned-To", "content": "campb303"}, {"type": "Assigned-To-Updated-Time", "content": "Tue, 23 Jun 2020 13:27:00 EDT"}, {"type": "Assigned-To-Updated-By", "content": "campb303"}, {"type": "QStatus", "content": "Dont Delete"}, {"type": "QStatus-Updated-Time", "content": "Tue, 23 Jun 2020 13:26:55 EDT"}, {"type": "QStatus-Updated-By", "content": "campb303"}, {"type": "Status", "content": "Dont Delete"}, {"type": "Status-Updated-Time", "content": "Tue, 23 Jun 2020 13:26:55 EDT"}, {"type": "Status-Updated-By", "content": "campb303"}, {"type": "Date", "content": "Tue, 23 Jun 2020 13:25:51 -0400"}, {"type": "From", "content": "Justin Campbell "}, {"type": "Message-ID", "content": "<911CE050-3240-4980-91DD-9C3EBB8DBCF8@purdue.edu>"}, {"type": "Subject", "content": "Beepboop"}, {"type": "To", "content": "cesite@ecn.purdue.edu"}, {"type": "Content-Type", "content": "text/plain; charset=\"utf-8\""}, {"type": "X-ECN-Queue-Original-Path", "content": "/home/pier/e/queue/Attachments/inbox/2020-06-23/208-original.txt"}], "content": ["Testtest\n", "\n", "*** Status updated by: campb303 at: 6/23/2020 13:26:55 ***\n", "Dont Delete\n", "*** Edited by: campb303 at: 06/23/20 13:27:56 ***\n", "\n", "This be an edit my boy\n", "\n", "\n", "\n", "*** Replied by: campb303 at: 06/23/20 13:28:18 ***\n", "\n", "This be a reply my son\n", "\n", "Justin\n", "ECN\n", "\n", "=== Additional information supplied by user ===\n", "\n", "Subject: Re: Beepboop\n", "From: Justin Campbell \n", "Date: Tue, 23 Jun 2020 13:30:45 -0400\n", "X-ECN-Queue-Original-Path: /home/pier/e/queue/Attachments/inbox/2020-06-23/212-original.txt\n", "X-ECN-Queue-Original-URL: https://engineering.purdue.edu/webqueue/Attachments/inbox/2020-06-23/212-original.txt\n", "\n", "Huzzah!\n", "\n", "===============================================\n"], "isLocked": "ce 100 is locked by knewell using qvi", "userEmail": "campb303@purdue.edu", "userName": "Justin Campbell", "userAlias": "campb303", "assignedTo": "campb303", "subject": "Beepboop", "status": "Dont Delete", "priority": "", "department": "", "building": "", "dateReceived": "Tue, 23 Jun 2020 13:25:51 -0400"} diff --git a/src/components/ItemMetadataView/ItemMetadataView.md b/src/components/ItemMetadataView/ItemMetadataView.md index 5aa20e8..5d4f5f3 100644 --- a/src/components/ItemMetadataView/ItemMetadataView.md +++ b/src/components/ItemMetadataView/ItemMetadataView.md @@ -4,8 +4,6 @@ The ItemMetadataView displays the metadata for an item as part of the [ItemView] import Paper from "@material-ui/core"; import ItemMetadataView from "./ItemMetadataView"; -const demoItem = {"queue": "ce", "number": 100, "lastUpdated": "07-23-20 10:11 PM", "headers": [{"type": "Merged-Time", "content": "Tue, 23 Jun 2020 13:31:53 -0400"}, {"type": "Merged-By", "content": "campb303"}, {"type": "QTime", "content": "1"}, {"type": "QTime-Updated-Time", "content": "Tue, 23 Jun 2020 13:28:50 EDT"}, {"type": "QTime-Updated-By", "content": "campb303"}, {"type": "Time", "content": "1"}, {"type": "Time-Updated-Time", "content": "Tue, 23 Jun 2020 13:28:50 EDT"}, {"type": "Time-Updated-By", "content": "campb303"}, {"type": "Replied-Time", "content": "Tue, 23 Jun 2020 13:28:48 -0400"}, {"type": "Replied-By", "content": "campb303"}, {"type": "Edited-Time", "content": "Tue, 23 Jun 2020 13:27:56 -0400"}, {"type": "Edited-By", "content": "campb303"}, {"type": "QAssigned-To", "content": "campb303"}, {"type": "QAssigned-To-Updated-Time", "content": "Tue, 23 Jun 2020 13:27:00 EDT"}, {"type": "QAssigned-To-Updated-By", "content": "campb303"}, {"type": "Assigned-To", "content": "campb303"}, {"type": "Assigned-To-Updated-Time", "content": "Tue, 23 Jun 2020 13:27:00 EDT"}, {"type": "Assigned-To-Updated-By", "content": "campb303"}, {"type": "QStatus", "content": "Dont Delete"}, {"type": "QStatus-Updated-Time", "content": "Tue, 23 Jun 2020 13:26:55 EDT"}, {"type": "QStatus-Updated-By", "content": "campb303"}, {"type": "Status", "content": "Dont Delete"}, {"type": "Status-Updated-Time", "content": "Tue, 23 Jun 2020 13:26:55 EDT"}, {"type": "Status-Updated-By", "content": "campb303"}, {"type": "Date", "content": "Tue, 23 Jun 2020 13:25:51 -0400"}, {"type": "From", "content": "Justin Campbell "}, {"type": "Message-ID", "content": "<911CE050-3240-4980-91DD-9C3EBB8DBCF8@purdue.edu>"}, {"type": "Subject", "content": "Beepboop"}, {"type": "To", "content": "cesite@ecn.purdue.edu"}, {"type": "Content-Type", "content": "text/plain; charset=\"utf-8\""}, {"type": "X-ECN-Queue-Original-Path", "content": "/home/pier/e/queue/Attachments/inbox/2020-06-23/208-original.txt"}], "content": ["Testtest\n", "\n", "*** Status updated by: campb303 at: 6/23/2020 13:26:55 ***\n", "Dont Delete\n", "*** Edited by: campb303 at: 06/23/20 13:27:56 ***\n", "\n", "This be an edit my boy\n", "\n", "\n", "\n", "*** Replied by: campb303 at: 06/23/20 13:28:18 ***\n", "\n", "This be a reply my son\n", "\n", "Justin\n", "ECN\n", "\n", "=== Additional information supplied by user ===\n", "\n", "Subject: Re: Beepboop\n", "From: Justin Campbell \n", "Date: Tue, 23 Jun 2020 13:30:45 -0400\n", "X-ECN-Queue-Original-Path: /home/pier/e/queue/Attachments/inbox/2020-06-23/212-original.txt\n", "X-ECN-Queue-Original-URL: https://engineering.purdue.edu/webqueue/Attachments/inbox/2020-06-23/212-original.txt\n", "\n", "Huzzah!\n", "\n", "===============================================\n"], "isLocked": "ce 100 is locked by knewell using qvi", "userEmail": "campb303@purdue.edu", "userName": "Justin Campbell", "userAlias": "campb303", "assignedTo": "campb303", "subject": "Beepboop", "status": "Dont Delete", "priority": "", "department": "", "building": "", "dateReceived": "Tue, 23 Jun 2020 13:25:51 -0400"}; -
diff --git a/src/ItemView.js b/src/components/ItemView/ItemView.js similarity index 69% rename from src/ItemView.js rename to src/components/ItemView/ItemView.js index 9ab3bef..6f8926e 100644 --- a/src/ItemView.js +++ b/src/components/ItemView/ItemView.js @@ -1,8 +1,9 @@ import React from 'react'; +import PropTypes from "prop-types"; import { Paper, Typography, makeStyles } from '@material-ui/core'; -import ItemMetadataView from "./components/ItemMetadataView/" +import ItemMetadataView from "../ItemMetadataView/" -function ItemView(props){ +export default function ItemView(props){ const useStyles = makeStyles((theme) => ({ "paperPadding": { @@ -24,6 +25,9 @@ return( )): "" } ); -} +}; -export default ItemView; \ No newline at end of file +ItemView.propTypes = { + /** The item to be viewed. */ + "activeItem": PropTypes.object.isRequired +}; \ No newline at end of file diff --git a/src/components/ItemView/ItemView.md b/src/components/ItemView/ItemView.md new file mode 100644 index 0000000..0546b58 --- /dev/null +++ b/src/components/ItemView/ItemView.md @@ -0,0 +1,18 @@ +The ItemView is the primary view for an iten. It displays the messages and actions in a timeline view. + +```jsx +import React, { useState } from "react"; + +const demoItem = {"queue": "ce", "number": 100, "lastUpdated": "07-23-20 10:11 PM", "headers": [{"type": "Merged-Time", "content": "Tue, 23 Jun 2020 13:31:53 -0400"}, {"type": "Merged-By", "content": "campb303"}, {"type": "QTime", "content": "1"}, {"type": "QTime-Updated-Time", "content": "Tue, 23 Jun 2020 13:28:50 EDT"}, {"type": "QTime-Updated-By", "content": "campb303"}, {"type": "Time", "content": "1"}, {"type": "Time-Updated-Time", "content": "Tue, 23 Jun 2020 13:28:50 EDT"}, {"type": "Time-Updated-By", "content": "campb303"}, {"type": "Replied-Time", "content": "Tue, 23 Jun 2020 13:28:48 -0400"}, {"type": "Replied-By", "content": "campb303"}, {"type": "Edited-Time", "content": "Tue, 23 Jun 2020 13:27:56 -0400"}, {"type": "Edited-By", "content": "campb303"}, {"type": "QAssigned-To", "content": "campb303"}, {"type": "QAssigned-To-Updated-Time", "content": "Tue, 23 Jun 2020 13:27:00 EDT"}, {"type": "QAssigned-To-Updated-By", "content": "campb303"}, {"type": "Assigned-To", "content": "campb303"}, {"type": "Assigned-To-Updated-Time", "content": "Tue, 23 Jun 2020 13:27:00 EDT"}, {"type": "Assigned-To-Updated-By", "content": "campb303"}, {"type": "QStatus", "content": "Dont Delete"}, {"type": "QStatus-Updated-Time", "content": "Tue, 23 Jun 2020 13:26:55 EDT"}, {"type": "QStatus-Updated-By", "content": "campb303"}, {"type": "Status", "content": "Dont Delete"}, {"type": "Status-Updated-Time", "content": "Tue, 23 Jun 2020 13:26:55 EDT"}, {"type": "Status-Updated-By", "content": "campb303"}, {"type": "Date", "content": "Tue, 23 Jun 2020 13:25:51 -0400"}, {"type": "From", "content": "Justin Campbell "}, {"type": "Message-ID", "content": "<911CE050-3240-4980-91DD-9C3EBB8DBCF8@purdue.edu>"}, {"type": "Subject", "content": "Beepboop"}, {"type": "To", "content": "cesite@ecn.purdue.edu"}, {"type": "Content-Type", "content": "text/plain; charset=\"utf-8\""}, {"type": "X-ECN-Queue-Original-Path", "content": "/home/pier/e/queue/Attachments/inbox/2020-06-23/208-original.txt"}], "content": ["Testtest\n", "\n", "*** Status updated by: campb303 at: 6/23/2020 13:26:55 ***\n", "Dont Delete\n", "*** Edited by: campb303 at: 06/23/20 13:27:56 ***\n", "\n", "This be an edit my boy\n", "\n", "\n", "\n", "*** Replied by: campb303 at: 06/23/20 13:28:18 ***\n", "\n", "This be a reply my son\n", "\n", "Justin\n", "ECN\n", "\n", "=== Additional information supplied by user ===\n", "\n", "Subject: Re: Beepboop\n", "From: Justin Campbell \n", "Date: Tue, 23 Jun 2020 13:30:45 -0400\n", "X-ECN-Queue-Original-Path: /home/pier/e/queue/Attachments/inbox/2020-06-23/212-original.txt\n", "X-ECN-Queue-Original-URL: https://engineering.purdue.edu/webqueue/Attachments/inbox/2020-06-23/212-original.txt\n", "\n", "Huzzah!\n", "\n", "===============================================\n"], "isLocked": "ce 100 is locked by knewell using qvi", "userEmail": "campb303@purdue.edu", "userName": "Justin Campbell", "userAlias": "campb303", "assignedTo": "campb303", "subject": "Beepboop", "status": "Dont Delete", "priority": "", "department": "", "building": "", "dateReceived": "Tue, 23 Jun 2020 13:25:51 -0400"}; + + +const [activeItem, setActiveItem] = useState({}); +const [sidebarOpen, setSidebarOpen] = useState(false); + + + +``` + +```jsx static + +``` \ No newline at end of file diff --git a/src/components/ItemView/index.js b/src/components/ItemView/index.js new file mode 100644 index 0000000..44014ba --- /dev/null +++ b/src/components/ItemView/index.js @@ -0,0 +1,3 @@ +import ItemView from "./ItemView"; + +export default ItemView; \ No newline at end of file