From 934f78eb90dd4aa16929e1b89c7c05f4f24b5c07 Mon Sep 17 00:00:00 2001 From: Michael Foiani Date: Thu, 11 Aug 2022 11:37:39 -0400 Subject: add basic way to view issues. videos still won't play/show controls. --- src/client/util/ReportManager.scss | 55 ++++++++++++++++++++++++++++++++++++++ src/client/util/ReportManager.tsx | 47 +++++++++++++++++++++++++------- 2 files changed, 92 insertions(+), 10 deletions(-) create mode 100644 src/client/util/ReportManager.scss (limited to 'src') diff --git a/src/client/util/ReportManager.scss b/src/client/util/ReportManager.scss new file mode 100644 index 000000000..1f008a426 --- /dev/null +++ b/src/client/util/ReportManager.scss @@ -0,0 +1,55 @@ +@import '../views/global/globalCssVariables'; + +.issue-list-wrapper { + position: relative; + min-width: 250px; + background-color: $light-blue; + overflow-y: scroll; +} + +.issue-list { + display: flex; + align-items: center; + justify-content: space-between; + padding: 5px; + margin: 5px; + border-radius: 5px; + border: 1px solid grey; + background-color: lightgoldenrodyellow; +} + +// issue should pop up when the user hover over the issue +.issue-list:hover { + box-shadow: 2px; + cursor: pointer; + border: 3px solid #252b33; +} + +.issue-content { + background-color: white; + padding: 10px; + flex: 1 1 auto; + overflow-y: scroll; +} + +.issue-title { + font-size: 20px; + font-weight: 600; + color: black; +} + +.issue-body { + padding: 0 10px; + width: 100%; + text-align: left; +} + +.issue-body > * { + margin-top: 5px; +} + +.issue-body img, +.issue-body video { + display: block; + max-width: 100%; +} diff --git a/src/client/util/ReportManager.tsx b/src/client/util/ReportManager.tsx index be58da29a..fa9a0513b 100644 --- a/src/client/util/ReportManager.tsx +++ b/src/client/util/ReportManager.tsx @@ -15,9 +15,14 @@ import { FontIconBox } from '../views/nodes/button/FontIconBox'; import { DragManager } from './DragManager'; import { GroupManager } from './GroupManager'; import './SettingsManager.scss'; +import './ReportManager.scss'; import { undoBatch } from './UndoManager'; import { Octokit } from "@octokit/core"; import { CheckBox } from '../views/search/CheckBox'; +import ReactLoading from 'react-loading'; +import ReactMarkdown from 'react-markdown'; +import rehypeRaw from 'rehype-raw'; +import remarkGfm from 'remark-gfm'; const higflyout = require('@hig/flyout'); export const { anchorPoints } = higflyout; export const Flyout = higflyout.default; @@ -31,6 +36,9 @@ export class ReportManager extends React.Component<{}> { @observable public issues: any[] = []; @action setIssues = action((issues: any[]) => { this.issues = issues; }); + + @observable public selectedIssue: any = null; + @action setSelectedIssue = action((issue: any) => { this.selectedIssue = issue; }); @observable public shownIssues = this.issues.filter(issue => issue.state === 'open'); @@ -118,24 +126,43 @@ export class ReportManager extends React.Component<{}> { this.close(); } + private renderIssue = (issue: any) => { + const { title, body, number, html_url } = issue; + + return ( +
+
Issue #{number}
+
+ {title} +
+ +
+ ); + } + private get reportInterface() { return (
-
- this.updateIssueSearch(e.target.value))}> -

Previous Issues

- {this.issues.length === 0 ?
loading
: this.shownIssues.map(issue =>
{issue.title}
)} +
+

Current Issues

+ this.updateIssueSearch(e.target.value))}>
+ {this.issues.length === 0 ? : this.shownIssues.map(issue =>
this.setSelectedIssue(issue)}>{issue.title}
)} -
+ {/*
-
+
*/}
+
-
+
+ {this.selectedIssue === null ? "no issue selected" : this.renderIssue(this.selectedIssue)} +
+ + {/*

Report an Issue


this.bugTitle = e.target.value} /> @@ -145,9 +172,9 @@ export class ReportManager extends React.Component<{}> {

{/* this.toGithub = e.target.checked} /> -
*/} +
} -
+
*/}
@@ -161,7 +188,7 @@ export class ReportManager extends React.Component<{}> { isDisplayed={this.isOpen} interactive={true} closeOnExternalClick={this.close} - dialogueBoxStyle={{ width: '500px', height: '500px', background: Cast(Doc.SharingDoc().userColor, 'string', null) }} + dialogueBoxStyle={{ width: 'auto', height: '500px', background: Cast(Doc.SharingDoc().userColor, 'string', null) }} /> ); } -- cgit v1.2.3-70-g09d2