Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
thsparks committed Sep 20, 2024
1 parent 4c20270 commit c2ffe93
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 22 deletions.
10 changes: 2 additions & 8 deletions teachertool/src/components/CatalogOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ const CatalogItemLabel: React.FC<CatalogItemLabelProps> = ({ catalogCriteria, is
<div className={css["catalog-item-label"]}>
<div className={css["action-indicators"]}>
{isMaxed ? (
<i
className="fas fa-check"
title={Strings.MaxReached}
/>
<i className="fas fa-check" title={Strings.MaxReached} />
) : (
<>
<i
Expand All @@ -59,10 +56,7 @@ const CatalogItemLabel: React.FC<CatalogItemLabelProps> = ({ catalogCriteria, is
title={lf("Added!")}
/>
<i
className={classList(
"fas fa-plus",
recentlyAdded ? css["hide-indicator"] : undefined
)}
className={classList("fas fa-plus", recentlyAdded ? css["hide-indicator"] : undefined)}
title={Strings.AddToChecklist}
/>
</>
Expand Down
6 changes: 5 additions & 1 deletion teachertool/src/components/CriteriaResultEntry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ const CriteriaResultError: React.FC<CriteriaResultErrorProps> = ({ criteriaInsta
leftIcon="fas fa-times-circle"
title={Strings.Dismiss}
onClick={() =>
setEvalResult(criteriaInstanceId, { result: EvaluationStatus.NotStarted, resultIsManual: false, error: undefined })
setEvalResult(criteriaInstanceId, {
result: EvaluationStatus.NotStarted,
resultIsManual: false,
error: undefined,
})
}
/>
</div>
Expand Down
10 changes: 7 additions & 3 deletions teachertool/src/components/ImportChecklistModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,22 @@ export const ImportChecklistModal: React.FC<IProps> = () => {
async function handleFileDroppedAsync(file: File) {
const parsedChecklist = await getChecklistFromFileAsync(file, false /* allow partial */);
if (!parsedChecklist) {
pxt.tickEvent(Ticks.ImportChecklistInvalidFile)
pxt.tickEvent(Ticks.ImportChecklistInvalidFile);
setErrorMessage(Strings.InvalidChecklistFile);
} else {
pxt.tickEvent(Ticks.ImportChecklistSuccess)
pxt.tickEvent(Ticks.ImportChecklistSuccess);
setErrorMessage(undefined);
closeModal(true);
replaceActiveChecklistAsync(parsedChecklist);
}
}

return teacherTool.modalOptions?.modal === "import-checklist" ? (
<Modal title={Strings.ImportChecklist} onClose={() => closeModal(false)} className={css["import-checklist-modal"]}>
<Modal
title={Strings.ImportChecklist}
onClose={() => closeModal(false)}
className={css["import-checklist-modal"]}
>
<div className={css["import-checklist"]}>
<DragAndDropFileSurface onFileDroppedAsync={handleFileDroppedAsync} errorMessage={errorMessage} />
</div>
Expand Down
7 changes: 6 additions & 1 deletion teachertool/src/transforms/mergeEvalResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import { setEvalResult } from "./setEvalResult";
import { setUserFeedback } from "./setUserFeedback";

// This will set the outcome and notes for a given criteria instance id, but if the provided value is undefined, it will not change that value.
export function mergeEvalResult(criteriaInstanceId: string, isManual: boolean, outcome?: EvaluationStatus, notes?: string) {
export function mergeEvalResult(
criteriaInstanceId: string,
isManual: boolean,
outcome?: EvaluationStatus,
notes?: string
) {
const { state: teacherTool, dispatch } = stateAndDispatch();

const newCriteriaEvalResult = { ...teacherTool.evalResults[criteriaInstanceId] };
Expand Down
23 changes: 14 additions & 9 deletions teachertool/src/types/criteriaParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@ export type CriteriaParameterBase = {
type: CriteriaParameterType;
default: string | undefined;
paths: string[]; // The json path(s) to update with the parameter value in the catalog criteria.
}
};

export type StringParameterBase = CriteriaParameterBase & {
maxCharacters?: number;
}
};

export type StringParameter = StringParameterBase & {
type: "string";
}
};

export type LongStringParameter = StringParameterBase & {
type: "longString";
}
};

export type NumberParameter = CriteriaParameterBase & {
type: "number";
min?: number;
max?: number;
}
};

export type BlockParameter = CriteriaParameterBase & {
type: "block";
}
};

/**
* System parameters are fields that can change for a criteria but which are not set directly by the user.
Expand All @@ -37,9 +37,14 @@ export type BlockParameter = CriteriaParameterBase & {
export type SystemParameter = CriteriaParameterBase & {
type: "system";
key?: string;
}

export type CriteriaParameter = StringParameter | LongStringParameter | NumberParameter | BlockParameter | SystemParameter;
};

export type CriteriaParameter =
| StringParameter
| LongStringParameter
| NumberParameter
| BlockParameter
| SystemParameter;

export interface CriteriaParameterValidationResult {
valid: boolean;
Expand Down

0 comments on commit c2ffe93

Please sign in to comment.