Skip to content
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

Rc interface #4

Open
wants to merge 42 commits into
base: mainbackup
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
22c3bd4
bug fixes
jordan-checkoff Apr 24, 2023
340ab36
wireframe
jordan-checkoff Apr 24, 2023
620b906
add/delete RCs
jordan-checkoff Apr 26, 2023
c2b8a05
context tags
jordan-checkoff Apr 27, 2023
3a3b9bc
Strategy modal
jordan-checkoff Apr 27, 2023
c12ab44
strategy blockly modal2
gragragrace Apr 28, 2023
db37edf
strategy blockly ordering issue fixed
gragragrace Apr 28, 2023
c2881b5
Blockly modals
jordan-checkoff Apr 28, 2023
b02bcc5
context + sidepanel
gragragrace Apr 28, 2023
cbec07b
sidebar slide guide and blockly fix
gragragrace May 1, 2023
6f0530e
user instructions
gragragrace May 1, 2023
1ff48f8
context tags
gragragrace May 1, 2023
24ab81e
Update sprintBlocks.ts
gragragrace May 1, 2023
9b7a5c3
accordions
jordan-checkoff May 10, 2023
75da045
General Context
gragragrace May 10, 2023
7b2efcd
troubleshooting next.js
gragragrace May 11, 2023
1143223
@chakra-ui fix
gragragrace May 11, 2023
139ed2d
framer-motion
gragragrace May 11, 2023
fa4f482
emotion/styled fix
gragragrace May 11, 2023
7758067
blockly rendering issue fix
gragragrace May 12, 2023
8daf26f
search blocks
gragragrace May 12, 2023
8e7b1b4
general context
gragragrace May 12, 2023
456c132
Update Sidebar.tsx
gragragrace May 12, 2023
3daed95
block fixes
gragragrace May 12, 2023
6b2c953
Sortable RCs
gragragrace May 12, 2023
4b59298
Disable part 1
gragragrace May 12, 2023
8b5feae
disable part 2
gragragrace May 13, 2023
85d5b7e
disable CSS change + select button
gragragrace May 13, 2023
3b60f8f
add new root cause
gragragrace May 13, 2023
cfbf34a
Usability issue-disable button
gragragrace May 16, 2023
70cbc83
Usability fix-edit RC
gragragrace May 17, 2023
61750ba
Callback fix
gragragrace May 17, 2023
bf71524
testing
gragragrace May 17, 2023
8fa0d27
OSEScript Data Model
gragragrace May 17, 2023
3c8da12
clean code and fix bugs
jordan-checkoff May 18, 2023
0863274
Merge branch 'rc-interface' of https://github.com/NUDelta/orchestrati…
jordan-checkoff May 18, 2023
0e6bc38
Diagnosis Model
gragragrace May 18, 2023
78b565b
setup
gragragrace May 18, 2023
57e0344
blockly trim
gragragrace May 19, 2023
cc9d0a4
connect to database
jordan-checkoff May 21, 2023
4a35c54
minor fix
gragragrace May 22, 2023
34dd024
Blockly fixes
gragragrace May 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
174 changes: 168 additions & 6 deletions components/BlocklyEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import React, { useState } from 'react';
import React, { useEffect, useState } from 'react';
import { BlocklyWorkspace } from 'react-blockly';
import { toolboxCategories } from '../lib/blockly/customBlocks/customToolboxCategories';
import { javascriptGenerator } from 'blockly/javascript';

