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

Bugfix and more housekeeping #55

Merged
merged 3 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
72 changes: 10 additions & 62 deletions client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Collapsible from "react-collapsible";
import lists from "./modules/Generic/BilletBank";
import ErrorMessage from "./errorMessage";
import Statistics from "./modules/Generic/Statistics";
import CombinedFunction from "./modules/Generic/CombinedFunction";
import AdrListEntry from "./modules/Generic/AdrListEntry";
import Logo from "./style/themes/7cav/logo";

const CLIENT_TOKEN = process.env.REACT_APP_CLIENT_TOKEN;
Expand Down Expand Up @@ -141,67 +141,15 @@ function MilpacRequest() {
) : (
<>
<div className="ListContainer">
<CombinedFunction
billetBankObject={lists.billetBankObject.regi.positionIds}
collapsibleTitle={lists.billetBankObject.regi.collapsibleTitle}
headerTitles={lists.billetBankObject.regi.positionTitles}
milpacArray={milpacArray}
usePrimaryOnly={lists.billetBankObject.regi.isPrimaryOnly}
/>
<CombinedFunction
billetBankObject={lists.billetBankObject.oneSeven.positionIds}
collapsibleTitle={
lists.billetBankObject.oneSeven.collapsibleTitle
}
headerTitles={lists.billetBankObject.oneSeven.positionTitles}
milpacArray={milpacArray}
usePrimaryOnly={lists.billetBankObject.oneSeven.isPrimaryOnly}
/>
<CombinedFunction
billetBankObject={lists.billetBankObject.twoSeven.positionIds}
collapsibleTitle={
lists.billetBankObject.twoSeven.collapsibleTitle
}
headerTitles={lists.billetBankObject.twoSeven.positionTitles}
milpacArray={milpacArray}
usePrimaryOnly={lists.billetBankObject.twoSeven.isPrimaryOnly}
/>
<CombinedFunction
billetBankObject={lists.billetBankObject.acd.positionIds}
collapsibleTitle={lists.billetBankObject.acd.collapsibleTitle}
headerTitles={lists.billetBankObject.acd.positionTitles}
milpacArray={milpacArray}
/>
<CombinedFunction
billetBankObject={lists.billetBankObject.imo.positionIds}
collapsibleTitle={lists.billetBankObject.imo.collapsibleTitle}
headerTitles={lists.billetBankObject.imo.positionTitles}
milpacArray={milpacArray}
/>
<CombinedFunction
billetBankObject={lists.billetBankObject.secOps.positionIds}
collapsibleTitle={lists.billetBankObject.secOps.collapsibleTitle}
headerTitles={lists.billetBankObject.secOps.positionTitles}
milpacArray={milpacArray}
/>
<CombinedFunction
billetBankObject={lists.billetBankObject.roo.positionIds}
collapsibleTitle={lists.billetBankObject.roo.collapsibleTitle}
headerTitles={lists.billetBankObject.roo.positionTitles}
milpacArray={milpacArray}
/>
<CombinedFunction
billetBankObject={
lists.billetBankObject.supportDepartments.positionIds
}
collapsibleTitle={
lists.billetBankObject.supportDepartments.collapsibleTitle
}
headerTitles={
lists.billetBankObject.supportDepartments.positionTitles
}
milpacArray={milpacArray}
/>
{/*note: BbGroup = billetBankGroup*/}
<AdrListEntry bBGroup={"regi"} milpacArray={milpacArray} />
<AdrListEntry bBGroup={"oneSeven"} milpacArray={milpacArray} />
<AdrListEntry bBGroup={"twoSeven"} milpacArray={milpacArray} />
<AdrListEntry bBGroup={"acd"} milpacArray={milpacArray} />
<AdrListEntry bBGroup={"imo"} milpacArray={milpacArray} />
<AdrListEntry bBGroup={"secOps"} milpacArray={milpacArray} />
<AdrListEntry bBGroup={"roo"} milpacArray={milpacArray} />
<AdrListEntry bBGroup={"support"} milpacArray={milpacArray} />
<div className="DepartmentContainer">
<Collapsible
trigger="Statistics"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
import React from "react";
import Collapsible from "react-collapsible";
import MilpacParse from "./MilpacParse.js";
import lists from "./BilletBank.js";

function AdrListEntry(props) {
let billetBankObject = lists.billetBankObject;
let selector = props.billetBankGroup;

function CombinedFunction(props) {
return (
<div className="DepartmentContainer">
<Collapsible
trigger={props.collapsibleTitle}
trigger={billetBankObject[selector].collapsibleTitle}
triggerClassName="Title"
triggerOpenedClassName="Title"
open={true}
>
<div className="ResponseContainer">
<MilpacParse
milpacArray={props.milpacArray}
headerTitles={props.headerTitles}
billetBankObject={props.billetBankObject}
headerTitles={billetBankObject[selector].positionTitles}
billetBankObject={billetBankObject[selector].positionIds}
/>
</div>
</Collapsible>
</div>
);
}

export default CombinedFunction;
export default AdrListEntry;
6 changes: 3 additions & 3 deletions client/src/modules/Generic/BilletBank.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ const acd = {
"Star Citizen Starter Platoon",
"Future Concepts Center",
],
collapsibleTitle: "First Battalion",
collapsibleTitle: "Auxillary Combat Division",
};

//IMO
Expand Down Expand Up @@ -737,7 +737,7 @@ const s7 = [
const ld = ["126", "127", "128", "129", "130", "131", "132", "539"];
const spd = ["175", "176"];

const supportDepartments = {
const support = {
positionIds: [spd, s3, s7, ld],
positionTitles: [
"Special Projects Division",
Expand All @@ -758,7 +758,7 @@ const billetBankObject = {
imo: imo,
secOps: secOps,
roo: roo,
supportDepartments: supportDepartments,
support: support,
};

//keeping a shortlist of individual exports open so that it doesnt break the Statistics section.
Expand Down