Skip to content

Commit

Permalink
Merge pull request #19 from columbiaspace/MG
Browse files Browse the repository at this point in the history
Dropdown for ingress
  • Loading branch information
adenjonah committed May 15, 2024
2 parents 09e53c6 + 9e17625 commit b373f7e
Show file tree
Hide file tree
Showing 14 changed files with 119 additions and 87 deletions.
Binary file removed __pycache__/server.cpython-312.pyc
Binary file not shown.
1 change: 0 additions & 1 deletion config_keys.json

This file was deleted.

Binary file added src/assets/Images/Egress1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Images/Egress2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Images/Egress3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Images/Egress4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Images/Ingress1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions src/assets/ProcedureLists/EgressProcedureList.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import image1 from '../Images/DCU_Front.jpg';
import image2 from '../Images/dog2.png';
import image3 from '../Images/dog3.png';
import image1 from '../Images/Egress1.jpg';
import image2 from '../Images/Egress2.jpg';
import image3 from '../Images/Egress3.jpg';
import image4 from '../Images/Egress4.jpg';

// import supplywaste from '../Images/supplywaste.jpg'
export const EgressProcedureList = [
{
Expand All @@ -21,7 +23,7 @@ export const EgressProcedureList = [
{
name: 'END Depress, Check Switches and Disconnect',
description: 'HMD 1. Wait until SUIT P, O2 P = 4\nUIA 2. DEPRESS PUMP PWR - OFF\nBOTH DCU 3. BATT - LOCAL\nUIA 9. EV-1, EV-2 PWR - OFF\nBOTH DCU 4. Verify OXY - PRI\nBOTH DCU 5. Verify COMMS - A\nBOTH DCU 6. Verify FAN - PRI\nBOTH DCU 7. Verify PUMP - CLOSE\nBOTH DCU 8. Verify CO2 - A\nUIA and DCU 9. EV1 and EV2 disconnect UIA and DCU umbilical',
image: null,
image: image4,
},

// Add more procedures as needed
Expand Down
2 changes: 1 addition & 1 deletion src/assets/ProcedureLists/IngressProcedureList.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import image1 from '../Images/DCU_Front.jpg';
import image1 from '../Images/Ingress1.jpg';
import image2 from '../Images/Ingress2.jpg';
import image3 from '../Images/Ingress3.jpg';
import image4 from '../Images/Ingress4.jpg';
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProcedureItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function ProcedureItem({ name, description, className }) {

return (
<div className={`ProcedureItem ${className}`}>
<h1>{name}</h1>
<h1 className="procedureTitle">{name}</h1>
<ul className='procedureDescription'>{descriptionItems}</ul>
</div>
);
Expand Down
73 changes: 58 additions & 15 deletions src/components/procedureitem.css
Original file line number Diff line number Diff line change
@@ -1,16 +1,59 @@
.ProcedureItem {
/* Styles for the procedure item */
max-width: 100%; /* Ensures the div doesn't grow beyond its container */
overflow-wrap: break-word; /* Allows long words to break and wrap onto the next line */
}

.procedureDescription {
list-style-type: disc; /* Adds bullets to the list */
margin-left: 20px; /* Indent the list for better readability */
padding: 0;
word-wrap: break-word; /* Wraps long words to the next line */
}

.procedureDescription li {
margin-bottom: 5px; /* Space between list items */
}
display: flex;
flex-direction: column;
width: 100%; /* Ensure ProcedureItem spans the entire width */
margin-bottom: 20px; /* Add margin to separate ProcedureItems */
}

.procedureTitle {
margin-bottom: 10px; /* Add margin between title and description */
flex-grow: 1; /* Allow title to grow to fill available space */
}

.procedureDescription {
padding-left: 20px; /* Add padding to the description for better readability */
flex-grow: 1; /* Allow description to grow to fill available space */
}

.left-column {
flex: 3;
padding: 20px;
background-color: #f0f0f0;
}

.right-column {
flex: 1;
padding: 20px;
background-color: #e0e0e0;
max-height: 400px; /* Set a maximum height for the right column */
overflow-y: auto; /* Enable vertical scrolling if content exceeds the maximum height */
}

.select-container {
margin-bottom: 10px;
}

.select-container select {
width: 100%;
padding: 8px;
font-size: 16px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}

.select-container select:focus {
outline: none;
border-color: #007bff;
}

.navigation-buttons {
margin-top: 10px;
}

.navigation-buttons button {
margin-right: 10px;
padding: 8px 12px;
cursor: pointer;
}

72 changes: 28 additions & 44 deletions src/pages-style/ingressegress 2.css
Original file line number Diff line number Diff line change
@@ -1,51 +1,35 @@
.ingressegress-container {
display: flex;
height: 73vh;
}

.left-column {
flex: 1;
}

.left-column {
flex: 3;
padding: 20px;
background-color: #f0f0f0;
display: flex;
flex-direction: column;
align-items: center;
}

.left-column img {
width: auto;
height: 300px;
margin-bottom: 20px;
}

.ProcedureList {
}

.right-column {
flex: 1;
padding: 20px;
background-color: #e0e0e0;
}

.ProcedureList {
text-wrap: true;
width: 50%;
height: 100%;
}

.ProcedureItem {
display: none;
height: 60vh;
}

.ProcedureItem.show {
display: block;
}

.navigation-buttons {
display: flex;
justify-content: center; /* Align buttons in the center horizontally */
margin-top: 10px;
}

.navigation-buttons button {
padding: 8px 12px;
cursor: pointer;
}
max-height: 400px; /* Set a maximum height for the right column */
overflow-y: auto; /* Enable vertical scrolling if content exceeds the maximum height */
}

.select-container {
margin-bottom: 10px;
}

.select-container select {
width: 100%;
padding: 8px;
font-size: 16px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}

.select-container select:focus {
outline: none;
border-color: #007bff;
}
2 changes: 1 addition & 1 deletion src/pages/focus/egress.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function Egress() {
};

return (
<div className="pagecontainer">
<div className="ingressegress-container">
<div className="left-column">
<h1>Egress</h1>
{EgressProcedureList[currentProcedure].image && (
Expand Down
44 changes: 24 additions & 20 deletions src/pages/focus/ingress.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,49 @@
import React, { useState } from 'react';
import '../../pages-style/ingressegress.css';
import React, { useState, useRef } from 'react';
import '../../pages-style/ingressegress 2.css';
import '../../pages-style/page.css'
import { IngressProcedureList } from '../../assets/ProcedureLists/IngressProcedureList';
import ProcedureItem from '../../components/ProcedureItem';


function Ingress() {
const [currentProcedure, setCurrentProcedure] = useState(0);
const procedureDropdownRef = useRef(null);

const handleNextProcedure = () => {
setCurrentProcedure((prevIndex) => (prevIndex + 1) % IngressProcedureList.length);
};

const handlePrevProcedure = () => {
setCurrentProcedure((prevIndex) => (prevIndex - 1 + IngressProcedureList.length) % IngressProcedureList.length);
const handleProcedureChange = () => {
const selectedIndex = procedureDropdownRef.current.selectedIndex;
setCurrentProcedure(selectedIndex);
};

return (
<div className="pagecontainer">
<div className="ingressegress-container">
<div className="left-column">
<h1>Ingress</h1>
{IngressProcedureList[currentProcedure].image && (
<img src={IngressProcedureList[currentProcedure].image} alt={IngressProcedureList[currentProcedure].name} />
)}
</div>
<div className="ProcedureList">
{IngressProcedureList.map((Item, index) => (
<div className="right-column">
<h2>Select Procedure</h2>
<div className="select-container">
<select ref={procedureDropdownRef} onChange={handleProcedureChange} value={currentProcedure}>
{IngressProcedureList.map((Item, index) => (
<option key={index} value={index}>{Item.name}</option>
))}
</select>
</div>
<div className="ProcedureList">
<ProcedureItem
key={index}
name={Item.name}
description={Item.description}
className={index === currentProcedure ? 'show' : ''}
name={IngressProcedureList[currentProcedure].name}
description={IngressProcedureList[currentProcedure].description}
className="show"
/>
))}
</div>
<div className="navigation-buttons">
<button onClick={handlePrevProcedure}>&lt; Previous</button>
<button onClick={handleNextProcedure}>Next &gt;</button>
<button onClick={() => setCurrentProcedure((prevIndex) => (prevIndex - 1 + IngressProcedureList.length) % IngressProcedureList.length)}>&lt; Previous</button>
<button onClick={() => setCurrentProcedure((prevIndex) => (prevIndex + 1) % IngressProcedureList.length)}>Next &gt;</button>
</div>
</div>
</div>
);
}

export default Ingress;
export default Ingress;

0 comments on commit b373f7e

Please sign in to comment.