export default function BlockEditor() {
const [xml, setXml] = useState('');
export default function BlockEditor({ workspaceId, RCs, setRCs, index } : any) {
// const [xml, setXml] = useState('');
const [javascriptCode, setJavascriptCode] = useState('');

const setXml = (e : any) => {
let copy = [...RCs]
copy[index].strategy = e
setRCs(copy)
}

const initialXml =
'<xml xmlns="http://www.w3.org/1999/xhtml"><block type="ApplicableSet" x="30" y="30"></block><block type="rootCause" x="200" y="300"></block><block type="Detector" x="30" y="145"></block><block type="StrategiesWrapper" x="30" y="200"></block><block type="Strategies" x="200" y="200"></block></xml>';
'<xml xmlns="http://www.w3.org/1999/xhtml"><block type="ApplicableSet" x="30" y="30"></block><block type="Detector" x="30" y="145"></block></xml>';

function workspaceDidChange(workspace) {
// console.log(workspace);
Expand All @@ -19,7 +25,9 @@ export default function BlockEditor() {

return (
<>
{workspaceId === 'workspace1' && (
<BlocklyWorkspace
id="workspace1"
toolboxConfiguration={toolboxCategories}
initialXml={initialXml}
className="blocklyWorkspace"
Expand All @@ -32,8 +40,162 @@ export default function BlockEditor() {
},
}}
onWorkspaceChange={workspaceDidChange}
onXmlChange={setXml}
// onXmlChange={setXml}
/>
)}
{workspaceId === 'workspace2' && (
<BlocklyWorkspace
id="workspace2"
toolboxConfiguration={toolboxCategories}
initialXml={RCs[index].strategy}
className="blocklyWorkspace"
workspaceConfiguration={{
grid: {
spacing: 20,
length: 3,
colour: 'red',
snap: true,
},
}}
onWorkspaceChange={workspaceDidChange}
onXmlChange={setXml}
/>)}
{workspaceId === 'workspace3' && (
<BlocklyWorkspace
id="workspace3"
toolboxConfiguration={toolboxCategories}
initialXml={RCs[index].strategy}
className="blocklyWorkspace"
workspaceConfiguration={{
grid: {
spacing: 20,
length: 3,
colour: 'blue',
snap: true,
},
}}
onWorkspaceChange={workspaceDidChange}
onXmlChange={setXml}
/>)}
{workspaceId === 'workspace4' && (
<BlocklyWorkspace
id="workspace4"
toolboxConfiguration={toolboxCategories}
initialXml={RCs[index].strategy}
className="blocklyWorkspace"
workspaceConfiguration={{
grid: {
spacing: 20,
length: 3,
colour: 'green',
snap: true,
},
}}
onWorkspaceChange={workspaceDidChange}
onXmlChange={setXml}
/>)}
{workspaceId === 'workspace5' && (
<BlocklyWorkspace
id="workspace5"
toolboxConfiguration={toolboxCategories}
initialXml={RCs[index].strategy}
className="blocklyWorkspace"
workspaceConfiguration={{
grid: {
spacing: 20,
length: 3,
colour: 'purple',
snap: true,
},
}}
onWorkspaceChange={workspaceDidChange}
onXmlChange={setXml}
/>)}
{workspaceId === 'workspace6' && (
<BlocklyWorkspace
id="workspace6"
toolboxConfiguration={toolboxCategories}
initialXml={RCs[index].strategy}
className="blocklyWorkspace"
workspaceConfiguration={{
grid: {
spacing: 20,
length: 3,
colour: 'pink',
snap: true,
},
}}
onWorkspaceChange={workspaceDidChange}
onXmlChange={setXml}
/>)}
{workspaceId === 'workspace7' && (
<BlocklyWorkspace
id="workspace7"
toolboxConfiguration={toolboxCategories}
initialXml={RCs[index].strategy}
className="blocklyWorkspace"
workspaceConfiguration={{
grid: {
spacing: 20,
length: 3,
colour: 'yellow',
snap: true,
},
}}
onWorkspaceChange={workspaceDidChange}
onXmlChange={setXml}
/>)}
{workspaceId === 'workspace8' && (
<BlocklyWorkspace
id="workspace8"
toolboxConfiguration={toolboxCategories}
initialXml={RCs[index].strategy}
className="blocklyWorkspace"
workspaceConfiguration={{
grid: {
spacing: 20,
length: 3,
colour: 'orange',
snap: true,
},
}}
onWorkspaceChange={workspaceDidChange}
onXmlChange={setXml}
/>)}
{workspaceId === 'workspace9' && (
<BlocklyWorkspace
id="workspace9"
toolboxConfiguration={toolboxCategories}
initialXml={RCs[index].strategy}
className="blocklyWorkspace"
workspaceConfiguration={{
grid: {
spacing: 20,
length: 3,
colour: 'lavender',
snap: true,
},
}}
onWorkspaceChange={workspaceDidChange}
onXmlChange={setXml}
/>)}
{workspaceId === 'workspace10' && (
<BlocklyWorkspace
id="workspace10"
toolboxConfiguration={toolboxCategories}
initialXml={RCs[index].strategy}
className="blocklyWorkspace"
workspaceConfiguration={{
grid: {
spacing: 20,
length: 3,
colour: 'black',
snap: true,
},
}}
onWorkspaceChange={workspaceDidChange}
onXmlChange={setXml}
/>)}
</>
);
}
}
18 changes: 18 additions & 0 deletions components/Context.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

