Skip to content

Commit

Permalink
fix: one day i will learn to not just test on prod
Browse files Browse the repository at this point in the history
but today is not that day
  • Loading branch information
Gobot1234 committed May 9, 2024
1 parent bec2237 commit 549e6c2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 16 deletions.
12 changes: 11 additions & 1 deletion apps/anvil/src/users/users.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,17 @@ const UserTrainingEntry = (id: string, options: UserTrainingEntryPropsOptions) =
),
options.include_fully_complete
? true
: e.op(e.op("exists", training["@in_person_created_at"]), "if", training.in_person, "else", true),
: e.op(
e.op(
e.op("not", e.op("exists", training["@in_person_created_at"])),
"and",
e.op("exists", training["@created_at"]),
),
"if",
training.in_person,
"else",
true,
),
),
),
}),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { errorDisplay } from "@/components/errors/ErrorDisplay";
import { SelectedTrainingPipDisplay } from "@/routes/_authenticated/_reponly/signin/actions/-components/SelectedTrainingPipDisplay.tsx";
import ToolSelectionList from "@/routes/_authenticated/_reponly/signin/actions/-components/TrainingSelectionList.tsx";
import { signinActions, useSignInSessionField } from "@/redux/signin.slice.ts";
import { AppDispatch, AppRootState } from "@/redux/store.ts";
import { SelectedTrainingPipDisplay } from "@/routes/_authenticated/_reponly/signin/actions/-components/SelectedTrainingPipDisplay.tsx";
import ToolSelectionList from "@/routes/_authenticated/_reponly/signin/actions/-components/TrainingSelectionList.tsx";
import { GetSignIn, GetSignInProps } from "@/services/signin/signInService.ts";
import { FlowStepComponent } from "@/types/signInActions.ts";
import { Training, User } from "@ignis/types/sign_in.ts";
Expand Down Expand Up @@ -176,8 +176,8 @@ const ToolSelectionInput: FlowStepComponent = ({ onSecondary, onPrimary }) => {
<CollapsibleContent className="space-y-2">
<ToolSelectionList
title="Un-selectable Training"
trainings={trainingMap.UNSELECTABLE}
toolTipContent="Tools that the user has training for, but reps are not trained on the tool"
trainings={trainingMap.UNSELECTABLE} // TODO allow these to be SELECTABLE but pop a warning saying that they need to be trained (only if the reps are trained to give it.)
toolTipContent="Tools that the user has training for, but reps are not trained on the tool or the tools that the user hasn't completed the in-person training for yet."
/>
<ToolSelectionList
title="Un-acquired Training"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import TrainingDisplay from "@/routes/_authenticated/_reponly/signin/actions/-components/TrainingDisplay.tsx";
import { cn } from "@/lib/utils.ts";
import TrainingDisplay from "@/routes/_authenticated/_reponly/signin/actions/-components/TrainingDisplay.tsx";
import { Training } from "@ignis/types/sign_in.ts";
import { ExclamationTriangleIcon } from "@radix-ui/react-icons";
import { Alert, AlertDescription, AlertTitle } from "@ui/components/ui/alert.tsx";
Expand Down Expand Up @@ -70,16 +70,18 @@ const TrainingSelectionList: React.FC<ToolSelectionListProps> = ({
<AlertDescription>No training available to select.</AlertDescription>
</Alert>
) : (
trainings.map((training) => (
<React.Fragment key={training.id}>
<TrainingDisplay
training={training}
selected={selectedTrainings.includes(training.id)}
selectable={selectable}
onClick={() => handleTrainingClick(training)}
/>
</React.Fragment>
))
trainings
.sort((a, b) => a.name.localeCompare(b.name))
.map((training) => (
<React.Fragment key={training.id}>
<TrainingDisplay
training={training}
selected={selectedTrainings.includes(training.id)}
selectable={selectable}
onClick={() => handleTrainingClick(training)}
/>
</React.Fragment>
))
)}
</div>
</ScrollArea>
Expand Down

0 comments on commit 549e6c2

Please sign in to comment.