.container {
background-color: #BBB;
height: 100%;
padding: 10px;
}

.container select {
width: 100%;
border-radius: 5px;
margin-bottom: 10px;
}

.contexts {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px 20px;
}
35 changes: 35 additions & 0 deletions components/Context.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import styles from "./Context.module.css"
import { Tag } from "./Tag"

const options = ["Sprint log-Total Points Spent this Sprint",
"Sprint log-Total Points Commited this Sprint",
"Sprint log-Summary of Stories",
"Sprint log-Summary of Tasks",
"Sprint log-Riskiest Risk specified in Planning View",
"PRC-Specific Slides (Under construction)",
"PRC-Time Last Edited",
"PRC-Slides Updated in this sprint",
"Github-Number of Lines Code Committed this sprint",
"Github-Number of Branches Created this sprint",
"Github-Summary of Commits made this sprint"]

export const Context = ({index, RCs, setRCs} : any) => {

const addContext = (val : string) => {
let copy = [...RCs]
copy[index].context.add(val)
setRCs(copy)
}

return (
<div className={styles.container}>
<select onChange={(e) => addContext(e.target.value)} value="Select context">
<option>Select context</option>
{options.map((x) => <option key={x}>{x}</option>)}
</select>
<div className={styles.contexts}>
{[...RCs[index].context].map((x: any, i: number) => <Tag key={i} name={x} RCs={RCs} index={index} setRCs={setRCs} />)}
</div>
</div>
)
}
14 changes: 14 additions & 0 deletions components/Detector.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.container {
margin-bottom: 40px;
}

.container .blockly {
width: '100%';
height: 300px;
border: 2px solid gray;
}

.container h2 {
font-size: 20px;
margin-bottom: 10px;
}
17 changes: 17 additions & 0 deletions components/Detector.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import dynamic from 'next/dynamic';
import styles from './Detector.module.css'

const BlocklyEditor = dynamic(() => import('./BlocklyEditor'), { ssr: false });

export const Detector = () => {

return (
<div className={styles.container}>
<h2>Detector</h2>

<div className={styles.blockly}>
<BlocklyEditor workspaceId="workspace1"/>
</div>
</div>
)
}
18 changes: 18 additions & 0 deletions components/GeneralContext.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

.gencontainer {
background-color: #BBB;
height: 200px;
padding: 10px;
}

.gencontainer select {
width: 100%;
border-radius: 5px;
margin-bottom: 10px;
}

.gencontexts {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px 20px;
}
64 changes: 64 additions & 0 deletions components/GeneralContext.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import styles from "./GeneralContext.module.css"
import { useState } from 'react';

const options = ["Sprint log-Total Points Spent this Sprint",
"Sprint log-Total Points Commited this Sprint",
"Sprint log-Summary of Stories",
"Sprint log-Summary of Tasks",
"Sprint log-Riskiest Risk specified in Planning View",
"PRC-Specific Slides (Under construction)",
"PRC-Time Last Edited",
"PRC-Slides Updated in this sprint",
"Github-Number of Lines Code Committed this sprint",
"Github-Number of Branches Created this sprint",
"Github-Summary of Commits made this sprint"]

function getOptionExplanation(option) {
if (option === "Sprint log-Summary of Stories") {
return "Title, Purpose, Deliverable, Points Planned, DTR Points Breakdown, and Points Spent";
} else if (option === "Sprint log-Summary of Tasks") {
return "Deliverable, Points Planned, DTR Points Breakdown, Person Assigned to, and Points Spent";
}
}

const GeneralContext = () => {
const [selectedTags, setSelectedTags] = useState([]);

// Add tag function
const addTag = (tag) => {
setSelectedTags([...selectedTags, tag]);
};

// Remove tag function
const removeTag = (tag) => {
setSelectedTags(selectedTags.filter((t) => t !== tag));
};

return (
<div className={styles.gencontainer}>
<h1>General Context</h1>
<select onChange={(e) => addTag(e.target.value)}>
<option value="">Select context</option>
{options.map((option, index) => (
<option key={index} value={option} title={getOptionExplanation(option)}>
{option}
</option>
))}
</select>

{/* Display tags */}
<div>
{selectedTags.map((tag, index) => (
<div key={index} className={styles.gencontexts}>
{tag}
<button onClick={() => removeTag(tag)} className="tag-close">
x
</button>
</div>
))}
</div>
</div>
);
};

export default GeneralContext;
Loading